/* ==========================================================================
   THALVIX v2 — SHARED SHELL
   --------------------------------------------------------------------------
   The design tokens, extracted from index.html on 2026-08-16 so that the app
   screen and the document pages (privacy, terms, account) cannot drift apart.
   ⛔ This is the ONLY definition of the palette. Do not re-declare a token in
   a page; if a page needs a new value, it belongs here.

   Palette is [H]'s own: WARM near-black ground with a COOL blue accent. The
   previous violet read as harsh because it sat on a cold base and went neon;
   warming the ground is what fixed it, not muting the hue.
   ========================================================================== */
:root{
  /* ---- [H]'s palette, 2026-08-16. Warm ground, cool accent — that tension is
         why the old scheme read as harsh: violet sat on a COLD base and went neon.
         Original names kept alongside so the two map cleanly. */
  --bg:#141312;    /* --bg-main    */
  --bg-1:#1c1917;  /* --bg-header  */
  --bg-2:#1f1d1b;  /* --bg-surface */
  --bg-3:#262320;  /* --bg-input   */
  --line:#2e2a26;  --line-soft:#242019;   /* warm borders to match the ground */

  --ink:#f3f4f6;   /* --text-primary   16.9:1 */
  --ink-2:#9ca3af; /* --text-secondary  7.3:1 */
  --ink-3:#6b7280; /* --text-muted      3.8:1 — hints/placeholders only, never body */
  --ink-4:#4b5158;

  /* ---- accent: blue shift.
     🔴 CONTRAST: white on #3b82f6 is 3.68:1 — BELOW the 4.5:1 AA floor for normal
     text. So anything carrying white text (user bubbles, send button) uses the
     darker #2563eb at 5.17:1, and #3b82f6 is kept for borders, links, focus and
     hover where it carries no text. Do not "simplify" these back to one value. */
  --accent:#3b82f6;        /* --accent-primary       — non-text uses */
  --accent-solid:#2563eb;  /* --accent-primary-hover — anything under white text */
  --accent-2:#60a5fa;      /* --accent-secondary     */
  --accent-ink:#fff;
  --accent-wash:rgba(59,130,246,.12);
  --accent-line:#2e3748;   /* --accent-border */

  /* ---- the companion's accent: violet. [H], 2026-08-17 — "add purple to the AI response part."
     The two sides of a conversation now carry a colour each: blue marks YOUR edge, violet marks
     HERS. That is the "two accents on purpose" the theme was approved with.
     ⭐ This is the violet that previously read as neon — and the reason it works now is the
     ground. On the old COLD base it glared; against the warm #141312 it sits down. Do not port
     this token to a cold-background surface without re-checking it there.
     ⚠ EDGE AND NAME ONLY, never a text ground: white on #a78bfa is 2.6:1, far under the floor.
     Nothing here carries text, so no contrast requirement applies — keep it that way. */
  --accent-ai:#a78bfa;
  --accent-ai-wash:rgba(167,139,250,.10);

  --ok:#3dd68c;  --warn:#f59e0b;  --bad:#f05a7c;
  --notice-bg:#292318;  --notice-line:#78350f;  --notice-ink:#f59e0b;

  /* ---- spacing scale (was: none) */
  --s1:4px; --s2:8px; --s3:12px; --s4:16px; --s5:24px; --s6:32px; --s7:48px; --s8:64px;

  /* ---- radii */
  --r1:8px; --r2:12px; --r3:18px; --r4:26px; --r-pill:999px;

  /* ---- type scale (was: none) */
  --t-xs:12px; --t-sm:13px; --t-md:15px; --t-lg:17px; --t-xl:22px; --t-2xl:30px;

  /* ---- z-index scale (was: none — with 7 stacked modals) */
  --z-base:1; --z-sticky:10; --z-scrim:20; --z-sheet:30; --z-toast:40;

  --font-ui:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
  --font-prose:'Newsreader',Georgia,'Times New Roman',serif;

  /* Companion PROSE, split out from --font-prose so the serif question can be
     answered without dragging the landing headline along: the hero is a display
     choice that already works, this is the one still undecided. */
  --font-msg:var(--font-prose);

  --ease:cubic-bezier(.16,1,.3,1);
  --shadow-1:0 1px 2px rgba(0,0,0,.4);
  --shadow-2:0 8px 30px rgba(0,0,0,.45);
}
*{box-sizing:border-box}

/* ==========================================================================
   DOCUMENT PAGES — privacy, terms, account.
   Not the app screen: these SCROLL, are read top to bottom, and are reachable
   signed out. index.html keeps its own body rules (height:100%, overflow:hidden)
   because an app shell and a document want opposite things from the viewport.
   ========================================================================== */
html{-webkit-text-size-adjust:100%}
body.doc{
  margin:0; background:var(--bg); color:var(--ink);
  font:400 var(--t-md)/1.65 var(--font-ui);
  -webkit-font-smoothing:antialiased;
}
button,input,select,textarea{font:inherit;color:inherit}
button{background:none;border:0;cursor:pointer}
:focus-visible{outline:2px solid var(--accent-2);outline-offset:2px;border-radius:var(--r1)}

.doc-wrap{max-width:760px;margin:0 auto;padding:var(--s6) var(--s4) var(--s8)}

.doc-brand{display:flex;align-items:center;gap:var(--s3);margin-bottom:var(--s7)}
.doc-brand .mark{
  width:30px;height:30px;border-radius:var(--r1);background:var(--accent-solid);
  color:var(--accent-ink);display:grid;place-items:center;font-weight:600;font-size:var(--t-md);
}
.doc-brand .name{font-weight:600;letter-spacing:-.01em}

.doc h1{font-size:var(--t-2xl);line-height:1.15;margin:0 0 var(--s3);letter-spacing:-.02em;text-wrap:balance}
.doc .lead{color:var(--ink-2);margin:0 0 var(--s7);max-width:62ch}
.doc h2{font-size:var(--t-lg);line-height:1.3;margin:0 0 var(--s3);letter-spacing:-.01em}
.doc p{margin:0 0 var(--s3);max-width:66ch}
.doc p:last-child{margin-bottom:0}
.doc a{color:var(--accent-2)}
.doc ul{margin:0 0 var(--s3) var(--s5);padding:0;max-width:66ch}
.doc li{margin-bottom:var(--s2)}
.doc .fine{color:var(--ink-3);font-size:var(--t-sm)}

.card{
  background:var(--bg-2);border:1px solid var(--line);border-radius:var(--r2);
  padding:var(--s5);margin-bottom:var(--s4);
}

/* Wide content scrolls inside its own box — the page body must never scroll sideways. */
.table-wrap{overflow-x:auto;border:1px solid var(--line);border-radius:var(--r1);margin:0 0 var(--s3)}
.doc table{border-collapse:collapse;width:100%;min-width:520px;font-size:var(--t-sm)}
.doc th{
  text-align:left;padding:var(--s3);background:var(--bg-3);color:var(--ink-2);
  font-weight:600;border-bottom:1px solid var(--line);white-space:nowrap;
}
.doc td{padding:var(--s3);border-bottom:1px solid var(--line-soft);vertical-align:top}
.doc tr:last-child td{border-bottom:0}

.doc-foot{
  margin-top:var(--s7);padding-top:var(--s4);border-top:1px solid var(--line);
  color:var(--ink-3);font-size:var(--t-sm);display:flex;gap:var(--s3);flex-wrap:wrap;
}
.doc-foot a{color:var(--ink-2);text-decoration:none}
.doc-foot a:hover{color:var(--ink);text-decoration:underline}

/* The controller-identity fallback notice styles itself inline (shared helper,
   also used by v1's pages) — this only keeps its links legible on our ground. */
.card a[href^="mailto:"]{color:var(--accent-2)}

