:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0a0d12;
  color: #eef2f7;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(95, 140, 255, .12), transparent 32%),
    radial-gradient(circle at bottom right, rgba(35, 198, 145, .08), transparent 28%),
    #0a0d12;
}

button, input, textarea { font: inherit; }

.shell {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.hidden { display: none !important; }

.brand {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: .08em;
}

.brand span { opacity: .55; }

.eyebrow {
  margin: 10px 0 0;
  font-size: 11px;
  letter-spacing: .16em;
  opacity: .55;
}

h1, h2 { margin: 0; }

h1 {
  margin-top: 12px;
  font-size: clamp(28px, 4vw, 48px);
}

h2 { font-size: 18px; }

.muted {
  color: #9ba5b4;
  line-height: 1.55;
}

.card {
  background: rgba(18, 23, 31, .9);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 18px 50px rgba(0,0,0,.22);
  backdrop-filter: blur(10px);
}
.login-card {
  width: min(560px, 100%);
  margin: 9vh auto 0;
}

.login-card form {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

label {
  display: grid;
  gap: 8px;
  font-size: 13px;
  color: #b9c2cf;
}

input, textarea {
  width: 100%;
  color: #eef2f7;
  background: #0f141c;
  border: 1px solid #28303b;
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
}

input:focus, textarea:focus {
  border-color: #687cff;
  box-shadow: 0 0 0 3px rgba(104, 124, 255, .12);
}

button {
  border: 0;
  border-radius: 12px;
  padding: 11px 15px;
  cursor: pointer;
  color: #fff;
  background: #5e70ff;
  font-weight: 700;
}

button:hover { filter: brightness(1.08); }

button.ghost {
  background: transparent;
  border: 1px solid #2c3542;
  color: #cdd6e3;
}

button.small {
  padding: 8px 11px;
  font-size: 12px;
}

.error {
  min-height: 20px;
  margin: 0;
  color: #ff8a8a;
  font-size: 13px;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.chat-card { grid-column: 1 / -1; }

.pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(94, 112, 255, .3);
  color: #aeb8ff;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 10px;
  letter-spacing: .1em;
}

.kv, .source, .audit-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.kv:last-child, .source:last-child, .audit-row:last-child {
  border-bottom: 0;
}

.kv span, .source span:first-child, .audit-row span {
  color: #8f9aaa;
  font-size: 12px;
}

.kv strong, .source .ok, .audit-row strong {
  color: #eaf0f7;
  font-size: 13px;
  text-align: right;
}

.source .ok { color: #86d7ad; }

.chat-log {
  min-height: 220px;
  max-height: 480px;
  overflow: auto;
  display: grid;
  gap: 10px;
  padding: 4px;
  margin-bottom: 14px;
}
.msg {
  max-width: 88%;
  border-radius: 14px;
  padding: 12px 14px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.msg.user {
  justify-self: end;
  background: #1c2740;
  border: 1px solid #2b3d66;
}

.msg.assistant {
  justify-self: start;
  background: #111820;
  border: 1px solid #26303a;
}

.msg-role {
  margin-bottom: 5px;
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #8f9aaa;
}

.chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

.audit {
  max-height: 220px;
  overflow: auto;
}

@media (max-width: 840px) {
  .grid { grid-template-columns: 1fr; }
  .chat-card { grid-column: auto; }
  .chat-form { grid-template-columns: 1fr; }
}

.team-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.team-row > div:first-child {
  display: grid;
  gap: 4px;
}

.team-row strong {
  font-size: 13px;
}

.team-row span {
  color: #8f9aaa;
  font-size: 12px;
}

.team-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.team-meta span:last-child {
  color: #aeb8ff;
  border: 1px solid rgba(94,112,255,.25);
  border-radius: 999px;
  padding: 4px 7px;
}

.admin-box {
  display: grid;
  gap: 5px;
  padding: 12px;
  border-radius: 12px;
  background: #101820;
  border: 1px solid rgba(255,255,255,.07);
  margin-bottom: 10px;
}

.admin-box span,
.team-note {
  color: #8f9aaa;
  font-size: 12px;
}

.team-note {
  margin-bottom: 0;
}

/* Authenticated MYRON-PAI secretary task bridge — queue only, no dispatch. */
.task-card { grid-column: 1 / -1; }
.secretary-task-form { display: grid; gap: 14px; margin: 16px 0 20px; }
.task-fields { display: grid; grid-template-columns: 1.15fr 1fr .65fr; gap: 12px; }
select { width: 100%; color: #eef2f7; background: #0f141c; border: 1px solid #28303b; border-radius: 12px; padding: 12px 14px; }
select:focus { outline: none; border-color: #687cff; box-shadow: 0 0 0 3px rgba(104,124,255,.12); }
.task-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.task-message { min-height: 18px; margin: 0; color: #a9d8bc; font-size: 13px; line-height: 1.5; }
.task-list { display: grid; gap: 10px; margin-top: 18px; }
.task-item { border: 1px solid rgba(255,255,255,.1); background: #0e141d; border-radius: 14px; padding: 14px; min-width: 0; }
.task-item-head { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 10px; }
.task-item-head strong { font-size: 14px; overflow-wrap: anywhere; }
.task-status { display: inline-flex; align-items: center; border: 1px solid #735c34; border-radius: 999px; padding: 5px 8px; color: #f3d8a4; font-size: 10px; letter-spacing: .04em; }
.task-meta { margin-top: 8px; color: #8f9aaa; font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.task-item p { margin: 10px 0; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; }
.task-delivery-warning { margin-top: 10px; padding: 9px 10px; border-radius: 9px; background: rgba(182,135,44,.1); color: #e7c987; font-size: 11px; line-height: 1.5; }
.task-note { font-size: 12px; margin-bottom: 0; }
.task-item .task-actions { margin-top: 10px; }
@media (max-width: 840px) {
  .task-fields { grid-template-columns: 1fr; }
  .task-card { grid-column: auto; }
}
