/* Same product system as Trust, Radar and Blueprints; Chat's accent is slate. */
@font-face {
  font-family: "Instrument Sans";
  src: url("fonts/instrument-sans-latin.woff2") format("woff2");
  font-weight: 400 700; font-stretch: 75% 100%; font-display: swap;
}
:root {
  --bg: #FAFAFB; --surface: #FFFFFF; --surface-2: #F2F4F6; --ink: #151A21; --ink-2: #3C4550; --muted: #66707C;
  --rule: rgba(21, 26, 33, 0.09); --rule-2: rgba(21, 26, 33, 0.16); --field: rgba(21, 26, 33, 0.22);
  --accent: #4B5B70; --accent-soft: #ECEFF3; --bad: #C0262D;
  --shadow-2: 0 1px 2px rgba(16, 24, 40, 0.05), 0 18px 40px -12px rgba(16, 24, 40, 0.18);
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --wrap: 780px; --gutter: clamp(20px, 4vw, 48px);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0D1015; --surface: #151A21; --surface-2: #1B212A; --ink: #ECEFF3; --ink-2: #C3CAD3; --muted: #939DA9;
    --rule: rgba(236, 239, 243, 0.09); --rule-2: rgba(236, 239, 243, 0.16); --field: rgba(236, 239, 243, 0.24);
    --accent: #A9B8CB; --accent-soft: #232A34; --bad: #F2777C;
    --shadow-2: 0 1px 2px rgba(0, 0, 0, 0.4), 0 24px 48px -16px rgba(0, 0, 0, 0.6);
  }
}
* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.6 var(--sans); min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid var(--rule); }
.top-inner { max-width: 1180px; margin: 0 auto; padding: 0 var(--gutter); display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; }
.chat-shell, .foot { width: 100%; max-width: var(--wrap); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.wordmark { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; font-size: 17px; letter-spacing: -0.01em; color: var(--ink); text-decoration: none; }
.wordmark img { border-radius: 6px; }
.family { display: flex; gap: 20px; flex-wrap: wrap; font-size: 14px; }
.family a { color: var(--muted); text-decoration: none; }
.family a:hover { color: var(--ink); }

.chat-shell { flex: 1; display: flex; flex-direction: column; padding-top: clamp(40px, 7vw, 80px); padding-bottom: 32px; }
h1 { font-size: clamp(34px, 5vw, 48px); font-weight: 650; letter-spacing: -0.035em; line-height: 1.06; margin: 0 0 14px; }
.chat-sub { color: var(--ink-2); font-size: 18px; margin: 0 0 32px; max-width: 52ch; }

.chat-panel, .chat-window { background: var(--surface); border: 1px solid var(--rule); border-radius: 18px; box-shadow: var(--shadow-2); }
.chat-window { flex: 1; min-height: 360px; max-height: 62vh; overflow-y: auto; padding: 22px; display: flex; flex-direction: column; gap: 12px; border-bottom-left-radius: 0; border-bottom-right-radius: 0; box-shadow: none; }
.msg { max-width: 82%; padding: 11px 16px; white-space: pre-wrap; line-height: 1.55; border-radius: 18px; font-size: 15.5px; }
.msg-user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 6px; }
@media (prefers-color-scheme: dark) { .msg-user { color: #0D1015; } }
.msg-bot { align-self: flex-start; background: var(--surface-2); color: var(--ink); border-bottom-left-radius: 6px; }
.msg-error { align-self: flex-start; color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, transparent); }
.msg-pending { align-self: flex-start; color: var(--muted); background: var(--surface-2); }

.starters { margin: auto 0 0; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.starters p { margin: 0 0 6px; color: var(--muted); font-size: 15px; }
.starter { font: 500 15px/1.3 var(--sans); color: var(--ink); background: var(--surface); border: 1px solid var(--rule-2); border-radius: 999px; padding: 10px 16px; cursor: pointer; text-align: left; transition: background-color 120ms ease, border-color 120ms ease; }
.starter:hover { background: var(--surface-2); border-color: var(--field); }

.chat-form { display: flex; gap: 10px; padding: 12px; background: var(--surface); border: 1px solid var(--rule); border-top: 0; border-radius: 0 0 18px 18px; box-shadow: var(--shadow-2); }
#chat-input { flex: 1; min-width: 0; height: 46px; font: 400 16px/1.4 var(--sans); color: var(--ink); background: var(--surface-2); border: 1px solid transparent; border-radius: 999px; padding: 0 18px; transition: border-color 120ms ease, box-shadow 120ms ease; }
#chat-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); background: var(--surface); }
#chat-send { height: 46px; font: 600 15px/1 var(--sans); color: #fff; background: var(--accent); border: 0; border-radius: 999px; padding: 0 24px; cursor: pointer; transition: transform 120ms ease, background-color 120ms ease; }
@media (prefers-color-scheme: dark) { #chat-send { color: #0D1015; } }
#chat-send:hover { background: color-mix(in srgb, var(--accent) 86%, var(--ink)); }
#chat-send:active { transform: scale(0.98); }
#chat-send:disabled, #chat-input:disabled { opacity: 0.55; cursor: not-allowed; }
.chat-note { color: var(--muted); font-size: 13px; margin: 14px 4px 0; max-width: 72ch; }

.foot { padding-bottom: 36px; color: var(--muted); font-size: 14px; }
.foot p { margin: 0 0 6px; }
.foot > :first-child { border-top: 1px solid var(--rule); padding-top: 24px; }
.foot-by a { font-weight: 600; }
.disclaimer { font-size: 12.5px; }

@media (max-width: 640px) { .family { display: none; } .chat-window { max-height: none; min-height: 320px; } .msg { max-width: 90%; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
