/*
 * Cadence design tokens — the SINGLE source of design values (ADR-023).
 *
 * Every colour, space, font, radius, and border value used by any screen lives
 * here as a CSS custom property. Screens and component stylesheets reference
 * these via var(--token); they NEVER hardcode a value.
 *
 * The values below are the FlowDocs-grounded light theme (UI re-theme slice 1,
 * MG-ruled 2026-07-06/07: "FlowDocs represents a solid representation of a
 * modern day SaaS product (light theme) versus the common navy/dark go-to —
 * less is more"). They are no longer placeholders. The remaining deferred
 * slices (table anatomy, the topbar app-shell, the 20-column decomposition,
 * the page-toolbar/status-pill pattern, Inter self-hosting, dark mode)
 * re-theme or extend the product by editing/adding values in THIS file alone;
 * no screen markup changes. Adding a screen means adding/reusing tokens here,
 * not hardcoding values there.
 */
/* Inter (variable), vendored — see the typography block's rationale. One
 * face serves every weight the scale uses (400–700). font-display: swap
 * keeps first paint on the system stack. */
@font-face {
  font-family: "InterVariable";
  src: url("../fonts/InterVariable.f9c8f0a0a662.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* =========================================================================
   * RAMP — primitives. Nothing in a screen references these directly; the
   * semantic tokens below alias them. Cool slate neutrals (ADR-0054 mock
   * direction; supersedes the FlowDocs warm stone) + one PK-orange
   * accent unchanged. Light theme is the design's identity; no dark ramp
   * is defined (see re-theme spec).
   * ========================================================================= */
  --ramp-stone-0: #ffffff;
  --ramp-stone-50: #f8fafc;
  --ramp-stone-100: #f1f5f9;
  --ramp-stone-200: #e2e8f0;
  --ramp-stone-400: #94a3b8;
  /* The control-border step (S-48, 2026-12-04): the lightest slate that clears
   * 3:1 on BOTH grounds a field sits on — 3.24:1 on white, 3.10:1 on stone-50.
   * Do not lighten it; tests/test_token_contrast.py pins both. */
  --ramp-stone-450: #8290a5;
  --ramp-stone-500: #64748b;
  /* Intermediate step added 2026-07-25 for AA headroom. The replacement
   * value keeps ~5.5:1 on white / ≥5:1 on stone-100 — same jobs. */
  --ramp-stone-550: #556070;
  --ramp-stone-600: #475569;
  --ramp-stone-700: #334155;
  --ramp-stone-800: #1e293b;
  --ramp-stone-900: #0f172a;

  /* Single brand accent — Pro Kinetics orange. Ruling: accent budget — see
   * docs/ui-direction.md §11 (no fixed job count; an earlier "four jobs"
   * went stale and was never corrected, U-3). The inventory itself stays
   * HERE, not just at §11 — it's maintenance-relevant at the token: the
   * focus ring, the active-nav underline, primary buttons (the Orders
   * table's confirmed bulk Push bar AND the order sheet's own confirmed
   * push button — slice 7a S3, U-3/U-7's pair of replacements for the
   * retired per-row CTA — and, since the Settings/Site-profile mock-fidelity
   * pass of 2026-09-06, the ONE per-card primary on those two pages: Add
   * facility, Set capacity, Save changes, Add closure, Save planning
   * rules), the selected-row/-cell/-day tints and the
   * open-row wash (schedule board, vessels/departures disclosure list AND
   * order rows, the exceptions/order sheets), the order sheet's act
   * section, toolbar focus, and the import direction slab. Nothing
   * decorative — every entry marks a state or an affordance, never colour
   * for its own sake. The deep step is the hover for the AA-darkened CTA
   * fill (quiet-professional pass, slice 5.1). */
  --ramp-accent: #e5641a;
  /* Darkened 2026-07-25 from #c8520e, which measured EXACTLY 4.50:1 on white —
   * dead on the AA line with zero headroom, so it failed on every tinted
   * ground the portal uses (4.31 on stone-50, 4.12 on stone-100). This step
   * carries the accent's two contrast-critical jobs at once and they pull the
   * same way: as INK on light grounds (EVERY link since the 2026-10-19 ruling
   * — the base `a` rule — and .btn-accent) darker is better,
   * and as a FILL behind white text (.btn-primary) darker is also better.
   * Now 5.12 white / 4.91 stone-50 / 4.70 stone-100 as ink, and 5.12 for the
   * white button label on the fill. --ramp-accent itself is unchanged: its
   * jobs (focus ring, nav underline, dot rings) are all NON-text, which needs
   * 3:1, and it clears that at 3.40. */
  --ramp-accent-hover: #ba4b0a;
  --ramp-accent-deep: #a84409;
  --ramp-accent-subtle: rgba(229, 100, 26, 0.06);

  /* =========================================================================
   * SEMANTIC — the names screens and portal.css consume. Existing Cadence
   * token names preserved exactly; values re-themed onto the ramp.
   * ========================================================================= */

  /* Colour ----------------------------------------------------------------- */
  --color-text: var(--ramp-stone-900);
  --color-text-muted: var(--ramp-stone-600);
  --color-text-faint: var(--ramp-stone-550);          /* micro-labels, table headers */
  --color-text-placeholder: var(--ramp-stone-500);    /* field hints: 4.76:1 on white, text floor (S-48) */
  --color-surface: var(--ramp-stone-0);
  --color-surface-subtle: var(--ramp-stone-50);
  --color-surface-header: var(--ramp-stone-50);       /* th fill: near-white; the border defines it */
  --color-border: var(--ramp-stone-200);
  /* Ruling: the control-border 3:1 rule — see docs/ui-direction.md §11 S-12.
   * Softened 2026-12-04 (MG, S-48): the slice 8a B8 re-look kept stone-500
   * (4.76:1) because the ramp had no step between it and stone-400 (2.56:1 —
   * fails). MG saw the softer step side by side and ruled for it, so the ramp
   * gained stone-450. Hover steps back up to the old value. */
  --color-border-control: var(--ramp-stone-450);
  --color-border-control-hover: var(--ramp-stone-500);
  /* Scrollbar thumb (.kanban-scroll) — non-text UI, so the 3:1 form-control
   * floor above does not apply here; a step darker than --color-border reads
   * as a grip against the surface without competing with real content.
   * Consumed since the kanban scroll affordance shipped but never defined
   * until now (slice 8a A6 — the guard asserted it, the declaration was dead). */
  --color-border-strong: var(--ramp-stone-400);

  --color-accent: var(--ramp-accent);
  --color-accent-hover: var(--ramp-accent-hover);
  --color-accent-subtle: var(--ramp-accent-subtle);

  /* Filled CTA pair (quiet-professional pass, slice 5.1): .btn-primary fills
   * with the DARK accent step — the raw accent on white is only ~3.4:1, the
   * dark step clears AA — and hovers one step deeper. */
  --color-accent-strong: var(--ramp-accent-hover);
  --color-accent-strong-hover: var(--ramp-accent-deep);

  /* Strong neutral action (.btn-solid): near-black stone fill, white text —
   * the FlowDocs "primary is stone, orange is rationed" discipline. */
  --color-btn-solid: var(--ramp-stone-900);
  --color-btn-solid-hover: var(--ramp-stone-800);

  /* State triads: pale bg + saturated border + AA-dark text (badge/alert
   * convention unchanged; values from the PK semantic set). */
  --color-danger-bg: #fef2f2;
  --color-danger-border: #dc2626;
  --color-danger-text: #991b1b;

  --color-success-bg: #f0fdf4;
  --color-success-border: #16a34a;
  --color-success-text: #166534;

  --color-warning-bg: #fffbeb;
  --color-warning-border: #d97706;
  --color-warning-text: #92400e;

  /* One step off --color-surface-hover (slice 8a B4, the --class-ambient-bg
   * precedent further down this file): it used to alias the SAME step
   * (--ramp-stone-100), so a neutral pill/chip on a hovered row vanished
   * into the row's own hover tint. One ramp step darker keeps it neutral
   * and quiet while staying visible against both the plain surface and the
   * hovered one. */
  --color-neutral-bg: var(--ramp-stone-200);
  --color-neutral-text: var(--ramp-stone-600);

  --color-info-bg: #eff6ff;
  --color-info-border: #2563eb;
  --color-info-text: #1e40af;

  /* Direction slabs (fused status header, spec 2026-07-31): quiet tint pair
   * per direction — pale bg + AA-dark ink, never colour-alone (the text IS
   * the direction). Import rides the accent family; export the success
   * family's cool counterpoint. */
  --direction-import-bg: var(--ramp-accent-subtle);
  --direction-import-text: var(--ramp-accent-deep);
  --direction-export-bg: var(--color-success-bg);
  --direction-export-text: var(--color-success-text);

  /* Table quiet-signals (consumed as zebra/sort/selection land) ------------ */
  --color-surface-hover: var(--ramp-stone-100);        /* row hover (table anatomy slice) */
  --color-row-selected: var(--ramp-accent-subtle);

  /* Spacing scale (unchanged — density budget already correct) ------------- */
  --space-3xs: 0.25rem;
  --space-2xs: 0.3rem;
  --space-xs: 0.4rem;
  --space-sm: 0.5rem;
  --space-md: 0.6rem;
  --space-lg: 0.75rem;
  --space-xl: 0.9rem;
  --space-2xl: 1rem;
  --space-3xl: 1.25rem;
  --space-4xl: 1.5rem;
  /* Region-rhythm steps (slice 5.1): used ONLY between major page regions
   * (section clusters) — tight-inside / loose-outside rhythm. */
  --space-5xl: 2rem;
  --space-6xl: 3rem;

  /* Typography — Inter, SELF-HOSTED (mock-fidelity, MG call 2026-08-14):
   * closes the mock's most diffuse visual gap while keeping the
   * no-EXTERNAL-fonts posture — the variable woff2 + its OFL licence are
   * vendored under static/portal/fonts/, no third-party request ever fires.
   * System stack stays as the swap-period and no-woff2 fallback. ----------- */
  --font-family-base: "InterVariable", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* Monospace stack for verbatim payload display (.codeblock). System fonts
     only — the same no-webfont posture as --font-family-base. */
  --font-family-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  /* --font-size-xs/-sm/-md/-section retired (slice 8a B2, ADR-0070 ruling 2
   * — one type scale): every consumer find/replaced onto the ADR-031 role
   * scale below (--font-size-xs → --text-micro, now identical in value;
   * --font-size-sm/-md → --text-body; --font-size-section → --text-section,
   * slice 8a A6) and the declarations deleted here. --font-size-lg is NOT
   * retired the same way — the auth wordmark is the scale's one sanctioned
   * outlier, so it keeps its own single-purpose name below instead of
   * joining a role it doesn't share. */
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;                             /* page-title tier ONLY */
  --line-height-base: 1.4;
  --line-height-tight: 1.15;                           /* a large figure on a tile */
  --letter-spacing-wide: 0.4px;                        /* pairs with --text-micro uppercase (the .micro-label recipe, slice 8a B3) */
  --letter-spacing-tight: -0.02em;                     /* titles at/above the section size */
  --font-numeric: tabular-nums;                        /* numeric/ID/date table columns */

  /* Operational-density type scale (ADR-031 §2.1). Role-named, ~1.15–1.2 ratio.
   * The ONE type scale (slice 8a B2, ADR-0070 ruling 2) — every legacy
   * --font-size-* rung above either folded in here (find/replaced across
   * every consumer, then deleted) or, for --font-size-lg, renamed to its own
   * single-purpose token since it shares no role with this scale.
   *
   * --text-title carries the SHIPPED 22px, not the 20px this rung was minted at
   * (continuity audit 2026-08-02). The scale had drifted into two half-migrated
   * halves: --font-size-title (22px) was what h1 actually rendered, while
   * --text-title (20px) — the rung ADR-031 says new components consume — had
   * zero consumers, so every new component picked a scale by coin flip and the
   * migration was running backwards. Resolved by keeping the pixels the estate
   * ships and retiring the legacy twin, so there is exactly one page-title
   * token and it is the ADR-031 one.
   *
   * Density honesty (slice 8a B1, U-2, ADR-0070 ruling 2): every rung's
   * comment states its RENDERED px at --root-scale's 90% (rem × 0.9 × 16 —
   * see --root-scale's own comment below for the mechanism), not the bare
   * rem-to-px conversion the comments used to carry — that unscaled number
   * was never what the page actually painted. No rung may render under the
   * 10px floor the ruling sets (test_ui_styling_discipline.py pins it). */
  --text-micro: 0.7rem;      /* 10.08px rendered — uppercase labels. Lifted from 0.6875rem (9.9px rendered — UNDER the floor) */
  --text-meta: 0.75rem;      /* 10.8px rendered — secondary / meta */
  --text-body: 0.8125rem;    /* 11.7px rendered — data / body */
  --text-emphasis: 0.875rem; /* 12.6px rendered — identifiers, key column */
  --text-section: 0.9375rem; /* 13.5px rendered — section heads */
  --text-title: 1.375rem;    /* 19.8px rendered — page titles */
  /* Auth entrance wordmark (auth.css, allauth layout) — the scale's one
   * sanctioned outlier (slice 8a B2): the wordmark's size is not a role this
   * operational-density scale carries, so it keeps its own single-purpose
   * name rather than being force-fit onto --text-title or left as a
   * scale-straggler. Its one consumer migrated from the retired
   * --font-size-lg (same 1.4rem value — no visual change). */
  --auth-wordmark-size: 1.4rem;

  /* Density tokens (ADR-031 §2.2): the compact operational table cell + the one
   * in-row control height, tuned once. */
  --cell-pad-y: 0.44rem;
  --cell-pad-x: 0.72rem;
  /* 34.2px rendered (S-48, 2026-12-04; was 2rem / 28.8px): fields, filter
   * rows, the segmented control and .btn-sm all read this one value, so they
   * moved together and every alignment between them holds. */
  --control-height: 2.375rem;
  /* A select's drawn chevron (S-48). A data URI cannot read var(), so the
   * stroke repeats --ramp-stone-550 (--color-text-faint) by value: keep the
   * two in step. The hex lives here because this is the one file that may
   * hold one. */
  --select-chevron: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23556070' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  --select-chevron-size: 0.75rem;
  --select-chevron-inset: 0.7rem;
  --select-pad-end: 2rem;

  /* Component sizing (guard-clean: dimension values live here, not in portal.css). */
  --facts-col-min: 9rem;     /* .facts auto-fit min column */
  --field-grow-basis: 12rem; /* .field-row .field.grow flex-basis */
  --form-cell-min: 14rem;    /* a form card's auto-fill field column (PRA record, 2026-10-16) */
  --form-max-width: 44rem;   /* cap in-panel action forms to a readable width */
  /* Command-bar search (every .filter-row screen): a fixed basis, not flex-grow — a full-width
   * search pushed Apply to the far right of the screen (MG refinement
   * 2026-08-01); wide enough for its own placeholder at --text-body. */
  --filter-search-width: 20rem;
  /* ActionBar free-text reason inputs (exceptions Confirm/Resolve/Dismiss/
   * Acknowledge): a fixed comfortable basis — .grow inflates a form's
   * intrinsic width inside the bar and wraps its own button. */
  --reason-input-width: 18rem;
  /* Worklist availability calendar (Task 9, vendor-portal spec §1). */
  --cal-time-col: 3.5rem;   /* calendar hour-label column */
  --cal-cell-min: 4rem;     /* calendar day-column minimum */
  /* Floor for wide DataTables inside .table-scroll. Without it a table with a
   * prose column does not overflow its scroller — it COMPRESSES, and at tablet
   * width the prose collapses to a one-word ribbon with mid-word breaks. The
   * .dscan tablet collapse at 768px is DisclosureList-only and never applied
   * to a plain <table>. (2026-07-27 notes review.) */
  --table-min-width: 62rem;
  /* The vessels panel table's own floor (Task 3, spec H4, slice 7b). Ruling:
   * vessels min-width arithmetic — see docs/ui-direction.md §11. Lowering
   * this value trims the Attention header's margin first — there is no
   * alignment left to trade it for. */
  --vessels-orders-min-width: 56rem;
  /* The deal form's line editor (trader deals slice 3, ADR-0114): a number
   * cell's control fits "12345678.1234"; the description cell's floor keeps
   * a product's name readable before the table scrolls. */
  --deal-line-num-width: 7.5rem;
  --deal-line-text-min: 14rem;
  /* The deal page's ruled key/value list and its counterparty column
   * (styling pass 2026-10-28): the label column fits "Seller reference";
   * the party column holds a four-line address beside the terms. */
  --deal-kv-label-col: 9rem;
  --deal-party-col: 17rem;
  /* The vessel scan line's content-sized tracks (Vessels final review
   * 2026-09-26, the Schedule list's recipe): each sized to its widest value
   * or header at the 90% root scale; the name is CAPPED and shrinks first,
   * and the spare width is shared equally between the gaps. */
  --vessels-col-name: 14rem;                           /* cap: "MSC NEW HAVEN VIII" / "SPIRIT OF MELBOURNE" (~190px) */
  --vessels-col-date: 5rem;                            /* "Sat 22 Aug" (~68px) under "DEMURRAGE" (~67px) */
  --vessels-col-date-marked: 6.75rem;                  /* ETD/ETA: "Mon 24 Aug" + the ATD/ATA mark (~93px), one line */
  --vessels-col-port: 4.75rem;                         /* "AUMEL" under "DISCHARGE" (~63px) */
  --vessels-col-orders: 3.25rem;                       /* "ORDERS" (~43px) */
  --vessels-col-boxes: 5rem;                           /* "CONTAINERS" (~70px) */
  --vessels-col-readiness: 5.5rem;                     /* six dots (~77px) */
  /* The Worklist row's content-sized tracks (Worklist final review
   * 2026-09-26, the Schedule/Vessels recipe): fixed-shape columns sized to
   * their widest value at the 90% root scale; Customer, Vessel and Site are
   * capped and shrink first; the spare width is shared between the gaps. */
  --wl-col-order: 7.5rem;                              /* PO + the Priority pill (~108px) */
  --wl-col-customer: 6.5rem;                           /* cap — capped tracks grow EQUALLY, so a loose cap starves Vessel */
  --wl-col-dir: 4.75rem;                               /* the EXPORT slab (~63px) */
  --wl-col-class: 6rem;                                /* one class chip (~61px); a second wraps into the title */
  --wl-col-vessel: 13rem;                              /* cap: "ANDROKLIS · 2613" (~180px) */
  --wl-col-anchor: 6.75rem;                            /* "Mon 24 Aug" + the ATA mark (~93px), one line */
  --wl-col-status: 8rem;                               /* "Ship confirmed" pill (~108px) */
  --wl-col-scheduled: 4.75rem;                         /* "SCHEDULED" header (~65px) */
  --wl-col-site: 6.5rem;                               /* cap: one site code (~57px); two ellipsise, full list in the title */
  /* The Dashboard Orders card's content-sized tracks (MG ruling 15,
   * 2026-09-26), at the 90% root scale. */
  --dash-col-order: 7.5rem;                            /* a 10-digit PO / FB-AUS ref */
  --dash-col-customer: 8rem;                           /* cap */
  --dash-col-site: 5rem;                               /* "QUBE-WH" */
  --dash-col-vessel: 11rem;                            /* cap: "SPIRIT OF AUCKLAND" */
  --dash-col-date: 5rem;                               /* "Sat 12 Sep" */
  --dash-col-status: 9rem;                             /* the widest stage pill */
  --dash-col-next: 8rem;                               /* cap: the next-action link */
  /* The Orders table's content-sized tracks (Orders review 2026-09-27,
   * ruling 1), at the 90% root scale: they fit the frame at a 1280 window
   * with the spare width shared between the gaps. */
  --orders-col-po: 10.5rem;                            /* the "Customer reference" heading with its sort arrow */
  --orders-col-job: 6rem;                              /* "B00015126" or the pick box */
  --orders-col-dir: 4.5rem;                            /* the Export slab (All only) */
  --orders-col-customer-min: 3.25rem;                  /* floor: "Fonterra" */
  --orders-col-customer-max: 6rem;                     /* cap: the vessel has first call on spare width */
  --orders-col-vessel-min: 4rem;                       /* floor */
  --orders-col-vessel-max: 9rem;                       /* cap: "SPIRIT OF AUCKLAND" */
  --orders-col-voyage: 3.75rem;                        /* "MA628R" */
  --orders-col-date: 5.25rem;                          /* "Wed 26 Aug" */
  --orders-col-stage: 11.25rem;                        /* "MT Waiting for Collection" */
  --orders-col-stage-import: 8.75rem;                  /* "Ready for Planning" */
  --orders-col-exc: 3.75rem;                           /* the "N" exception pill */
  --orders-col-count: 2.5rem;                          /* a box count under its glyph */
  --orders-col-received: 8rem;                         /* "29 Aug 2026, 10:16" */
  /* The customer Orders list's two text caps (customer surface slice 1):
   * past them a product or vessel clips with an ellipsis (its title holds
   * the whole value), so the row fits the frame at the laptop tier. */
  --customer-col-product-max: 15rem;                   /* "Anhydrous milk fat 210L drums + 1 more" clips */
  --customer-col-vessel-max: 12rem;                    /* "SPIRIT OF AUCKLAND 2609W" */
  --customer-col-product-laptop: 8.5rem;               /* the caps at the 1024 tier, */
  --customer-col-vessel-laptop: 8rem;                  /* where the sidebar is a rail */
  --customer-col-buyer-max: 14rem;                     /* "PT. Example Indonesia Tbk" (export scope) */
  --customer-col-business-max: 10rem;                  /* "Sibling Co" … a business's name, All businesses view */
  --customer-col-buyer-laptop: 8rem;
  /* The export scope's desktop caps (customer market profile, F7): its
   * Market and Buyer columns cost the room, so Product, Vessel and Buyer
   * clip sooner and the row fits its frame at 1600 wide, sidebar open. The
   * import and All scopes keep the caps above; the laptop caps are shared. */
  --customer-col-product-export: 10rem;
  --customer-col-vessel-export: 9rem;
  --customer-col-buyer-export: 10rem;
  /* The customer container page's History: its when column carries a date
   * AND a time, wider than a 6.5rem label column holds. */
  /* The customer Warehousing page (customer Warehousing, second cut): the
   * grid's site column — a customer's site is named in full, wider than the
   * Schedule's code column — and the list row's Site cap. */
  --warehousing-site-col: 11rem;                       /* "Laverton Cool Store" on one line, longer names take two */
  --warehousing-col-site-max: 9rem;                    /* "Laverton Cool Store" (~125px); longer names clip */
  /* The customer Performance page's charts (slice 3): the weekly bars'
   * height, a leg bar's thickness, and the leg-name column on a desktop. */
  --chart-weeks-height: 9rem;                          /* the busiest week's bar */
  --chart-week-min: 2.75rem;                           /* one week's column: its "26 Oct" label (~30px) plus air */
  --chart-trend-height: 13rem;                         /* the export performance trend's plot */
  --chart-line-width: 2px;                             /* the trend's line */
  --chart-dot-size: 9px;                               /* a month's point on the trend */
  --meter-height: 0.375rem;                            /* a tile's or a table row's rate meter */
  --kpi-min: 10.5rem;                                  /* one headline tile, so six sit across a desktop */
  --kpi-rule: 3px;                                     /* a headline tile's top rule */
  --text-figure: 1.75rem;                              /* a headline tile's figure */
  --perf-callout-lead: 9.5rem;                         /* the call-outs' lead column: "Not in the booking report" */
  --perf-table-meter: 5rem;                            /* the breakdown table's drawn rate */
  --perf-field-min: 15rem;                             /* one field on the Definitions grid: its longest select */
  --perf-upload-max: 30rem;                            /* the Imports drop box: a file name in full, the button still beside it */
  --choice-panel-width: 22rem;                         /* a filter's tick list on a desktop: a customer's name in full */
  --choice-panel-height: 20rem;                        /* a tick list before it scrolls: a year of months without scrolling */
  --chart-month-min: 3.75rem;                          /* one month on the export performance trend: "31 of 53" beneath its rate */
  --print-margin: 12mm;                                /* a printed report's page margin */
  --chart-leg-height: 0.75rem;                         /* one time-in-stage bar */
  --chart-leg-name-col: 21rem;                         /* "Collected → Empty returned" + its clock pill (~290px) */
  /* The customer Markets page's share-of-tonnes bar, beside its figure. */
  --share-bar-width: 4rem;                             /* 100% of the period's tonnes */
  --share-bar-height: 0.5rem;                          /* thinner than a time-in-stage bar: a row's aside */
  /* Ruling: the compact checkbox — see docs/ui-direction.md §11. */
  --checkbox-size-compact: 1rem;

  /* Ruling: temperature chips — see docs/ui-direction.md §11. */
  /* Ambient is the neutral of the three, but it still has to READ as a chip.
   * It aliased --ramp-stone-100, the SAME value as --color-surface-hover, so
   * the capsule vanished on any hovered row and on every tinted ground, and
   * barely registered on white — one of three sibling chips rendering as bare
   * text (continuity audit 2026-08-02). One ramp step darker keeps it neutral
   * and quiet while staying visible against both the surface and the hover. */
  --class-ambient-bg: var(--ramp-stone-200);
  --class-ambient-text: var(--ramp-stone-700);
  --class-chilled-bg: #eff6ff;
  --class-chilled-text: #1e40af;
  --class-frozen-bg: #e0e7ff;
  --class-frozen-text: #3730a3;

  /* Borders & radius -------------------------------------------------------- */
  --border-width: 1px;
  --border-width-thick: 2px;                           /* current-gate dot ring (UI slice 4) */
  --radius-md: 8px;                                    /* inputs */
  --radius-lg: 10px;                                   /* buttons, controls */
  --radius-xl: 16px;                                   /* cards, panels (shell slice) */
  --radius-full: 9999px;                               /* status pills */

  /* Control heights (slice 5.1): base controls and the compact in-row tier.
   * Rendered pixels are at the 90% root scale (--root-scale, S-1). */
  --btn-height: 2.375rem;                              /* 34.2px base buttons/inputs */
  --btn-height-sm: var(--control-height);              /* in-row actions: the field's height, by reference (S-48) */
  /* The toolbar's action pair sizes to the WIDER of the two labels so Apply
   * and Clear read as a matched set — see docs/ui-direction.md §11 S-26. */
  --btn-min-width-sm: 3.5rem;                          /* 50.4px */

  /* Ruling: --target-min — see docs/ui-direction.md §11. 1.7rem, not 1.5:
   * at the 90% root scale (--root-scale) 1.5rem renders 21.6px — under the
   * WCAG 2.5.8 24px floor this token exists to hold. */
  --target-min: 1.7rem;

  /* Dot-status language (slice 5.1): state is a small saturated dot beside
   * calm ink text, never a tinted slab (danger badges excepted). */
  --dot-size: 0.375rem;                                /* 6px status dot */
  --notice-edge-width: 4px;                            /* flash-notice left rail */
  --notice-max-width: 34rem;                           /* a note, not a banner */
  --measure-reading: 50rem;                            /* long-form prose: the customer Guide */
  --guide-toc-width: 16rem;                            /* the Guide's contents rail */
  --guide-term-width: 12rem;                           /* the Guide's definition-term column */

  /* =========================================================================
   * ELEVATION. Ruling: elevation — see docs/ui-direction.md §11.
   * ========================================================================= */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.07), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06);
  /* The card whisper (slice 5.1): the ONE name a card surface reaches for,
   * so the estate's cards move together. Resolves to shadow-md — S-11's
   * neighbour S-10 (ui-direction §11) holds the ladder: xs for controls and
   * grids, card for surfaces, sheet for the sheet's edge, sm as a hover
   * lift. */
  --shadow-card: var(--shadow-md);

  /* =========================================================================
   * SHELL — app chrome (values parked for the shell slice; the page ground
   * is consumed NOW via portal.css's body rule).
   * ========================================================================= */
  --shell-page-bg: var(--ramp-stone-50);
  --shell-header-bg: var(--ramp-stone-0);
  --shell-header-border: var(--ramp-stone-200);
  --shell-header-height: 56px;
  /* MG ruling 2026-07-19: near-fluid for the data-heavy operator screens —
   * full width on any real PK display (27" ≈ 2560 logical px), while still
   * bounding scan-row eye-travel on ultrawides. The 13px --text-body density
   * scale stands unchanged. */
  --shell-content-max-width: 2400px;
  --shell-nav-active-underline: 2px;                   /* accent underline, not a filled pill */

  /* Ruling: z-order — see docs/ui-direction.md §11 (S-11 holds the whole
   * ladder; the other rungs sit in the shell block below). */
  --z-topbar: 10;
  --z-scrim: 10;                                       /* the phone drawer's scrim shares the topbar's rung */
  --z-skip-link: 21;

  /* Opacity ----------------------------------------------------------------- */
  --opacity-muted: 0.45;                               /* dimmed / closed rows read as parked */

  /* Motion ------------------------------------------------------------------ */
  --motion-fast: 0.12s; /* the one interactive-transition duration (buttons) */
  --motion-spin: 0.8s; /* busy-ring rotation period (data-busy in-flight state) */

  /* =========================================================================
   * STAGE COLOURS (ADR-0054). Ruling: stage colours — see
   * docs/ui-direction.md §11.
   * ========================================================================= */
  --stage-1-bg: #eff6ff; --stage-1-ink: #1e40af; --stage-1-dot: #3b82f6;   /* blue */
  --stage-2-bg: #eef2ff; --stage-2-ink: #3730a3; --stage-2-dot: #6366f1;   /* indigo */
  --stage-3-bg: #faf5ff; --stage-3-ink: #6b21a8; --stage-3-dot: #a855f7;   /* purple */
  --stage-4-bg: #fff7ed; --stage-4-ink: #9a3412; --stage-4-dot: #ea580c;   /* orange — dot 3.35 on tint, 3.56 on white, 3.25 on stone-100 (review T8, 2026-08-30) */
  --stage-5-bg: #fffbeb; --stage-5-ink: #92400e; --stage-5-dot: #d27205;   /* amber — dot 3.29 / 3.41 / 3.12 */
  --stage-6-bg: #f5f3ff; --stage-6-ink: #5b21b6; --stage-6-dot: #8b5cf6;   /* violet */
  --stage-7-bg: #f0fdf4; --stage-7-ink: #166534; --stage-7-dot: #16a34a;   /* green — dot 3.15 / 3.30 / 3.01 */
  --stage-group-1-bg: var(--stage-1-bg); --stage-group-1-ink: var(--stage-1-ink); --stage-group-1-dot: var(--stage-1-dot);
  --stage-group-2-bg: var(--stage-4-bg); --stage-group-2-ink: var(--stage-4-ink); --stage-group-2-dot: var(--stage-4-dot);
  --stage-group-3-bg: var(--stage-6-bg); --stage-group-3-ink: var(--stage-6-ink); --stage-group-3-dot: var(--stage-6-dot);
  --stage-group-4-bg: var(--stage-7-bg); --stage-group-4-ink: var(--stage-7-ink); --stage-group-4-dot: var(--stage-7-dot);
  /* The customer Performance page's charts (customer surface slice 3): one
   * hue per direction, from the stage ramp's dots. Blue and amber, not the
   * direction slabs' orange and green: that pair falls to dE 6.9 under
   * deuteranopia, this one holds dE 30 (dataviz validator, 2026-10-03). */
  --chart-import: var(--stage-1-dot);
  --chart-export: var(--stage-5-dot);

  /* Shell sidebar (ADR-0054 slice 2) + board/dashboard sizing. The vh
   * values live HERE like --auth-page-min-height does — tokens.css is the
   * single home for every dimension value, and the guard bans them in
   * portal.css. */
  --sidebar-width: 15rem;
  --plan-pick-min: 20rem;  /* vendor Plan Delivery: the pick-list column's floor */
  --plan-box-min: 9rem;    /* vendor Plan Delivery: one container link's floor in an order block */
  /* Collapsed icon rail (mock-fidelity round 2): the sidebar narrows to
   * icons-only rather than vanishing — nav stays one click away while the
   * tables get the viewport. */
  --sidebar-rail-width: 3.5rem;
  --sidebar-border: var(--ramp-stone-200);
  --sidebar-motion: 0.2s;                              /* the rail's and the phone drawer's soft open / close (S-47) */
  /* Icon system (mock-fidelity slice 1): stroke-drawn sprite icons riding
   * currentColor. Stroke is unitless SVG user units against the 24-box. */
  --icon-size: 1rem;
  --icon-stroke: 2;
  --brand-mark-size: 1.5rem;
  /* Dashboard fidelity (mock-fidelity slice 2): the square icon chips and
   * the meter bar. The chevron-tile geometry (--chevron-notch,
   * --chevron-num-size) and the site-card column floor (--site-card-min)
   * retired with the 2026-09-16 dashboard redesign, along with their one
   * consumer. */
  --icon-tile-size: 2.25rem;  /* card-head / banner square icon chip */
  --kpi-icon-size: 1.75rem;
  --meter-height: 0.375rem;   /* the dashboard's site share bar */
  /* Ruling: density (the 90% root scale) — see docs/ui-direction.md §11.
   * Mechanism: every rem-derived size (type AND spacing) scales together
   * off this property, exactly like browser zoom — so a token's SHIPPED
   * size is its rem value × --root-scale × the browser's 16px rem base,
   * which is what the --text-* scale's own rung comments each compute. */
  --root-scale: 90%;
  --sidebar-height: 100vh;
  --shell-min-height: 100vh;
  --z-sidebar: 15;
  --z-form-foot: 5;                                    /* .form-foot, under the topbar and sheets */
  --z-sheet: 18;                                       /* see ui-direction §11 · z-order */
  --z-menu: 19;                                        /* popover menus (.more-menu-list, .fold--cta) — above the sheet they may open inside */
  --z-sidebar-overlay: 20;                             /* see ui-direction §11 · z-order */
  /* A raise inside a component's OWN stacking context (a positioned cell's
   * badge over its fill, a kanban pill over its stretched link) — never a
   * layer of the page. Sites that need a second step use calc() on it. */
  --z-local-raise: 1;
  --color-scrim: rgba(15, 23, 42, 0.5);
  /* Seven columns fit a 1280 window (Orders review 2026-09-27, ruling 4):
   * the ruling's ~10.5rem, taken down to what fits — at the 90% root seven
   * columns and six --space-lg gaps must sit inside the frame a 1280 window
   * leaves beside the sidebar. */
  --kanban-col-min: 9.25rem;
  --kpi-tile-min: 13rem;

  /* Sizing ------------------------------------------------------------------ */
  --detail-label-col: 10rem; /* order-detail .kv label track: "Country of destination" on one line */

  /* Busy ring (data-busy in-flight state, 2026-08-05). em-based so the ring
   * scales with the button label it trails. */
  --busy-size: 0.625em; /* ring diameter */
  --busy-stroke: 2px; /* ring stroke width */
  --busy-gap: 0.4em; /* gap between the swapped label and the ring */

  /* Auth entrance shell (allauth account pages — auth.css). The min-height is
   * structural-by-nature (full viewport, like --shell-header-height's fixed
   * bar) but lives here because tokens.css is the single home for every
   * dimension value (ADR-023). */
  --auth-card-max-width: 24rem;
  --auth-page-min-height: 100vh;

  /* Accessibility ----------------------------------------------------------- */
  /* Ring uses accent-dark, not raw accent: #e5641a on white is ~3.2:1
   * (borderline WCAG 2.2 non-text); #c8520e clears it while staying PK orange. */
  --color-focus-ring: var(--ramp-accent-hover);
  --focus-ring-width: 2px;
  --focus-ring-offset: 2px;
  /* Soft accent focus halo (slice 5.1) for form controls and buttons — pairs
   * with an accent border-colour flip so focus stays clearly visible. */
  --ring-accent-soft: 0 0 0 3px rgba(229, 100, 26, 0.1);

  /* Notification centre (spec 2026-08-14) */
  --notif-dot-size: 8px;
  --bell-badge-size: 16px;
  --bell-badge-offset: 4px;
  --bell-badge-font-size: 10px;
  /* The whole line — a flex item that wraps to its own row. */
  --width-full: 100%;

  /* Schedule board (spec 2026-08-29, revised 2026-08-30): the site x day
   * grid's cell furniture and the container sheet. The allocation fill is a
   * native <meter> (booked/ceiling), so it carries no width tokens. */
  /* The day head's date numeral — a filled circle on today (polish 2026-08-30). */
  --sched-today-size: 1.5rem;
  /* The board toolbar's search field: a fixed, shrink-only basis narrower
   * than the Worklist's, so scope and navigation share one line at 1440. */
  --toolbar-search-width: 15rem;
  /* The topbar's one global search input (slice 6, spec S1). Wider than the
   * board's — it names four scopes in its placeholder (container, order, PO,
   * vessel) against the board's one week's worth of rows. */
  --topbar-search-width: 18rem;
  /* The filter panel (.toolbar--panel, UI sweep 2026-10-04): a page's filter
   * bar as a card, its controls one step roomier than the compact in-row
   * --control-height they redefine; the stage select's floor keeps "All"
   * from shrinking it to a stub; the chip's remove cross is a step smaller
   * than the base icon. */
  --control-height-panel: 2.5rem;
  --filter-select-min: 11rem;
  --filter-chip-icon: 0.875rem;
  --sched-site-col: 9.5rem;                            /* grid col 1: fits "NEWCOLD 30/day" unwrapped */
  /* The Schedule list's fixed-shape tracks (table housekeeping, MG
   * 2026-09-26): each sized to its widest value at the 90% root scale, so
   * the gap after it is the grid gap, not leftover fr share. */
  --sched-col-key: 7rem;                               /* "MSCU1234567" semibold (~91px) */
  --sched-col-dir: 4.75rem;                            /* the EXPORT slab (~63px) */
  --sched-col-class: 5.25rem;                          /* the AMBIENT chip (~70px) */
  --sched-col-site: 4.75rem;                           /* "NEWCOLD" (~60px) */
  --sched-col-slot: 3.25rem;                           /* "09:00" (~33px) */
  --sched-col-booking: 6.25rem;                        /* the Confirmed pill (~83px) */
  --sched-col-order: 7.5rem;                           /* "FB-AUS-26-10-01" (~105px); fixed, so tight space falls on the three shrinkable text columns alike */
  --sched-col-customer-max: 8rem;                      /* Customer's cap: "Fonterra (walk)" (~100px); longer names clip */
  --sched-col-vessel-max: 10.5rem;                     /* Vessel's cap: "SPIRIT OF MELBOURNE" (~140px) */
  --sched-col-position-max: 12rem;                     /* Position's cap: the longest leg label (~165px) */
  --sched-col-date: 6rem;                              /* "Wed 23 Sep" (~75px) */
  /* The Exceptions list's content-sized tracks (review 2026-09-27, the
   * Schedule recipe): fixed-shape columns sized to their widest value; the
   * headline takes the rest. */
  --exc-col-customer-max: 10rem;                       /* Customer's cap; longer names clip */
  --exc-col-status: 7.5rem;                            /* the Acknowledged pill */
  --exc-col-age: 4.5rem;                               /* "12d open" */
  --sheet-width: 32rem;                                /* the container sheet — widened 2026-09-03 (MG walk) so a rung's report lines and the Activity rows sit on one line; every sheet shares it */
  --rail-col: 22rem; /* the container page's rail column (spec 2026-09-04 §3.3): ~317px at the 90% root scale */
  --split-entry-aside-width: 20rem;                    /* .split-entry's documents column (New shipment from a mailed set): a file name and its kind select */
  --split-entry-aside-max-height: calc(100vh - var(--shell-header-height) - 2 * var(--space-lg)); /* the sticky documents card fits the window below the topbar and scrolls inside */
  --step-node: 1.5rem;                                 /* the stepper's node diameter (Overview polish 2026-09-04): ~21.6px at the 90% root scale */
  --step-min: 5rem;                                    /* a step's narrowest legible track — the stepper scrolls in-frame below the tier, ADR-0074 S-30 */
  --summary-label-col: 7.5rem;                         /* the summary grid's label column: fits "Current gate" and "Next action" */
  --glyph-size: 1.5rem;                                /* the events table's ringed family glyph (Events polish 2026-09-04): the stepper node's size */
  --sheet-label-col: 6.5rem;                           /* .kv label column */
  --ml-step-col: 11.5rem;                              /* the lifecycle ladder's step column (MG walk 2026-09-03): fits "Available for collection" */
  --more-menu-width: 16rem;                            /* the More menu — the sheet's and the container page's */
  --sheet-motion: 0.18s;                              /* the sheet's slide in / out */
  --shadow-sheet: -8px 0 24px rgba(15, 23, 42, 0.08);  /* the sheet's left edge */
  --sched-badge-size: 1rem;                            /* the cell's ! / alert-count pill */
  --sched-cell-pad-top: 1.25rem;                       /* the badge band above the cell's count */
  /* The planned layer (spec 2026-09-25 §5-§6): the pale booked + planned fill
   * under a cell's booked fill (the info wash, so it never reads as the green
   * booked fill), and a planned list row's dashed leading edge. */
  --sched-plan-fill: var(--color-info-bg);
  --sched-plan-edge: var(--color-border-strong);
  /* An over cell's planned fill (§5): the plan itself takes the site past its
   * ceiling, so the clamped planned meter carries the danger wash too. */
  --sched-plan-over-fill: var(--color-danger-bg);

  /* Settings + Site profile mock fidelity (spec 2026-09-06 §3): the CSS-only
   * toggle switch, the illustrated empty state's tile, the CTA fold's popover
   * form, and the split inset's copy basis. */
  --switch-width: 2.75rem;
  --switch-height: var(--target-min);                /* the 24px pointer-target floor, by alias */
  --switch-knob: 1.25rem;
  --switch-pad: 0.225rem;                            /* (1.7rem - 1.25rem) / 2 */
  --empty-icon-size: 3rem;
  --fold-body-width: 26rem;                            /* .fold--cta's popover form */
  --inset-copy-min: 16rem;                             /* .card-inset--split's title block */
}
