/* The chrome and transcript share a palette, with an opaque reading surface. */
:root {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: light;
  color: var(--ink);
  background: var(--base);
  --base: #edf3f0;
  --paper: #fcfefe;
  --line: #cbdcd5;
  --green: #216c60;
  --ink: #193c43;
  --secondary: #586f70;
  --muted: var(--secondary);
  --chrome: #f4faf6;
  --glass: #f7fcf9bd;
  --accent-wash: #e1efe9;
  --focus: #216c60;
  --send: #1e514b;
  --send-hover: #173f3b;
  --send-text: #fff;
  --aura: #7dc3ad66;
  --aura-primary: #a6e0ca59;
  --rim: inset 0 1px 0 #fff;
  --card-shadow: 0 4px 20px #2443310a;
}

body {
  background:
    radial-gradient(ellipse at 0 12%, #dfede3 0%, transparent 54%),
    radial-gradient(ellipse at 100% 90%, #e7eff3 0%, transparent 51%),
    var(--base);
}

.topbar,
.history {
  background: var(--chrome);
}

.topbar {
  border-bottom-color: var(--line);
  box-shadow: var(--rim), 0 2px 8px #24433106;
}

.identity {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  gap: 4px;
  font-weight: 650;
}

.identity span {
  margin-left: 0;
  color: var(--green);
  font-weight: 650;
}

.topbar .history-trigger,
.feedback-open {
  border-radius: 12px;
}

.history {
  border-right-color: var(--line);
  box-shadow: inset -1px 0 #fff, 4px 0 20px #2443310b;
}

.sidebar-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--accent-wash);
  color: var(--green);
  font-family: inherit;
  font-size: 21px;
  font-weight: 750;
  letter-spacing: -.045em;
}

.drawer-heading h2 {
  color: var(--ink);
  font-weight: 650;
}

.drawer-account {
  border-color: var(--line);
}

.drawer-account a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

#session-list {
  padding: 0 7px;
  margin-inline: -7px;
}

.session {
  min-height: 44px;
  border-color: transparent;
  border-radius: 11px;
  background: transparent;
}

.session:hover {
  border-color: var(--line);
  background: var(--accent-wash);
}

.session[aria-current=true] {
  border-color: #bbd1c1;
  background: var(--accent-wash);
  box-shadow: inset 3px 0 var(--green);
}

.welcome h1 {
  font-weight: 650;
  letter-spacing: -.038em;
  line-height: 1.2;
}

.demo-button,
.starter,
.new-chat {
  min-height: 44px;
  border-radius: 13px;
}

.demo-button,
.starter,
.new-chat:not(:disabled) {
  border-color: var(--line);
  background: var(--paper);
  box-shadow: var(--card-shadow);
}

.demo-button:hover,
.starter:hover,
.new-chat:hover:not(:disabled) {
  border-color: #8bad96;
  background: var(--accent-wash);
}

.demo-icon {
  flex-shrink: 0;
  background: var(--accent-wash);
  color: var(--green);
}

.message.assistant {
  border: 1px solid var(--line);
  border-radius: 21px;
  padding: 20px 22px;
  background: var(--paper);
  box-shadow: var(--card-shadow);
}

.message.user {
  border-color: #c9dbcd;
  background: var(--accent-wash);
  color: var(--ink);
  box-shadow: none;
}

.assistant-label {
  border-color: var(--line);
  color: var(--green);
}

.assistant-label:before {
  border-color: #c9dbcd;
  background: var(--accent-wash);
}

.composer-area {
  background: none;
}

.composer {
  border-color: var(--line);
  background: var(--paper);
  box-shadow: var(--rim), 0 5px 22px #24433114;
}

.composer:focus-within {
  border-color: var(--focus);
  box-shadow: 0 0 0 1px var(--focus), 0 5px 22px #24433114;
}

.auth-panel input,
.auth-submit,
.auth-switch,
.google-signin,
.jump-latest,
.response-tools button,
.response-tools .voice-button,
.retry,
.resume-analysis,
.workflow > summary,
.verification-log > summary,
.previous-versions > summary,
.brief-details > summary,
.breakdown > summary {
  min-height: 44px;
}

:is(button, a, summary, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  @media (prefers-reduced-transparency: no-preference) {
    .topbar,
    .history {
      background: var(--glass);
      -webkit-backdrop-filter: blur(16px) saturate(115%);
      backdrop-filter: blur(16px) saturate(115%);
    }

    @supports selector(body:has(.history:modal)) {
      :where(body:has(.history:modal)) .topbar {
        background: var(--chrome);
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
      }
    }
  }
}

@media (max-width: 600px) {
  .message.assistant {
    padding: 13px;
    border-radius: 16px;
  }
}

@media (prefers-reduced-transparency: reduce) {
  body {
    background: var(--base);
  }

  .topbar,
  .history {
    background: var(--chrome);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .history[open],
  .feedback-dialog[open],
  .thinking-line:before {
    animation: none;
  }

  .icon-button,
  .demo-button,
  .starter,
  .session {
    transition: none;
  }
}

@media (forced-colors: active) {
  body,
  .topbar,
  .history,
  .composer {
    background: Canvas;
    color: CanvasText;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .topbar,
  .history,
  .composer,
  .message.assistant,
  .message.user {
    border-color: CanvasText;
    box-shadow: none;
  }

  .session[aria-current=true] {
    border-color: Highlight;
  }

  .composer .icon-button,
  .topbar .history-trigger,
  .feedback-open {
    border: 1px solid ButtonText;
  }

  :is(button, a, summary, input, select, textarea, [tabindex]):focus-visible {
    outline-color: Highlight;
  }

  .composer textarea:focus-visible {
    outline: 2px solid Highlight;
    outline-offset: -2px;
  }
}
