/* All six typefaces offered in the Settings panel's typography picker are loaded
   up front, not lazily on selection — switching must be instant, and @import is only
   valid at the top of a stylesheet, so they can't be added on demand. Must stay the
   first rules in this file. Lives here rather than in each page's <head> so any
   prototype that links tokens.css gets them automatically, with no per-page
   boilerplate. Requires a network connection; pages fall back to system-ui offline. */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,200..800;1,200..800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Figtree:ital,wght@0,300..900;1,300..900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Archivo:ital,wght@0,100..900;1,100..900&display=swap');

:root {
  /* Type — default is Figtree (2026-08-20, on the user's direct instruction; it was
     Lato that morning, Plus Jakarta Sans before that). Set here and not only in
     js/shell.js's TYPEFACES so a page renders the default before any script runs,
     rather than painting one face and snapping to another. The Settings panel's
     typography radios override --font-sans at runtime (inline style on :root,
     persisted to localStorage as "ce-ui-typeface"). See js/shell.js,
     mountSettingsPanel() — and change both, or a page paints one face and settles
     on the other. */
  --font-sans: 'Figtree', system-ui, sans-serif;
  /* Fixed shell chrome — the account button and the Settings panel it opens read
     this instead of --font-sans, so picking a typeface doesn't restyle the control
     you picked it from. Never overridden at runtime, unlike --font-sans above. */
  --font-ui: 'Plus Jakarta Sans', system-ui, sans-serif;
  /* The face "Headings: Unique" puts on (2026-09-15, on request: "make the unique
     heading font to be Archivo when selecting this in Settings"). It was --font-ui
     until then, which made Unique mean "the chrome's face" rather than a face of
     its own — and on the New theme, where the body is Plus Jakarta Sans, the
     setting did nothing at all.
     A NEW TOKEN, which elements.css's own note called a token decision rather than
     an element one: two files carry the Unique rule (elements.css for the ratified
     headings, proposals.css for the proposal-level ones) and a literal family in
     both would drift the first time this changes again. Not overridden at runtime
     by anything — the typeface picker writes --font-sans only, so a Unique heading
     stays Archivo whichever body face is chosen, which is the point of the
     setting. */
  --font-heading: 'Archivo', system-ui, sans-serif;
  /* rem, not px, so type honours the reader's browser font-size setting. The px
     equivalents are the Figma values — 1rem = 16px at the default root size. */
  /* TRIAL, 2026-09-03 — may be reverted. Both body sizes up one point, 13 -> 14 and
     15 -> 16, to see how the prototype feels at a larger base. Sizes only: the line
     boxes are deliberately left where they were (16 and 20), so nothing reflows and
     the comparison is about glyph size alone. To revert, put 0.8125rem and 0.9375rem
     back — nothing else was touched for this.
     Two things this leaves inconsistent while it stands, both on purpose:
     --text-body-sm's box is now 1.14x its size (it was 1.23), which is tight for
     running text and fine for the labels and table headers it mostly carries; and
     --text-identifier below still says it is "kept equal to --text-body-sm" while
     sitting a point under it. Both get resolved if this trial sticks. */
  --text-body-sm: 0.875rem/1.25rem;
  --text-body-md: 1rem/1.5rem;
  /* The three heading steps were rescaled together on 2026-09-03 (request): 15 -> 18,
     20 -> 24, 28 -> 40. Earlier the same day --text-heading had gone 16 -> 15, which
     put it level with --text-body-md and left weight as the only thing separating a
     heading from body copy; 18 restores a real size difference and does it more
     plainly than the 16 ever did — one point of separation was never going to read,
     three does.
     LINE HEIGHTS are not part of the request and are chosen here, on one rule: the
     two text-scale steps take a 4/3 box (18/24, 24/32), which is the ratio 16/24 and
     15/20 both already used, and the display step takes a tighter 1.2 (40/48) because
     a 4/3 box on 40px type opens a gap a title has to jump. Every value stays on the
     4px grid the rest of the scale sits on.
     KNOCK-ONS worth knowing. --text-heading-2xl at 40/48 is now the same pair as
     app-header.css's own --app-header-text-lg, the "sixth type size" that file
     documents as a thing to retokenise away — they are two names for one value until
     someone does.
     --text-heading-xl then went 24 -> 28 (request, same day), keeping its 32 line
     box — so it is the one step off the 4/3 rule above, at 1.14. It took that size
     from products.html's product detail title, which had been trialling a raw 28
     then 30 literal; naming it here instead put the trial on the scale. Consumers
     that inherit the change: the filter drawer title (proposals.css), the order
     detail page title and its section titles (orders.html). */
  --text-heading: 1.125rem/1.5rem;      /* 18/24 */
  --text-heading-xl: 1.75rem/2rem;      /* 28/32 */
  --text-heading-2xl: 2.5rem/3rem;      /* 40/48 */
  --weight-regular: 400;
  --weight-medium: 500;

  /* Identifiers only — GTIN, MPN, channel order no., merchant order no., and any
     other value styled with .identifier. A scoped exception to "only the five
     sizes" above, the same way --radius-channel-nav is scoped to one element:
     nothing else may reference these. Same metrics as --text-body-sm, but pulled
     into its own token because identifiers need letter-spacing to keep long digit
     strings scannable, which is not something the body sizes carry. Always
     --weight-regular; there is no medium-weight identifier. */
  --text-identifier: 0.8125rem/1rem;    /* 13/16 — kept equal to --text-body-sm */
  --tracking-identifier: 0.0625rem;     /* 1px */

  /* Radius — 3 / 6 / 12 / 21 only. A 3px-based scale, tried 2026-09-04 because the
     4 / 8 / 16 / 24 set read as too round at every size. xs/sm/md double from 3;
     lg breaks that doubling and is 3 x 7, set by hand the same day to pull the
     largest surfaces in from 24. The 2 / 4 / 8 / 16 set is still reachable in the
     settings panel as "Sharp" (js/shell.js). This is a trial and may be reverted. */
  /* Nested-control step, added for .segmented (elements.css): a track at
     --radius-sm (6px) needs something smaller to nest its active item's
     radius inside, the same "outer bigger than inner" rule --radius-channel-nav
     exists to satisfy for the channel nav's own track/pill pair. Scoped to
     nested-inside-sm situations, not a general-purpose smallest step. */
  /* The Rounder preset's values, retuned to the 3px scale 2026-09-04 (was
     4/8/16/24; lg went 24 -> 21 later the same day). Same reason as --font-sans above: the default lives here so
     nothing has to run for a page to look right, and js/shell.js's ROUNDNESS[0]
     holds these same four numbers. Change both. */
  --radius-xs: 3px;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 21px;
  --radius-full: 9999px;   /* badges and chips only */
  /* Deliberately outside the scale and scoped to one element — NOT a fourth step,
     and nothing else may reference it. The channel nav's track is the one place a
     radius has to be concentric with the thing inside it: 12 minus the 4px of track
     padding was exactly the pill's --radius-sm — true of the old 8px --radius-sm,
     not of the 6px one above, and not of Sharp's 4px either. Left at 12px because
     that is what every roundness preset does with the scoped exceptions (each
     re-points xs/sm/md/lg only), so nothing moved under the channel bar when the
     scale changed under it. Whether
     it should now step down to 8px to make the concentric rule true again is an
     open decision, not something to change in passing. */
  --radius-channel-nav: 12px;
  /* Scoped to the floating AI composer (2026-10-12, user's call: 16px, added as a
     token rather than borrowing md or lg). Outside the scale like the channel nav's,
     so the roundness presets leave it alone. */
  --radius-composer: 16px;
  /* Scoped to the flag inside .badge--logo, the same way --radius-channel-nav is
     scoped to one element — a --radius-sm corner on an 8-10px-tall flag would
     round it into a circle; nothing else may reference this. It equalled --radius-xs
     from 2026-08-19 until the 3px scale of 2026-09-04 moved xs to 3px and left this
     behind at 2 — which is exactly why it is its own name: it is scoped to the flag,
     and the nested-control step is free to move without dragging the flag with it. */
  --radius-flag: 2px;
  /* Scoped to .checkbox alone — a --radius-sm corner on a 16px box was half its
     size, rounding it into a circle instead of a square with soft corners. It too
     tracked --radius-xs from 2026-08-19 and parted from it on 2026-09-04, and is
     kept separate for the same reason as --radius-flag above. */
  --radius-checkbox: 2px;
  /* THE MENU PANEL MATCHES ITS TRIGGER (2026-10-20, rule: "the menu opened by a
     dropdown has the same corner radius as the dropdown itself"). Every trigger
     that opens a .menu or .filter-select__panel — .btn, .filter-select,
     .search__scope — is --radius-sm, so the panel points at --radius-sm too and
     rides the roundness presets with it: 6px under Rounder, 4px under Sharp.
     Was a fixed 12px one-off (2026-09-10) that read as a second, rounder
     component hanging off a 6px button.
     THE ROW IS --radius-xs, one step in. Outer larger than inner (CLAUDE.md): a
     6px row inside a 6px panel crowds its corner. With --space-4 of inset,
     concentric would be 2px; --radius-xs (3 / 2) is the same answer given when
     panel and row last shared --radius-sm ("use 3 for the inner element").
     Both stay as named tokens so the pair can be retuned in one place. */
  --radius-menu: var(--radius-sm);
  --radius-menu-item: var(--radius-xs);
  /* THE SEGMENTED CONTROL'S TRACK, scoped like the two above it and like
     --radius-channel-nav — not a fifth step, nothing else may reference it.
     THE BRACKET IS THE RECORD (all three passes on 2026-09-10): --radius-sm (6) was
     the original and read as "a square trough with the corners knocked off";
     --radius-md (12) was asked for and came back "too rounded", which it is — the
     track is --control-height (32px), so 16 would be a full pill and 12 is most of
     the way there. 9 is the midpoint of the two values that were rejected in
     opposite directions, and it is the only reason this is a one-off rather than a
     scale step: there is nothing between 6 and 12 on the scale.
     The item inside it is not a second token — .segmented__item derives its own
     radius from this one by subtracting the track's padding, so the pair stays
     concentric whatever this becomes. See elements.css. */
  --radius-segmented: 9px;
  /* Scoped to the content sheet (proposals.css, .shell__main) and to the strip of
     rail that shows behind its two corners — nothing else may reference it.
     TUNED BY EYE, AND BACK WHERE IT STARTED. The sheet was built on --radius-md,
     then asked to 16 ("change this corner radius from 12 to 16"), then to 9 ("change
     this sidebar radius to 9px, instead of 16"), then to 12 ("go to 12px") — all on
     2026-09-07. Expect it to move again, which is the argument for the token: each
     step would otherwise have been a raw literal edited in two rules.
     12 IS ON THE SCALE, AND THIS IS STILL A LITERAL — READ BEFORE "SIMPLIFYING".
     --radius-md is 12px under the Rounder default, so this token and that step
     currently agree, and pointing this at var(--radius-md) looks like the obvious
     cleanup. It is not equivalent: --radius-md is 8px under the Sharp preset, so the
     repoint would silently make the sheet's corner follow a setting it does not
     follow today, and 12px is the value that was actually asked for. If the corner
     SHOULD track the roundness presets, that is a real and defensible change — it is
     just a different decision from this one, and it is a one-line repoint here.
     IT DOES NOT MOVE WITH THE ROUNDNESS PRESETS, and that is the cost of the above.
     Sharp and Rounder re-point xs/sm/md/lg only, so the sheet's corner is 12 under
     both. The scoped exceptions have always behaved this way; worth knowing if the
     presets are ever meant to reach everything.
     ONE TOKEN, TWO CONSUMERS, and they must not drift: the sheet's radius and the
     width of the rail strip painted behind it are the same number by construction.
     Widen one without the other and the corner shows page fill instead of rail. */
  --radius-shell-sheet: 12px;

  /* Spacing — the only legal gap, padding and margin values.
     Eight steps, doubling from 8 with 12 and 24 as the half-steps that keep dense
     rows from jumping straight to 16. 2 and 4 are for optical work inside a
     control (a track's inset, an icon's offset), not for laying out a page.
     Named by px so a step is never guessed at: --space-12 is 12px.
     If a design needs a value that is not here, ask — do not round to the
     nearest step and do not write a literal. */
  --space-2: 2px;
  --space-4: 4px;
  --space-8: 8px;
  --space-12: 12px;
  --space-16: 16px;
  --space-24: 24px;
  --space-32: 32px;
  /* A ninth step, added 2026-08-25 on the user's direct instruction after the
     dashboard asked for exactly 48px below its GMV flow — the same footing as
     --color-connector and --color-page-tint above, where the user supplied the
     value rather than it being guessed at or rounded to a neighbouring step.
     It is the 32-64 gap's own half-step, which is the one stretch of the scale
     that doubles with nothing in between, so it fits the shape the other
     half-steps (12 between 8 and 16, 24 between 16 and 32) already set.
     Available everywhere, like any step: this is not scoped to the dashboard. */
  --space-48: 48px;
  --space-64: 64px;

  /* Controls */
  --control-height: 32px;
  --control-height-compact: 28px;

  /* Layout */
  --page-width: 80%;      /* PROVISIONAL — cap still unresolved, see docs/shell-forms.md */
  --app-header-height: 44px;
  --sidebar-width: 220px;
  /* The rail's width when collapsed (2026-09-07, with the collapse toggle). It is
     REPOINTED ONTO --sidebar-width by html[data-sidebar-collapsed] rather than read
     directly by anything, which is the whole trick: .sidebar's width, the content
     sheet's rail strip in proposals.css and the two fixed overlays that start at the
     rail's right edge all say --sidebar-width already, so one repoint moves every
     one of them and none of them has to know the rail can collapse.
     64, not the 52 a centred 18px icon in a 36px row would need: the tenant mark is
     32px inside .sidebar__brand's 6px padding and 8px margin, so 60 is the floor
     before the one thing that must stay visible when collapsed gets clipped. 64 is
     the next step up and leaves the nav's own rows 48 wide to centre in. */
  --sidebar-width-collapsed: 64px;
  --page-gutter: var(--space-16);
  /* The content card's TOP inset, split off from --page-gutter 2026-09-07 so the
     l-shaped shell can open it up without moving the other three sides. Resolves to
     the gutter, so unset it is the single value it replaced; [data-shell-shape] is
     the only thing that repoints it (proposals.css) and no theme touches it. */
  --page-body-pad-top: var(--page-gutter);

  /* Icons */
  --icon-size: 16px;
  --icon-size-identifier: 12px;   /* .identifier's own copy icon only — not a general small size */
  --icon-size-sidebar: 18px;      /* .sidebar's own icons only — not a general large size */
  --icon-stroke: 2;
  --icon-stroke-emphasis: 2.5;

  /* Elevation — interactive elements only */
  --elevation: 0 1px 2px 0 rgb(0 0 0 / 0.06), 0 1px 1px 0 rgb(0 0 0 / 0.04);
  /* Second, stronger step — larger floating panels that need to read as clearly
     lifted off the surface behind them (e.g. the Orders preview popover), not
     just the 1-2px lift a small dropdown needs. Same two-layer shape as
     --elevation, scaled up: a wider, softer key shadow plus a tighter contact
     shadow. Not a replacement for --elevation — small menus/dropdowns keep the
     subtler value. */
  --elevation-lg: 0 4px 12px 0 rgb(0 0 0 / 0.12), 0 2px 4px 0 rgb(0 0 0 / 0.08);
  /* A RUNG BETWEEN THE FIRST TWO, added 2026-09-07 ("dial down on the shadow
     effect, it's too strong now, somewhere in between and towards the softer
     side") after the content sheet on the New theme went to --elevation-lg and
     overshot. The gap it fills is real and was already showing: --elevation is
     2px of blur at 6% and --elevation-lg is 12px at 12%, a 6x jump in spread, so
     anything that wants "lifted, but quietly" has had nothing to ask for — Light's
     sheet took the bottom rung and New's wanted the middle of a scale that had no
     middle.
     NOT THE MIDPOINT — biased toward --elevation, per "towards the softer side":
     6px of blur where halfway is 7, and 8% where halfway is 9. Same two-layer
     shape as the rest of the scale, a wider key shadow over a tighter contact one,
     so it reads as the same light source at a different height.
     THE NAME SAYS THE BASE STEP IS "sm", which it is in everything but its name;
     renaming --elevation now would touch every menu and dropdown in the system for
     no visual change, so the scale reads elevation / -md / -lg / -xl and the odd
     one out is the one that was there first. */
  --elevation-md: 0 2px 6px 0 rgb(0 0 0 / 0.08), 0 1px 2px 0 rgb(0 0 0 / 0.05);
  /* Third step, stronger still — for a floating panel that needs to read as
     dominant over everything behind it, not just lifted off it. Same two-layer
     shape as --elevation/--elevation-lg, scaled up again. */
  --elevation-xl: 0 8px 24px 0 rgb(0 0 0 / 0.18), 0 4px 8px 0 rgb(0 0 0 / 0.1);
  /* THE CONTENT CARD'S OWN SHADOW, and the only elevation in the set that names an
     element rather than a step (added 2026-09-07: "the shadow is visible, now make it
     50% softer"). It is --elevation-xl at HALF THE ALPHA and the same geometry —
     0.09/0.05 against 0.18/0.10, with the 24px and 8px blurs untouched.
     WHY THE GEOMETRY IS HELD, which is the whole reason this is not just the next rung
     down: "softer" is about strength, not spread. Every step of the scale moves both
     at once (--elevation-lg would also halve the blur), and a big blur at low alpha —
     which is what this is — reads as soft light, where a small blur at low alpha reads
     as a faint line. Stepping down the scale would have changed the character while
     dimming it.
     WHY IT IS A TOKEN AT ALL. The card is the one place the system puts elevation on
     static content (CLAUDE.md's rule, and the exception is argued at the rule that
     uses this in proposals.css). That value has now been retuned five times in a day
     — xl, then --elevation, --elevation-md, --elevation-lg, back to xl, and now this —
     and every one of those passes was a search for a value the four general steps do
     not contain, because they are tuned for menus and popovers rather than for a
     full-height sheet. Naming it stops the next pass being a literal at the call site.
     NOT FOR ANYTHING ELSE. A menu, a dropdown or a popover wants a step of the scale;
     this is the sheet's.
     LIGHTER AGAIN (2026-09-08: "make the shadow of the main container in l shaped
     theme a tiny bit lighter"). 0.07/0.04, down from 0.09/0.05 — roughly a fifth off
     each layer, which is what "a tiny bit" buys before the boundary starts to go. The
     geometry is held for the reason given above, so this is the same soft light at a
     lower level and not a different shadow.
     THE ASK NAMED THE SHAPE, NOT A THEME, so Classic here and Light below both moved;
     Dark did not. Its 0.28/0.18 is not the same kind of value — Dark separates two
     near-blacks and the shadow is doing structural work there, where here it is
     ornament on an already-visible edge. Lightening it in sympathy would have cost the
     card its boundary. */
  --elevation-sheet: 0 8px 24px 0 rgb(0 0 0 / 0.07), 0 4px 8px 0 rgb(0 0 0 / 0.04);
  /* The inverse: recesses a surface so what sits in it reads as raised — the
     channel nav's track, and since 2026-08-28 the search bar, which is a field
     you type into rather than a control you press (EXPLORATION, may be reverted;
     see .search in elements.css). Still not a licence for containers generally:
     a card or a table gets no shadow of either direction.
     Value from Figma node 159:2797. */
  --elevation-inset: inset 0 1px 4px 0 rgb(0 0 0 / 0.13);
  /* Scrim behind a slide-out panel (Filters). Added on the user's explicit
     instruction (2026-08-14), not guessed — the system had no overlay colour
     until the filter drawer needed one. */
  --color-overlay: rgb(0 0 0 / 0.4);

  /* Colour — from Figma variables (node 281-5372) */
  --color-background: #f5f5f5;
  --color-surface: #ffffff;
  --color-outline: rgb(0 0 0 / 0.15);   /* every stroke: dividers, container edges, controls */
  /* A CARD's own outline specifically — lighter than the general stroke above, so a
     static surface recedes against the controls sitting on it. Added 2026-08-25 on
     the user's direct instruction, value included ("full black at 8% opacity") —
     same footing as --color-connector and --color-page-tint below, where the user
     supplied the number rather than it being derived.
     SCOPED TO CARDS, deliberately not a repoint of --color-outline: that token is
     every stroke in the system, so taking it to 8% would also lighten every button,
     input, checkbox, table and menu edge — a much larger change than the one asked
     for. Applied to .card and .product-card in elements.css, and to the card-shaped
     proposals in proposals.css; the full list is in this file's git history and in
     each rule's own comment.
     NO CARD USES IT ANY MORE (2026-09-16, on request: "all cards to use a stronger
     border 15% of black ... use a relevant equivalent for dark mode"). .card,
     .product-card, .table and the five card-shaped proposals all went to
     --color-outline; what is left on this token is the other job it had picked up —
     DIVIDERS and chrome bands: a table's row rules, head, toolbar and foot edges, a
     card's own .card__toolbar, .dashboard-action-row, the app header and the sticky
     page-header bands. So the name is now doubly wrong: it is not the card's outline
     and it never was only cards. A rename (--color-outline-subtle) is still a token
     decision and still raised rather than done — this note is the second time it has
     come up.

     SINCE EXTENDED PAST CARDS (2026-08-25, on request): the Channels card's own
     tab-row divider, then the global header (.app-header) and every sticky page
     header band (.page-header:has(.tabs)/:has(.channel-nav), and the order
     detail's page-local copy of that pair) — "all pages". So the NAME is now
     narrower than the job: this is really the system's subtle stroke, and cards
     were only the first thing to ask for it. Renaming it (--color-outline-subtle,
     say) is a token decision and has been raised rather than done.
     Controls — buttons, inputs, checkboxes, menus — the table, and every
     ordinary divider still keep --color-outline at 15%. */
  --color-outline-card: rgb(0 0 0 / 0.08);
  /* A CONTAINER'S EDGE — 12% BLACK (2026-09-16, on request: cards went to
     --color-outline's 15% earlier the same day and then "dial it down to 12% off
     black"). A NEW NAME RATHER THAN A LITERAL OR A REPOINT, and both alternatives were
     real: writing rgb(0 0 0 / 0.12) at each card rule would put the same number in
     eight places, and repointing --color-outline-card from 8% to 12% would have taken
     every DIVIDER up with it — a table's row rules, the header bands — which is not
     what was asked and would have collapsed the distinction the 15% pass had just
     drawn between a container's edge and the lines inside it.
     SO THE SET IS THREE STROKES, EACH WITH A JOB: --color-outline at 15% for CONTROLS
     (buttons, inputs, checkboxes, menus) and ordinary dividers, this at 12% for a
     CONTAINER's own edge (cards, product cards, tables, the card-shaped proposals, the
     filter panel), and --color-outline-card at 8% for the subtle lines WITHIN a surface.
     A card is now quieter than the controls on it and stronger than its own dividers,
     which is the order the three were asked for in.
     THE DARK VALUE IS THE SAME RATIO, not a guess: that theme runs --color-outline at
     18% white and its subtle stroke at 10%, so 12/15 of 18 is 14.4 — 14% white, which
     also lands midway between the two the way 12 does in Classic. Light inherits the
     12% here, as it inherits every stroke. */
  --color-outline-container: rgb(0 0 0 / 0.12);

  --color-text-primary: #141414;
  --color-text-secondary: #666666;
  --color-input-placeholder: #666666;
  --color-accent-primary: #09599b;
  --color-accent-secondary: #2095f3;
  --color-on-accent: #ffffff;
  --color-sidebar: #18294F;   /* the shell's sidebar fill */
  /* The lighter blue washed over the TOP of the rail, so the tenant switcher sits
     in a brighter band that falls off into the flat fill below it. Added 2026-09-07
     on request ("add a bit of a gradient on the top section in the side bar, a bit
     of a lighter blue"), from Figma h1VLKaMZnXSFvvLTZd1oGf node 2270:22173.
     A SECOND COLOUR, NOT A SECOND FILL. --color-sidebar is still what the rail is;
     this is one translucent layer over it (elements.css, .sidebar), which is why
     hover, selected, the muted subtitle and the footer divider are all untouched —
     they still color-mix() --color-sidebar-on over --color-sidebar and now simply
     composite over the wash where it reaches. Nothing about the rail's derivation
     had to learn about the gradient.
     The Figma frame paints this at FULL strength for the top ~30px and hard-stops
     into the fill 5px later. It is applied here at a fraction of that strength over
     a much longer, mid-stopped falloff — softer, and beginning at the top of the
     switcher rather than below it. One reason is measurable: .sidebar__brand-sub
     (the tenant region, 12px at 60% ink) is 6.06:1 on the flat fill and drops to
     3.08:1 on full-strength #0968b4, under AA for its size. The other is that a
     held band with an edge reads as a panel behind the switcher, not as light on
     the rail. See the stop-by-stop note in elements.css. */
  /* THE BULK SELECTION BAR'S FILL AND ITS INK — a pair of names, not a second
     sidebar (added 2026-09-08, on request: "in light theme, when bulk selection,
     keep the selection header row as dark as in any other theme").
     WHY THIS NEEDED A TOKEN AT ALL. The bar has been --color-sidebar since it was
     built, and on Classic and Dark that is right for the reason proposals.css gives:
     it is the app's one dark band, the same dark the rail is. Light repoints
     --color-sidebar to a pale blue for the RAIL's sake, and the bar came along with
     it — a pale bar with white buttons on it, where every other theme has a dark
     band that says plainly "these actions apply to the rows you ticked".
     A [data-theme] .selection-bar rule would have been the quick fix and is exactly
     what CLAUDE.md calls a smell: "a second one of those means the token set is
     missing a name". This is the missing name. The bar's fill and the rail's fill
     were never the same statement — they only happened to agree in two themes.
     BY REFERENCE HERE, so Classic and Dark are unchanged byte for byte and a future
     theme that repoints the rail to another dark gets the bar with it for free. Light
     is the one theme that has to state a value, and it states Classic's own navy —
     see its note in the Light block. */
  --color-selection-bar: var(--color-sidebar);
  --color-selection-bar-on: var(--color-sidebar-on);
  --color-sidebar-glow: #0968b4;
  /* The sidebar's INK — every label, icon and derived state on the rail. Added
     2026-08-31 with the Light theme, which is the first thing that ever needed the
     rail's foreground to differ from --color-on-accent.
     It resolves to --color-on-accent by default, so the Classic rail is unchanged
     to the pixel; what it buys is a name for the job. Before it, the whole rail was
     derived with color-mix() against --color-on-accent — a token whose contract is
     "text that sits ON an accent fill", which the sidebar is only incidentally.
     elements.css's own sidebar section carried a note that "no dedicated on-sidebar
     token set exists yet"; this is that token, and the note is gone with it.
     A THEME REPOINTS THIS AND --color-sidebar TOGETHER. The rail's hover, selected,
     muted-label and divider values are all color-mix percentages of this one colour
     over that one fill, so the pair is the entire sidebar palette — see the
     [data-theme="light"] block below. */
  --color-sidebar-on: var(--color-on-accent);
  /* The app's page fill — what sits behind every page's content, and what a short
     page leaves showing outside the shell. Added 2026-08-31 with the Light theme.
     Points at --color-page-tint by default, so Classic is unchanged: that token
     became the page fill everywhere on 2026-08-25 and is still the value Classic
     wants. The indirection exists because "the blue-tinted fill" and "whatever this
     theme puts behind a page" stopped being the same statement the moment a second
     theme existed — Light's page is neutral grey and calling that a tint would be a
     lie in the name. Consumers (.shell, and each page's own `body`) name this.

     TRIAL, CLASSIC ONLY (2026-09-09, on the user's instruction, value supplied:
     "make this the page background in the classic theme for a bit, might revert
     after testing EDF4F8"). MAY BE REVERTED — the revert is this one line back to
     `var(--color-page-tint)` and nothing else.
     It is a LITERAL here rather than a repoint because the trial is specifically
     that Classic's page stops being the blue tint: #edf4f8 is a shade greyer and a
     shade lighter than #ecf5fe, so moving --color-page-tint itself would have
     dragged the dashboard's own tinted fill and the Light theme's rail
     (--color-sidebar) along with it, neither of which is being tested.
     Only Classic moves — Light and Dark state their own --color-page in their own
     blocks below and are untouched.
     Contrast re-walked against the new fill before it landed: text-primary 16.58,
     text-secondary 5.17, accent-primary 6.49 (was 16.72 / 5.21 / 6.54), so every
     pair that reads directly on the page fill still clears 4.5:1. */
  /* Classic's page fill, and a NAME for that specific blue (2026-09-10). The value
     is unchanged and --color-page still resolves to it here; what the extra name
     buys is a theme being able to reach this exact colour after it has repointed
     --color-page itself, which Light now does to build a gradient out of it. Without
     it that theme would have to restate #edf4f8 as a literal, and a second copy of a
     colour is how the set drifts. Nothing else may reference this — it is Classic's
     page, not a general "pale blue". */
  --color-page-classic: #edf4f8;
  --color-page: var(--color-page-classic);
  --color-ai-edge: #6cb4ff;   /* AI assistant only — its border and glow */
  /* NO LONGER THE TABLE HEAD'S FILL (2026-09-16, on request: the head is white in
     every table now — see .table__head in elements.css). Kept, not deleted: it is
     the one name for "a recessed band inside a surface", Dark parts it from
     --color-background on purpose (see its own note there), and docs/elements.md
     still cites it as the fill a white-on-white mark would vanish against. NOTHING
     IN THE CSS REFERENCES IT TODAY, so before using it, be sure the thing you are
     filling is genuinely recessed — a table head is not, any more. */
  --color-table-header: #f5f5f5;
  /* ONE LIGHT BLUE FOR THE WHOLE SYSTEM (2026-09-16, on request: "replace the current
     lightest version of blue from tokens css with this blue tint. So that this
     propagates to other places, like hovering menu items, badges with count, filter
     buttons being selected, chips in multi select dropdowns").
     IT WAS #f5fafe, ITS OWN VALUE, one step paler than --color-page-tint's #ecf5fe.
     Two near-identical pale blues a step apart was a distinction nothing could use:
     at 1.03:1 on white the chip fill was barely a fill at all — a hovered row, a
     selected filter button and a count badge all had to be read from something other
     than their colour — while the tint beside it did the same job visibly. Tried on
     the Orders prototype as a row-hover exploration first, then made the token's own
     value, which is what propagates it: everything below follows in one line, no
     selector touched (18 uses across elements.css and proposals.css — menu item hover,
     table row hover and selected, .chip, the filters count, a selected filter button,
     the dashboard summary rows, the search recess mix).
     AN ALIAS, NOT A COPY OF #ecf5fe. The two names now hold ONE value and a second
     literal is how a set drifts; --color-page-tint keeps the number because it is also
     what the Light theme paints the rail and the selection bar with. The NAMES stay
     apart because their jobs do: "the fill that means you are touching this" and "the
     blue-tinted page fill" are independently repointable, and Dark does exactly that —
     it declares both, #232323 and #080808, so nothing here reaches it.
     THE SET IS NOW THREE BLUES, which is the end state the request describes: the
     accents (#09599b / #2095f3), this light one (#ecf5fe), and Classic's page
     (#edf4f8 — a shade greyer and lighter, deliberately its own).
     WHAT DID NOT MOVE: --color-info-tint (#c5e2fb), per the request — the "In progress"
     status pill and the toned chips that match it keep their own blue, which is a
     status colour and not a surface. */
  --color-chip: var(--color-page-tint);
  /* The dotted connector line joining the dashboard flow's columns, and its
     endpoint dots. Figma's Color/Blue/B50. Added 2026-08-25 on the user's
     explicit instruction, value included — not guessed, same footing as
     --color-overlay above. It exists because the flow's connectors had been
     borrowing --color-info as "the closest existing token" since the first
     one was built, which docs/proposals.md logged as a substitution twice
     over. Named for the role, not the hue, like every other colour here.
     .dashboard-revenue__connector (the hidden legacy fan, css/proposals.css)
     still uses --color-info and is left alone — it is inert. */
  --color-connector: #51acf6;
  /* A blue-tinted page fill, in place of the neutral --color-background above.
     Added 2026-08-25 on the user's explicit instruction, value included, same
     footing as --color-connector and --color-overlay. NOT a replacement for
     --color-background, which is also the neutral fill behind a product
     thumbnail, a table header and a hovered identifier's pill — it is the
     page's own surface only. Applied by dashboard.html to its own .shell for
     now; making it the app's background everywhere is a one-line change to
     .shell in elements.css, and a system decision rather than a page one. */
  --color-page-tint: #ecf5fe;

  /* ---- Direction-of-light constants --------------------------------------
     Added 2026-09-02 with the Dark theme. All three are named CONSTANTS here
     rather than colours in their own right: they hold the value the system has
     always used, and exist so the one rule that needs the opposite under Dark can
     say so in tokens.css instead of in a component file. See the dark block at
     the foot of this file for what each is for and where it is read; each is
     scoped to the rules named there and nothing else may reference them.
     --color-hover-shade replaces the literal `black` in .btn--primary/.btn--
     destructive's hover mix, --hover-brightness the literal 0.95 in
     .badge-trigger's, and --color-logo-plate is transparent here because a light
     surface already is the plate a brand mark needs. */
  --color-hover-shade: black;
  --hover-brightness: 0.95;
  --color-logo-plate: transparent;
  /* The one of the four that is NOT theme-dependent, and has no override in the
     dark block: the disc a country flag sits on (.dashboard-channel-tile's
     .badge__flag-circle, proposals.css). Added 2026-09-02 on request. A flag is
     artwork containing white — nl and pl are half white — so the ground under it
     has to be white for the mark to have a shape at all, on every theme. It is a
     token rather than a #ffffff literal at the call site for the same reason
     --color-logo-plate is: the two are the same idea (a plate under fixed artwork)
     and belong next to each other, where the difference between "white always" and
     "white only where the surface is not" is visible. */
  --color-flag-plate: #ffffff;

  /* Status. The full colours are fills for solid marks; the tints (Figma node
     473-8368) are the badge fills. Badge labels stay --color-text-primary on every
     tint — measured 12.5:1 to 16.3:1, so all four clear 4.5:1 at body-sm. */
  /* #af1d1d, not the #d32222 this was until 2026-08-27 — changed on the user's
     direct instruction ("change the token.css main red to this one to be
     consistent across"). "This one" is Figma's Red/R80, the value
     --color-error-text was added with two days earlier: the dashboard was
     carrying two reds for one meaning, a 5.22:1 fill and a 6.96:1 text grade,
     and the brighter one lost.
     EVERY use of this token gets better contrast, none gets worse — checked
     each: .btn--destructive fills with it under WHITE text (6.96:1 now, up from
     5.22:1), and the other four are type or a small mark, where darker is
     strictly better (.btn--text.btn--destructive, .btn--icon-destructive's
     hover glyph, .menu__item--danger, .selection-bar__btn--danger).
     --color-error-TINT is untouched: it is a pale badge fill carrying dark text
     and nothing about this change bears on it. */
  --color-error: #af1d1d;
  --color-error-tint: #f6caca;
  --color-warning: #f1ca2c;
  --color-warning-tint: #fbf1c5;
  --color-success: #6ebc62;
  --color-success-tint: #d7edd4;
  --color-info: #2095f3;
  --color-info-tint: #c5e2fb;

  /* Text-grade status pair — for a status colour carrying TYPE or a small
     graphic, where the four above are fills sized to sit behind dark text.
     Added 2026-08-25 on the user's explicit decision, after the dashboard's
     GMV flow coloured a 13px trend figure and the measurements were put in
     front of them:
       --color-success  #6ebc62  2.32:1 on white  — fails 4.5:1 AND 3:1
       Figma Green/G80  #488f3d  3.98:1           — clears 3:1, fails 4.5:1
       --color-success-text      5.00:1           — clears 4.5:1
     So this is NOT Figma's G80: G80 is the frame's own value and still fails
     as body text, which would make it a token that fails the thing it was
     added for. It is G80's own hue and saturation (112deg, 0.40) taken one
     step darker, so it reads as the same green, and it clears 4.5:1 on both
     --color-surface (5.00:1) and --color-chip (4.76:1) — the two fills a
     coloured figure sits on in this system.
     Red needs no compromise: Figma's own R80 is 6.96:1, better than
     --color-error's 5.22:1, so this one IS the frame's value.
     Use for a coloured figure, a trend, a small solid mark. NOT for a badge
     fill — that is what --color-success/--color-error and their tints are.

     RED'S HALF OF THIS PAIR IS NOW AN ALIAS (2026-08-27). The measurement above
     said R80 was better than the fill red as text; the instruction that raised
     --color-error to R80 accepted it as the fill red too. So the two are the
     same colour, and pointing one at the other is what stops them drifting
     apart again — a hex here and a hex there is exactly how the system ended up
     with two reds in the first place.
     The name stays, and stays worth using: it says "this is type, not a fill",
     which is still true and still the thing to know at the call site. Green's
     half is NOT an alias and must not become one — --color-success is a 2.32:1
     fill that genuinely cannot carry type, which is the whole reason this pair
     exists. The split by job survives; only red's two values converged. */
  --color-success-text: #3f7d36;
  --color-error-text: var(--color-error);
}

/* ==========================================================================
   Light theme
   ==========================================================================
   The first theme with values behind it (2026-08-31, on request: "let's build one
   of the themes in settings — light mode. This will affect the left sidebar to
   light mode colours, and also change the page background to light grey, the
   lightest in the tokens").

   THREE DECLARATIONS, and that is the whole theme. Everything else on the rail —
   hover, selected, the muted brand subtitle, the footer divider, the collapse
   button — is a color-mix percentage of --color-sidebar-on over --color-sidebar
   (elements.css), so repointing those two repaints all of it with the same
   relationships the dark rail had. The percentages are NOT re-tuned per theme: an
   8% ink wash over a light fill is the same gesture as an 8% ink wash over a dark
   one, and holding them still is what makes this a theme rather than a second
   sidebar.
   Applied on :root by applyTheme() in js/shell.js. Scoped as an attribute rather
   than a media query on purpose — this is a user setting in Settings, not a
   response to the OS preference. `prefers-color-scheme` is a separate question and
   deliberately not answered here.
   NOT A DARK THEME IN REVERSE. Dark is still an option with nothing behind it (it
   stays WIP in Settings): it needs roughly ten colours tokens.css has not got —
   every surface, outline and text pair re-derived — where Light needed three,
   because Light is the palette the system is already built in. */
:root[data-theme="light"] {
  /* THE LIGHTEST BLUE THE SYSTEM HAS AS A SURFACE (2026-09-07, on request: "in
     light mode make the side bar background and global header (for l-shaped) use the
     lightest shade of blue"). Was --color-surface, i.e. white.
     --color-page-tint, NOT --color-chip, even though the chip was the paler of the two
     when this was written. Two reasons, and only the first survives: the chip token
     means "the fill that says you are touching this" and is not a surface colour — and
     at its old #f5fafe, 1.02:1 against the white card below it, the rail would not have
     read as a separate thing at all. THE SECOND REASON IS GONE SINCE 2026-09-16: the
     two tokens now hold the same #ecf5fe (see --color-chip's own note), so this is a
     choice of NAME rather than of value. Still the right name, and still the one line
     to change if the rail should stop following the page's tint.
     THE L-SHAPED HEADER FOLLOWS WITH NOTHING ELSE TO CHANGE: that shape paints
     .app-header in --color-sidebar (elements.css), so "the sidebar and the global
     header" is one token here, which is exactly what made the request a one-liner.
     The rail keeps its 8%-black border-right in the default shell, which is
     what separates it from the page; in the l-shape that border is dropped and the
     card's own edge does the separating. */
  /* WHITE, AS A TRIAL (2026-09-10: "for light mode, make the side bar white just to
     try it out"). It was --color-page-tint, the palest blue in the set.
     Everything derived from the rail follows on its own — hover, selected, the brand
     subtitle and the footer divider are all color-mix percentages of
     --color-sidebar-on over this token (elements.css), so none of them needed
     touching and none of them was.
     WHAT TO LOOK AT WHILE JUDGING IT: the rail and the content area are now both
     white, so the only thing dividing them is .sidebar's own 8%-black
     border-right — the fill boundary that used to do that work is gone. The page
     gradient below starts at white too, so at the top of the screen the rail, the
     header and the page are one continuous white and the seam is a single hairline.
     Reverting is this one line back to var(--color-page-tint). */
  --color-sidebar: var(--color-surface);
  /* No top wash. The gradient's whole job on Classic is to lift a NAVY rail, and
     there is no navy here — over a rail that is already the pale end of the same
     blue it has nothing to lift and would only add a band.
     THIS IS ALSO WHAT KEEPS THE L UNIFORM IN THIS THEME. The l-shaped header paints
     --sidebar-fill-image alongside the rail (elements.css) so the two share one ramp
     on Classic; here the image resolves to transparent, both are flat
     --color-sidebar, and they match for the simpler reason. */
  --color-sidebar-glow: transparent;
  /* THE SELECTION BAR STAYS DARK (2026-09-08 — see the token's own note at :root).
     #18294F IS A LITERAL AND HAS TO BE, which is the one uncomfortable line in this
     theme: it is Classic's --color-sidebar, but this block has already repointed that
     name to the pale rail, so there is nothing left to reference it by. The
     alternative — a third token holding the raw navy for both to read — is more
     machinery than one duplicated hex earns, and tokens.css is where a hex belongs.
     IF CLASSIC'S NAVY EVER CHANGES, CHANGE IT HERE TOO. That is the cost, stated so
     it is not discovered.
     The ink follows to --color-on-accent, which is the same white --color-sidebar-on
     resolves to on Classic — the bar is a dark fill again, so it takes dark-fill ink
     rather than this theme's near-black body colour. */
  --color-selection-bar: #18294F;
  --color-selection-bar-on: var(--color-on-accent);
  /* The page's own body ink. Every derived state on the rail follows: hover
     becomes an 8% black wash instead of an 8% white one, the brand subtitle a 60%
     grey instead of a 60% white, and so on. */
  --color-sidebar-on: var(--color-text-primary);
  /* WHITE, and it got there by the request's own conditional (2026-09-07: "make the
     main container lightest grey, if it's already that make it white"). It was
     --color-background, #f5f5f5, which is that lightest grey — the only grey in the
     set between white and --color-text-secondary's #666 — so the second half of the
     instruction applied and this is --color-surface.
     WHAT IT COSTS, and it is the same trap the New theme carried: --color-page and
     --color-surface are now THE SAME COLOUR in this theme. A card on the page is
     separated by --color-outline-card alone, not by its fill — the dashboard's
     containers are where it shows. That falls directly out of "make it white" and is
     not a defect to route around; if the flatness needs answering, the card's stroke
     or its elevation is the lever, both already tokens.
     What keeps the theme from reading as one white field is that the chrome is no
     longer white: the rail and the l-shaped header are the pale blue above, so the
     card is the neutral object inside a tinted L rather than white on white. */
  /* WHITE AT 80% (2026-09-08, on request: "change the page background from 100%
     white to white at 80% opacity"). It was --color-surface flat; the note above
     names what that cost — page and surface were the same colour, so a card was
     separated by its stroke alone.
     MIXED AGAINST --color-page-tint RATHER THAN LEFT TRANSLUCENT, and that is the
     one judgement in this line. "80% white" only means something over a stated
     ground, and the two shells do not share one: in the l-shape the page sheet is
     painted over the --color-sidebar band (proposals.css), in the default shell
     .shell paints straight onto a body the pages set to --color-page itself, which
     is circular. A real alpha would therefore read blue in one shape and stay white
     in the other. Blending here gives the SAME colour in both — the l-shape's own
     result, resolved once — and keeps the token opaque, so nothing that stacks two
     page-filled surfaces doubles the tint.
     The result (#fafdff) is a hair of the chrome's blue in the page, which is what
     puts a boundary back between the page and a white card sitting on it. */
  /* CLASSIC'S PAGE BLUE, FLAT (2026-09-10: "in light mode keep the page background
     the blue, no gradient just solid blue"). Third value in a day and the sequence
     is the useful part: the flat color-mix quoted in the note above, then a
     white-to-blue gradient, then this — the gradient's bottom end, held all the way
     up.
     --color-page-classic, not a hex. That token was added for the gradient and earns
     its keep here for the same reason: this theme has to name the exact blue Classic
     paints, and a second copy of the value is how a set drifts. Light and Classic now
     resolve --color-page to the same colour through one name, so a change to Classic's
     page moves both — which is right while this is a trial, and the line to split if
     the two are ever meant to differ.
     THE GRADIENT'S CAVEATS DIE WITH IT: no per-surface ramps, so the l-shape sheet
     and the "Top 3" pill are exact matches again, and this token is a plain colour —
     safe in a color-mix() or as a border colour, which the gradient was not.
     WHAT THIS COSTS, and it is the thing the old color-mix was buying: --color-page
     is a full step of blue now rather than a hair of it, so a white card reads
     clearly against the page — but the SIDEBAR is white in this theme as of today, so
     the rail is now the lightest surface on screen and the page is darker than the
     cards sitting on it. Worth judging together; the rail's own trial note is above. */
  --color-page: var(--color-page-classic);

  /* ---- The rail's selected and hover fills --------------------------------
     THE ONE PLACE THIS THEME CANNOT JUST REPOINT A COLOUR. Every overlay on the
     rail is a color-mix of --color-sidebar-on, the rail's INK. On a dark rail that
     ink is white and an overlay of it is a highlight; here the ink is #141414, so
     the same expression painted a selected row as a grey wash on pale blue — the
     right amount of the wrong thing, and dropping the percentage only made it a
     fainter smudge. See the hook's note in elements.css.
     WHITE INTO LIGHT BLUE (2026-09-07, on request: "make the highlight of the side
     bar lighter, more around white and light blue"). The row is the page's own
     surface at its top edge, shading into the accent at its bottom — a pane of the
     page resting on the rail, catching the light at the top and shading where it
     meets it. Both ends are lighter than the grey wash they replace.
     WHY IT CANNOT BE WHITE ALL THE WAY DOWN, which is the thing to know before
     "lighter" is asked for again: fully opaque white is 1.10:1 against this rail,
     and that is the CEILING for a white pill — there is no more travel in that
     direction, and a white row on a pale blue rail is close to invisible. The
     accent bottom is what makes the pill readable at all: at 10% it is 1.16:1, and
     because it is a translucent dark over a light ground it holds that separation
     rather than depending on the rail staying pale.
     THREE STOPS, AND THE MIDDLE ONE IS THE ANSWER TO "too strong" (2026-09-07:
     "reduce the gradient in the selected list items light mode side bar, make it
     mostly white with a bit of a light blue tint, now the gradient is too strong").
     A two-stop ramp is tinting from the very first pixel, so half the pill is already
     part-blue however low the bottom stop goes — the ramp itself is what reads as
     strong, not its end. Holding --color-surface flat to 60% and running the tint over
     the last 40% makes the row MOSTLY WHITE with the blue arriving as an edge, which
     is what was asked for, and it is the same technique the rail's own top wash uses
     to stop looking like a band (see .sidebar in elements.css).
     6% AT THE BOTTOM, down from 10. The pill still spans both sides of the rail's
     value — 1.10:1 lighter at the top, 1.09:1 darker at the bottom, 1.20:1 across
     itself — which is what makes it findable at all. Do not read the small numbers as
     "invisible": a white pill on this rail is capped at 1.10:1 no matter what, so
     every version of this lives in that range and the tint is what buys the rest.
     Below about 4% the bottom stop stops being distinguishable from the top and the
     row goes back to being a flat white pane.
     HOVER FOLLOWS TO 3%, and it had to. Its bottom stop has to stay clearly under
     selected's or the two states collide; against a 6% selected, the old 5% would have
     been all but the same row. 60% white at the top is unchanged.
     TEXT IS UNAFFECTED — #141414 is 14.8:1 on the deepest part of the selected pill.
     LAST PASS, AND IT IS THE LAST ONE AVAILABLE (2026-09-08: "the sidebar highlight,
     just make it white, with a lighter blue gradient, the current one still feels too
     strong"). The white hold runs to 70% instead of 60% and the accent bottom drops
     6% -> 4%, so the pill is white for the better part of its height and the blue is a
     hairline of shading at the very bottom edge. 4% IS THE FLOOR THE NOTE ABOVE NAMES:
     below it the bottom stop is no longer distinguishable from the top and the row
     reads as a flat white pane with no shape at all — which is the failure mode, not a
     quieter version of this. If "still too strong" comes back a fourth time, the thing
     to change is no longer the gradient: it is either the rail's own tint (--color-sidebar,
     which is what the pill is being read against) or dropping to a flat --color-surface
     pill and giving it an edge instead of a ramp.
     HOVER FOLLOWS TO 2% and keeps its 60% white, holding the same one-step gap under
     selected that the pass before this one established. */
  /* THE RAMP IS GONE (2026-09-08: "remove the gradient in the side bar list item
     highlight, just keep it white"). This is the fourth pass on the pill and the
     one the note above said was the remaining move — every earlier pass lowered the
     accent stop, and the answer to "still too strong" was always the ramp itself,
     not its end. So the pill is now flat --color-surface, hover a 60% wash of the
     same, and no blue anywhere in either.
     WHAT THIS SPENDS, stated plainly because the note above priced it: a fully
     opaque white pill is 1.10:1 against this rail and there is no travel left in
     that direction. Selected is now findable by its shape and its ink, not by
     contrast with the rail. If it turns out to read too faintly, the lever is
     --color-outline-card as an edge on the pill or the rail's own tint — NOT a
     reintroduced gradient, which is what was just asked to go.
     Written as a two-stop ramp between IDENTICAL colours rather than as a bare
     colour, purely so the two tokens keep the shape elements.css's fallbacks have
     (a gradient either way, whoever supplies it) and so a future theme editing one
     stop does not have to restructure the value first. `background` would take a
     flat colour here just as happily. */
  /* THE PAGE'S OWN BLUE (2026-09-10: "in light mode side bar, change the selected
     list item background colour to match the background page colour"). It was
     --color-surface, i.e. white — and white stopped saying anything the moment the
     rail itself went white earlier the same day: a white pill on a white rail is
     1.00:1, which is not a faint highlight but no highlight at all.
     --color-page, so the selected row is literally the page arriving in the rail —
     the row you are on is the page you are looking at. That also inverts the
     relationship the dark rail had, where the pill was LIGHTER than the fill; here
     it is a shade darker, which is the only direction left on a white rail.
     Still written as a two-stop ramp between identical colours, per the note above:
     the shape is kept so a future theme can put a real gradient back without
     restructuring the value first. */
  --color-sidebar-selected-fill: linear-gradient(
    to bottom,
    var(--color-page) 0%,
    var(--color-page) 100%
  );
  /* HOVER IS NOT PART OF THAT REQUEST AND IS NOW THE WEAK ONE. 60% white over a
     white rail is invisible for exactly the reason selected was, and nothing above
     fixes it — pointing this at --color-page too would make hover and selected the
     same fill, so it wants its own answer (a lighter mix of --color-page, or the
     rail's ink at a low percentage) rather than a copy of the line above. Left as it
     was so the change stays the one that was asked for. */
  --color-sidebar-hover-fill: linear-gradient(
    to bottom,
    color-mix(in srgb, var(--color-surface) 60%, transparent) 0%,
    color-mix(in srgb, var(--color-surface) 60%, transparent) 100%
  );

  /* The content card's shadow, halved again for this theme (2026-09-07: "l shaped
     light theme, decrease the shadow some more on the main container"). 0.05/0.03
     against the :root value's 0.09/0.05, with the 24px and 8px blurs held for the
     reason that token's own note gives — softer is strength, not spread.
     A THEME REPOINTING AN ELEVATION IS ALLOWED, and it is worth saying why, because
     the l-shape's own rule used to promise one shadow for every theme. What is
     forbidden is a theme carrying STRUCTURE; a shadow's alpha is a colour over a
     ground, and how much of it a card needs depends entirely on the contrast between
     that card and the chrome around it. Dark already repoints all four elevations for
     exactly this reason. This is a token repoint in a theme block, not a
     [data-theme] .element rule, so the model holds.
     THIS THEME NEEDS LESS THAN THE OTHERS. Classic separates a tinted card from a navy
     rail and Dark separates near-blacks that lean on their strokes; here the card is
     white against #ecf5fe chrome, a 1.10:1 boundary where the same shadow reads much
     heavier because there is nothing else competing with it. It cannot go to none —
     1.10:1 is not an edge on its own — but it can go quiet.
     AND QUIETER (2026-09-08, the same "a tiny bit lighter" pass that took Classic to
     0.07/0.04): 0.04/0.02 here. This theme is the one with a real floor under it —
     the card is white on #ecf5fe, a 1.10:1 boundary the shadow is most of, so the
     next request in this direction is not another alpha. It is --color-outline-card
     on the sheet, giving it a stroke to be separated by instead of a wash. */
  --elevation-sheet: 0 8px 24px 0 rgb(0 0 0 / 0.04), 0 4px 8px 0 rgb(0 0 0 / 0.02);
}

/* ==========================================================================
   Dark theme
   ==========================================================================
   Built 2026-09-02, on request ("build the dark theme, make sure it applies
   across all pages and all colour and text combinations are readable"). Until
   now Dark was a name on the Settings list with `wip: true` beside it and
   nothing behind it; js/shell.js's own comment predicted the shape of this work
   — "roughly ten colours tokens.css has not got — every surface, outline and
   text pair re-derived" — and that is what this block is. It came to fifteen.

   WHY THIS IS BIGGER THAN LIGHT. Light is three declarations because the system
   is already drawn in light: it repoints the rail and the page and everything
   else is already correct. Dark inverts the polarity, so every token whose value
   assumed a light ground has to be restated — the surfaces, both text greys, the
   two neutral strokes (which were black at low alpha and are now white), the
   four status tints (pale fills built to carry DARK type, useless under near-white
   type), the elevations (a black shadow is invisible on a dark page), and the
   accent pair, which flips: a light-blue fill with dark ink on it, rather than a
   dark-blue fill with white ink.

   IT IS STILL ONLY A TOKEN REPOINT. Nothing here is a per-theme rule about a
   component, and there are no [data-theme="dark"] .some-element overrides below
   this block — the audit that shipped with it walked every text node on all eight
   app pages against its own computed background, and the failures it found were
   fixed by moving a token's value, never by exempting an element. The three
   things elements.css/proposals.css DID need are all the same defect: a hard-coded
   `black` or a black-shaded constant where the system had never needed to name
   which way "darker" points. Each became a token (--color-hover-shade,
   --hover-brightness, --color-logo-plate) and each is listed below.

   THE SURFACES ARE NEUTRAL, THE ACCENTS ARE THE SYSTEM'S OWN. The first pass built
   every surface as a desaturated step of the sidebar's Blue/B120 (#021627), on the
   reasoning that a blue-black would read as the same product with the lights off.
   It did not: eight full pages of it put a blue cast on every card, table, menu and
   input at once, and the verdict was immediate — "white surfaces in dark mode should
   be black, or close to it, there's too much blue nuance in the whole screen".
   So the ramp below is achromatic. What carries the brand is what carried it in
   Light: the accent blues, the status colours, and the artwork — all of which read
   as deliberate against a neutral ground and as noise against a blue one.
   The accents are the existing blues brightened to clear 4.5:1 on those surfaces;
   the status colours keep their hue and move in lightness only.

   Applied on :root by applyTheme() in js/shell.js — an attribute, not a media
   query, for the same reason Light is: this is a setting in Settings, not a
   response to the OS. `prefers-color-scheme` is still deliberately unanswered.
   -------------------------------------------------------------------------- */
:root[data-theme="dark"] {
  /* ---- Surfaces -----------------------------------------------------------
     A NEUTRAL RAMP — no hue at all, by the same instruction that set the tone of
     this whole block (see the header). Five steps, deepest first. The page is the
     floor, a card sits above it, and --color-background is the RECESS — in Light it
     is the grey a table header or a thumbnail plate takes against white, i.e. a step
     DOWN from the surface, and it stays a step down here rather than flipping to
     "lighter" with the theme. Its job did not invert; only the direction of the
     light did.
     The steps measure about 1.1:1 against each other, which is simply what luminance
     ratios do at this end of the scale — the printed number understates a separation
     that is perfectly legible on screen — and it is why a dark UI leans on its
     strokes. See --color-outline below, raised for exactly this. */
  --color-page-tint: #080808;
  --color-surface: #1a1a1a;
  --color-background: #111111;
  /* Never repointed here before: with no override this fell through to :root's
     --color-page (var(--color-page-classic), the light blue), so every page in
     Dark sat on Classic's pale fill instead of this ramp. The floor is
     --color-page-tint, the deepest step, matching "the page is the floor" above. */
  --color-page: var(--color-page-tint);
  /* Slightly ABOVE the surface, unlike --color-background: a table header USED TO BE
     the one recessed fill that also had to stay legible as a band across a wide row,
     and a step down put it level with the page showing past the table's edge. In
     Light these two are the same #f5f5f5 under two names; here they part company,
     which is what having the second name was for.
     THE TABLE HEAD NO LONGER USES IT (2026-09-16 — see the Light definition's note and
     .table__head in elements.css). The value is kept as this theme's answer for a
     recessed band, and the reasoning above still holds for anything that needs one. */
  --color-table-header: #232323;
  /* The hover/tint fill, and the one token where dropping the hue costs something:
     in Light it is a pale BLUE, tinted toward the accent, and a neutral cannot say
     that. It is a step UP from the surface instead — "the fill that means you are
     touching this" carried by lightness rather than by hue. The alternative was to
     keep a blue chip on a neutral ramp, which is precisely the cast that was asked
     to go, and it would have shown on every hovered row in the app. */
  --color-chip: #232323;
  /* The rail goes below the page rather than above it, keeping Classic's
     relationship — the sidebar has always been the darkest thing on screen, and
     inverting that here would make the one element that was already dark the only
     one that got lighter. */
  --color-sidebar: #030303;
  /* No top wash, for the reason the whole ramp below is achromatic: a blue bloom
     is exactly the "blue nuance" this theme was rebuilt to remove. A neutral lift
     in its place is possible and is a separate decision, not a translation of the
     Classic value. */
  --color-sidebar-glow: transparent;
  /* MUST BE SET EXPLICITLY, and this is the one non-obvious dependency in the
     block: it defaults to var(--color-on-accent), which is white in Classic and
     is now a near-black ink (see below). Left to default, the rail would paint
     its labels, icons, hovers and dividers in #04121f on #020c16. Light had the
     same obligation for the same reason and set it too. */
  --color-sidebar-on: #f2f2f2;

  /* ---- Strokes ------------------------------------------------------------
     White at low alpha, not black — a black stroke on a dark surface is nothing.
     The alphas rise slightly (15 -> 18, 8 -> 10) because the surfaces they
     separate are 1.3:1 apart where Light's are 1.6:1: the stroke is doing more of
     the separating here, which is the trade a dark UI makes. The two keep their
     relationship — the card outline is still the lighter of the pair, so a static
     surface still recedes against the controls on it. */
  --color-outline: rgb(255 255 255 / 0.18);
  --color-outline-card: rgb(255 255 255 / 0.10);
  /* 14% white — see the Light definition for why this is 12/15 of this theme's own 18%
     rather than a value chosen by eye. */
  --color-outline-container: rgb(255 255 255 / 0.14);

  /* ---- Text ---------------------------------------------------------------
     Neutral, like the surfaces, and not pure white at either end: #f2f2f2 on
     #1a1a1a measures 15.4:1, which is ample, and backing off #ffffff is what keeps
     long tables from vibrating. Secondary is 7.1:1 on a card and 6.5:1 on the chip
     fill — it clears 4.5:1 on every surface in this block, which Light's #666
     does on its own set. */
  --color-text-primary: #f2f2f2;
  --color-text-secondary: #a6a6a6;
  /* Kept a step down from secondary, as in Light, but not below 4.5:1 (5.3:1 on
     a surface): a placeholder is real text and the system has never treated it
     as decoration. */
  --color-input-placeholder: #8f8f8f;

  /* ---- Accent -------------------------------------------------------------
     THE PAIR FLIPS. In Light, accent-primary is a dark blue carrying white text;
     the same colour on a dark page is a filled button you can barely find (1.5:1
     against the surface). So the fill becomes light and the ink on it becomes
     dark — the standard dark-mode inversion, and the reason --color-on-accent is
     a token rather than a `white` literal in the first place.
     accent-primary is also every link and text action in the app: 8.1:1 on a
     card, 8.9:1 on the page. accent-secondary stays the brighter of the two, as
     it is in Light, and is the focus ring and selected edge. */
  --color-accent-primary: #67b4f5;
  --color-accent-secondary: #4aa5f7;
  --color-on-accent: #0a0a0a;

  /* ---- Status -------------------------------------------------------------
     Hue held, lightness moved. The FULL colours carry --color-on-accent (a filled
     destructive button, a solid mark) or stand as type, so they lighten; the
     TINTS are badge fills under --color-text-primary, so they darken — in Light
     they are pale fills built to carry dark type, and left alone they would put
     near-white text on #f6caca. Every tint measures 11.6:1 or better under primary
     text, which is the same "all four clear it comfortably" the Light set was
     checked to; they sit a shade deeper than the first pass did, so a status pill
     reads as a tinted patch on a near-black ground rather than as a lit panel.
     --color-error doubles as a text grade (--color-error-text is an alias to it,
     and stays one here): #f28b8b is 6.5:1 on a card. Green does NOT become an
     alias, for the reason the Light block already states — the fill and the text
     grade are different jobs — but on this ground they converge in value, so both
     are #7fce72 written twice rather than aliased.
     THE STATUS HUES STAY. Neutralising the surfaces was about the fills behind
     everything; a status colour that lost its hue would lose its meaning, and these
     four plus the accents are now the only colour on the screen, which is what makes
     them read. */
  --color-error: #f28b8b;
  --color-error-tint: #3d1414;
  --color-warning: #e8c34a;
  --color-warning-tint: #3d2f0a;
  --color-success: #7fce72;
  --color-success-tint: #173418;
  --color-info: #67b4f5;
  --color-info-tint: #0f3350;
  --color-success-text: #7fce72;

  /* ---- Direction-of-light tokens -----------------------------------------
     Three values that were constants in a system with one polarity, and had to
     become tokens the moment there were two. Each is used in exactly the place
     named; none is a general-purpose knob.

     --color-hover-shade is what a filled button mixes with at 10% on hover
     (.btn--primary, .btn--destructive in elements.css). It was the literal
     `black`, which is correct in Light and backwards here: on a dark page a
     control that dims on hover reads as disabling, not responding.
     --hover-brightness is the same problem for .badge-trigger (proposals.css),
     which darkens whatever tint the badge gave it rather than naming four hover
     colours; 1.18 is the same size of step in the other direction.
     --color-logo-plate is the one thing here that is not about shade at all — see
     .badge--logo img and .dashboard-channel-tile__logo in their own files. A
     channel's mark is fixed brand artwork (bol's #0100A4, Amazon's near-black)
     and cannot be re-tinted without misprinting somebody's logo, so on a dark
     surface it gets a white plate to sit on instead. Transparent in Light, where
     the surface already is one. */
  --color-hover-shade: white;
  --hover-brightness: 1.18;
  --color-logo-plate: #ffffff;

  /* ---- Depth --------------------------------------------------------------
     Same two-layer shapes and the same three steps, with the alphas roughly
     tripled: a 6%-black key shadow is invisible on #080808, so the elevation
     scale would silently flatten to nothing and the one thing separating a
     dropdown from the page behind it would be its 1px stroke. The scrim goes to
     60% for the same reason — 40% black over a dark page barely dims it. */
  --elevation: 0 1px 2px 0 rgb(0 0 0 / 0.35), 0 1px 1px 0 rgb(0 0 0 / 0.25);
  /* Re-tuned with the rest of the scale, and it has to be here even though the
     only thing reading it today is a LIGHT theme's sheet: a token that exists at
     :root and is missing from this block silently keeps its light-ground alpha,
     which is the trap the four around it were written to avoid. Sits between
     --elevation's 0.35/0.25 and --elevation-lg's 0.45/0.3, biased soft, exactly
     as the light value is. */
  --elevation-md: 0 2px 6px 0 rgb(0 0 0 / 0.4), 0 1px 2px 0 rgb(0 0 0 / 0.28);
  --elevation-lg: 0 4px 12px 0 rgb(0 0 0 / 0.45), 0 2px 4px 0 rgb(0 0 0 / 0.3);
  --elevation-xl: 0 8px 24px 0 rgb(0 0 0 / 0.55), 0 4px 8px 0 rgb(0 0 0 / 0.35);
  /* Half of the xl above, exactly as the light value is half of its own — re-tuned
     here rather than inherited because a token that exists at :root and is missing
     from this block silently keeps its light-ground alpha, which is the trap the four
     around it were written to avoid. */
  --elevation-sheet: 0 8px 24px 0 rgb(0 0 0 / 0.28), 0 4px 8px 0 rgb(0 0 0 / 0.18);
  --elevation-inset: inset 0 1px 4px 0 rgb(0 0 0 / 0.4);
  --color-overlay: rgb(0 0 0 / 0.6);
}

/* Archivo is a two-axis variable face (wght + wdth), added to the typography picker
   2026-09-14. Google serves it with wdth defaulting to 100, but state it anyway —
   and turn optical sizing on — so the face renders as its specimen does rather than
   as whatever a browser settles on. Scoped to the one face by the attribute
   applyTypeface() writes: font-variation-settings is inherited and not additive, so
   a global rule would fight DM Sans's and Inter's own optical-size axes. */
:root[data-typeface="archivo"] body {
  font-optical-sizing: auto;
  font-variation-settings: "wdth" 100;
}
