/* ─────────────────────────────────────────────────────────────────────────────
 * TOGRA — Reskin register tokens (rsk-, 2026-07-13 · Phase 0)
 *
 * The register system replaces data-theme as the palette source of truth.
 *   <html data-reg="ledger">  → warm light (default)
 *   <html data-reg="console"> → refined dark
 *   <html data-reg="irish">   → warm editorial (landing)
 *
 * These blocks OVERRIDE the legacy CSS variables (--bg / --surface / --accent …)
 * that theme.css + app.css define, so every existing component recolours with no
 * markup change. Loaded LAST (after theme.css / app.css / togra-page.css); the
 * html[data-reg=…] selector (0,1,1) + load order beats the legacy :root / [data-theme].
 *
 * NAMESPACE NOTE: the app already owns `tg-*` (togra-page.css). New reskin
 * classes use `rsk-*`. New design tokens use `--rsk-*`.
 * ───────────────────────────────────────────────────────────────────────────── */

:root {
  --rsk-serif: 'Iowan Old Style','Palatino Linotype',Palatino,'Book Antiqua',Georgia,serif;
  --rsk-mono:  'SF Mono',ui-monospace,'JetBrains Mono',Menlo,monospace;
  --rsk-sans:  -apple-system,BlinkMacSystemFont,'Segoe UI',Inter,Roboto,sans-serif;
  --rsk-spine-w: 236px;
  --rsk-shadow: 0 1px 2px rgba(33,29,22,.05);
}

/* ── Ledger (default) — warm-cream surfaces + the existing AA-tuned light text
      colours, so contrast stays proven while the surfaces warm up. ── */
html[data-reg="ledger"] {
  --bg:#f6f3ec; --surface:#fffdf8; --surface2:#f1ece2; --border:#e4ddcf;
  /* muted #7a7466 → #6b6656: AA (4.5:1) on the raised --surface2, not just the
     main bg (was 3.95 on surface2 — table headers / stat labels). */
  --text:#211d16; --text-muted:#6b6656; --muted:#6b6656;
  /* accent #a8530c→#9a4b0a: #a8530c was AA on the bare bg (4.85) but WEAK on its
     own tints — accent text on --accent-dim 4.25 (cat F) / accent-tint banners
     4.53 (cat C). #9a4b0a (= --orange) clears both (4.9 / 5.23) + strengthens
     accent everywhere on Ledger; imperceptible brand shift. */
  --accent:#9a4b0a; --accent-dim:rgba(154,75,10,.10);
  --green:#287048; --green-dim:rgba(40,112,72,.10);
  /* --red/--orange darkened (#b3402f→#a5392a, #a8530c→#9a4b0a) so status text
     clears AA on its own -dim background (was red 4.46 / orange 4.25 on Ledger).
     --accent stays the AA-tuned brand orange #a8530c. */
  --red:#a5392a;   --red-dim:rgba(179,64,47,.10);
  --orange:#9a4b0a;--orange-dim:rgba(168,83,12,.10);
  --blue:#2160c4;  --blue-dim:rgba(33,96,196,.10);
  --purple:#6b45c8;--purple-dim:rgba(107,69,200,.10);
  --rsk-elev:#f1ece2;
  color-scheme: light;
}

/* ── Console — refined dark ── */
html[data-reg="console"] {
  --bg:#0f1013; --surface:#181a1f; --surface2:#1f2229; --border:#262a31;
  /* muted lifted #7c8089 → #969ca6 so secondary text clears WCAG AA (4.5:1) on
     the raised surfaces (was 4.02–4.4 on surface2/surface); staging-measured
     5.76–6.3. The contrast CI gate only covers light registers, so Console is
     verified by the in-page composited pass. */
  --text:#eceef2; --text-muted:#969ca6; --muted:#969ca6;
  --accent:#e8913f; --accent-dim:rgba(232,145,63,.15);
  --green:#4ec27a; --green-dim:rgba(78,194,122,.14);
  --red:#e0705c;   --red-dim:rgba(224,112,92,.14);
  --orange:#e8913f;--orange-dim:rgba(232,145,63,.12);
  --blue:#5aa9d6;  --blue-dim:rgba(90,169,214,.14);
  --purple:#9b7de8;--purple-dim:rgba(155,125,232,.14);
  --rsk-elev:#1f2229;
  color-scheme: dark;
}

/* ── Irish — warm editorial (landing / marketing) ── */
html[data-reg="irish"] {
  --bg:#f3ebdd; --surface:#fdf9f0; --surface2:#efe6d4; --border:#e2d6bf;
  /* muted #8a7d66 → #6e634b: AA on the raised --surface2 (was 3.25 there). */
  --text:#241c12; --text-muted:#6e634b; --muted:#6e634b;
  /* accent #b5561e→#9c4818: was 4.11 (sub-AA) on the parchment --bg, both as
     accent link-text and as var(--bg) text on accent buttons; now 5.29. */
  --accent:#9c4818; --accent-dim:rgba(156,72,24,.10);
  /* green/red/blue darkened for AA on their own -dim backgrounds (Irish was
     green 3.83 / blue 4.36; the contrast gate resolves via theme.css not the
     register, so these were only caught by the Irish register walk). */
  --green:#2b6540; --green-dim:rgba(61,122,82,.10);
  --red:#8f2c20;   --red-dim:rgba(168,60,38,.10);
  --orange:#9c4818;--orange-dim:rgba(181,86,30,.10); /* was #b5561e: 3.64→4.68 on -dim */
  --blue:#2f5c72;  --blue-dim:rgba(58,107,124,.10);
  --purple:#6b45c8;--purple-dim:rgba(107,69,200,.10);
  --rsk-elev:#efe6d4;
  color-scheme: light;
}
