/* ==========================================================================
   ts-tokens.css — design-token sheet (§12 of the UI/UX handoff)
   --------------------------------------------------------------------------
   The ONLY place raw color/size values live. Components consume the
   semantic aliases; shells override tokens (never components). Loaded
   after Bootstrap, before ts-bridge/ts-base/ts-components/ts-shells.

   BRAND STATUS (§4A.6): accent blue #2332CF and attention orange #FC4300
   are the OFFICIAL brand colours, measured from the supplied RCS logo
   (Overlay 28, 2026-08-26; pixel counts over the whole image). The
   structural navy remains DERIVED in-family — re-hued to the new accent
   at constant luminance. The logo's amber #FC9C00 and light blue #72AEE3
   stay logo-only by decision Q104b (both are under 4.5:1 on white and
   must never carry text). Re-run scripts/design_contrast_check.py after
   ANY palette change.

   Measured contrast (WCAG 2.x), from scripts/design_contrast_check.py:
     ink on white 15.72 / on bg 15.72 · ink-secondary on white 8.72 ·
     ink-muted on white 5.83 / on bg 5.83 / in wells 4.93 · accent on
     white 8.65 / on bg 8.65 · white on accent 8.65 / hover 9.79 /
     active 11.03 · accent on accent-soft 7.61 · structure-ink on navy
     15.76 · structure-muted on navy 8.27 / raised 7.40 ·
     success-emphasis on soft 6.64 · white on success 5.36 ·
     warning-emphasis on soft 6.57 · white on warning 5.38 ·
     danger-emphasis on soft 7.78 · white on danger 6.57 · info-emphasis
     on soft 8.42 · neutral-emphasis on soft 6.78 · on-attention on
     attention 5.69 / hover 5.09 / active 4.70 · attention-emphasis on
     soft 5.97 · border-strong on white 4.12 / on bg 4.12 (1.4.11).
     38/38 pass. (Re-measured Overlay 128: the page background is white, so
     every "on bg" pair now equals its "on white" twin.)
   ========================================================================== */

:root {
  /* ------------------------------------------------------------------ *
   *  Primitives — neutral ramp (true neutral; §12.1)                    *
   * ------------------------------------------------------------------ */
  /* Neutralised in Overlay 28 (decision Q103-A, superseding the
     2026-08-21 blue-cast request): "there is too much of one colour"
     was mostly the greys, so brand hue is now carried ONLY by the
     accent and attention families. Every step holds the previous
     step's relative luminance to within 0.007, so the measured
     contrast table survives by construction. */
  --ts-neutral-0: #ffffff;
  --ts-neutral-25: #fafafa;
  --ts-neutral-50: #f2f2f2;
  --ts-neutral-100: #ececec;
  --ts-neutral-150: #e5e5e5;
  --ts-neutral-200: #dddddd;
  --ts-neutral-300: #cccccc;
  --ts-neutral-400: #b8b8b8;
  --ts-neutral-500: #7d7d7d;
  --ts-neutral-600: #656565;
  --ts-neutral-700: #4b4b4b;
  --ts-neutral-800: #343434;
  --ts-neutral-900: #232323;
  --ts-neutral-950: #181818;

  /* ------------------------------------------------------------------ *
   *  Surfaces, borders, ink (semantic aliases)                          *
   * ------------------------------------------------------------------ */
  /* ⚠ Overlay 128 (Q2) — Ian, 2026-09-24: "I don't like that weird body
     background color #F4F2ED, i would just want that anywhere in any page or
     style to be white." That REVERSES Overlay 46's Q1, which had warmed the two
     surface aliases to #f4f2ec / #eeece6 through their own `--ts-warm-*` tokens.
     Both warm tokens are DELETED, not left defined for nobody (Overlay 85's rule):
     the page is the white step of the ramp, and the sunken wells go back to the
     neutral step the warm one was luminance-matched to (#ececec -> #eeece6, dL
     0.0000132), so every measured pair in the table above still holds. The ink
     ramp was never warmed and stays true-neutral (Overlay 28, Q103-A). */
  --ts-bg: var(--ts-neutral-0);
  /* 2026-10-06 (Ian, the reports restyle's Option AB — "A's look and colours":
     navy sidebar, light canvas, indigo): the page BEHIND the cards on the
     dashboard frame (the reports area and the organizer console). A cool, very
     pale grey-blue — not the warm #F4F2ED Overlay 128's Q2 removed; cards stay
     white. Ink 14.9:1, muted ink 5.4:1 on it. One line to undo: point it back at
     --ts-bg.
     ⚠ 2026-10-10 (Ian, Overlay 217's For-Ian 3: "yes" — the organizer area goes
     white too): the canvas is WHITE. The cards keep their borders, which is what
     separates them now. Kept as its own token, and as a literal hex, because the
     two installed apps' manifests and offline pages copy it
     (reports.tests_overlay193_voice reads it as a hex). Was #f4f5fa. */
  --ts-canvas: #ffffff;
  --ts-surface: var(--ts-neutral-0);
  --ts-surface-sunken: var(--ts-neutral-100);
  --ts-border: var(--ts-neutral-200);
  --ts-border-strong: var(--ts-neutral-500);   /* input boundaries: ≥3:1 */
  --ts-border-soft: var(--ts-neutral-150);
  --ts-ink: var(--ts-neutral-900);
  --ts-ink-secondary: var(--ts-neutral-700);
  --ts-ink-muted: var(--ts-neutral-600);

  /* ------------------------------------------------------------------ *
   *  Accent — RCS blue (provisional, §4A.2/§12.2)                       *
   * ------------------------------------------------------------------ */
  --ts-accent: #2332cf;
  --ts-accent-rgb: 35, 50, 207;
  --ts-accent-hover: #202dba;
  --ts-accent-active: #1c28a6;
  --ts-accent-soft: #eef0fb;
  --ts-accent-soft-line: #cfd2f4;
  --ts-on-accent: #ffffff;

  /* ------------------------------------------------------------------ *
   *  Structural navy — major navigation/chrome surfaces (§4A.2).       *
   *  A surface family, never body ink (§4A.3).                          *
   * ------------------------------------------------------------------ */
  --ts-structure-bg: #171a3a;
  /* R,G,B of --ts-structure-bg — keep in sync. Exists so ts-shells.css
     can repaint Bootstrap's .bg-white utility through --bs-white-rgb
     instead of out-specifying the event-theme injection (Overlay 28). */
  --ts-structure-bg-rgb: 23, 26, 58;
  --ts-structure-raised: #1f224c;
  --ts-structure-border: #2f3576;
  --ts-structure-ink: #f7f7f9;
  --ts-structure-ink-muted: #b1b4cf;
  --ts-structure-hover: #232757;
  --ts-structure-active: var(--ts-accent);
  --ts-structure-on-active: var(--ts-on-accent);

  /* ------------------------------------------------------------------ *
   *  Semantic status families (§12.3): strong / soft / emphasis / line. *
   *  Info carries NO separate hue — accent-tinted (§4A.3 resolution).   *
   * ------------------------------------------------------------------ */
  --ts-success: #187a48;
  --ts-success-rgb: 24, 122, 72;
  --ts-success-soft: #e3f3ea;
  --ts-success-emphasis: #116038;
  --ts-success-line: #bfe3cf;

  --ts-warning: #8a6400;              /* ochre — kept apart from attention orange */
  --ts-warning-rgb: 138, 100, 0;
  --ts-warning-soft: #faf0d3;
  --ts-warning-emphasis: #6e5000;
  --ts-warning-line: #ecdba4;
  /* Light round 2026-10-13: the show app's star — a gold that reads as a star
     (the ochre warning reads brown), still 3:1 against white for an icon. */
  --ts-star: #bf8115;

  --ts-danger: #b42318;
  --ts-danger-rgb: 180, 35, 24;
  --ts-danger-soft: #fdebe9;
  --ts-danger-emphasis: #8f1c12;
  --ts-danger-line: #f5c8c2;

  --ts-info: var(--ts-accent);
  --ts-info-rgb: var(--ts-accent-rgb);
  --ts-info-soft: var(--ts-accent-soft);
  --ts-info-emphasis: #202ebe;
  --ts-info-line: var(--ts-accent-soft-line);

  /* Hue-free neutral status for inert states: draft / n/a / archived. */
  --ts-neutral-status-soft: #edf0f5;
  --ts-neutral-status-emphasis: #46536b;
  --ts-neutral-status-line: #d8dee8;

  /* ------------------------------------------------------------------ *
   *  Attention — RCS orange (provisional; §4A.2 rules: at most one per  *
   *  screen, never on warnings or destructive actions, dark label).     *
   * ------------------------------------------------------------------ */
  --ts-attention: #fc4300;
  --ts-attention-rgb: 252, 67, 0;
  /* RCS orange is brighter than the colour it replaced, so a dark label
     LOSES contrast as the fill darkens. The ladder is deliberately
     shallow (−6% / −10%) and the label is a darker warm near-black:
     #0d0603 reads 5.69 / 5.09 / 4.70 on attention / hover / active.
     A conventional −10%/−20% ladder fails the 4.5 floor outright. */
  --ts-attention-hover: #ed3f00;
  --ts-attention-active: #e33c00;
  --ts-attention-soft: #ffeee8;
  --ts-attention-emphasis: #ab2e00;
  --ts-on-attention: #0d0603;

  /* ------------------------------------------------------------------ *
   *  Category-palette slots (§7): stripe/TypeChip colors are EVENT      *
   *  DATA; these slots exist so a future mapping has houses to live in. *
   *  Desaturated, deliberately unreadable as success/warning/danger.    *
   * ------------------------------------------------------------------ */
  --ts-category-1: #3d6f8e;
  --ts-category-2: #6e5a9e;
  --ts-category-3: #2e7d74;
  --ts-category-4: #8a5a44;
  --ts-category-5: #5b7553;
  --ts-category-6: #86527d;
  --ts-stripe-color: var(--ts-neutral-300); /* neutral until data exists */

  /* ------------------------------------------------------------------ *
   *  Chart series (Overlay 187, C187-1). Read by the report chart       *
   *  partial (internal/_report_chart.html) through getComputedStyle —   *
   *  a chart never carries a colour of its own. FIXED ORDER, never      *
   *  cycled: a ninth series folds into "Other". Slot 1 is the accent,   *
   *  so a one-series chart is the house indigo.                         *
   *  Validated with the dataviz skill's validate_palette.js on white:   *
   *  lightness band, chroma floor, adjacent CVD ΔE ≥ 9.1, normal-vision *
   *  ΔE ≥ 19.6 — all PASS. Slots 3, 4 and 5 sit under 3:1 on white, so  *
   *  every chart ships beside its table (the relief rule). The status   *
   *  colours above are never a series.                                  *
   * ------------------------------------------------------------------ */
  --ts-series-1: var(--ts-accent);
  --ts-series-2: #eb6834;
  --ts-series-3: #1baf7a;
  --ts-series-4: #eda100;
  --ts-series-5: #e87ba4;
  --ts-series-6: #008300;
  --ts-series-7: #7a5ce0;
  --ts-series-8: #e34948;
  /* A comparison series (last year, Overlay 190) — recessive on purpose. */
  --ts-series-comparison: var(--ts-neutral-500);

  /* ------------------------------------------------------------------ *
   *  Focus (§20)                                                        *
   * ------------------------------------------------------------------ */
  --ts-focus: var(--ts-accent);
  --ts-focus-ring: rgba(35, 50, 207, 0.28);
  --ts-focus-ring-width: 0.1875rem;

  /* ------------------------------------------------------------------ *
   *  Type (§11) — IBM Plex Sans + IBM Plex Mono, self-hosted            *
   * ------------------------------------------------------------------ */
  --ts-font-sans: "IBM Plex Sans", -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --ts-font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo,
    Consolas, monospace;

  --ts-text-xs: 0.75rem;      /* micro-labels, chips */
  --ts-text-sm: 0.8125rem;    /* dense table text */
  --ts-text-md: 0.875rem;     /* small body */
  --ts-text-base: 0.9375rem;  /* standard body */
  --ts-text-lg: 1rem;         /* comfortable body / emphasized */
  --ts-text-xl: 1.125rem;     /* section titles */
  --ts-text-2xl: 1.375rem;    /* page titles */
  --ts-text-3xl: 1.75rem;     /* public display moments */

  --ts-tracking-label: 0.08em;

  /* ------------------------------------------------------------------ *
   *  Radii & elevation (§13): borders first; shadows only for true      *
   *  elevation.                                                         *
   * ------------------------------------------------------------------ */
  --ts-radius: 0.5rem;        /* panels */
  --ts-radius-sm: 0.375rem;   /* controls, chips */
  --ts-radius-pill: 999px;    /* status chips, progress */
  --ts-shadow-sm: 0 1px 2px rgba(24, 24, 24, 0.05);
  --ts-shadow-raised: 0 4px 12px rgba(24, 24, 24, 0.1),
    0 2px 4px rgba(24, 24, 24, 0.06);
  --ts-shadow-overlay: 0 12px 32px rgba(24, 24, 24, 0.18),
    0 4px 8px rgba(24, 24, 24, 0.08);

  /* ------------------------------------------------------------------ *
   *  Density (§3.12/§10) — defaults are the "standard" shell            *
   *  (organizer/exhibitor). Shell classes override in ts-shells.css.    *
   * ------------------------------------------------------------------ */
  --ts-density-body: var(--ts-text-base);
  --ts-density-control-font: var(--ts-text-base);
  --ts-density-control-pad-y: 0.4375rem;
  --ts-density-control-pad-x: 0.75rem;
  --ts-density-table-font: var(--ts-text-md);
  --ts-density-table-pad-y: 0.5rem;
  --ts-density-table-pad-x: 0.625rem;
  --ts-density-section-gap: 2rem;

  /* ------------------------------------------------------------------ *
   *  Event-theme variable defaults (§12.5): the per-event injection      *
   *  re-points these on themed public pages; unthemed they resolve to    *
   *  the platform values, so any rule reading them is themable for free. *
   * ------------------------------------------------------------------ */
  --ts-theme-primary: var(--ts-accent);
  --ts-theme-heading: var(--ts-ink);
  --ts-theme-accent: var(--ts-ink-muted);

  /* ------------------------------------------------------------------ *
   *  Legacy aliases — pre-refresh token names in app.css-era CSS and    *
   *  the theme injection. NEVER remove; alias forward (§12.1).          *
   * ------------------------------------------------------------------ */
  --ts-brand: var(--ts-accent);
  --ts-brand-soft: var(--ts-accent-soft);
  --ts-muted-soft: var(--ts-neutral-status-soft);
}
