/* ============================================================================
   The Argentum Index — brand tokens.  THE ONLY PLACE COLOUR IS AUTHORED.

   Every page links this file. Do not re-declare these values in a page's own
   <style> — a local :root wins over this file and silently forks the palette,
   which is exactly the drift this file exists to end.

   Authored contract + rationale for each value: build/brand_spec.json
   Conformance scanner:                          python build/brand_audit.py
   Owner:                                        Brand & Design Agent

   Official Argentum brand (Brand Standards V5.07.19) — navy #162B53,
   gold #FFC62F, gray #404041. The surface palette below is the sanctioned
   dark-UI derivation of that navy; the gold is the brand gold exactly.

   TWO MODES. :root is dark — the default and the mode the product was designed
   in. :root[data-theme="light"] at the foot of this file overrides the same
   token names with a light derivation. Nothing else in the product may branch
   on theme: if a rule needs a different value in light, that value belongs in
   the light block under a token name, not in a page's [data-theme] selector.
   ========================================================================= */
@import url("brand-elements.css");   /* the Argentum "A" graphic element + the four states */

:root{
  /* ---- surfaces & ink (dark-UI derivation of Argentum Navy) ---- */
  --bg:#0a2949;        /* page ground — deeper than print navy so panels can step above it */
  --panel:#123459;     /* card / surface */
  --panel2:#1a4069;    /* hover, active, secondary surface */
  --line:#2d5480;      /* borders, dividers */
  --txt:#e8eef5;       /* body ink */
  --txt-strong:#ffffff;/* the selected nav item, the one line that must out-rank body ink */
  --muted:#9fb3cf;     /* labels, captions, secondary text */

  /* Elevation as a TINT, not a lightness. A dark UI raises a surface by adding
     light and recesses it by adding black; a light UI does the reverse. Naming
     them by intent is what lets the same rule serve both modes. */
  --lift:rgba(255,255,255,.05);   /* a surface a step above its parent */
  --sink:rgba(0,0,0,.22);         /* a well, a track, an inset — translucent, sits over its parent */
  /* Surface-elevation ladder (2026-10-24, James) — built on --sink so one definition is mode-aware in
     both themes. A card rests at e1 and lifts to e2 on hover; the single focal surface on a view (the
     "spotlight", via .spotlight in brand-elements.css) sits at e-spot. Reserve e-spot for ONE element. */
  --e1:0 1px 2px var(--sink), 0 4px 12px var(--sink);
  --e2:0 7px 20px var(--sink), 0 2px 6px var(--sink);
  --e-spot:0 14px 38px var(--sink), 0 3px 10px var(--sink);
  /* The two ends a token gets mixed toward, named by INTENT rather than by colour, because which
     literal is correct depends entirely on the mode:
       --contrast-up  push a colour AWAY from the page ground, i.e. make it more readable. On navy
                      that means toward white; on a light ground it means toward the ink. Written
                      as #ffffff everywhere before light mode existed, which silently meant "less
                      readable" the moment the ground went light.
       --shade        push a colour TOWARD the ground / deeper, for a well or a lower surface. */
  --contrast-up:#ffffff;
  --shade:#000000;                /* the SOLID end-stop to color-mix() toward for "deeper".
                                     Distinct from --sink because mixing an opaque colour with a
                                     translucent one yields a translucent result, which is not what
                                     a gradient stop or a solid panel wants. */
  --scrim:rgba(4,12,26,.62);      /* the modal backdrop — always dark, in both modes; a light scrim
                                     over a light page does not read as "behind a dialog" */

  /* PAPER. Print is neither mode — it is always ink on white, so these two do not appear in the
     light block below and must never be re-declared there. The print stylesheet used to spell this
     as var(--bg), which happened to be navy and so happened to work; in light mode --bg is nearly
     white and every printed page came out blank. A value that must not follow the mode needs a
     name that says so. */
  --paper:#ffffff;
  --ink-print:#162b53;            /* official Argentum Navy — the ink, on paper, in either mode */

  /* ---- the DATA-FILL palette (2026-07-24) ------------------------------------------------------
     A bar/line/area/map-state/dot is a FILL — it is read against its NEIGHBOURS, not the page, so
     it wants to be VIVID and DISTINCT, not text-legible. The categorical --green/--blue/... below
     are tuned for TEXT (dark on white for a label to hit 4.5:1); reusing them as fills is why light
     charts looked dark and muddy. These *-fill tokens are the vivid mid-tones for fills, and they
     are MODE-INDEPENDENT on purpose — a mid-saturation colour pops on both navy and white — so they
     are NOT re-declared in the light block. Rule: FILLS use *-fill; LABELS/TEXT use the plain hue.
     Route a chart series through the entity registry (brand_spec.platform.entity_colour) so
     "Senior Living", "SNF", "Restaurants" are the same colour everywhere. */
  --blue-fill:#2b8fe0;
  --green-fill:#2ba85e;
  --teal-fill:#12a5b4;
  --violet-fill:#7d68e0;
  --orange-fill:#ef8a2c;
  --plum-fill:#c14d92;            /* Operations module identity (2026-07-26); teal retired from module identity, still a data-ramp hue */
  --ramp-hi-orange:#c2540c;       /* deep end for Market's sequential ramp; pairs with --ramp-lo-orange (both modes). --orange-fill is a mid-tone, too light to anchor a ramp, so the ramp gets its own deep endpoint on the same hue line (h~24-31) to keep the mid bins clean, not muddy. */
  --red-fill:#e14b3c;
  --yellow-fill:#f0b81f;          /* status fills only, not a data scale */
  --grey-fill:#8895a8;            /* the "other / not-applicable" category fill */

  /* ---- the brand accent (official Argentum Gold, PMS 123C) ---- */
  --accent:#ffc62f;
  --gold:#ffc62f;      /* alias: the headline number / the member's own market */
  /* Gold as TEXT. On our navy the brand gold is 9:1 and needs no help; on a
     light ground it is 1.7:1 and cannot legally carry a word. --accent means
     "the gold" and stays brand-exact for fills, rules, dots and bars;
     --accent-ink means "gold, but it has to be readable" and is the only one
     of the two that may colour type. Never set type to --accent. */
  --accent-ink:#ffc62f;
  --accent-soft:#f0d68a;    /* gold as a paragraph, not a highlight — a softer gold for prose */
  --ink-on-accent:#0a1c33;  /* type sitting ON gold — dark in both modes */
  /* Type sitting ON any saturated data fill (a value badge on a green plate, a
     label inside a red bar). This one INVERTS: our data colours are light on
     dark and dark on light, so the ink on top has to go the other way. */
  --ink-on-fill:#08182c;

  /* ---- chart & data colour map — the official secondaries, lifted for
          legibility on a dark field. Route colour through these by MEANING
          (see UX & Design Standards §8), never by picking a hex. ---- */
  --green:#43ae74;     /* good / growth / money        (print: #275D38) */
  --orange:#e8924a;    /* watch / pressure / a gap     (print: #EA7600) */
  --red:#e87c73;       /* bad / risk / cost / loss     (print: #93272C) */
  --blue:#4aa3e0;      /* neutral / national reference (print: #004C97) */
  --violet:#8599d8;    /* composition / segments / identity */
  --yellow:#e8b730;    /* caution / awaiting */
  --teal:#3fb6c4;      /* secondary categorical */
  --grey:#8c9cb6;      /* inactive / not available */

  /* ---- the choropleth ramps ---- The maps interpolate from a LOW end to the
          hue above. The low end is not a lighter version of the hue — it is the
          hue barely present against the page ground, so it belongs to the mode,
          not to the palette. On navy the low end is dark; on a light ground it
          has to be a pale tint or every map reads as a solid block. Same for the
          "state reported nothing" fill, which must not look like a low value. */
  /* THE DATA-COLOUR SYSTEM (2026-07-24). Four families, and only these — see build/brand_spec.json
     platform.data_colour and assets/js/ramp.js. NO hand-rolled ramps, NO hue-shifting scales, NO
     gold as a data colour (gold is the brand accent only — bright on fills, navy where it must read
     as text; it cannot carry a data scale on white without turning brown).
       1 SEQUENTIAL  one hue, pale low -> saturated hue, for magnitude with no good/bad.  seq('blue')
       2 VALENCED    a sequential in green (more=good) or red (more=risk).                seq('green')
       3 DIVERGING   red <- pale mid -> green, for a real midpoint (above/below).         diverge(t)
       4 CATEGORICAL the fixed palette below, for unordered groups.
     Each sequential low is the hue "barely present" against the ground, so it belongs to the mode. */
  --nodata:#22406b;          /* "state reported nothing" — neutral, never reads as a low value */
  --ramp-lo:#26456e;         /* SEQUENTIAL low — BLUE, the neutral/default magnitude ramp */
  --ramp-lo-green:#123a2a;   /* valenced: more = good */
  --ramp-lo-red:#6b3935;     /* valenced: more = risk / cost */
  --ramp-lo-violet:#2d3449;  /* a second neutral sequential when blue is taken */
  --ramp-lo-teal:#04262a;    /* a third neutral sequential */
  --ramp-lo-orange:#38200c;  /* Market identity ramp (dark-mode low end) -> --ramp-hi-orange */
  --ramp-mid:#12273f;        /* DIVERGING neutral midpoint (the "zero"), near the ground */

  /* ---- shape & depth ---- */
  --shadow:0 4px 18px rgba(0,0,0,.4);
  --radius-card:12px; --radius-modal:14px; --radius-pop:10px;
  --radius-pill:20px; --radius-btn:8px;

  /* ---- type ---- Proxima Nova is the brand face but is a licensed webfont and
          these pages must run self-contained; the guide sanctions a substitute.
          Segoe UI is the standard (decided 2026-07-22) — see the Digital Brand Supplement §5. */
  --font:"Segoe UI",Roboto,Helvetica,Arial,sans-serif; /* Proxima Nova is deliberately
     NOT named here. Tried 2026-09-24 and measured: even on a machine that "has" it, Chromium
     rendered the serif fallback, because Proxima Nova arrives via Adobe Creative Cloud font
     activation and a browser cannot use it. Naming a face that never resolves looks like brand
     compliance while changing nothing. Rendering Proxima Nova on the web needs a licensed
     webfont host (an Adobe Fonts web project) -- see brand_spec divergence
     typeface-system-stack. */

  /* THE TYPE SCALE — eight steps, and only these.
     A heading LEVEL must always mean the same rank: h1 is the page, h2 a section,
     h3 a card or chart. If a heading needs to be a different size, it is a
     different level — do not re-size the tag. */
  --fs-display:26px;   /* the ONE hero number on a view — a single oversized headline metric */
  --fs-metric:23px;    /* the card KPI value — the metric on a tile, repeated many times a view.
                          Distinct from --fs-display (one hero) and from --fs-h1 (a heading, not a
                          number). Added 2026-07-24: the scale jumped 19→26 with nothing between, so
                          every card metric drifted to an ad-hoc 22 or 23. Same "the app was right,
                          the scale was short" correction as the micro-label band. */
  --fs-h1:19px;        /* page title */
  --fs-h2:15px;        /* section title */
  --fs-h3:14px;        /* card / chart title — 14px/600 is a hard rule */
  --fs-body:13px;      /* body copy, table cells */
  --fs-sm:12.5px;      /* secondary text, notes */
  --fs-label:11.5px;   /* uppercase KPI + column labels */
  --fs-micro:11px;     /* table headers, provenance, footnotes */
  /* The micro-label band. Added 2026-07-22 after the first scale sweep would have pushed 248 badge
     and footnote sizes UP to 11px — a visible inflation of every small label in the product. The
     app was right and the scale was short: status pills, provenance lines and dense table
     footnotes legitimately sit below 11px. Two steps, not six ad-hoc sizes. */
  --fs-badge:11px;     /* status pills, source tags — raised from 10px: 11px floor, Usability & Accessibility Standard (2026-09-16) */
  --fs-tiny:11px;      /* dense provenance, legend footnotes — raised from 8.5px, same standard; literal px sizes migrate per page */

  --fw-reg:400; --fw-med:500; --fw-semi:600; --fw-bold:700; --fw-heavy:800;
  --lh-tight:1.3; --lh-body:1.5; --lh-loose:1.65;

  --a-ink:#ffffff;     /* the "A" element — white on dark, per the guide */
  color-scheme:dark;   /* native scrollbars, form controls and autofill follow */
}

/* ============================================================================
   LIGHT MODE

   Not an inversion. Three things genuinely change meaning, and they are the
   whole job:

   1  ELEVATION FLIPS.  Dark raises a surface by making it lighter, so --panel
      is lighter than --bg. Light cannot do that — white is the ceiling. Here
      --bg is the tinted ground and --panel steps UP to plain white, with the
      shadow doing the work the lightness used to do.

   2  THE DATA COLOURS GO BACK TO PRINT.  The dark map lifted the official
      secondaries for legibility on navy; lifted colours are exactly the ones
      that wash out on white. So light mode returns to the print values from
      Brand Standards V5.07.19 — #275D38, #EA7600, #93272C, #004C97 — which is
      the more brand-true half of the pair, nudged only where a fill needed it.

   3  GOLD STOPS BEING TYPE.  See --accent-ink above.

   Type, spacing, radius and weight are mode-independent and are NOT repeated
   here — one scale, two palettes.
   ========================================================================= */
:root[data-theme="light"]{
  /* ---- surfaces & ink (light derivation of Argentum Navy) ---- */
  --bg:#eef2f8;        /* page ground — a cool navy-tinted grey, never pure white */
  --panel:#ffffff;     /* card / surface — the step up */
  --panel2:#e4ebf5;    /* hover, active, secondary surface */
  --line:#cfd9e8;      /* borders, dividers */
  --txt:#162b53;       /* body ink IS the official Argentum Navy — 12.4:1 on --bg (measured) */
  --txt-strong:#0a1c38;
  --muted:#526686;     /* the floor for a label, and it must clear it on EVERY surface a label can
                          land on, not just the page. Was #5a6f8f (4.55 on --bg but 4.26 on --panel2,
                          the hover/secondary plate — sub-AA). Deepened to clear 4.5 on --bg (5.2),
                          --panel (5.8) and --panel2 (4.9) alike. [Editor & Brand F3] */

  --lift:rgba(22,43,83,.035);
  --sink:rgba(22,43,83,.07);
  --contrast-up:#0a1c38;  /* away from THIS ground is toward the ink, not toward white */
  --shade:#b9c7dc;     /* "deeper" on a light ground is a deeper cool grey, never black */
  --scrim:rgba(4,12,26,.52);

  /* ---- the brand accent ---- gold is unchanged as a FILL; --accent-ink is the darkened gold that
          may carry type. #8a6512 cleared --bg (4.73) but not --panel2 (4.43, sub-AA) where gold
          number-badges sit; #846013 clears all three — --bg 5.1, --panel 5.7, --panel2 4.8.
          [Editor & Brand F3] */
  --accent:#ffc62f;
  /* --gold and --accent part company here, and only here. --accent is the brand gold as CHROME --
     a badge, a rule, an active border -- and it keeps its exact brand value. --gold is the DATA
     gold: 462 chart calls use it for "the member's own market", and at 1.57:1 a gold series on a
     white panel is a line nobody can see. As a FILL it only needs to read against its neighbours,
     not carry 4.5:1 text, so on the light ground it stays a brighter, truer gold rather than the
     brown a text-legible gold would force. Gold TEXT is handled by --accent-ink below, not here. */
  --gold:#e0a72b;
  /* GOLD THAT CARRIES TYPE, on white, is unavoidably brown (a legible dark yellow reads as olive).
     James's call (2026-07-24): keep BRIGHT gold for fills/accents (--accent, --gold), and where gold
     must be readable as TEXT / a thin line / a small mark, use brand NAVY instead. So on the light
     ground --accent-ink is navy, not a dark gold. In DARK it stays the brand gold (gold reads fine
     on navy). One token, the right ink for each ground. */
  --accent-ink:#162b53;
  --accent-soft:var(--accent-ink);   /* gold-toned prose → navy on white, per the rule above */
  --ink-on-accent:#0a1c33;
  --ink-on-fill:#ffffff;    /* inverts — the data fills below are dark on this ground */

  /* ---- chart & data colour map — the official secondaries at print value ---- */
  /* Every one of these clears 4.5:1 on --bg, measured, because on this ground the data colours
     are also the LABELS — the number under a bar is drawn in the bar's own colour. Print values
     that came in under the bar (orange, and the yellow that cannot stay yellow on white) are
     darkened only as far as it took to clear it. */
  --green:#276a41;     /* good / growth / money        (print #275D38, a touch lifted for fills) */
  --orange:#a34f00;    /* watch / pressure / a gap     (print #EA7600, darkened to carry text) */
  --red:#93272c;       /* bad / risk / cost / loss     (print exactly) */
  --blue:#004c97;      /* neutral / national reference (print exactly) */
  --violet:#4a55a8;    /* composition / segments / identity */
  --yellow:#8a6a00;    /* caution / awaiting — status only, never a data scale (yellow browns on white) */
  --teal:#0d6470;      /* secondary categorical */
  --grey:#5c6a7d;      /* inactive / not available */

  /* ---- the choropleth ramps — pale tints so the scale still climbs; --nodata is a NEUTRAL grey
          so "no data" never reads as a low value. See --ramp-* contract in the dark block above. */
  --nodata:#dde3ec;
  --ramp-lo:#e6eefa;
  --ramp-lo-green:#dfeee4;
  --ramp-lo-red:#f7e3e2;
  --ramp-lo-violet:#e6e8f7;
  --ramp-lo-teal:#dcedf0;
  --ramp-lo-orange:#fdd6ad;  /* Market identity ramp (light-mode low end) -> --ramp-hi-orange */
  --ramp-mid:#eef1f5;     /* diverging neutral midpoint — a pale near-paper grey (the "zero") */

  /* ---- depth ---- the shadow carries the elevation the lightness no longer can,
          and it is navy-tinted rather than black so it reads as our grey. */
  --shadow:0 1px 2px rgba(22,43,83,.07), 0 5px 16px rgba(22,43,83,.08);

  --a-ink:#162b53;     /* the "A" element — navy on light, per the guide */
  color-scheme:light;
}

/* module identity tag — the section name in its module colour. OUTLINED (readable --txt text on a light
   tint, colour carried by the border) so it never puts dark ink on a dark fill — violet/red fills fall
   in a dead zone where neither dark nor white ink clears 4.5:1. Works for every hue incl. gold, and the
   --mc fill is mode-independent so the identity colour is the same in light and dark. */
.modtag{display:inline-block;font-size:11px;font-weight:800;letter-spacing:.6px;text-transform:uppercase;
  padding:3px 11px;border-radius:6px;color:var(--ink-on-accent);
  background:var(--mc,var(--accent));margin:0 0 9px}

/* Launch: build/data-status flair retired. Decorative "LIVE" livedots and the runtime
   feed-status badges (JS flips these to LIVE / PENDING / SETUP) are hidden site-wide. The
   scripts still run untouched; data provenance (Sample / Measured pills, source citations)
   and in-table status columns (.pill.live) are unaffected. Delete this block to restore. */
.livedot, span.live[id]{display:none !important}

/* Module identity accent. Each module page sets data-mod on <body>; --mod resolves to that
   module's identity hue and the shared structural chrome wears it: section headers get a
   left bar, the "how to read this" strip and any .lead intro pick up a colour edge, and
   the page opens with a thin module rule. Data tiles, charts and maps keep their SEMANTIC
   colours (green=good, red=risk, etc.) — module colour lives on chrome, never on data.
   `body[data-mod] <sel>` out-specifies each page's own `<sel>{}`, so this holds even though
   brand.css loads before the page's <style>. Warm hues (market orange, ai/peer gold) show a
   touch deep on white, so the bar uses a same-hue chip-depth for reliable contrast. */
/* Per module: --mod = identity hue; --mod-solid / --mod-ink = a readable fill+ink pair for
   chrome that CARRIES TEXT (active buttons, tabs) — same warm=vivid+dark / cool=deep+white
   logic as the header pill, so text always clears contrast. --mod-edge = a deepened same-hue
   tone for thin bars and small text accents that must read on white. */
/* --mod-edge = the on-hue tone for thin bars, tab underlines and small text accents (.go).
   It must read on white: >=3:1 as a graphic line, >=4.5:1 as text. Light hues (green, orange,
   gold) have to go deeper than the cool ones to clear that — gold especially lands as a dark
   bronze, the unavoidable price of gold-as-line (fills still show true gold with dark ink). */
body[data-mod="workforce"],body[data-mod="core"]{--mod:var(--blue-fill);   --mod-solid:color-mix(in srgb, var(--blue-fill) 74%, #000);   --mod-ink:#fff;                  --mod-edge:color-mix(in srgb, var(--blue-fill) 76%, #000)}
body[data-mod="market"]                          {--mod:var(--orange-fill); --mod-solid:var(--orange-fill);                                --mod-ink:var(--ink-on-accent); --mod-edge:color-mix(in srgb, var(--orange-fill) 64%, #000)}
body[data-mod="capital"]                         {--mod:var(--green-fill);  --mod-solid:color-mix(in srgb, var(--green-fill) 74%, #000);  --mod-ink:#fff;                  --mod-edge:color-mix(in srgb, var(--green-fill) 66%, #000)}
body[data-mod="policy"],body[data-mod="career"]   {--mod:var(--violet-fill); --mod-solid:color-mix(in srgb, var(--violet-fill) 74%, #000); --mod-ink:#fff;                  --mod-edge:color-mix(in srgb, var(--violet-fill) 80%, #000)}
body[data-mod="operations"]                      {--mod:var(--plum-fill);   --mod-solid:color-mix(in srgb, var(--plum-fill) 88%, #000);   --mod-ink:#fff;                  --mod-edge:color-mix(in srgb, var(--plum-fill) 82%, #000)}
body[data-mod="wil"],body[data-mod="pulse"]      {--mod:var(--teal-fill);   --mod-solid:color-mix(in srgb, var(--teal-fill) 70%, #000);   --mod-ink:#fff;                  --mod-edge:color-mix(in srgb, var(--teal-fill) 62%, #000)}   /* Women in Leadership (2026-09-19): teal returns to module identity; brand_spec entity_colour.modules.wil */
body[data-mod="ai"],body[data-mod="peer"]        {--mod:var(--accent);      --mod-solid:var(--accent);                                    --mod-ink:var(--ink-on-accent); --mod-edge:color-mix(in srgb, var(--accent) 48%, #000)}

/* Structural chrome */
body[data-mod] h2.sec{border-left:4px solid var(--mod-edge); padding-left:12px}
body[data-mod] details.howto{border-left:3px solid var(--mod-edge)}
body[data-mod] .wrap>.lead:first-child{border-left:3px solid var(--mod-edge); padding-left:11px}

/* Bold module chrome: active nav + interactive accents + neutral tiles wear the module hue.
   Data-encoding surfaces (valenced tiles/maps, categorical & entity-coloured series) are NOT
   targeted here — they stay on the data-colour standards. Each rule out-specifies the page's
   own gold (--accent-ink) default. */
/* Active nav tabs — every module named its own tab class; !important because each page's
   `elem.tabclass.on{border-bottom-color:--accent-ink}` ties this rule's specificity and loads later. */
/* (Section-tab active state is handled by the FOLDER-TAB block near the end of this file —
   the active tab is filled in the module colour, not underlined.) */
/* Filled active controls (segmented buttons, active chips) — module fill + readable ink */
body[data-mod] .mbtn.on,
body[data-mod] .subtab.active,
body[data-mod] .vtab.active,
body[data-mod] .seg.on,
body[data-mod] .chip.on,
body[data-mod] .yrchip.on,
body[data-mod] .rg-pk.on,
body[data-mod] .seg-toggle button.active,
body[data-mod] .sig-toggle button.active,
body[data-mod] .viewseg button.on,
body[data-mod] .sig-stagenum{background:var(--mod-solid) !important; color:var(--mod-ink) !important; border-color:var(--mod-solid) !important}
/* Interactive accents. Staff beta C-KH-02 (2026-10-10): only cards that actually open something highlight on hover -
   a plain .card:hover made every card look clickable. */
body[data-mod] .card[role="link"]:hover,
body[data-mod] .card[role="button"]:hover,
body[data-mod] a.card:hover,
body[data-mod] .card.clickable:hover,
body[data-mod] .kpi.hoverable:hover,
body[data-mod] .ptr:hover,
body[data-mod] .mbtn:hover{border-color:var(--mod)}
body[data-mod] .go{color:var(--mod-edge)}
/* NOTE: tile border-top colours are intentionally NOT module-coloured. They are the semantic
   status channel (green=good, orange=watch, red=risk, blue=neutral, gold=headline). Market's
   hue is orange and Capital's is green, so a module-coloured neutral tile would masquerade as
   a "watch"/"good" signal. Tiles stay on the data-colour standard; module colour lives on the
   surrounding chrome (headers, nav, tabs, buttons). */

/* ============================================================================
   FOLDER / FILE TABS — all modules (2026-07-26). The horizontal section menu reads
   as one module-coloured family: the ACTIVE tab is the pure module colour
   (--mod-solid + readable --mod-ink); every other tab is a lighter GRADE of the same
   colour (a tint over the panel). Covers every section-tab variant and both the
   `.on` and `.active` naming conventions. Filled toggles (.seg/.mbtn/.subtab/.vtab
   /chips) are NOT here — they stay filled buttons. Delete this block for underline tabs.
   ========================================================================== */
/* NOTE: bare `.tab` is OVERLOADED — on some pages it is a tab BUTTON, on others a content
   PANE (display:none/block). We scope it to `.tabs .tab` (buttons live inside a .tabs strip;
   panes do not) so folder styling never hits a pane. Other tab classes are unambiguous. */
body[data-mod] .tabs, body[data-mod] .wtabs, body[data-mod] .ytabs, body[data-mod] .rtabs,
body[data-mod] .captabs, body[data-mod] .ptabs, body[data-mod] .ftabs{
  border-bottom:2px solid var(--mod-solid); gap:3px; align-items:flex-end}
/* inactive tabs — a graded tint of the module colour. !important so per-page tab CSS
   (e.g. `.wtab{background:none}`) can't win and leave the tab invisible until hover. */
body[data-mod] .tabs .tab, body[data-mod] .wtab, body[data-mod] .ytab, body[data-mod] .rtab,
body[data-mod] .captab, body[data-mod] .op-tab, body[data-mod] .ptab, body[data-mod] .ftab,
body[data-mod] .navhead{
  background:color-mix(in srgb, var(--mod) 40%, #eef0f4) !important;
  border:1px solid color-mix(in srgb, var(--mod) 55%, #cfd4dc) !important;
  border-bottom:none !important; border-radius:9px 9px 0 0 !important; margin:0 3px -2px 0 !important;
  padding:8px 15px 10px !important; color:var(--ink-on-accent) !important; font-weight:600}
body[data-mod] .tabs .tab:hover, body[data-mod] .wtab:hover, body[data-mod] .ytab:hover,
body[data-mod] .rtab:hover, body[data-mod] .captab:hover, body[data-mod] .op-tab:hover,
body[data-mod] .ptab:hover, body[data-mod] .ftab:hover, body[data-mod] .navhead:hover{
  background:color-mix(in srgb, var(--mod) 55%, #eef0f4) !important}
/* active tab — the pure module colour */
body[data-mod] .tabs .tab.on, body[data-mod] .wtab.on, body[data-mod] .ytab.on, body[data-mod] .rtab.on,
body[data-mod] .captab.on, body[data-mod] .op-tab.active, body[data-mod] .ptab.active,
body[data-mod] .ftab.active, body[data-mod] .navhead.active{
  background:var(--mod-solid) !important; color:var(--mod-ink) !important;
  border:1px solid var(--mod-solid) !important; border-bottom:none !important; font-weight:700}


/* ============================================================================
   UX-PREBETA-A11Y (2026-09-16) — Usability & Accessibility Standard, central rules.
   ONE visible keyboard focus ring for every interactive element (WCAG 2.4.7 / 2.4.11), and ONE
   reduced-motion switch (WCAG 2.3.3). Pages must not restyle these; see the standard.
   ============================================================================ */
:where(a, button, input, select, textarea, summary, [tabindex]:not([tabindex="-1"]), [role="button"], [role="tab"]):focus-visible{
  outline:2px solid var(--accent-ink, #ffc62f) !important; outline-offset:2px !important; border-radius:4px}
@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{animation-duration:.01ms !important; animation-iteration-count:1 !important;
    transition-duration:.01ms !important; scroll-behavior:auto !important}
}

/* Module overview head (James, 2026-10-12): the page leads with its real vital signs; the module's
   Climate Index is demoted to a quiet corner badge (index_tile.js data-compact="corner") in the
   upper right. On desktop the how-to sits left, the badge upper-right, the vital tiles full width
   below. On a phone the badge PINS BELOW the tiles so the numbers still come first. A page with no
   vital row in its head simply leaves the vitals area empty (it collapses). */
.ovhead{display:grid;gap:12px 16px;grid-template-columns:1fr minmax(260px,300px);
  grid-template-areas:"howto badge" "vitals vitals";align-items:start;margin-bottom:12px}
.ovhead>.howto{grid-area:howto;margin:0}
.ovhead>[data-compact="corner"]{grid-area:badge;align-self:start}
.ovhead>.ovhead-vitals{grid-area:vitals;margin:0}
@media(max-width:680px){
  .ovhead{grid-template-columns:1fr;grid-template-areas:"howto" "vitals" "badge"}
}
/* Variant for a page whose head has no leading vital row (e.g. Operations): how-to + corner badge only. */
.ovhead-2{display:grid;gap:12px 16px;grid-template-columns:1fr minmax(260px,300px);
  grid-template-areas:"howto badge";align-items:start;margin-bottom:12px}
.ovhead-2>.howto{grid-area:howto;margin:0}
.ovhead-2>[data-compact="corner"]{grid-area:badge;align-self:start}
@media(max-width:680px){.ovhead-2{grid-template-columns:1fr;grid-template-areas:"howto" "badge"}}

/* Phone layout, phase 2 of the responsive plan (James 2026-10-13, R1012-14): one site, no separate mobile
   version. Under 760px wide tables and charts stay inside their card (scroll sideways inside it, never the
   page), chart graphics scale to the card, toggle rows wrap, and tile popovers fit the screen. */
@media (max-width:760px){
  .tblwrap,.table-wrap,.tbl-wrap,.twrap{overflow-x:auto;-webkit-overflow-scrolling:touch;max-width:100%}
  .card table:not(.wl-keep){display:block;overflow-x:auto;max-width:100%}
  .card svg[viewBox]{max-width:100%;height:auto}
  .card canvas,.card img{max-width:100%;height:auto}
  .seg,.statetabs,.chips{flex-wrap:wrap}
  .card{padding-left:12px;padding-right:12px}
  .kpi-pop{left:0;right:0;max-width:calc(100vw - 32px)}
  /* side-by-side card pairs stack (157 pages use .grid2, often with inline column widths) */
  .grid2,.grid3{grid-template-columns:1fr !important}
  .grid2>*,.grid3>*{min-width:0}
}
