/* public/tokens.css — the palette. One file, every page.
 *
 * It used to live in two places. styles.css and workspace.css each carried a
 * :root block, because workspace.html loads no styles.css: that page is a
 * fixed-height three-column shell and the rest of the app is document flow, so
 * .center, .rail, .topbar, body and html mean different things in each. Those
 * two shells are a real constraint and they stay separate.
 *
 * The palette was never part of that constraint. It was duplicated as
 * collateral — one of the fourteen selectors the two files share — and the
 * duplication is what produced the last month of defects. A shared component
 * cannot know which of the two files the page it lands on will load, so it
 * guesses and writes a fallback, and every fallback written before 2026-09-22
 * holds the deleted dark theme:
 *
 *   alpha.css  var(--bg-1, #13161c)   feedback modal, title 1.06:1, textarea 1.02:1  (#464)
 *   dataroom.css                      a private copy of the whole dark palette        (#466)
 *   decision-loop.css  var(--panel, #13161c)  every tab label 1.02:1, every claim 1.06:1  (#471)
 *
 * With one home there is nothing to guess and nothing to fork.
 *
 * TWO NAMES PER ROLE, FOR NOW. --bg-1 and --panel are the same colour under
 * different names; so are --border-2/--line and --accent/--rust. The first set
 * is canonical (1,143 call sites against 548) and the second aliases it, so
 * they cannot drift while the second is retired. Do not add a third name.
 */

:root {
  /* ── grounds ──────────────────────────────────────────────────────────── */
  --bg-0: #f4f5f2;
  --bg-1: #fbfbf9;
  --bg-2: #ffffff;
  --bg-3: #ffffff;
  --surface: #ffffff;   /* the card ground; .ctx-modal-card reads it bare */

  /* ── rules ────────────────────────────────────────────────────────────── */
  --border-1: #efefea;   /* faintest hairline on paper */
  --border-2: #e7e7e1;   /* = --doc-line, the standard hairline */
  --border-3: #d9dad2;   /* = --doc-line-2, the stronger rule */

  /* ── ink ──────────────────────────────────────────────────────────────── */
  --ink-0: #1a1c1a;
  --ink-1: #33352f;
  --ink-2: #5f615a;
  --ink-3: #6f7168;
  /* Tier 4 is an ALIAS of tier 3, not a paler value. It shipped at #a9aaa1 —
     2.35:1 on white, half the AA floor — across 50 call sites. Aliasing keeps
     those call sites and makes the pale grey unable to come back. */
  --ink-4: #6f7168;

  /* ── accents ──────────────────────────────────────────────────────────────
     Paper-legible values of the hues the dark theme used. The originals
     (#ff6a3d, #7dd3fc, #fbbf24, #34d399) were tuned to glow on #0f1218 and
     measure 2.85:1, 1.67:1, 1.67:1 and 1.92:1 on white.
     --accent-amber was #9a6a12 until 2026-09-23: 4.56:1, clearing AA by 0.06,
     so it failed the moment it sat on any tint — which it does in twelve
     files. Darkened to 5.44:1 on paper and 4.92:1 on its own 8% wash. */
  --accent: #a8462c;
  --accent-cyan: #2a6b65;
  --accent-amber: #8a5f10;
  --accent-green: #1f7a52;
  --accent-violet: #63519b;
  /* An 8% wash of the cyan, for a selected chip. admin.css declared this on
     :root at rgba(125,211,252,.08) — the dark cyan, written as rgba and so
     invisible to every hex-based check. */
  --accent-cyan-weak: rgba(42, 107, 101, .08);

  /* A second naming set — --bg/--panel/--line/--rust/--cyan/--green/--amber/
     --violet — used to alias the eleven roles above, because the two palette
     homes had named them differently. 609 call sites, retired 2026-09-23. A
     component that reads a token now has exactly one name to read.
     Two files kept their own and are prefixed so they cannot be mistaken for
     these: --acqc-* (a self-contained component palette, with its own theme
     toggle) and --mc-* (metrics-coverage, not yet converted). */

  /* ── danger — was hardcoded #f87171 in ~60 places ──────────────────────── */
  /* #f87171 until 2026-09-24 — 2.67:1 on paper, so every `color: var(--danger)`
     failed AA, and context.css had twelve more sites written as the raw hex.
     #a32128 is 7.22:1; dealroom.css picked it first and now aliases this. */
  --danger: #a32128;
  --danger-weak: rgba(163, 33, 40, .08);
  --danger-mid:  rgba(163, 33, 40, .15);
  --danger-line: rgba(163, 33, 40, .40);

  /* ── document surface ─────────────────────────────────────────────────── */
  --doc-bg: #fbfbf9;
  --doc-card: #ffffff;
  --doc-wash: #f4f5f2;
  --doc-subtle: #f6f7f9;
  --doc-line: #e7e7e1;
  --doc-line-2: #d9dad2;
  --doc-border: #e7e7e1;
  --doc-ink-0: #1a1c1a;
  --doc-ink-1: #33352f;
  --doc-ink-2: #5f615a;
  --doc-ink-3: #6f7168;
  --doc-ink-4: #6f7168;   /* alias of tier 3, same reason as --ink-4 */
  --doc-accent: #1d4e4a;
  --doc-accent-2: #2a6b65;
  --doc-accent-soft: #e8f0ee;
  --doc-amber: #8a5f10;
  --doc-amber-soft: #f6edd7;
  /* Ink for a label sitting on an amber wash: --doc-amber is tuned for white
     and drops once an 8% wash lifts the ground under it. */
  --doc-amber-ink: #8a5a12;
  --doc-green: #1f7a52;
  --doc-warn: #a8462c;
  --doc-serif: 'Fraunces', Georgia, serif;
  --doc-sans: -apple-system, BlinkMacSystemFont, 'Inter', system-ui, sans-serif;

  /* ── scrollbars ───────────────────────────────────────────────────────── */
  --scrollbar-size: 8px;
  --scrollbar-track: transparent;
  --scrollbar-thumb: #d9dad2;
  --scrollbar-thumb-hover: #c3c4ba;
  --scrollbar-thumb-active: #adaea4;

  /* ── type scale — use these instead of ad-hoc px (no fractional sizes) ─── */
  --fs-2xs: 10px;
  --fs-xs:  11px;
  --fs-sm:  12px;
  --fs-base:13px;
  --fs-md:  14px;
  --fs-lg:  17px;
  --fs-xl:  20px;
  --fs-2xl: 24px;

  /* ── radius scale ─────────────────────────────────────────────────────── */
  --radius-xs:   4px;
  --radius-sm:   6px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-pill: 999px;

  /* ── spacing scale (4px base) ─────────────────────────────────────────── */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
}

/* Metrics estimate states — the metrics coverage page and its headline, which
   the home page's Metrics card also draws (metrics-headline.css). */
/* The chrome half of this block was the global palette under other names, with
   a shade of drift — --mc-ink #1a1d21 against --ink-0 #1a1c1a, --mc-line #e6e8eb
   against --border-2 #e7e7e1, --mc-soft identical to --doc-subtle. It read
   --accent as the dark theme's #ff6a3d, 2.85:1, and declared all of it on :root,
   so it overrode the palette for the whole page. The names came out in #473 and
   the values follow here: the page inherits.

   What stays is the five provenance categories, which are the page's actual
   vocabulary — where a metric came from. They are a categorical scale, not
   accents: the app palette has four accents and a danger, so mapping five onto
   them would collapse two pairs into one colour and lose the distinction the
   table exists to draw. All five clear AA on white (5.08, 5.85, 4.70, 7.58,
   6.57 on white) and the hues are left as they are. Two were darkened a step:
   each label sits on its OWN 8%-ish wash, and a colour tuned for white loses a
   little there — peer measured 4.12:1 on #f7efe2 and computed 4.49:1 on
   #e7f4ec. They are 5.39:1 and 5.39:1 now. Same trap as the rgba washes in
   #478, from the other direction. */
:root{
  --mc-computed:#177130; --mc-computed-bg:#e7f4ec;
  --mc-triangulated:#0a6aa1; --mc-triangulated-bg:#e5f1f8;
  --mc-peer:#8f530d; --mc-peer-bg:#f7efe2;
  --mc-recorded:#475569; --mc-recorded-bg:#eef1f5;
  --mc-gap:#b42318; --mc-gap-bg:#fbeceb;
  /* the gap bar is a pale fill, not the solid the other four use — absence,
     shown faint. It was the file's one loose hex. */
  --mc-gap-weak:#f0d4d1;
}
