
:root {
  font: 16px/1.55 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #e8edf5; background: #0d1729; color-scheme: dark;
  --muted: #b1bfd1; --line: #33465f; --accent: #23746f; --soft: #1b3545;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body, h1, h2, h3, p { margin: 0; }
button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:focus-visible, textarea:focus-visible, summary:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px;
}
header {
  min-height: 66px; display: flex; align-items: center; gap: 32px;
  padding: 0 clamp(16px, 4vw, 48px); border-bottom: 1px solid var(--line);
}
header { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; min-height: 64px; background: #111b2e; border-color: #28394e; }
.brand { display: flex; align-items: center; gap: 9px; min-width: 0; white-space: nowrap; }
.brand img { width: 104px; display: block; height: auto; }
.brand span { padding-left: 9px; border-left: 1px solid #43546b; color: #b6c3d5; font-size: 13px; }
nav { display: flex; gap: 4px; padding: 3px; border: 1px solid #3d536a; border-radius: 9px; background: #18273b; }
nav button { min-width: 78px; height: 34px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; color: #aebdd0; font-size: 12px; font-weight: 600; }
nav button[aria-current="page"] { background: #27555d; color: #effffd; box-shadow: inset 0 0 0 1px #2c958b; }
.account { display: flex; justify-content: flex-end; align-items: center; gap: 10px; min-width: 0; color: #c6d1e0; font-size: 13px; }
.account .button { font-size: 12px; }
main { min-height: calc(100dvh - 66px); }
main.query-screen { position: relative; background: #0d1729; }
.query-tools { position: absolute; top: 16px; left: clamp(12px,3vw,48px); z-index: 1; }
.chat {
  width: min(100% - 32px, 720px); margin: auto; min-height: calc(100dvh - 66px);
  display: flex; flex-direction: column; justify-content: flex-end;
}
.chat.empty { justify-content: center; padding-bottom: 11vh; }
.welcome { text-align: center; margin-bottom: 22px; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: -.045em; line-height: 1.17; }
h2 { font-size: 1.22rem; letter-spacing: -.024em; line-height: 1.3; }
h3 { font-size: .98rem; line-height: 1.4; }
.thread { padding: 57px 2px 12px; display: grid; gap: 13px; }
.message { max-width: 88%; white-space: pre-wrap; overflow-wrap: anywhere; }
.message.mine { justify-self: end; padding: 10px 14px; background: #21324a; border: 1px solid #3d536a; border-radius: 13px; }
.message.answer { width: fit-content; padding: 10px 14px; background: #173e48; border: 1px solid #2a6065; border-radius: 13px; color: #d6fcf6; }
.composer {
  position: sticky; bottom: 0; background: #0d1729; padding: 10px 0 20px;
}
.chat.empty .composer { position: static; padding: 0; }
.entry {
  display: flex; align-items: end; gap: 8px; padding: 8px; border-radius: 15px; background: #18273b;
  border: 1px solid #3d536a; box-shadow: 0 4px 16px #040b1988;
}
.entry textarea {
  flex: 1; min-width: 0; min-height: 42px; max-height: 170px; resize: vertical;
  border: 0; border-radius: 7px; padding: 8px; background: #17253a;
}
.button {
  display: inline-flex; align-items: center; justify-content: center; white-space: nowrap;
  background: #18273b; padding: 7px 12px; border: 1px solid #40536e; border-radius: 8px;
  font-weight: 620; font-size: .88rem; line-height: 1.4;
}
.button:hover { background: var(--soft); }
.primary { background: var(--accent); border-color: var(--accent); color: #effffd; }
.primary:hover { background: #28645e; }
.icon { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; }
.icon[aria-pressed="true"] { background: #51333c; color: #ffd1d6; }
.icon svg { width: 18px; height: 18px; }
.issue-layout {
  width: 100%; padding: 28px clamp(16px,3vw,48px) 55px;
  display: grid; grid-template-columns: minmax(248px, 21%) minmax(0, 1fr); gap: clamp(16px,2vw,32px);
}
.queue-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.queue-heading h1 { font-size: 1.75rem; }
.queue { display: grid; gap: 9px; }
.queue-card {
  width: 100%; display: flex; align-items: start; justify-content: space-between; gap: 8px;
  text-align: left; background: #18273b; border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 12px; line-height: 1.4;
}
.queue-card:hover { background: #182d43; }
.queue-card[aria-pressed="true"] { border-color: #318b85; background: var(--soft); box-shadow: inset 3px 0 #36a89d; }
.queue-card:disabled, .queue-card.read-only { background: #142136; color: #b1bfd1; }
.queue-card:disabled .author-pill, .queue-card.read-only .author-pill { background: #283747; color: #bdcada; }
.queue-meta { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.submitted-pill { background: #20334a; color: #c4d0df; font-weight: 670; }
.helper { color: var(--muted); font-size: .86rem; margin-top: 3px; }
.section-title { margin: 2px 0 8px; }
dialog > p { margin: 10px 0 15px; }
.queue-card strong { font-size: .93rem; }
.author-pill {
  flex: 0 0 auto; padding: 1px 7px; border-radius: 999px;
  background: #25465a; color: #c7e5fb; font-size: .73rem; font-weight: 640;
}
.author-pill[data-person="Tony"] { background: #214b46; color: #c5f4e8; }
.author-pill[data-person="Terry"] { background: #534032; color: #fbe1c0; }
.issue { min-width: 0; display: grid; align-content: start; gap: 11px; }
.card { min-width: 0; padding: 15px; border: 1px solid var(--line); border-radius: 10px; background: #142237; }
.card p { margin-top: 5px; overflow-wrap: anywhere; }
.card .detail { padding-top: 9px; border-top: 1px solid var(--line); margin-top: 9px; white-space: pre-wrap; }
.card small, .muted { color: var(--muted); font-size: .85rem; }
.decision { background: var(--soft); border-color: #365267; }
.impact { display: grid; gap: 8px; margin-top: 7px; }
.impact summary { cursor: pointer; font-weight: 670; }
.impact .summary-text { color: var(--muted); margin-top: 9px; }
.impact p { font-size: .89rem; }
.controls { display: flex; gap: 8px; flex-wrap: wrap; }
.draft { max-width: 92%; display: grid; gap: 10px; }
.draft dl { margin: 0; }
.draft dt { font-weight: 650; }
.draft dd { margin: 2px 0 9px; overflow-wrap: anywhere; }
.proposal textarea {
  display: block; width: 100%; min-height: 86px; resize: vertical;
  border: 1px solid #3d536a; border-radius: 7px; padding: 9px; margin: 8px 0 10px;
}
.status { min-height: 1.4em; color: var(--muted); font-size: .86rem; }
.loading { display: flex; align-items: center; gap: 8px; margin-top: 9px; color: var(--muted); font-size: .87rem; }
.loading::before {
  content: ""; width: 13px; height: 13px; flex: 0 0 13px;
  border: 2px solid #40536e; border-top-color: var(--accent);
  border-radius: 50%; animation: spin .72s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .loading::before { animation: none; } }
.button:disabled { opacity: .56; cursor: wait; }
dialog { width: min(580px, calc(100% - 30px)); max-height: 90vh; padding: 20px; border: 1px solid var(--line); border-radius: 12px; color: inherit; }
dialog::backdrop { background: #070d19aa; }
dialog .controls { align-items: center; }
dialog .proposal { margin-top: 11px; }
dialog .draft { max-width: none; margin-top: 11px; }
.draft-impact { margin: 0; }

@media (max-width: 720px) {
  .issue-layout { grid-template-columns: minmax(0,1fr); gap: 17px; padding: 24px 16px; }
  .queue-card { padding: 9px 11px; }
}
@media (max-width: 480px) {
  header { gap: 6px; padding-inline: 10px; } .brand img { width: 65px; } .brand span { display: none; }
  nav button { min-width: 52px; padding-inline: 6px; } .account { gap: 5px; }
}

.initial-loading { padding: 24px; }
.form-error { margin: 8px 0; color: #ffc5c5; }

  .auth-loading { min-height: 100vh; display: grid; place-content: center; grid-auto-flow: column; gap: 5px; background: #0f172a; }
  .auth-loading span { width: 6px; height: 6px; background: #2dd4bf; border-radius: 50%; animation: auth-pulse 1.2s ease-in-out infinite; }
  .auth-loading span:nth-child(2) { animation-delay: 100ms; }
  .auth-loading span:nth-child(3) { animation-delay: 200ms; }
  .sign-in-page {
    width: 100%;
    min-height: 100vh;
    margin: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    color: #f1f5f9;
    background: #0f172a;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
  .sign-in-page, .sign-in-page * { box-sizing: border-box; }
  .sign-in-panel { width: 390px; max-width: 100%; margin: 0; padding: 0; }
  .sign-in-panel > img { display: block; width: 128px; height: auto; margin-bottom: 44px; }
  .sign-in-kicker { display: inline-flex; margin: 0; color: #2dd4bf; font-size: 13px; font-weight: 700; line-height: 1.5; }
  .sign-in-panel h1 { margin: 10px 0 24px; color: #f1f5f9; font-size: 24px; font-weight: 600; line-height: 1.2; }
  .sign-in-panel form { display: grid; gap: 9px; margin: 0; }
  .sign-in-panel label, .sign-in-code-fieldset legend { color: #94a3b8; font-size: 11px; font-weight: 500; line-height: 1.5; }
  .sign-in-panel input { width: 100%; height: 42px; margin: 0; padding: 0 12px; color: #f1f5f9; background: #1e293b; border: 1px solid #475569; border-radius: 8px; outline: 0; font: inherit; letter-spacing: 0; }
  .sign-in-panel input:focus { border-color: #14b8a6; box-shadow: 0 0 0 1px rgba(20, 184, 166, .25); }
  .sign-in-panel form button, .secondary-command { min-height: 40px; margin-top: 8px; padding: 0; color: #ccfbf1; background: rgba(19, 78, 74, .7); border: 1px solid rgba(20, 184, 166, .45); border-radius: 6px; font: inherit; font-size: 12px; font-weight: 600; letter-spacing: 0; cursor: pointer; }
  .sign-in-panel form button:disabled { color: #64748b; background: #1e293b; border-color: #334155; cursor: default; }
  .sign-in-copy { margin: 0 0 18px; color: #94a3b8; font-size: 13px; line-height: 1.6; }
  .sign-in-copy strong { color: #cbd5e1; font-weight: 600; }
  .sign-in-error { margin: 2px 0; color: #fca5a5; font-size: 11px; }
  .secondary-command { min-height: 32px; padding: 0; color: #94a3b8; background: transparent; border-color: transparent; }
  .secondary-command:hover:not(:disabled) { color: #cbd5e1; }
  .secondary-command:focus-visible { outline: 2px solid rgba(45, 212, 191, .65); outline-offset: 3px; }
  .secondary-command:disabled { color: #64748b; background: transparent; border-color: transparent; cursor: default; }
  .sign-in-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; width: 100%; margin-top: 10px; }
  .sign-in-actions .secondary-command { width: max-content; margin-top: 0; }
  .sign-in-actions .secondary-command:first-child { justify-self: start; }
  .sign-in-actions .secondary-command:last-child { justify-self: end; }
  .sign-in-code-fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
  .sign-in-code-fieldset legend { margin: 0 0 9px; padding: 0; }
  .sign-in-code-digits { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
  .sign-in-panel .sign-in-code-digits input { height: auto; aspect-ratio: 1; padding: 0; text-align: center; font-size: 22px; font-variant-numeric: tabular-nums; font-weight: 600; }
  .signed-out-panel { width: min(560px, 100%); text-align: center; }
  .signed-out-panel h1 { margin: 0; color: #f1f5f9; font-size: clamp(24px, 4vw, 32px); font-weight: 600; line-height: 1.3; }
  .signed-out-panel button { display: inline-block; margin-top: 28px; padding: 0; border: 0; background: none; color: #5eead4; font-size: 14px; font-weight: 650; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
  .signed-out-panel button:hover { color: #99f6e4; }
  .signed-out-panel button:focus-visible { outline: 2px solid rgba(45, 212, 191, .65); outline-offset: 4px; border-radius: 2px; }

@keyframes auth-pulse {
  0%, 100% { opacity: .35; }
  50% { opacity: 1; }
}

.idle-session-backdrop {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(2, 6, 23, .82);
  backdrop-filter: blur(4px);
}

.idle-session-dialog {
  width: min(420px, 100%);
  padding: 28px;
  color: #e2e8f0;
  background: #1e293b;
  border: 1px solid #475569;
  border-radius: 12px;
  box-shadow: 0 24px 64px rgba(2, 6, 23, .56);
}

.idle-session-kicker { margin: 0; color: #fbbf24; font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.idle-session-dialog h2 { margin: 8px 0 10px; color: #f8fafc; font-size: 22px; line-height: 1.25; }
.idle-session-dialog > p:not(.idle-session-kicker) { margin: 0; color: #94a3b8; font-size: 14px; line-height: 1.6; }
.idle-session-dialog strong { color: #f8fafc; font-variant-numeric: tabular-nums; }
.idle-session-dialog button { width: 100%; min-height: 42px; margin-top: 22px; color: #042f2e; background: #2dd4bf; border: 0; border-radius: 7px; font-size: 13px; font-weight: 750; }
.idle-session-dialog button:hover { background: #5eead4; }
.idle-session-dialog button:focus-visible { outline: 3px solid rgba(94, 234, 212, .5); outline-offset: 3px; }


.sign-in-page h1, .idle-session-dialog h2 { letter-spacing: normal; }
#email-step { display: grid; gap: 9px; }

.idle-session-dialog::backdrop { background: rgba(2, 6, 23, .82); backdrop-filter: blur(4px); }
.idle-session-dialog { max-width: calc(100% - 48px); }
