/**
 * ERPAL CRM Cockpit — DESIGN TOKENS.
 *
 * Single source of truth for every color/background/border/shadow in the
 * cockpit. Components must reference these custom properties only — no
 * hardcoded colors outside this file's :root / [data-theme] blocks.
 *
 * Theming model (Day / Night / Auto, driven by js/erpal-topbar.js):
 *   - <html data-theme="light">  → forced Day
 *   - <html data-theme="dark">   → forced Night
 *   - no data-theme attribute    → Auto (follows prefers-color-scheme)
 *
 * Legacy aliases (--erpal-ink/-ink-soft/-line/-brand…) are kept so existing
 * component CSS keeps working; new code should use the canonical names
 * (--erpal-text/-muted/-border/-accent…).
 */

:root {
  /* ---- layout metrics ---- */
  --erpal-sidebar-w: 248px;
  --erpal-topbar-h: 56px;
  --erpal-radius: 8px;

  /* ---- core palette (canonical names) ---- */
  --erpal-bg: #f5f6f8;            /* app canvas */
  --erpal-surface: #ffffff;       /* cards, bars, panels */
  --erpal-text: #1f2733;          /* primary ink */
  --erpal-muted: #5f6b7a;         /* secondary ink */
  --erpal-border: #e6e9ee;        /* hairlines */
  --erpal-accent: #1a73e8;        /* primary action blue */
  --erpal-accent-dark: #1559b8;   /* hover/active blue */
  --erpal-accent-soft: #e8f0fe;   /* selected/active tint */
  /* INK ON THE ACCENT GROUND, and on the accent ground ONLY (d-2026-09-04-021).
     Day: white on #1a73e8 = 4.51:1. Night redefines it — see the dark blocks.
     It used to double as the ink on the DANGER ground too, which is precisely
     what pinned it to white and blocked the Night fix for a whole release
     (app.css records the deadlock: "stays where it is because it is ALSO the
     ink on the DANGER ground"). Two grounds, two tokens; --erpal-on-danger is
     directly below. */
  --erpal-on-accent: #ffffff;     /* text on accent surfaces */
  --erpal-on-danger: #ffffff;     /* text on the danger ground (destructive buttons) */
  --erpal-success: #19b886;
  --erpal-warning: #e8a13a;
  --erpal-purple: #7a5cd0;
  /* 🔴 THE DANGER GROUND IS MEASURED AGAINST --erpal-on-danger, NOT PICKED.
     #d64550 carried white at 4.35:1 — under the 4.5 bar on every destructive
     button in Day, and invisible to the leaf-text contrast probe because a
     Drupal submit button keeps its label in @value and has no text node to
     walk (which is exactly how it survived three sweeps). #cc3b46 is the same
     red one step down: white on it measures 4.90:1, and as TEXT on the surface
     (.tidy-peek__error and friends) it improves from 4.35 to 4.90 as well.
     Night is untouched — #e2606a already carries the Night on-danger ink
     #0e1320 at 5.39:1. Ruling d-2026-09-04-027. */
  --erpal-danger: #cc3b46;
  --erpal-danger-dark: #b4333d;

  /* ---- legacy aliases (existing component CSS) ---- */
  --erpal-ink: var(--erpal-text);
  --erpal-ink-soft: var(--erpal-muted);
  --erpal-line: var(--erpal-border);
  --erpal-brand: var(--erpal-accent);
  --erpal-brand-dark: var(--erpal-accent-dark);
  --erpal-brand-soft: var(--erpal-accent-soft);

  /* ---- interactive surfaces ---- */
  --erpal-hover: #eef1f6;         /* pills, pagers, ghost buttons */
  --erpal-hover-soft: #f3f5f9;    /* sidebar links */
  --erpal-thead-bg: #fafbfe;      /* table header strip */
  --erpal-row-hover: #f3f7fe;     /* table row hover */
  --erpal-track: #eef2f9;         /* bar chart tracks, pills */
  --erpal-divider: #f1f3f6;       /* intra-card field dividers */
  --erpal-input-bg: #ffffff;      /* form controls */
  /* 🪤 --erpal-surface-2 EXISTED IN CONSUMERS BEFORE IT EXISTED HERE. Four
     stylesheets ask for it — the topbar's ⌘K chip, the relation rail's empty
     chip and three erpal_tms panels — always as `var(--erpal-surface-2,
     #lightliteral)`. It was never declared, so on any tenant WITHOUT erpal_tms
     (the LD hub) the literal WAS the value in every colour scheme, and Night's
     --erpal-muted ink landed on a stuck-light chip at 2.20:1. erpal_tms had
     already worked around the gap by declaring the token locally; those values
     are adopted verbatim here so nothing moves on a TMS tenant and the hub
     stops using the fallback. Measured after: 5.10:1 Day, 6.38:1 Night.
     (d-2026-09-02-055 re-audit, 2026-09-03.) */
  --erpal-surface-2: #f6f8fa;     /* recessed chip/panel inside a surface */

  /* ---- sidebar (LIGHT Zoho-style: white, dark text, blue active) ---- */
  --erpal-sidebar-bg: #ffffff;
  --erpal-sidebar-ink: #3c4858;
  /* ink-dim carries the rail's group headers (.68rem/700 uppercase — real
     text, so the bar is 4.5:1, not the 3:1 non-text floor). #97a1b0 on the
     white rail measured 2.61:1 (recorded by the 2026-09-01 mobile-nav audit,
     fixed here per d-2026-09-01-010's fold-in). #6b7789 measures 4.54:1 and
     keeps the same blue-grey family.
     ⚠️ NIGHT'S OWN VALUE WAS NOT FINE, and the 2026-09-01 note above saying so
     was a light-mode reading. Measured 2026-09-03 on the live hub across six
     routes x two schemes x 1440/390: #6e7a92 on the Night rail (#121828) is
     4.10:1 — under the 4.5 body-text bar — and it was the SINGLE dominant
     pattern in 300 of the hub's 312 dark-mode contrast failures, because this
     one token carries every group header, caret, tool-tab label and column-
     manager hint in the product. #8b96ad measures 5.95 on the rail, 6.24 on
     the canvas and 5.71 on a raised card — dual-safe against all three Night
     grounds — and stays in the same blue-grey family. (d-2026-09-02-055.) */
  --erpal-sidebar-ink-dim: #6b7789;
  --erpal-sidebar-active-bg: var(--erpal-accent-soft);
  /* The ACTIVE tile's ink sits on --erpal-accent-soft, and the bare accent
     measured 3.93:1 there (14px/600 — not "large text", so the bar is 4.5:1;
     same 2026-09-01 audit, same fold-in). --erpal-accent-dark measures
     5.81:1 on the soft tint and is already the house hover/active blue, so
     the active state stays a token and gains no new colour. Night (6.13:1)
     is redefined in the dark block and untouched. */
  --erpal-sidebar-active-ink: var(--erpal-accent-dark);

  /* ---- status tags (bg / ink pairs) ---- */
  /* CHIP INK, DAY — three measured misses fixed 2026-09-02 (d-2026-09-01-029's
     cockpit-polish leg). These are the Call / Meeting / Task / Email / Note
     chips on every record timeline and list view, so they are exactly the
     "activity displays" this ruling asks for, and exactly the shared-token
     class the mobile-nav worker recorded and left. Measured on the chip's own
     background, Day: amber 3.27 -> 5.37, green 3.81 -> 5.73, blue 3.93 -> 5.81.
     Red (4.52), purple (4.82) and the default grey (6.65) already passed and
     are untouched; NIGHT already measured 6.0-7.2 on all six and is untouched.
     This restyles chips CRM-wide by design — one palette, one measurement. */
  --erpal-tag-bg: #eef1f6;       --erpal-tag-ink: #4a5568;
  --erpal-tag-green-bg: #e3f4ec; --erpal-tag-green-ink: #0f6b46;
  --erpal-tag-blue-bg: #e8f0fe;  --erpal-tag-blue-ink: #1559b8;
  --erpal-tag-amber-bg: #fdf0db; --erpal-tag-amber-ink: #8a5800;
  --erpal-tag-red-bg: #fde7e7;   --erpal-tag-red-ink: #c5343a;
  --erpal-tag-purple-bg: #f0e9fb;--erpal-tag-purple-ink: #7c3aed;
  --erpal-marker-dim: #8a94a6;   /* timeline "note" marker */

  /* ---- accent INK and accent FILL (added 2026-09-02, d-2026-09-01-029) ----
     Two jobs the palette had been doing with one value, which is why both
     measured short in one scheme or the other.
     --erpal-accent-on-soft = accent-coloured TEXT. Verified against every
       ground it lands on: Day #1559b8 = 6.16 on the canvas, 6.66 on a surface,
       5.81 on --erpal-accent-soft; Night #79aeff = 8.22 / 7.53 / 6.13.
     --erpal-accent-fill + --erpal-on-accent-fill = a FILLED primary button.
       Day white on #1559b8 = 6.66. Night flips the pair rather than darkening
       the blue — white on Night's lifted accent measures 2.77, and dark ink on
       it measures 6.69, which is the same trick the chips use. */
  --erpal-accent-on-soft: #1559b8;
  --erpal-accent-fill: #1559b8;
  --erpal-on-accent-fill: #ffffff;
  /* The "Total Records" badge's tint, as VALUES rather than a color-mix.
     1.8.6 wrote it as color-mix(in srgb, var(--erpal-accent) 9%, var(--erpal-
     surface)) — correct colour, 5.90:1, and a mistake anyway: with a var() in
     it Chromium serialises the computed background as `color(srgb 0.919 0.950
     0.991)`, and every contrast probe in this fleet parses `rgb()` only. The
     hub audit read those three fractions as 0-255 channels and scored the
     badge 3.13:1 against a near-black ground that does not exist; the TMS
     cert's probe found no rgb() match, treated the ground as transparent and
     silently walked past it to the canvas. A rule that makes the CHECKER
     wrong is worse than the defect it fixes. These are the same colours the
     mix produced, written out. */
  --erpal-badge-bg: #eaf2fd;
  --erpal-badge-border: #c6dcf9;


  /* ---- NAV SECTION PALETTE (Troy, 2026-09-01: "color-code the main tidy-menu
     tiles so they are easier to tell apart") -------------------------------
     ONE HUE PER SECTION, ONE SATURATION/LIGHTNESS PAIR PER SCHEME. Every tint
     in the rail is computed from these — css/erpal-tidymenu.css contains no
     colour of its own — so a tenant skin re-points the whole rail by
     re-declaring hues, and Night is correct without a second palette.

     WHY hue-per-section rather than a hand-picked colour per tile: there are
     up to fifteen tiles in one group, and fifteen genuinely distinct colours
     inside one rail is the "noise" failure, not the scanning aid. The SECTION
     is what the eye sorts by; within a section the tiles take a small hue step
     (the 4-step ladder in erpal-tidymenu.css) so neighbours differ without
     leaving the family.

     WHY S and L are ONE pair for every hue: contrast is governed by S/L, so
     the whole palette can be measured as a family rather than tile by tile —
     and it was, in a real browser, in both schemes (see the report). Hues that
     ran short of the 3:1 non-text-contrast floor at the shared pair get a
     named override below rather than a nudge to the shared pair, which would
     have moved every other tint to fix one.

     ⚠️ THE HUES CARRY `deg` ON PURPOSE. The ladder in erpal-tidymenu.css adds
     a step to the hue inside calc(), and calc() cannot add a unitless number
     to an angle — it is a TYPE error, the whole hsl() becomes invalid at
     computed-value time, the declaration is dropped, and every tint silently
     reverts to the inherited ink with no error anywhere. Measured exactly that
     way on the clone before these units were added. Keep them.

     MEANING IS NEVER COLOUR-ALONE: the tint lands on the icon and a 3px left
     accent bar. The LABEL keeps --erpal-sidebar-ink at full text contrast and
     the icon keeps its own distinct shape, so a colour-blind or monochrome
     reader loses nothing but the sorting aid. */
  --erpal-nav-tint-s: 58%;
  --erpal-nav-tint-l: 40%;
  --erpal-nav-hue-crm: 214deg;          /* blue     — the CRM's own accent family */
  --erpal-nav-hue-sales: 150deg;        /* green    — money in */
  --erpal-nav-hue-catalog: 30deg;       /* amber    — stock and things */
  --erpal-nav-hue-events: 280deg;       /* violet */
  --erpal-nav-hue-publishing: 330deg;   /* magenta */
  --erpal-nav-hue-recruiting: 186deg;   /* teal */
  --erpal-nav-hue-operations: 258deg;   /* indigo   — machines, jobs, the fleet */
  --erpal-nav-hue-reports: 8deg;        /* red-orange */
  --erpal-nav-hue-knowledge: 96deg;     /* olive */
  --erpal-nav-hue-settings: 222deg;     /* slate-blue */
  --erpal-nav-hue-default: 220deg;      /* any group this palette has no name for */
  /* Per-hue lightness overrides — see the measurement note above. Amber and
     olive, and green and teal, are perceptually lightest at a given HSL L, so
     on white they were the four that measured weakest at the shared pair.
     MEASURED on the clone across all 41 rendered tiles before the overrides:
     sales 3.18-3.32 and recruiting 3.55-5.71 were the floor. They pass 1.4.11
     (3:1 for a graphical object) even there, but marginally, and they are the
     tints doing the sorting work — so they get a darker L rather than the
     whole palette moving to fix two families. */
  --erpal-nav-l-catalog: 34%;
  --erpal-nav-l-knowledge: 32%;
  --erpal-nav-l-sales: 30%;
  --erpal-nav-l-recruiting: 32%;

  /* ---- elevation ---- */
  --erpal-shadow: 0 1px 3px rgba(20,33,61,.06), 0 1px 2px rgba(20,33,61,.04);
  --erpal-shadow-lg: 0 4px 16px rgba(20,33,61,.10);

  color-scheme: light;
}

/* ====================================================================
   NIGHT (Zoho NextGen-style navy/near-black surfaces).
   Keep this token list in sync with the auto block below.
   ==================================================================== */
[data-theme="dark"] {
  --erpal-bg: #0e1320;            /* near-black navy canvas */
  --erpal-surface: #161c2c;       /* raised navy cards */
  --erpal-text: #e8ecf4;
  --erpal-muted: #9aa5b8;
  --erpal-border: #28304a;
  --erpal-accent: #5b9bff;        /* lifted blue for dark contrast */
  --erpal-accent-dark: #3d83f2;
  --erpal-accent-soft: #1d2c4d;
  /* 🔴 NIGHT FLIPS THE INK INSTEAD OF DARKENING THE ACCENT (d-2026-09-04-021,
     Troy's ruling `token_fix_next_window`).
     Night lifts the accent to #5b9bff so accent-coloured TEXT is readable on a
     dark canvas. White on that lifted blue is 2.77:1 — under the 4.5 bar — so
     EVERY control painting white on the accent failed in Night: the active
     pager tile, the primary list button, the mode switch, the topbar's accent
     chips, erpal_tidy's peek-open button, erpal_mail's primary button,
     erpal_hub's social chrome (which aliases this token as --sa-on-accent) and
     the house dialog titlebar. Reported by the route module 2026-09-04, which
     had already paired its OWN ink (--riq-on-accent) rather than paint white,
     and named the token as the wider defect.
     #0e1320 on #5b9bff measures 6.76:1 — the same flip --erpal-on-accent-fill
     and the status chips already use, and the same value erpal_login_brand
     independently arrived at for its own dark block. The accent itself does not
     move, so nothing treating it as a FILL or a BORDER changes.
     DANGER IS A SEPARATE GROUND and now has its own token: dark ink on Night's
     #e2606a is 5.45:1 where white was 3.43:1. Decoupling the two is what made
     this fix possible at all. */
  --erpal-on-accent: #0e1320;
  --erpal-on-danger: #0e1320;
  --erpal-success: #2fc795;
  --erpal-warning: #e9ad52;
  --erpal-purple: #9a82e8;
  --erpal-danger: #e2606a;
  --erpal-danger-dark: #c54850;

  --erpal-hover: #202942;
  --erpal-hover-soft: #1b2238;
  --erpal-thead-bg: #131929;
  --erpal-row-hover: #1b2440;
  --erpal-track: #232c47;
  --erpal-divider: #1f2740;
  --erpal-input-bg: #0e1320;
  --erpal-surface-2: #1b2233;

  --erpal-sidebar-bg: #121828;
  --erpal-sidebar-ink: #c4cddd;
  --erpal-sidebar-ink-dim: #8b96ad;
  --erpal-sidebar-active-bg: #1d2c4d;
  --erpal-sidebar-active-ink: #79aeff;

  --erpal-tag-bg: #232c47;       --erpal-tag-ink: #aeb9cc;
  --erpal-tag-green-bg: #14352a; --erpal-tag-green-ink: #3ecf8e;
  --erpal-tag-blue-bg: #18294b;  --erpal-tag-blue-ink: #79aeff;
  --erpal-tag-amber-bg: #392c14; --erpal-tag-amber-ink: #e9b35c;
  --erpal-tag-red-bg: #3c1c22;   --erpal-tag-red-ink: #f0838b;
  --erpal-tag-purple-bg: #2a2245;--erpal-tag-purple-ink: #b79bf2;
  --erpal-marker-dim: #8b96ad;

  --erpal-accent-on-soft: #79aeff;
  --erpal-accent-fill: #5b9bff;
  --erpal-on-accent-fill: #0e1320;
  --erpal-badge-bg: #1c273f;
  --erpal-badge-border: #273c61;

  /* Night: the HUES are inherited from :root — only the saturation/lightness
     pair flips, which is the whole point of separating them. */
  --erpal-nav-tint-s: 68%;
  --erpal-nav-tint-l: 70%;
  --erpal-nav-l-catalog: 66%;
  --erpal-nav-l-knowledge: 64%;
  /* Green and teal need no help on a dark ground — they measured 8.2-12.1
     there. The overrides exist for Day and must be RESTATED here, or they
     would inherit the Day values and paint near-black on navy. */
  --erpal-nav-l-sales: var(--erpal-nav-tint-l);
  --erpal-nav-l-recruiting: var(--erpal-nav-tint-l);

  --erpal-shadow: 0 1px 3px rgba(0,0,0,.45), 0 1px 2px rgba(0,0,0,.35);
  --erpal-shadow-lg: 0 4px 18px rgba(0,0,0,.55);

  /* ==================================================================
     🔴 THE BASE THEME'S OWN INK TOKENS, FLIPPED (ruling d-2026-09-01-048).
     Troy: "when the text in dark mode is a color that blends into the
     background color making the text difficult to read, we need ... a text
     color that suits both dark and light mode."

     Olivero declares three neutral ink tokens and gives them ONE value each,
     because Olivero has no dark mode:

       --color-text-neutral-soft   : gray-45
       --color-text-neutral-medium : gray-20
       --color-text-neutral-loud   : gray-5   ← hsl(…, 5%) ≈ rgb(11,13,15)

     Twenty-two rules across the base theme paint with them, and the one that
     bit us is `table th { color: var(--color-text-neutral-loud) }`. On the
     /loads board — a plain Views table, not the CRM listing shell our own
     `.erpal-content table thead th` rule reaches — the column headers Load,
     Equipment, Target rate and Pickup rendered NEAR-BLACK ON NAVY in Night.
     52 of slice 2's 156 cert checks flagged the same class on the assistant
     panel; this is its twin on the board itself.

     FIXING THE TABLE RULE WOULD HAVE FIXED ONE SCREEN. The token is the defect
     — every other core component using it is wrong in Night for the same
     reason and simply has not been looked at yet. Redefine the TOKEN, in both
     dark states, and all twenty-two follow. This is the same lesson tms.css
     §"UNDEFINED tokens" records one layer up: a value that only has a light
     meaning is a light literal, whatever it is spelled as.

     Values are our own ink ladder rather than inverted greys, so core
     components and ours agree instead of nearly agreeing.
     ================================================================== */
  --color-text-neutral-loud: var(--erpal-text);
  --color-text-neutral-medium: var(--erpal-text);
  --color-text-neutral-soft: var(--erpal-muted);

  /* ------------------------------------------------------------------ */
  /*
     🔵 AND ITS PRIMARY (LINK) INK, same defect, same fix (d-2026-09-02-048
     class 2). Olivero derives every link colour from one hue-and-lightness
     ladder that only has a LIGHT meaning: --color--primary-40 computes to
     #1475ad, and --color-text-primary-medium/-loud point at it. That is the
     ink on a bare <a>, on core's button.link, on the breadcrumb, the pager and
     the action links — 32 of the 56 Night failures the cert measured, at
     3.38-3.69:1 on the Night canvas and on Night surfaces. The theme already
     ships the correct value for accent-coloured TEXT and had one consumer:
     --erpal-accent-on-soft, #79aeff in Night, verified 8.22 / 7.53 / 6.13
     against canvas, surface and the soft tint. Point the two TEXT roles at it.
     Deliberately NOT --color--primary-40 itself: that variable is also a
     BACKGROUND in core (buttons, the active pager tile), and moving it would
     lift a fill, not an ink.
     ------------------------------------------------------------------ */
  --color-text-primary-medium: var(--erpal-accent-on-soft);
  --color-text-primary-loud: var(--erpal-accent-on-soft);

  color-scheme: dark;
}

/* AUTO: no data-theme attribute set → follow the OS. Duplicate of the
   [data-theme="dark"] token set (CSS has no mixins without a build step). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --erpal-bg: #0e1320;
    --erpal-surface: #161c2c;
    --erpal-text: #e8ecf4;
    --erpal-muted: #9aa5b8;
    --erpal-border: #28304a;
    --erpal-accent: #5b9bff;
    --erpal-accent-dark: #3d83f2;
    --erpal-accent-soft: #1d2c4d;
    /* 🔴 NIGHT FLIPS THE INK INSTEAD OF DARKENING THE ACCENT (d-2026-09-04-021,
       Troy's ruling `token_fix_next_window`).
       Night lifts the accent to #5b9bff so accent-coloured TEXT is readable on a
       dark canvas. White on that lifted blue is 2.77:1 — under the 4.5 bar — so
       EVERY control painting white on the accent failed in Night: the active
       pager tile, the primary list button, the mode switch, the topbar's accent
       chips, erpal_tidy's peek-open button, erpal_mail's primary button,
       erpal_hub's social chrome (which aliases this token as --sa-on-accent) and
       the house dialog titlebar. Reported by the route module 2026-09-04, which
       had already paired its OWN ink (--riq-on-accent) rather than paint white,
       and named the token as the wider defect.
       #0e1320 on #5b9bff measures 6.76:1 — the same flip --erpal-on-accent-fill
       and the status chips already use, and the same value erpal_login_brand
       independently arrived at for its own dark block. The accent itself does not
       move, so nothing treating it as a FILL or a BORDER changes.
       DANGER IS A SEPARATE GROUND and now has its own token: dark ink on Night's
       #e2606a is 5.45:1 where white was 3.43:1. Decoupling the two is what made
       this fix possible at all. */
    --erpal-on-accent: #0e1320;
    --erpal-on-danger: #0e1320;
    --erpal-success: #2fc795;
    --erpal-warning: #e9ad52;
    --erpal-purple: #9a82e8;
    --erpal-danger: #e2606a;
    --erpal-danger-dark: #c54850;

    --erpal-hover: #202942;
    --erpal-hover-soft: #1b2238;
    --erpal-thead-bg: #131929;
    --erpal-row-hover: #1b2440;
    --erpal-track: #232c47;
    --erpal-divider: #1f2740;
    --erpal-input-bg: #0e1320;
    --erpal-surface-2: #1b2233;

    --erpal-sidebar-bg: #121828;
    --erpal-sidebar-ink: #c4cddd;
    --erpal-sidebar-ink-dim: #8b96ad;
    --erpal-sidebar-active-bg: #1d2c4d;
    --erpal-sidebar-active-ink: #79aeff;

    --erpal-tag-bg: #232c47;       --erpal-tag-ink: #aeb9cc;
    --erpal-tag-green-bg: #14352a; --erpal-tag-green-ink: #3ecf8e;
    --erpal-tag-blue-bg: #18294b;  --erpal-tag-blue-ink: #79aeff;
    --erpal-tag-amber-bg: #392c14; --erpal-tag-amber-ink: #e9b35c;
    --erpal-tag-red-bg: #3c1c22;   --erpal-tag-red-ink: #f0838b;
    --erpal-tag-purple-bg: #2a2245;--erpal-tag-purple-ink: #b79bf2;
    --erpal-marker-dim: #8b96ad;

    --erpal-accent-on-soft: #79aeff;
    --erpal-accent-fill: #5b9bff;
    --erpal-on-accent-fill: #0e1320;
    --erpal-badge-bg: #1c273f;
    --erpal-badge-border: #273c61;

    --erpal-nav-tint-s: 68%;
    --erpal-nav-tint-l: 70%;
    --erpal-nav-l-catalog: 66%;
    --erpal-nav-l-knowledge: 64%;
    --erpal-nav-l-sales: var(--erpal-nav-tint-l);
    --erpal-nav-l-recruiting: var(--erpal-nav-tint-l);

    --erpal-shadow: 0 1px 3px rgba(0,0,0,.45), 0 1px 2px rgba(0,0,0,.35);
    --erpal-shadow-lg: 0 4px 18px rgba(0,0,0,.55);

    /* ==================================================================
       🔴 THE BASE THEME'S OWN INK TOKENS, FLIPPED (ruling d-2026-09-01-048).
       Troy: "when the text in dark mode is a color that blends into the
       background color making the text difficult to read, we need ... a text
       color that suits both dark and light mode."

       Olivero declares three neutral ink tokens and gives them ONE value each,
       because Olivero has no dark mode:

         --color-text-neutral-soft   : gray-45
         --color-text-neutral-medium : gray-20
         --color-text-neutral-loud   : gray-5   ← hsl(…, 5%) ≈ rgb(11,13,15)

       Twenty-two rules across the base theme paint with them, and the one that
       bit us is `table th { color: var(--color-text-neutral-loud) }`. On the
       /loads board — a plain Views table, not the CRM listing shell our own
       `.erpal-content table thead th` rule reaches — the column headers Load,
       Equipment, Target rate and Pickup rendered NEAR-BLACK ON NAVY in Night.
       52 of slice 2's 156 cert checks flagged the same class on the assistant
       panel; this is its twin on the board itself.

       FIXING THE TABLE RULE WOULD HAVE FIXED ONE SCREEN. The token is the defect
       — every other core component using it is wrong in Night for the same
       reason and simply has not been looked at yet. Redefine the TOKEN, in both
       dark states, and all twenty-two follow. This is the same lesson tms.css
       §"UNDEFINED tokens" records one layer up: a value that only has a light
       meaning is a light literal, whatever it is spelled as.

       Values are our own ink ladder rather than inverted greys, so core
       components and ours agree instead of nearly agreeing.
       ================================================================== */
    --color-text-neutral-loud: var(--erpal-text);
    --color-text-neutral-medium: var(--erpal-text);
    --color-text-neutral-soft: var(--erpal-muted);

    /* ------------------------------------------------------------------ */
    /*
       🔵 AND ITS PRIMARY (LINK) INK, same defect, same fix (d-2026-09-02-048
       class 2). Olivero derives every link colour from one hue-and-lightness
       ladder that only has a LIGHT meaning: --color--primary-40 computes to
       #1475ad, and --color-text-primary-medium/-loud point at it. That is the
       ink on a bare <a>, on core's button.link, on the breadcrumb, the pager and
       the action links — 32 of the 56 Night failures the cert measured, at
       3.38-3.69:1 on the Night canvas and on Night surfaces. The theme already
       ships the correct value for accent-coloured TEXT and had one consumer:
       --erpal-accent-on-soft, #79aeff in Night, verified 8.22 / 7.53 / 6.13
       against canvas, surface and the soft tint. Point the two TEXT roles at it.
       Deliberately NOT --color--primary-40 itself: that variable is also a
       BACKGROUND in core (buttons, the active pager tile), and moving it would
       lift a fill, not an ink.
       ------------------------------------------------------------------ */
    --color-text-primary-medium: var(--erpal-accent-on-soft);
    --color-text-primary-loud: var(--erpal-accent-on-soft);

    color-scheme: dark;
  }
}
