/* ==========================================================================
   Frazil design tokens - Phase A foundation
   ==========================================================================

   THIS FILE DECLARES CUSTOM PROPERTIES AND NOTHING ELSE.

   There is not one selector here that paints anything. Every rule below is
   `:root { --name: value }`, so linking this stylesheet cannot change a
   single rendered pixel. That is deliberate: Phase A ships the whole brand
   foundation into production, verified and reviewable, while the running
   application still looks exactly as it did. Phase B then activates it by
   replacing hard-coded values in main.css with `var(--token)` references,
   one component at a time, with screenshots per step.

   Governing authority: data/Brand Book.pdf (51pp), by way of
   planning/frazil-visual-system-audit.md. Where a brand value cannot meet
   an accessibility requirement, the OFFICIAL value is still recorded here
   verbatim and an ACCESSIBLE SEMANTIC ALTERNATIVE is defined beside it.
   The brand value is never silently altered - see "official vs semantic"
   below.

   ---------------------------------------------------------------------
   OFFICIAL VS SEMANTIC - the one rule that keeps this honest
   ---------------------------------------------------------------------
   `--frazil-*` tokens are the Brand Book's own values, transcribed exactly.
   They are the record of what the brand IS.

   Every other token is a SEMANTIC token: it says what a value is FOR, and
   it is the only kind of token application CSS may reference. A semantic
   token usually points at a `--frazil-*` value; where contrast made that
   impossible, it points at a documented adaptation instead, and the
   comment says why.

   Never reference a `--frazil-*` token directly from a component. Never
   write a raw hex value outside this file.

   All contrast ratios in the comments below are MEASURED with the WCAG 2.1
   relative-luminance formula, not estimated.
   ========================================================================== */

:root {
  /* ======================================================================
     1. OFFICIAL BRAND PALETTE - Brand Book pp16-18, transcribed verbatim
     ====================================================================== */

  /* Primary (p16) */
  --frazil-dark-blue: #1d4484;
  --frazil-white: #ffffff;
  --frazil-light-blue: #97c9e9;

  /* Secondary (p17) */
  --frazil-coral-light: #f1868d;
  --frazil-coral: #ef6d72;
  --frazil-peach-light: #f8c78e;
  --frazil-peach: #f9a371;
  --frazil-lavender: #b0a1ce;
  --frazil-yellow-pale: #faf6ae;
  --frazil-yellow: #fae100;
  --frazil-green: #aad078;
  --frazil-blue-pale: #c8e5f6;

  /* Flavour colours (p18).
     NOTE: the Brand Book prints a hex for "Rock 'n' Roll" (#FB8713) and for
     "Bermuda Triangle" (#F6871F) that contradicts the CMYK/RGB printed on
     the same swatch; the two appear transposed. The RGB-derived values are
     used here and the discrepancy is logged as an open brand-owner item in
     docs/design/frazil-design-system.md. */
  --frazil-lemon-ice: #faffcc;
  --frazil-cherry-limeade: #e3203c;
  --frazil-simply-mango: #fcb01a;
  --frazil-green-apple: #29c21e;
  --frazil-blue-razzmatazz: #006de9;
  --frazil-georgia-peach: #fb6a13;
  --frazil-tigers-blood: #e31f17;
  --frazil-rock-n-roll: #533393;
  --frazil-pog: #ed5845;
  --frazil-bermuda-triangle: #fb8713;

  /* ======================================================================
     2. BRAND PRIMARY - interaction ramp
     Derived from #1D4484 by mixing toward black/white so the whole ramp
     stays on-brand rather than drifting to an unrelated blue.
     ====================================================================== */

  --brand-primary: #1d4484;          /* anchor. 9.49:1 on white (AAA)      */
  --brand-primary-hover: #1a3c74;    /* 12% -> black. white on it 10.81:1  */
  --brand-primary-active: #173567;   /* 22% -> black. white on it 12.06:1  */
  --brand-primary-muted: #46669a;    /* 18% -> white. white on it  5.79:1  */
  --brand-primary-subtle: #edf0f5;   /* tinted surface. primary on it 8.7:1 */
  --brand-primary-surface: #f6f8fa;  /* page background                     */

  /* ======================================================================
     3. BRAND LIGHT BLUE - SURFACES ONLY
     #97C9E9 measures 1.77:1 against white in BOTH directions. It can never
     be a text colour, and white text can never sit on it. Every token here
     is a background, always paired with --text-primary or --brand-primary.
     The brand colour is unchanged; only the failing PAIRING is excluded.
     ====================================================================== */

  --brand-light: #97c9e9;            /* primary on it: 5.36:1 (AA)          */
  --brand-light-subtle: #d0e7f5;     /* primary on it: 7.43:1 (AAA)         */
  --brand-light-surface: #e8f3fa;    /* primary on it: 8.42:1 (AAA)         */

  /* ======================================================================
     4. NEUTRAL SURFACES
     ====================================================================== */

  --surface-page: #f6f8fa;
  --surface-default: #ffffff;        /* cards, tables, report bodies        */
  --surface-elevated: #ffffff;       /* modals/popovers - pair with shadow  */
  --surface-sunken: #edf0f5;         /* wells, code blocks                  */
  --surface-inverse: #1d4484;        /* navigation, mastheads               */

  /* ======================================================================
     5. TEXT
     Blue-tinted neutrals rather than grey, so body copy sits in the same
     colour family as the brand without tinting the page.
     ====================================================================== */

  --text-primary: #0f1b2e;           /* 17.26:1 on white (AAA)              */
  --text-secondary: #163363;         /* 12.44:1 on white (AAA)              */
  --text-muted: #546279;             /*  6.18:1 on white (AA)               */
  --text-inverse: #ffffff;           /*  9.49:1 on --brand-primary (AAA)    */
  --text-on-light-blue: #1d4484;     /*  5.36:1 on --brand-light (AA)       */
  /* Clears 3:1 against BOTH white and --disabled-surface. The earlier
     #7e90ac managed only 2.84:1 on the disabled fill - WCAG exempts
     inactive controls from 1.4.3, but an unreadable disabled label is
     still a usability problem, so it is held to the non-text bar. */
  --text-disabled: #718097;          /*  4.01:1 white / 3.51:1 on fill      */

  /* ACCESSIBILITY ADAPTATION. main.css currently ships
     --color-text-subtle: #98A2B3, which measures 2.58:1 on white and fails
     WCAG 1.4.3 today, before any brand work. --text-muted above is its
     accessible replacement. Phase B retires the old token. */

  /* ======================================================================
     6. BORDERS
     Two tiers, because they do different jobs. A decorative rule may be
     faint; a border that IS the control (an input outline) is a non-text
     UI component and must reach 3:1 under WCAG 1.4.11.
     ====================================================================== */

  --border-default: #d6deea;         /* 1.36:1 - decorative separators only */
  --border-strong: #7e90ac;          /* 3.24:1 - input borders, real edges  */
  --border-inverse: #46669a;         /* dividers on dark-blue chrome        */

  /* ACCESSIBILITY ADAPTATION. main.css currently ships
     --color-border: #E5E9F2 (1.22:1) as an input border. That cannot meet
     1.4.11, so --border-strong exists for controls while --border-default
     keeps the light look for purely decorative rules. */

  /* ======================================================================
     7. FOCUS - two-tone, and it has to be
     No single colour clears 3:1 against BOTH white and the dark-blue
     sidebar: #97C9E9 is 5.36:1 on primary but 1.77:1 on white, while a mid
     blue is 5.42:1 on white but 1.75:1 on primary. So the ring is an inner
     colour plus a contrasting outer halo, which stays visible on white,
     light-blue, dark-blue and the page background alike.
     ====================================================================== */

  --focus-ring: #006de9;             /* 4.81:1 on white                     */
  --focus-ring-inverse: #97c9e9;     /* 5.36:1 on --brand-primary           */
  --focus-ring-halo: #ffffff;        /* outer separation on dark chrome     */
  --focus-ring-width: 3px;
  --focus-ring-offset: 2px;

  /* ======================================================================
     8. STATUS
     Brand Book secondary colours all fail as TEXT on white (1.11:1-2.96:1),
     so each status is a SURFACE carrying --brand-primary text, plus a
     separate text/icon colour where a stronger signal is needed.
     Colour is never the only indicator: every status also carries a label
     and an icon glyph (see the component spec in the audit).
     ====================================================================== */

  --status-success-surface: #aad078; /* primary on it: 5.43:1 (AA)          */
  --status-success-text: #1b7e14;    /* 5.20:1 on white (AA)                */
  --status-warning-surface: #f8c78e; /* primary on it: 6.13:1 (AA)          */
  --status-warning-text: #8a5a00;    /* 4.9:1 on white                      */
  --status-pending-surface: #faf6ae; /* primary on it: 8.52:1 (AAA)         */
  --status-info-surface: #c8e5f6;    /* primary on it: 7.23:1 (AAA)         */
  --status-neutral-surface: #edf0f5;
  --status-neutral-text: #546279;

  /* ACCESSIBILITY ADAPTATIONS.
     #F1868D measures 3.86:1 and #B0A1CE 3.99:1 against --brand-primary:
     fine for bold >=16px text (large-text threshold is 3:1) but NOT for
     body copy. They are therefore badge/chip surfaces only, and a separate
     accessible danger pair exists for error text and destructive fills. */
  --status-danger-surface: #f1868d;  /* 3.86:1 - badges w/ bold text only   */
  --status-danger-surface-safe: #fdecec; /* danger-text on it: 5.9:1        */
  --status-danger-text: #b3261e;     /* 6.4:1 on white                      */
  --status-danger-strong: #e3203c;   /* Cherry Limeade. white on it 4.63:1  */
  --status-lavender-surface: #b0a1ce; /* 3.99:1 - badges w/ bold text only  */

  /* ======================================================================
     8b. LINKS
     Links in body copy also carry an underline - colour is never the only
     affordance distinguishing a link from surrounding text.
     ====================================================================== */

  --link-default: #1d4484;           /*  9.49:1 on white (AAA)              */
  --link-hover: #173567;             /* 12.06:1 on white (AAA)              */
  --link-visited: #533393;           /*  9.28:1 on white (AAA)              */

  /* ======================================================================
     9. CHART SERIES - permanent assignments
     A series keeps the same colour on every page, for ever. Today the same
     conceptual series is #2563eb on Headcount and #4f46e5 on Weekly
     Summary; these tokens are what ends that.

     Five flavour colours were DARKENED because they fail the 3:1 non-text
     threshold at book value (Green Apple 2.38, Simply Mango 1.85, Georgia
     Peach 2.93, Bermuda Triangle 2.45, P.O.G 3.45). The originals remain
     above as --frazil-* for brand surfaces; only chart marks use these.

     Colour is never the sole differentiator: series must also differ by
     dash pattern and point shape, so the charts survive greyscale printing
     and colour-vision deficiency.

     There is deliberately NO Owen series - that downline has no historical
     15Five reporting segment. metric_reporting_segments holds exactly four
     executive rows.
     ====================================================================== */

  /* PHASE C CORRECTION. The Phase A values were chosen for contrast alone
     and were never validated for colour-vision separation. Running the
     six-check validator over them found two hard failures:

       Sam #23A51A  <-> Adam #BD8414        deltaE 3.5 (deuteranopia)
       Reid #533393 <-> Companywide #1D4484 deltaE 2.6 (deutan), 8.7 NORMAL

     The second is the serious one: a worst normal-vision pair below 15 means
     full-colour readers cannot reliably tell them apart either, and secondary
     encoding does not excuse it. Companywide and the selected executive
     appear on the same axes in every scoped report, so that pair is on
     screen constantly.

     The steps below keep each series' Brand Book FLAVOUR HUE and move only
     its lightness - the same kind of chart-only derivative Phase A already
     documented for Green Apple and Simply Mango. The official --frazil-*
     values above are untouched. Measured all-pairs after the change:
     CVD deltaE 10.3 (target >= 8), normal-vision deltaE 15.1 (gate >= 15),
     every mark >= 3:1 on white.

     --chart-companywide remains #1D4484 exactly. It sits below the
     validator's light-mode lightness band (L 0.396 vs 0.43) and that is an
     accepted, documented deviation: it is the Brand Book primary and the
     report's structural anchor, it clears contrast at 9.49:1, and it passes
     every separation check. The brand value wins where accessibility is not
     the thing at stake. */
  /* CORRECTION 2 - COMPANYWIDE vs EXECUTIVE SEPARATION.

     Phase C validated this palette ALL-PAIRS. That was the wrong gate for
     this chart. Only ONE pair is ever drawn: companywide against the single
     selected executive (weekly-executive-report.js is the sole consumer of
     --chart-exec-*, and it plots one downline at a time). Measured on the
     Phase C values, that pair was the WEAKEST in the set:

       Sam  #176B10 <-> Companywide #1D4484   deltaE 6.9 (tritanopia)
       Reid #775EAA <-> Companywide #1D4484   deltaE 16.3 (normal vision)

     6.9 is below the validator's CVD target of 8, on the one pair that is
     on screen for every scoped report - while pairs that never render
     together scored 10.3. The steps below re-solve for the pair that is
     actually drawn. Each series keeps its Brand Book FLAVOUR HUE and moves
     only lightness/saturation, exactly as the Phase C derivation did; the
     official --frazil-* values above are untouched.

       companywide <-> exec   CVD  6.9 -> 12.9    normal  16.3 -> 20.0
       all-pairs              CVD 10.3 ->  8.2    normal  15.1 -> 15.2

     All-pairs CVD gives up 2.1 and stays above the target of 8. That is the
     deliberate trade: a pair no page renders pays so the pair every scoped
     report renders clears the gate.

     --chart-companywide remains #1D4484 exactly, and its documented
     lightness-band deviation (L 0.396 vs 0.43) stands for the same reason
     as before: it is the Brand Book primary and the report's structural
     anchor, and it passes every separation and contrast check. */
  /* UX Refresh req 6: each executive's line is coloured to its fruit marker.
     The marker PNGs live in static/img/markers/ and the mapping is
     Companywide=Frazil logo (Frazil blue since the Improvements Build),
     Lemmon=lemon, Adam=green apple,
     Reid=blue raspberry, Sam=mango - see static/js/chart-theme.js.

     Three of the five are the image's dominant colour EXACTLY: strawberry,
     blue raspberry and mango.

     Two are adjusted, and the reasons are worth keeping:
       * LEMON  #d8c030 measures 1.83:1 on white. Darkened to #a88c10. A
         line nobody can see is not a match to anything.
       * APPLE  #90a830 measures 2.68:1, and is the most-adjusted of the
         five because it has to satisfy three constraints at once - 3:1 on
         white, 3:1 on the report's own #fcfcfb surface, AND at least 10
         Delta-E from STRAWBERRY under colour-vision deficiency, which
         matters because Companywide is now red and Adam's line sits beside
         it. Darkening alone made the CVD separation WORSE (yellow-green
         converges with red under tritanopia), so #749450 is a greener,
         less yellow apple. It is recognisably the fruit and it is the
         honest limit of "as closely as practical".

     Every value below is executed against --surface-default by
     tests/test_design_tokens.py, and the CVD separations by
     tests/test_weekly_executive_report_corrections.py. */
  /* Webapp Improvements Build: the Companywide series is Frazil blue again -
     exactly --frazil-dark-blue / --brand-primary (#1d4484), the Brand Book
     primary of the Frazil logo, its marker. Only this series changed; the
     executives' fruit colours below are untouched. */
  --chart-companywide: #1d4484;      /* Frazil blue.    exact.  9.49:1      */
  --chart-exec-lemmon: #a88c10;      /* Lemon.          dark.   3.27:1      */
  --chart-exec-reid: #0060a8;        /* Blue raspberry. exact.  6.48:1      */
  --chart-exec-sam: #c07818;         /* Mango.          exact.  3.53:1      */
  --chart-exec-adam: #749450;        /* Green apple.  adjusted. 3.45:1      */
  /* NOMINAL CATEGORICAL RAMP - for breakdowns with no permanent identity
     (employee type, department, location). Assigned in fixed slot order
     1..N and never cycled; a breakdown with more categories than slots
     folds the tail into "Other" rather than generating a hue.

     Distinct from the named series above: those follow an entity and must
     never change, these follow a slot. Validated all-adjacent-pairs:
     CVD deltaE 19.6, normal-vision deltaE 21.9, every slot >= 3:1 on white.
     The order alternates cool and warm, which is what produces that
     separation - re-ordering these would undo it.

     It replaces a seven-colour array in headcount.js that was assigned by
     position and failed three of the six checks, including a normal-vision
     pair at 14.4 (#dc2626 next to #d97706). */
  --chart-cat-1: #1d4484;
  --chart-cat-2: #b07b12;
  --chart-cat-3: #368cee;
  --chart-cat-4: #176b10;
  --chart-cat-5: #775eaa;
  --chart-cat-6: #b3261e;

  /* OUTCOME RAMP - one positive colour and a SEQUENTIAL orange family for
     the ways an outcome can go wrong. Used by the retention breakdowns on
     the Executive Recruiting Summary, where "still here" is one slice and
     every termination category is a shade of one hue.

     WHY SEQUENTIAL AND NOT THE CATEGORICAL RAMP ABOVE. The categorical
     ramp alternates cool and warm precisely to separate unrelated things.
     Termination categories are not unrelated - they are all the same
     outcome - and giving them six unrelated hues would read as six
     unconnected facts rather than one population broken down. This was
     approved explicitly: one orange family, progressively darker, no red.

     NO RED, and that is why --chart-cat-6 (#b3261e) is not borrowed here.

     MEASURED, NOT PICKED. OKLab deltaE x100, all pairs:
       retained vs every orange   21.0 min  (teal is never confusable)
       adjacent orange pairs      14.1 - 16.1
       worst pair, deuteranopia   10.7      (#FFE3B3 / #F5A93C)
       worst pair, protanopia     11.7      (same pair)
     The CVD figures clear the >= 8 target comfortably. The tightest
     normal-vision pair sits just under the 15 floor that applies to a
     CATEGORICAL palette, which is inherent to five steps of one hue - the
     hue does not contain five mutually distant lightnesses. That is why
     the slices carry a hatch pattern AND a legend naming every one with
     its count and share: identity never rests on the colour alone. (The
     hatch was removed from the retention donuts by the Consolidated
     Product Correction - see --chart-outcome-retained below.)

     Tail beyond five folds into "Other" rather than generating a shade,
     the same rule the categorical ramp states above. */
  /* CONSOLIDATED PRODUCT CORRECTION. The positive population - retained,
     reached, hired - is the approved Green Apple brand green, and the
     retention donuts carry no texture. Re-measured with the termination
     categories in their FIXED order (green, Resigned <1 Month 5, Let Go 2,
     Left Voluntarily (Non-Regrettable) 4, Left Voluntarily (Regrettable) 3,
     Uncategorised 1, wrapping back to green - the canonical labels adopted
     in the final product decision, each on its predecessor's shade): every adjacent pair clears
     CVD deltaE 15.0 and the normal-vision floor of 15. Green against a
     mid orange collapses under deuteranopia/protanopia when a category is
     empty and two non-neighbours meet, which is why every donut also has
     2px surface gaps, a legend naming each slice with its count and share,
     and a drill-down titled by category. Fill only - the green is 2.3:1
     against white and is never used for text. */
  --chart-outcome-retained: var(--frazil-green-apple);
  --chart-outcome-1: #ffe3b3;
  --chart-outcome-2: #f5a93c;
  --chart-outcome-3: #d4740c;
  --chart-outcome-4: #9a4a05;
  --chart-outcome-5: #5a2b02;

  /* CORRECTION 3 - ONE SEMANTIC TARGET TOKEN, AND IT IS ORANGE.
     Every target on every chart resolves through this one property: the
     eight-week 100% line and the three per-milestone retention markers all
     read FrazilChart.series("target"). Changing this value changes all of
     them, and there is no second place to change.

     It was grey (#546279), which is also --chart-axis: a target drawn in
     the axis colour reads as chart furniture rather than as the goal.
     Georgia Peach, stepped down for contrast (book value is 2.93:1).

     Measured against the series it is drawn beside:
       companywide 22.4 | lemmon 31.0 | reid 20.0 | adam 9.3 | sam 5.9 (CVD)
     Sam and Adam are the warm/green pairs, and no orange can separate from
     both under protanopia - orange, gold and green collapse onto one axis
     there. That is a hue-space fact, not a search failure, and it is why
     the target carries FOUR non-colour encodings instead: a unique dash
     [6,4], pointRadius 0 when every series has markers, a constant flat
     value, and its own legend entry naming the figure. A flat dashed line
     with no points is not mistakable for a data series at any colour. For
     full-colour readers - the common case - it is 24.0 from Sam. */
  --chart-target: #be500e;           /* Georgia Peach step.   4.71:1        */
  --chart-prior-period: #8a9bb5;
  --chart-current-period: #1d4484;
  --chart-positive: #1b7e14;         /* 5.20:1                              */
  --chart-negative: #b3261e;         /* 6.4:1                               */
  --chart-muted: #d6deea;            /* unavailable / not applicable        */
  --chart-grid: #d6deea;
  --chart-axis: #546279;

  /* ======================================================================
     10. TYPOGRAPHY
     Family is staged but NOT applied anywhere in Phase A. Phase B sets
     `font-family: var(--font-brand)` on body, which is the single line
     that switches the application to Barlow.
     ====================================================================== */

  --font-fallback: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-brand: "Barlow", var(--font-fallback);
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Weights - Brand Book p20 hierarchy */
  --font-weight-body: 500;           /* Barlow Medium: body copy            */
  --font-weight-label: 600;          /* SemiBold: labels, table headers     */
  --font-weight-subhead: 700;        /* Bold: subheads                      */
  --font-weight-subhead-strong: 800; /* ExtraBold: impactful subheads       */
  --font-weight-headline: 900;       /* Black: headlines                    */

  /* Role tokens: size / line-height / weight / tracking.
     Uppercase is a PROPERTY OF THE ROLE, not a global style - see the
     uppercase policy note at the end of this file. */
  --type-display-size: 2rem;         /* 32px */
  --type-display-line: 1.15;
  --type-display-weight: 900;
  --type-display-tracking: 0.01em;

  --type-page-title-size: 1.625rem;  /* 26px */
  --type-page-title-line: 1.2;
  --type-page-title-weight: 900;
  --type-page-title-tracking: 0.01em;

  --type-section-size: 1.25rem;      /* 20px */
  --type-section-line: 1.25;
  --type-section-weight: 800;

  --type-card-title-size: 1rem;      /* 16px */
  --type-card-title-line: 1.3;
  --type-card-title-weight: 700;

  --type-subhead-size: 0.9375rem;    /* 15px */
  --type-subhead-line: 1.35;
  --type-subhead-weight: 700;

  --type-body-size: 0.9375rem;       /* 15px */
  --type-body-line: 1.55;
  --type-body-weight: 500;

  --type-body-sm-size: 0.84375rem;   /* 13.5px */
  --type-body-sm-line: 1.5;
  --type-body-sm-weight: 500;

  --type-label-size: 0.8125rem;      /* 13px */
  --type-label-line: 1.3;
  --type-label-weight: 600;

  --type-table-header-size: 0.75rem; /* 12px - matches current rendering    */
  --type-table-header-line: 1.2;
  --type-table-header-weight: 600;
  --type-table-header-tracking: 0.03em;

  --type-table-body-size: 0.84375rem; /* 13.5px */
  --type-table-body-line: 1.45;
  --type-table-body-weight: 500;

  --type-metric-value-size: 1.875rem; /* 30px */
  --type-metric-value-line: 1.1;
  --type-metric-value-weight: 900;

  --type-metric-label-size: 0.75rem;  /* 12px */
  --type-metric-label-line: 1.3;
  --type-metric-label-weight: 600;
  --type-metric-label-tracking: 0.04em;

  --type-helper-size: 0.78125rem;    /* 12.5px */
  --type-helper-line: 1.45;
  --type-helper-weight: 500;

  --type-callout-size: 0.9375rem;    /* 15px */
  --type-callout-line: 1.5;
  --type-callout-weight: 500;
  --type-callout-style: italic;      /* Barlow Medium Italic, p20           */

  --type-caption-size: 0.75rem;      /* 12px */
  --type-caption-line: 1.4;
  --type-caption-weight: 500;

  /* Mobile adaptations, applied by Phase B inside a breakpoint block */
  --type-display-size-sm: 1.625rem;      /* 26px */
  --type-page-title-size-sm: 1.375rem;   /* 22px */
  --type-metric-value-size-sm: 1.5rem;   /* 24px */

  /* ======================================================================
     11. SPACING - 4px base
     --space-4 (12px) and --space-5 (16px) are exactly today's table cell
     padding, so Phase B can adopt the scale without shifting density.
     ====================================================================== */

  --space-0: 0;
  --space-px: 1px;
  --space-1: 0.125rem;   /*  2px */
  --space-2: 0.25rem;    /*  4px */
  --space-3: 0.5rem;     /*  8px */
  --space-4: 0.75rem;    /* 12px - table cell padding (vertical)   */
  --space-5: 1rem;       /* 16px - table cell padding (horizontal) */
  --space-6: 1.25rem;    /* 20px */
  --space-7: 1.5rem;     /* 24px - card padding                    */
  --space-8: 2rem;       /* 32px - section gap                     */
  --space-9: 2.5rem;     /* 40px */
  --space-10: 3rem;      /* 48px - page section rhythm             */
  --space-11: 4rem;      /* 64px */
  --space-12: 5rem;      /* 80px */

  /* Semantic spacing */
  --space-control-x: var(--space-5);
  --space-control-y: var(--space-3);
  --space-table-cell-x: var(--space-5);
  --space-table-cell-y: var(--space-4);
  --space-card-padding: var(--space-7);
  --space-section-gap: var(--space-8);
  --space-page-gutter: var(--space-7);
  --space-page-gutter-sm: var(--space-5);

  /* Logo clear space. The approved master touches all four edges of its
     canvas (measured padding 0/0/0/0), and the Brand Book requires clear
     space, so every placement supplies its own. 25% of rendered height. */
  --logo-clear-space-ratio: 0.25;

  /* ======================================================================
     11b. APPLICATION SHELL
     The navigation is Frazil Dark Blue, so the sidebar's own text colours
     are measured against #1D4484 rather than the old near-black slate.
     The previous muted value (#8895AB) would be 3.13:1 on brand blue and
     fail body text, which is why these are new tokens rather than reused.
     ====================================================================== */

  --sidebar-width: 264px;

  /* ---- Build 1: the sidebar inverts -----------------------------------
     The approved Executive Summary and Directory renderings both show a
     LIGHT sidebar - pale blue, dark-blue text - over the strawberry-and-
     water artwork. The previous dark-blue panel with light text is the
     old visual system and is replaced, not restyled.

     Every value below is measured against the surface it actually sits
     on, which for the navigation block is --sidebar-surface (the scrim
     over the artwork), NOT the artwork itself. The scrim is opaque
     enough that the photograph never contributes to the text contrast -
     that is its job, and it is why these ratios hold at every scroll
     position and over every part of the image. */

  --sidebar-surface: #eaf3fb;        /* scrim over the artwork             */
  --sidebar-surface-strong: #ffffff; /* nav block, fully opaque            */
  --sidebar-text: #163363;           /* 11.09:1 on --sidebar-surface (AAA) */
  --sidebar-text-muted: #4c5f7d;     /*  5.77:1 on --sidebar-surface (AA)  */
  --sidebar-border: #d3e3f2;
  --sidebar-hover-bg: #dceaf7;       /* --sidebar-text on it: 9.47:1       */
  --sidebar-active-bg: #1d4484;      /* the deep Frazil blue, per spec     */
  --sidebar-active-text: #ffffff;    /* 9.49:1 on it (AAA)                 */
  --sidebar-active-marker: #006de9;  /* bright blue rail on the active row */
  --sidebar-icon: #46669a;           /* 5.16:1 on --sidebar-surface        */
  --sidebar-icon-active: #ffffff;

  /* The artwork. `--sidebar-art-height` is the share of the sidebar the
     photograph occupies, measured from the bottom. The asset is 627x2508
     - exactly 1:4 - so at a 264px sidebar it renders at its native
     proportion with no stretching at all. */
  --sidebar-art-height: 27%;
  --sidebar-art-fade: 22%;           /* seam fade at the top of the band  */

  /* ---- Build 1: the top bar -------------------------------------------
     New in this build. The previous shell had no desktop top bar at all;
     the account control lived at the foot of the sidebar. */

  --topbar-height: 68px;
  --topbar-surface: rgba(255, 255, 255, 0.82);
  --topbar-surface-opaque: #ffffff;  /* the no-backdrop-filter fallback    */
  --topbar-border: #dbe7f3;
  --topbar-blur: 14px;

  /* ---- Build 1: the content canvas ------------------------------------
     Pale icy blue, atmospheric rather than flat. The gradient is two
     barely-separated steps - enough to read as depth, not as a feature. */

  --canvas-bg: #e8f2fb;
  --canvas-bg-top: #f2f8fd;
  --canvas-bg-bottom: #dfedf9;
  --canvas-max-width: 1600px;

  /* ---- Build 1: frosted surfaces --------------------------------------
     Used ONLY where the spec approves translucency - sidebar nav, top
     bar, high-level cards, filter containers, tabs, KPI surfaces. Tables,
     forms, modals, drawers, menus and long text take --surface-default,
     which is opaque white.

     Each frosted token has an opaque twin. `@supports not
     (backdrop-filter: blur(1px))` swaps to the twin, so readability never
     depends on a filter the browser may not apply. */

  --surface-frosted: rgba(255, 255, 255, 0.76);
  --surface-frosted-strong: rgba(255, 255, 255, 0.9);
  --surface-frosted-opaque: #f7fbfe;
  --surface-frosted-border: rgba(255, 255, 255, 0.72);
  --frost-blur: 12px;

  /* ---- Build 1: control sizing ----------------------------------------
     One height for every control that sits in a row with another control,
     so a filter bar's input, select and button line up without a
     per-component nudge. 40px at the default font size clears the 24px
     WCAG 2.2 target minimum and the 44px recommendation once the row's
     own padding is counted. */

  --control-height: 40px;
  --control-height-sm: 32px;
  --control-height-lg: 48px;

  /* Default rendered logo height. Each placement overrides it, and the
     clear-space wrapper derives its padding from whatever it is set to. */
  --brand-logo-height: 38px;

  /* ======================================================================
     11c. OVERLAY AND DISABLED
     ====================================================================== */

  --overlay: rgba(15, 27, 46, 0.55);
  --disabled-surface: #edf0f5;

  /* ======================================================================
     11e. INTERACTION STATES AND INVERSE OVERLAYS
     Hover/active steps for the non-primary buttons, and the translucent
     whites used on dark-blue chrome. Defined here so no component file
     carries a literal colour.
     ====================================================================== */

  --status-danger-strong-hover: #c81a33;   /* white label 5.75:1 */
  --status-danger-strong-active: #ad162c;  /* white label 7.17:1 */
  --status-warning-surface-hover: #f5b76d; /* brand label 5.37:1 */

  --overlay-hover-inverse: rgba(255, 255, 255, 0.1);
  --border-inverse-subtle: rgba(255, 255, 255, 0.24);
  --focus-halo-inverse: rgba(29, 68, 132, 0.9);

  /* ======================================================================
     11d. GRADIENTS - backgrounds only
     Brand Book p27: gradients are for backgrounds, never for text, vectors,
     icons, logos, chart lines, borders or data marks. Approved directions
     are top-to-bottom and right-to-left (light to dark); never diagonal.

     Each ramp below was checked at 5% intervals for white-text contrast,
     because a gradient that passes at one end can fail at the other:

       masthead      #173567 -> #1D4484   worst white contrast 9.49:1
       masthead-rtl  #46669A -> #1D4484   worst white contrast 5.79:1
       auth          #1D4484 -> #46669A   worst white contrast 5.79:1

     REJECTED: #1D4484 -> #97C9E9 reaches 1.77:1 at the light end. It must
     never carry text. It is not defined here so it cannot be used by
     accident.
     ====================================================================== */

  --gradient-masthead: linear-gradient(180deg, #173567 0%, #1d4484 100%);
  --gradient-masthead-rtl: linear-gradient(270deg, #46669a 0%, #1d4484 100%);
  --gradient-auth: linear-gradient(180deg, #1d4484 0%, #46669a 100%);

  /* ======================================================================
     12. RADII - restrained. This is an HR system, not a consumer app.
     ====================================================================== */

  --radius-sm: 6px;      /* small controls, badges       */
  --radius-md: 10px;     /* buttons, inputs  (current)   */
  --radius-lg: 14px;     /* cards, tables    (current)   */
  --radius-xl: 18px;     /* large panels     (current)   */
  --radius-pill: 999px;  /* status pills                 */

  /* ======================================================================
     13. SHADOWS
     Recoloured from slate to brand blue so elevation reads as part of the
     palette. Deliberately restrained - no glassmorphism, no glow, no
     glossy or liquid treatment. The visual language is icy, not wet.
     ====================================================================== */

  --shadow-color-rgb: 29, 68, 132;   /* --brand-primary as rgb triplet */
  --shadow-control: 0 1px 2px rgba(29, 68, 132, 0.06);
  --shadow-card: 0 2px 8px rgba(29, 68, 132, 0.08), 0 1px 2px rgba(29, 68, 132, 0.04);
  --shadow-menu: 0 6px 16px rgba(29, 68, 132, 0.12);
  --shadow-elevated: 0 12px 28px rgba(29, 68, 132, 0.16);
  --shadow-modal: 0 20px 48px rgba(15, 27, 46, 0.24);
  --shadow-focus: 0 0 0 var(--focus-ring-offset) var(--focus-ring-halo);

  /* ======================================================================
     14. MOTION
     Phase B wraps every transition in a prefers-reduced-motion guard; the
     override at the end of this file makes these tokens inert for users
     who ask for less motion, whatever consumes them.
     ====================================================================== */

  --motion-fast: 120ms;
  --motion-base: 200ms;
  --motion-slow: 320ms;
  --motion-ease: cubic-bezier(0.2, 0, 0.2, 1);
  --motion-ease-out: cubic-bezier(0, 0, 0.2, 1);

  /* ======================================================================
     15. BREAKPOINTS
     Custom properties cannot be used in media queries, so these are
     REFERENCE VALUES: the numbers Phase B must write literally, kept here
     so there is one place that records them. 768 and 960 are today's.
     ====================================================================== */

  --bp-sm: 640px;
  --bp-md: 768px;    /* existing */
  --bp-lg: 960px;    /* existing */
  --bp-xl: 1280px;

  /* ======================================================================
     16. Z-INDEX
     ====================================================================== */

  --z-base: 0;
  --z-raised: 10;
  --z-sticky: 100;    /* sticky table headers    */
  --z-sidebar: 200;
  --z-backdrop: 300;
  --z-modal: 400;
  --z-toast: 500;

  /* ======================================================================
     17. PRINT
     Values only. The print STRATEGY lives in print.css, which is loaded
     with media="print" and currently declares tokens only.
     ====================================================================== */

  --print-ink: #000000;
  --print-muted: #333333;
  --print-rule: #999999;
  --print-brand: #1d4484;
  --print-surface: #ffffff;
  --print-body-size: 10.5pt;
  --print-heading-size: 16pt;
  --print-page-margin: 12mm;
}

/* ==========================================================================
   REDUCED MOTION
   Neutralises the motion tokens at the source. No component needs to know.
   This is the only non-`:root`-value rule in the file and it still paints
   nothing on its own - it only changes what the duration tokens evaluate to.
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  :root {
    --motion-fast: 0.01ms;
    --motion-base: 0.01ms;
    --motion-slow: 0.01ms;
  }
}

/* ==========================================================================
   UPPERCASE POLICY (enforced by review, recorded here so it travels with
   the tokens)

   `text-transform: uppercase` is permitted ONLY for:
     --type-display, --type-page-title, --type-table-header,
     --type-metric-label

   It is FORBIDDEN for employee names, table body content, form labels,
   validation messages, narrative report copy, and anything touching
   employee relations, investigations, compensation, accommodations,
   disciplinary matters or compliance. Brand Book p20 asks for uppercase
   on SHORT headlines; an HR record is not a headline.

   Where uppercase is used it must be applied with `text-transform` so the
   accessible name in the DOM stays correctly cased for screen readers.
   ========================================================================== */
