/* tokens.css — Design tokens — the ONLY file in css/ allowed to contain a colour literal.
   Cascade position 1 of 18. Order is load-bearing and is asserted by
   verify-fixtures.mjs; index.html links these explicitly (never @import) because Caddy's
   try_files turns a missing file into a 200 text/html SPA shell.
   Owner after Step 1: shared, frozen.

   DESIGN-SPEC §2. Two blocks:

   A. The --sn-* system. This is what new and restyled rules use.
   B. The legacy names (--bg, --panel, --ink, --dim, --signal, --line …) the fourteen
      component files still point at. They are ALIASES onto block A, so the two systems
      cannot drift. A component section deletes its legacy uses when it restyles; the
      alias leaves this file the day nothing references it.

   Exactly two values change here versus what shipped, and both are the point:
     --dim2  #71717a -> #8b8b95   (item 75: 3.99:1 -> 5.71:1, the most widespread
                                   contrast failure in the file, 43 uses at 11-12.5px)
     --bad   undefined -> #ff8585 (item 83: referenced at the custom-printer invalid
                                   state and defined nowhere, so the #e2606a fallback
                                   always won and was the only use of that red)
   Everything else is byte-identical to what the single stylesheet resolved to, which is
   why the computed-style diff for the rest of the app is empty.

   NOT hoisted into apps/web/shared.css. That is the marketing site's stylesheet and the
   marketing page is out of scope (IMPLEMENTATION-PLAN §7.3); linking it here would change
   a second page's paint. The measured, written disagreement is in the Step 1 report —
   item 87 asks that the two stop disagreeing SILENTLY, and a recorded difference is not
   silent. */
:root {
  color-scheme: dark;

  /* ── A. surfaces (§2.1) — opaque; elevation is carried by the line, not the fill ── */
  --sn-surface-0: #09090b;   /* page, stage backdrop, dialog scrim base */
  --sn-surface-1: #0e0e11;   /* top bar, rail, dock, result panel */
  --sn-surface-2: #16161a;   /* cards, inputs, selects, chips, file rows, dossier cells */
  --sn-surface-3: #1e1e24;   /* popovers, menus, tooltips, dialog card */
  --sn-surface-0-rgb: 9 9 11;
  --sn-surface-1-rgb: 14 14 17;
  --sn-surface-2-rgb: 22 22 26;
  --sn-surface-4-rgb: 39 39 42;   /* the one darker chrome used by the image-remove button */
  /* Two off-ladder greys the shipped sheet used once each. Kept at their exact values so
     nothing repaints; their component sections fold them into the ladder above. */
  --sn-surface-1-alt: #111116;    /* the feedback panel's fill */
  --sn-surface-2-alt: #14141a;    /* the stage gradient's inner stop, and the .btn hover fill */
  --sn-white-rgb: 255 255 255;
  --sn-black-rgb: 0 0 0;

  /* ── A. lines (§2.2) ──────────────────────────────────────────────────────────── */
  --sn-line: #2b2b32;
  --sn-line-strong: #43434f;
  --sn-line-raised: #606070;   /* the border of anything floating: menu, tooltip, dialog */

  /* ── A. ink (§2.3) — all three clear AA on every surface they are allowed on ───── */
  --sn-ink: #fafafa;
  --sn-ink-dim: #a1a1aa;
  --sn-ink-mute: #8b8b95;      /* replaces --dim2 #71717a: 3.99:1 -> 5.71:1 (item 75) */
  --sn-ink-soft: #d4d4d8;      /* prose inside a card */
  --sn-ink-soft-2: #e4e4e7;    /* the result reason line */
  --sn-ink-placeholder: #8b8b94;

  /* ── A. accent and state (§2.4) — channel tokens kill the 19 hand-typed alphas ── */
  --sn-accent-rgb: 5 206 120;
  --sn-accent: rgb(var(--sn-accent-rgb));
  --sn-accent-ink: #052e1c;       /* label on a solid accent fill — 7.15:1 */
  --sn-accent-shade: #0f1512;     /* the near-black green of the stage backdrop */
  --sn-accent-tint: rgb(var(--sn-accent-rgb) / .14);
  --sn-accent-tint-hi: rgb(var(--sn-accent-rgb) / .26);
  --sn-accent-edge: rgb(var(--sn-accent-rgb) / .55);
  --sn-accent-hover: #0ae085;
  --sn-accent-press: #04b869;
  --sn-accent-disabled-bg: #17402e;
  --sn-accent-disabled-ink: #8fdcb6;
  /* MEASURED, and a correction to DESIGN-SPEC §4.14: the spec's #1f5a41 outline reaches
     2.38:1 against the rail, not the 3:1 item 76's Verify line asks for (the spec's own
     note says 2.0:1 and then claims the target is met). #1f6c42 is the first value in
     the same family that actually reaches it: 3.01:1 against the rail, 3.11:1 against
     the page. The label stays 7.23:1 on its own fill. */
  --sn-accent-disabled-edge: #1f6c42;

  --sn-warn-rgb: 255 183 101;
  --sn-warn: rgb(var(--sn-warn-rgb));
  --sn-warn-tint: rgb(var(--sn-warn-rgb) / .10);
  --sn-warn-edge: rgb(var(--sn-warn-rgb) / .45);
  --sn-warn-ink: #f5d9b4;         /* body copy inside a warn notice — 11.97:1 */
  --sn-warn-ink-on-fill: #2a1c05; /* label on a solid amber fill */

  /* --sn-bad is the ONE error family (item 83). The three orphans it replaces are
     #e2606a (the undefined --bad's fallback), #ffb4b4 (headings) and #ffc9c9 (body).
     The legacy #ff4d4d* backgrounds keep their channel token until their component
     sections restyle, so nothing repaints in Step 1 that was not asked for. */
  --sn-bad-rgb: 255 133 133;
  --sn-bad: rgb(var(--sn-bad-rgb));
  --sn-bad-tint: rgb(var(--sn-bad-rgb) / .10);
  --sn-bad-edge: rgb(var(--sn-bad-rgb) / .55);
  --sn-bad-title: #ffb4b4;
  --sn-bad-ink: #ffc9c9;          /* body copy inside a bad notice — 11.85:1 */
  --sn-bad-legacy-rgb: 255 77 77; /* the shipped error backgrounds, unchanged */

  /* --sn-ok is a DIFFERENT green from --sn-accent on purpose (item 67): accent is the
     only colour an action may wear, ok is the only colour a success state may wear. */
  --sn-ok-rgb: 99 232 173;
  --sn-ok: rgb(var(--sn-ok-rgb));
  --sn-ok-tint: rgb(var(--sn-accent-rgb) / .12);
  --sn-ok-ink: #bff0d8;           /* 13.33:1 on the ok tint */
  --sn-ok-soft: #9fe3c3;
  --sn-ok-pale: #bff3da;
  --sn-ok-bright: #d8ffeb;

  --sn-focus: var(--sn-accent);

  /* ── A. type — 5 steps (§2.5). No half-pixel size survives a migrated rule. ────── */
  --sn-text-2xs: 11px;    --sn-lh-2xs: 1.45;   /* eyebrows, badges, status pills */
  --sn-text-xs: 12.5px;   --sn-lh-xs: 1.45;    /* hints, notes, tooltip body */
  --sn-text-sm: 13.5px;   --sn-lh-sm: 1.5;     /* body default in the rail */
  --sn-text-md: 15px;     --sn-lh-md: 1.4;     /* step titles, button labels, chips */
  --sn-text-lg: 20px;     --sn-lh-lg: 1.15;    /* panel headings, dialog h1 */
  --sn-font: 'Schibsted Grotesk', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --sn-font-display: Gabarito, ui-sans-serif, system-ui, sans-serif;
  --sn-font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;

  /* ── A. spacing — 4-based (§2.6). px only: the px/em mix is the direct cause of the
     28.77-vs-28.00 px header pill mismatch (items 12, 86). ───────────────────────── */
  --sn-space-1: 4px;  --sn-space-2: 8px;  --sn-space-3: 12px;  --sn-space-4: 16px;
  --sn-space-5: 24px; --sn-space-6: 32px; --sn-space-7: 48px;

  /* ── A. radii — exactly 3 (§2.7) ───────────────────────────────────────────────── */
  --sn-radius-sm: 8px;      /* inputs, chips, menu rows, file rows, tooltips */
  --sn-radius-md: 12px;     /* cards, panels, popovers, primary button, dialog card */
  --sn-radius-lg: 16px;     /* UI Quiet: the floating viewport toolbar, file rows, the empty card (DESIGN §2) */
  --sn-radius-pill: 999px;  /* top-bar pills */

  /* ── A. shadows — exactly 2 (§2.8). The border is the separator; the shadow is
     only depth, because a black shadow contributes nothing on a #09090b page. ────── */
  --sn-shadow-raised: 0 8px 24px -8px rgb(0 0 0 / .70), 0 2px 6px rgb(0 0 0 / .50);
  --sn-shadow-overlay: 0 24px 64px -12px rgb(0 0 0 / .80);

  /* ── A. motion (§2.9). REFERENCE-STUDY §18: no interaction may exceed 200ms, so
     --sn-dur-slow is for panel state changes and step collapse ONLY. ─────────────── */
  --sn-dur-fast: 120ms;
  --sn-dur-base: 180ms;
  --sn-dur-slow: 320ms;
  --sn-ease-out: cubic-bezier(.22, 1, .36, 1);
  --sn-ease-in-out: cubic-bezier(.40, 0, .20, 1);

  /* ── B. legacy aliases. Delete a line here when nothing references it. ─────────── */
  --bg: var(--sn-surface-0);
  --panel: var(--sn-surface-1);
  --surface: var(--sn-surface-2);
  --ink: var(--sn-ink);
  --dim: var(--sn-ink-dim);
  --dim2: var(--sn-ink-mute);           /* VALUE CHANGED — item 75 */
  --signal: var(--sn-accent);
  --signal-ink: var(--sn-accent-ink);
  --warn: var(--sn-warn);
  --bad: var(--sn-bad);                 /* NEWLY DEFINED — item 83 */
  /* --line / --line-strong keep their ALPHA values in Step 1. The opaque replacements
     are --sn-line / --sn-line-strong above; swapping them globally would repaint every
     border in the app, which is each component section's decision, not this one's. */
  --line: rgb(var(--sn-white-rgb) / .078431372549);
  --line-strong: rgb(var(--sn-white-rgb) / .141176470588);
}
