/* ════════════════════════════════════════════════════════════════
   TALKIE  ·  PRINT-SHOP STYLE SHEET
   Aged paper, oxblood ink, Bodoni for display, Garamond for body,
   Special Elite for the typewriter parts. Designed to read like a
   small literary monthly from about 1930.
   ════════════════════════════════════════════════════════════════ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  /* Aged-paper palette */
  --paper-1: #F2EAD3;        /* base sheet */
  --paper-2: #E9DEC2;        /* card/sidebar */
  --paper-3: #DCCEAA;        /* hover, deeper paper */
  --ink-1:   #1F160B;        /* main text */
  --ink-2:   #4D3B23;        /* muted */
  --ink-3:   #8A7551;        /* dim */
  --rule:    #B19872;        /* hairline rules */
  --rule-soft: #C7B189;
  --oxblood: #7B1A1A;        /* primary accent (links, button hover) */
  --gold:    #8C6A14;        /* secondary accent */
  --navy:    #28466A;        /* tertiary, used sparingly */

  --font-display: 'Bodoni Moda', 'Playfair Display', Georgia, serif;
  --font-body:    'EB Garamond', Georgia, 'Times New Roman', serif;
  --font-mono:    'Special Elite', 'Courier Prime', 'Courier New', monospace;

  --topbar-h: 64px;
  --sidebar-w: 248px;
  --ease-out: cubic-bezier(.4,0,.2,1);
}

html, body { height: 100%; }

body {
  background: var(--paper-1);
  color: var(--ink-1);
  font-family: var(--font-body);
  font-size: 1.04rem;
  line-height: 1.7;
  font-feature-settings: "kern" 1, "liga" 1, "onum" 1;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Paper texture — very fine grain only. Anything heavier reads as
   stains, not stock. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 300 300' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.2' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.22 0 0 0 0 0.16 0 0 0 0 0.09 0 0 0 0.30 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.85;
  mix-blend-mode: multiply;
}

a { color: var(--oxblood); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--ink-1); }

h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; font-weight: 700; }

.container { max-width: 960px; margin: 0 auto; padding: 0 20px; }

/* ════ Brand / masthead ════ */
.nav-brand {
  display: inline-flex; align-items: baseline; gap: 6px;
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.005em;
  color: var(--ink-1);
  text-decoration: none;
}
.nav-brand:hover { color: var(--oxblood); }
.nav-dot { display: none; }

/* Masthead meta — VOL/NO line under the brand */
.masthead-meta {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  color: var(--ink-3);
  text-transform: uppercase;
  margin-top: 1px;
}

/* ════ Login page nav (separate page) ════ */
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px;
  border-bottom: 1px solid var(--rule);
  background: var(--paper-1);
  position: relative;
}
.nav::after {
  content: '';
  position: absolute;
  left: 24px; right: 24px; bottom: -3px; height: 1px;
  background: var(--rule);
}
.nav-links { display: flex; gap: 4px; align-items: center; }
.nav-link {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
  padding: 4px 10px;
  text-decoration: none;
  transition: 0.15s ease;
}
.nav-link:hover { color: var(--oxblood); }
.nav-link--dim { color: var(--ink-3); }

/* ════ Buttons ════ */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 24px;
  border: 1px solid var(--ink-1);
  border-radius: 6px;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--paper-1);
  background: var(--ink-1);
  cursor: pointer;
  text-decoration: none;
  transition: 0.18s var(--ease-out);
  box-shadow: 2px 2px 0 var(--rule);
}
.btn-primary:hover {
  background: var(--oxblood);
  border-color: var(--oxblood);
  color: var(--paper-1);
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--rule);
}
.btn-primary:active { transform: translate(1px, 1px); box-shadow: 0 0 0 var(--rule); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: 1px 1px 0 var(--rule); }

.btn-secondary {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
  background: transparent;
  cursor: pointer;
  text-decoration: none;
  transition: 0.15s ease;
}
.btn-secondary:hover { color: var(--ink-1); border-color: var(--ink-1); background: var(--paper-3); }

/* ════ Login page ════ */
.login-page {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  padding: 64px 20px;
}
.login-card {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 36px 32px;
  max-width: 380px; width: 100%;
  position: relative;
  box-shadow: 4px 4px 0 var(--rule-soft);
}
.login-card::before {
  /* double-rule top frame, like a printed receipt */
  content: '';
  position: absolute;
  top: 6px; left: 6px; right: 6px; bottom: 6px;
  border: 1px solid var(--rule-soft);
  pointer-events: none;
}
.login-card h1 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: 0.01em;
  margin-bottom: 12px;
}
.login-input {
  width: 100%; padding: 12px 14px;
  background: var(--paper-1);
  border: 1px solid var(--rule);
  border-radius: 6px;
  color: var(--ink-1);
  font-family: var(--font-body);
  font-size: 1.02rem;
  margin: 18px 0 14px;
  outline: none;
  transition: 0.15s ease;
}
.login-input:focus { border-color: var(--oxblood); background: var(--paper-1); }
.login-error {
  background: color-mix(in srgb, var(--oxblood) 6%, var(--paper-1));
  border: 1px solid color-mix(in srgb, var(--oxblood) 35%, var(--rule));
  color: var(--oxblood);
  border-radius: 6px;
  padding: 10px 12px;
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.92rem;
  margin-bottom: 12px;
}
.login-sent {
  background: color-mix(in srgb, var(--gold) 8%, var(--paper-1));
  border: 1px solid color-mix(in srgb, var(--gold) 40%, var(--rule));
  color: var(--ink-1);
  border-radius: 6px;
  padding: 14px;
  font-family: var(--font-body);
  font-size: 1rem;
  text-align: center;
}
.text-muted { color: var(--ink-2); }
.text-dim { color: var(--ink-3); }

/* ════════════════════════════════════════════════════════════════
   CHAT PAGE
   ════════════════════════════════════════════════════════════════ */
.chat-body {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr;
  grid-template-areas:
    "topbar topbar"
    "sidebar main";
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

/* ── Topbar (newspaper masthead) ── */
.topbar {
  grid-area: topbar;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  background: var(--paper-1);
  border-bottom: 3px double var(--rule);
  z-index: 20;
  gap: 16px;
}
.topbar-left {
  display: flex; align-items: center; gap: 16px;
  min-width: 0;
}
.topbar-left .nav-brand-wrap {
  display: flex; flex-direction: column;
  line-height: 1;
}
.topbar-right {
  display: flex; align-items: center; gap: 18px;
  min-width: 0;
}
.topbar-icon {
  display: none;
  align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 6px;
  color: var(--ink-2);
  width: 34px; height: 34px;
  cursor: pointer;
  transition: 0.15s ease;
}
.topbar-icon:hover { color: var(--ink-1); border-color: var(--ink-1); background: var(--paper-3); }
.topbar-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  border-left: 1px solid var(--rule);
  padding-left: 14px;
  margin-left: 4px;
}
.topbar-words {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--ink-2);
  white-space: nowrap;
}
.topbar-words .topbar-words-num { color: var(--ink-1); font-weight: 700; }
.topbar-words.words-warn .topbar-words-num { color: var(--gold); }
.topbar-words.words-over .topbar-words-num { color: var(--oxblood); }
.topbar-action {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
  background: transparent;
  border: 1px solid var(--rule);
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  transition: 0.15s ease;
}
.topbar-action:hover { color: var(--paper-1); background: var(--ink-1); border-color: var(--ink-1); }

/* ── Sidebar (table of contents) ── */
.sidebar {
  grid-area: sidebar;
  background: var(--paper-2);
  border-right: 1px solid var(--rule);
  display: flex; flex-direction: column;
  min-height: 0;
  z-index: 15;
}
.sidebar-head {
  padding: 16px 18px 12px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--rule);
}
.sidebar-title {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.sidebar-list {
  flex: 1; overflow-y: auto;
  padding: 10px 12px;
}
.sidebar-item {
  display: block;
  padding: 8px 10px;
  border-radius: 4px;
  color: var(--ink-2);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-style: italic;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: 0.15s ease;
  text-decoration: none;
  border-bottom: 1px dotted var(--rule-soft);
}
.sidebar-item:hover { color: var(--oxblood); background: var(--paper-1); }
.sidebar-item--active {
  color: var(--ink-1);
  background: var(--paper-1);
  border-left: 2px solid var(--oxblood);
  padding-left: 8px;
}
.sidebar-empty {
  padding: 28px 16px;
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.9rem;
  color: var(--ink-3);
  text-align: center;
  line-height: 1.6;
}
.sidebar-foot {
  border-top: 1px solid var(--rule);
  padding: 12px 18px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  word-break: break-all;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sidebar-foot-link {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
  text-decoration: none;
  border-bottom: 1px dotted var(--rule);
  padding-bottom: 6px;
  display: inline-block;
}
.sidebar-foot-link:hover { color: var(--oxblood); }
.sidebar-email {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--ink-3);
}

.sidebar-scrim {
  position: fixed; inset: 0;
  background: rgba(31, 22, 11, 0.4);
  z-index: 14;
}
.sidebar-scrim[hidden] { display: none; }

/* ── Main / stream / input ── */
.chat-main {
  grid-area: main;
  display: flex; flex-direction: column;
  min-height: 0;
  min-width: 0;
  background: var(--paper-1);
}
.chat-stream {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 36px max(20px, calc(50% - 380px));
  scroll-behavior: smooth;
  /* iOS Safari can fail touch-scroll when the scroll container is also
     a flex column. Keep this a plain block element and space messages
     with margins instead of `gap`. */
  touch-action: pan-y;
}
.chat-stream > .msg + .msg,
.chat-stream > .msg + .suggestions,
.chat-stream > .suggestions + .msg { margin-top: 26px; }

.msg { display: flex; flex-direction: column; gap: 6px; }
.msg-role {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-3);
}
.msg--user .msg-role { color: var(--navy); }
.msg--assistant .msg-role { color: var(--oxblood); }
.msg-body {
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: var(--font-body);
  font-size: 1.08rem;
  line-height: 1.75;
  color: var(--ink-1);
}

/* Auto-suggestion chips after a Charles reply.
   Float right, italic, dotted border — clearly secondary to the message,
   designed to be ignored as easily as taken up. */
.suggestions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  margin: 12px 0 0;
  padding-top: 8px;
  border-top: 1px dotted var(--rule-soft);
}
.suggestions-intro {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-right: 4px;
}
.suggestion-chip {
  font-family: var(--font-body);
  font-size: 0.92rem;
  line-height: 1.2;
  color: var(--ink-2);
  background: transparent;
  border: 1px dotted var(--rule);
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.15s ease;
  max-width: 280px;
  text-align: left;
}
.suggestion-chip:hover {
  color: var(--paper-1);
  background: var(--ink-1);
  border-style: solid;
  border-color: var(--ink-1);
}
@media (max-width: 720px) {
  .suggestions { justify-content: flex-start; }
}

/* ── Landing / empty state ── */
.chat-empty {
  margin: 24px 0 32px;
  max-width: 660px;
  padding: 8px 0 0;
  position: relative;
}
.deco-sunburst {
  display: block;
  width: 200px;
  height: 60px;
  margin: 0 0 18px;
  color: var(--ink-2);
  opacity: 0.85;
}
.page-mark {
  text-align: center;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.85rem;
  color: var(--ink-3);
  letter-spacing: 0.4em;
  margin: 36px 0 8px;
  padding-right: 0.4em;
}
.chat-empty-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--ink-3);
  margin-bottom: 18px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
  display: block;
}
.chat-empty h1 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2rem, 5.5vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -0.005em;
  margin-bottom: 6px;
  color: var(--ink-1);
}
.chat-empty h1::after {
  content: '';
  display: block;
  width: 80px;
  height: 1px;
  background: var(--ink-1);
  margin: 18px 0 22px;
}

.chat-empty-lede {
  color: var(--ink-2);
  font-family: var(--font-body);
  font-size: 1.08rem;
  line-height: 1.75;
  margin-bottom: 18px;
  max-width: 58ch;
}
/* Drop cap on the first paragraph of the lede — Bodoni 900 oxblood */
.chat-empty-lede:first-of-type::first-letter {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 4.2em;
  line-height: 0.82;
  float: left;
  padding: 0.04em 0.14em 0 0;
  color: var(--oxblood);
  margin-top: 0.02em;
  text-shadow: 1px 1px 0 var(--rule-soft);
}
.chat-empty-lede--dim {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-top: 28px;
  margin-bottom: 14px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--rule-soft);
}
.chat-empty-lede--dim::first-letter { font-size: inherit; float: none; padding: 0; color: inherit; }

/* CTA with manicule (pointing hand) */
.chat-empty-cta-line {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--ink-2);
  margin-top: 32px;
  margin-bottom: 18px;
  padding: 10px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  gap: 12px;
}
.manicule {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--oxblood);
  line-height: 1;
}

/* Roman-numeral marker on group labels */
.prompt-num {
  display: inline-block;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--oxblood);
  margin-right: 8px;
  letter-spacing: 0;
  text-transform: none;
}

/* ── Pull-quote examples ── */
.examples {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 12px;
}
.example {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--ink-1);
  border-radius: 6px;
  padding: 16px 22px 18px;
  position: relative;
}
.example::before, .example::after {
  /* corner ornaments — small fleurons */
  content: '';
  position: absolute;
  width: 6px; height: 6px;
  border: 1px solid var(--rule);
}
.example::before { top: 4px; right: 4px; }
.example::after  { bottom: 4px; left: 4px; }
.example figcaption {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-3);
  margin-bottom: 10px;
}
.example blockquote {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 1.08rem;
  line-height: 1.55;
  color: var(--ink-1);
}
.example blockquote::before { content: '\201C'; margin-right: 1px; color: var(--oxblood); font-size: 1.2em; line-height: 0; vertical-align: -0.2em; }
.example blockquote::after  { content: '\201D'; margin-left: 1px; color: var(--oxblood); font-size: 1.2em; line-height: 0; vertical-align: -0.2em; }

/* ── Asterism between empty-state sections ── */
.chat-empty-section {
  margin-top: 28px;
  position: relative;
}
.chat-empty-section::before {
  content: '⁂';
  display: block;
  text-align: center;
  color: var(--ink-3);
  font-size: 1.1rem;
  letter-spacing: 0.6em;
  margin: 0 0 24px;
  padding-right: 0.6em;
}

/* ── Prompt cloud (chips like an old library catalog) ── */
.prompt-group-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--ink-2);
  margin-top: 24px;
  margin-bottom: 10px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--rule);
  position: relative;
}
.prompt-group-label::after {
  /* small diamond ornament at the end of the rule */
  content: '◆';
  position: absolute;
  right: 0;
  bottom: -7px;
  background: var(--paper-1);
  padding: 0 4px;
  font-size: 0.6rem;
  color: var(--rule);
}
.prompt-group-label:first-child { margin-top: 0; }

.prompt-cloud {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
}
.prompt-chip {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  color: var(--ink-1);
  padding: 11px 16px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.3;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: 0.15s ease;
  text-align: left;
  width: 100%;
}
.prompt-chip:hover {
  color: var(--paper-1);
  background: var(--ink-1);
  border-color: var(--ink-1);
}

/* ── Empty state foot ── */
.chat-empty-foot {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  border-top: 1px solid var(--rule);
  padding-top: 16px;
  margin-top: 32px;
  line-height: 1.7;
  font-style: italic;
}

/* ── Input ── */
.chat-input-wrap {
  border-top: 3px double var(--rule);
  padding: 16px max(20px, calc(50% - 380px));
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  display: flex; gap: 14px; align-items: flex-end;
  background: var(--paper-1);
  flex-shrink: 0;
}
.chat-input-wrap textarea {
  flex: 1;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 6px;
  color: var(--ink-1);
  font-family: var(--font-body);
  font-size: 1.05rem;
  padding: 14px 16px;
  resize: none;
  outline: none;
  min-height: 52px;
  max-height: 200px;
  transition: border-color 0.15s ease;
}
.chat-input-wrap textarea:focus { border-color: var(--oxblood); background: var(--paper-1); }
.chat-input-wrap textarea::placeholder { color: var(--ink-3); font-style: italic; }

/* ════ Modal ════ */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(31, 22, 11, 0.5);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-backdrop[hidden] { display: none; }
.modal-card {
  background: var(--paper-1);
  border: 1px solid var(--ink-1);
  border-radius: 6px;
  padding: 32px 30px;
  max-width: 440px; width: 100%;
  position: relative;
  box-shadow: 6px 6px 0 var(--rule-soft);
}
.modal-card::before {
  content: '';
  position: absolute;
  top: 6px; left: 6px; right: 6px; bottom: 6px;
  border: 1px solid var(--rule);
  pointer-events: none;
}
.modal-card h2 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.45rem;
  margin-bottom: 12px;
  color: var(--ink-1);
}
.modal-card p {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 16px;
}
.modal-status {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: 6px;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.92rem;
  color: var(--ink-2);
}
.modal-status--ok {
  border-color: color-mix(in srgb, var(--gold) 50%, var(--rule));
  background: color-mix(in srgb, var(--gold) 8%, var(--paper-1));
  color: var(--ink-1);
}
.modal-dismiss {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 8px;
  background: transparent;
  border: none;
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
}
.modal-dismiss:hover { color: var(--oxblood); }

/* ════════════════════════════════════════════════════════════════
   ABOUT PAGE
   ════════════════════════════════════════════════════════════════ */
.about-page {
  flex: 1;
  padding: 48px 24px 72px;
}
.about-article {
  max-width: 640px;
  margin: 0 auto;
}
.about-article .chat-empty-eyebrow { display: block; }
.about-article .chat-empty-lede:first-of-type::first-letter,
.about-article > p:first-of-type::first-letter {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 4em;
  line-height: 0.82;
  float: left;
  padding: 0.04em 0.14em 0 0;
  color: var(--oxblood);
  text-shadow: 1px 1px 0 var(--rule-soft);
}
.about-article h1 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.9rem, 4.5vw, 2.6rem);
  line-height: 1.1;
  letter-spacing: -0.005em;
  margin-bottom: 24px;
}
.about-article h1::after {
  content: '';
  display: block;
  width: 80px;
  height: 1px;
  background: var(--ink-1);
  margin: 18px 0 0;
}
.about-article h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  margin-top: 36px;
  margin-bottom: 12px;
  color: var(--ink-1);
}
.about-article p {
  font-family: var(--font-body);
  font-size: 1.06rem;
  line-height: 1.75;
  color: var(--ink-1);
  margin-bottom: 14px;
}
.about-article p strong { font-weight: 600; }
.about-article p code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: var(--paper-2);
  padding: 1px 6px;
  border: 1px solid var(--rule-soft);
}
.about-article a {
  color: var(--oxblood);
  text-decoration: underline;
  text-decoration-style: solid;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
.about-article a:hover { color: var(--ink-1); }

.about-link-line {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  padding: 10px 14px;
  margin-bottom: 14px !important;
  word-break: break-all;
}
.about-link-line a { font-family: inherit; font-size: inherit; }

.about-divider {
  text-align: center;
  font-size: 1.1rem;
  letter-spacing: 0.6em;
  color: var(--ink-3);
  margin: 40px 0 24px;
  padding-right: 0.6em;
}

.about-credits {
  list-style: none;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.85;
  margin-bottom: 32px;
}
.about-credits li {
  border-bottom: 1px dotted var(--rule);
  padding: 6px 0;
}
.about-credits li:last-child { border-bottom: 0; }
.about-credits span {
  display: inline-block;
  min-width: 160px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.about-foot {
  margin-top: 48px;
  text-align: center;
}
.about-foot .btn-primary {
  color: var(--oxblood);
  background: var(--paper-2);
  border-color: var(--oxblood);
  box-shadow: 2px 2px 0 var(--rule-soft);
}
.about-foot .btn-primary:hover {
  color: var(--paper-1);
  background: var(--oxblood);
  border-color: var(--oxblood);
}

/* ════ Footer (login + about pages) ════ */
.footer {
  margin-top: auto;
  padding: 22px 24px;
  border-top: 1px solid var(--rule);
}
.footer-inner {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  flex-wrap: wrap;
}
.footer-sep { opacity: 0.5; }
.footer a { color: var(--ink-3); text-decoration: underline; text-decoration-style: dotted; }
.footer a:hover { color: var(--oxblood); }

/* ════ Responsive ════ */
@media (max-width: 720px) {
  .chat-body {
    grid-template-columns: 1fr;
    grid-template-areas:
      "topbar"
      "main";
  }
  .sidebar {
    position: fixed;
    top: var(--topbar-h); left: 0;
    width: min(280px, 80vw);
    height: calc(100dvh - var(--topbar-h));
    border-right: 1px solid var(--rule);
    transform: translateX(-100%);
    transition: transform 0.25s var(--ease-out);
    box-shadow: 4px 0 0 var(--rule-soft);
  }
  .sidebar.sidebar--open { transform: translateX(0); }
  .topbar-icon { display: inline-flex; }
  .topbar-badge { display: none; }
  .topbar { padding: 0 14px; gap: 10px; }
  .nav-brand { font-size: 1.4rem; }
  .chat-stream { padding: 22px 18px; }
  .chat-input-wrap { padding: 12px 14px; }
  .chat-empty { margin: 12px 0 24px; }
  .chat-empty h1 { font-size: clamp(1.7rem, 8vw, 2.2rem); }
  .chat-empty-lede { font-size: 0.98rem; }
  .chat-empty-lede:first-of-type::first-letter { font-size: 2.8em; }
  .example blockquote { font-size: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
