/*
 * Operator-surface screen styles (ADR-018 portal). Every design value comes from
 * a token in tokens.css via var(--token) — NO hardcoded hex/colour/spacing here
 * (ADR-023). Load order: tokens.css, then this file (the shared base + component
 * layers, in that order — slice 8a A4), then the current page's pages/<name>.css
 * if it has one (slice 8a A1-A3). Structural primitives that are not design
 * values (0, 100%, flex, capitalize, …) stay literal.
 *
 * BASE REGION starts here: reset, typography, links, focus system, sr-only/
 * skip-link, tables, shell (+ its responsive blocks).
 */

/* scroll-padding-top keeps a #row fragment landing (every PRG return) clear
 * of the sticky topbar (spec D10). */
html { font-size: var(--root-scale); scroll-padding-top: var(--shell-header-height); }

/* Page ground (UI re-theme slice 1, spec docs/superpowers/specs/
 * 2026-07-07-ui-retheme-slice1-design.md §3.1): the soft page ground the
 * white tables and cards lift off via their hairline borders. */
/* The type default (MG ruling 2026-11-30, docs/ui-direction.md S-44): text
 * with no size of its own renders at --text-body. Before this the body had
 * no size, so unstyled text inherited the root size — larger than every rung
 * below --text-title — and read as the biggest text on its page (the PRA
 * record's "to fix" lines). Anything meant to be larger names its rung. The
 * render sweep fails any visible text whose size is off the scale. */
body {
  font-family: var(--font-family-base);
  font-size: var(--text-body);
  margin: 0;
  color: var(--color-text);
  line-height: var(--line-height-base);
  background: var(--shell-page-bg);
}

/* Tabular figures (re-theme slice 1 §3.2) line up numeric/ID/date columns.
 * The table surface itself is on the `table` rule further down. */
td,
th {
  font-variant-numeric: var(--font-numeric);
}

/* Ruling: the one-bold-weight rule — see docs/ui-direction.md §11. */
h1 {
  font-size: var(--text-title);
  font-weight: var(--font-weight-bold);
  letter-spacing: var(--letter-spacing-tight);
  margin: 0 0 var(--space-2xl);
}

/* Section-head tier: compact semibold, with the region-rhythm gap ABOVE —
 * loose between regions, tight inside them. */
h2 {
  font-size: var(--text-section);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--letter-spacing-tight);
  margin: var(--space-6xl) 0 var(--space-lg);
}

/* Sub-heads share the section rung: an unstyled h3 took the browser's default
 * (S-44), a size on no rung. Weight per S-18 (bold is h1's alone). */
h3,
h4 {
  font-size: var(--text-section);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--letter-spacing-tight);
}

/* The wordmark beside the brand mark in a top bar (S-44). */
.topbar .brand-name,
.vendor-topbar .brand-name { font-size: var(--text-section); }

/* Links: ONE treatment for the whole estate (MG ruling 2026-10-19, replacing
 * the re-theme §3 "quiet ink + underline" rule): the AA-dark accent as ink,
 * no underline until pointed at, the deep step + underline on hover and
 * focus — the recipe the order page's containers table, .kv and the card-head
 * "View ›" links had each re-declared locally. Links are an affordance, so
 * this sits inside S-2's accent budget (ui-direction §11). The hover rule is
 * wrapped in :where() so it stays at element specificity: a family that is a
 * CONTROL rather than a link (sidebar nav, tabs, segmented, sort headers,
 * pills, buttons, disclosure rows, kanban cards, the pager) keeps its own ink
 * and hover with a plain class rule — nothing has to out-rank this. */
a {
  color: var(--color-accent-strong);
  text-decoration: none;
}
a:where(:hover, :focus-visible) {
  color: var(--color-accent-strong-hover);
  text-decoration: underline;
  text-underline-offset: var(--space-3xs);
}

/* Ruling: the focus policy (five shapes, one system) — see
 * docs/ui-direction.md §11. `summary` is listed explicitly: it matches
 * neither `a` nor `[tabindex]` nor `button`, so the disclosure ROW — the
 * primary interactive element of both exemplar screens — was the one
 * control in the estate with no house focus rule at all, falling back to a
 * UA ring that .disclosure-list's own `overflow: hidden` then clipped away
 * (continuity audit 2026-08-02). The offset is negative so the ring draws
 * INSIDE the row and survives that clip. */
a:focus-visible,
[tabindex]:focus-visible {
  outline: var(--focus-ring-width) solid var(--color-focus-ring);
  outline-offset: var(--focus-ring-offset);
}
summary:focus-visible {
  outline: var(--focus-ring-width) solid var(--color-focus-ring);
  outline-offset: calc(-1 * var(--focus-ring-width));
}
/* Inside an overflow: hidden container the generic positive offset is clipped;
 * draw the ring inward, as summary does (review T8, spec D7). */
.segmented-item:focus-visible,
a.drow:focus-visible {
  outline: var(--focus-ring-width) solid var(--color-focus-ring);
  outline-offset: calc(-1 * var(--focus-ring-width));
}
/* The border-colour flip alone is invisible on the FILLED tiers: .btn-primary
 * and .btn-solid paint their own dark grounds, against which an accent border
 * and a 10%-alpha halo both disappear. Every tier therefore also draws the
 * shared ring, offset clear of the fill so it reads on any ground. */
button:focus-visible {
  outline: var(--focus-ring-width) solid var(--color-focus-ring);
  outline-offset: var(--focus-ring-offset);
  border-color: var(--color-accent);
  box-shadow: var(--ring-accent-soft);
}
/* The field's resting states (S-48, MG 2026-12-04), in the order they must
 * yield: hover steps the border one shade darker; a field in error takes the
 * danger border (Django sets aria-invalid on a bound field with errors, and
 * the hand-written forms set it themselves); a disabled field does not answer
 * the pointer; focus, below, beats all three. All (0,1,1) — source order IS
 * the precedence, so keep these four rules together and in this order. */
input:hover,
select:hover,
textarea:hover {
  border-color: var(--color-border-control-hover);
}
input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: var(--color-danger-border);
}
input:disabled,
select:disabled,
textarea:disabled {
  border-color: var(--color-border-control);
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: var(--ring-accent-soft);
}

/* Visually hidden, available to assistive tech. Token-built: --border-width is
 * the one hairline-width token, so the classic recipe passes the guard (spec D11). */
.sr-only {
  position: absolute;
  width: var(--border-width);
  height: var(--border-width);
  margin: calc(-1 * var(--border-width));
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Utilities — the estate's three one-job recipes (CSS review 2026-11-09,
 * F11). Each replaced page-local copies; compose with them, never re-type.
 * .list-plain: a <ul>/<ol> that is a list for AT only — no marker, no box.
 * .clip: one line, ellipsis, the title holds the whole value (the recipe
 *   .dcell-clip has carried since the ledger rows; both share one rule).
 *   Desktop-tier clips inside the desktop breakpoint block stay page-local on
 *   purpose: the narrow card must wrap where this would nowrap. */
.list-plain {
  list-style: none;
  margin: 0;
  padding: 0;
}
.clip { min-width: 0; }

/* In-page skip past a wide grid to the list below it (Schedule, customer
 * Warehousing; final review 2026-09-26): the .sr-only recipe until focused,
 * then an ordinary link above the grid. Its target — a .section-head given
 * tabindex="-1" — takes focus without drawing a ring. One recipe for both
 * pages (CSS review 2026-11-09, F8: two byte-identical page copies and the
 * estate's only two ID selectors folded here). */
.list-skip:not(:focus) {
  position: absolute;
  width: var(--border-width);
  height: var(--border-width);
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.list-skip:focus {
  display: inline-flex;
  align-items: center;
  min-height: var(--target-min);
  margin-bottom: var(--space-xs);
}
.section-head:focus { outline: none; }

/* Skip-link: hidden until focused, then jumps a keyboard user past the nav to
 * the main content (a11y correctness). Positioned off-canvas via tokens.
 * z-index above --z-topbar: without it the positioned-but-auto skip-link
 * paints BELOW the topbar's explicit z-index, so on :focus it would land
 * inside the bar's opaque white band, invisible to keyboard users. */
.skip-link {
  position: absolute;
  left: var(--space-sm);
  top: calc(-1 * var(--space-4xl) - var(--space-4xl));
  z-index: var(--z-skip-link);
  /* It is a link and owes the minimum target once focused (it measured under the
   * minimum tall). inline-flex so the min-height actually applies to the box. */
  display: inline-flex;
  align-items: center;
  min-height: var(--target-min);
  /* It also owes a BOX. Without one it arrives on focus as transparent text
   * landing on top of the topbar wordmark — legible as neither (continuity
   * audit 2026-08-02). Same surface recipe as .card, so it reads as a real
   * control the moment it appears. */
  padding: 0 var(--space-sm);
  background: var(--color-surface);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}
.skip-link:focus {
  top: var(--space-sm);
}

/* Wide-table scroll container (a11y/usability) — slice 5.1 promotes it to
 * the card treatment — plain surface, hairline border, large radius and the
 * whisper shadow, with the table flush to the edges (the scroll clip also
 * clips the corners). Tables float as panels on the stone page ground. */
.table-scroll {
  overflow-x: auto;
  /* The frame must CONTAIN what it clips (S-30). An absolutely positioned
   * descendant is clipped by an overflow ancestor only when that ancestor is
   * in its containing-block chain, so with the frame unpositioned the
   * .sr-only span in a wide table's last <th> escaped it and extended the
   * DOCUMENT's scroll width — the render sweep's first run found Settings
   * scrolling sideways with no visible offender at all. Nothing else in the
   * estate is absolutely positioned inside a .table-scroll (checked across
   * every swept surface), so this clips only what was already invisible. */
  position: relative;
  background: var(--color-surface);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
}

table {
  border-collapse: collapse;
  width: 100%;
  background: var(--color-surface);
}
/* Single-rule anatomy (slice 5.1): the ONLY horizontal rule is the header's
 * bottom border — per-cell row borders are gone; the faint zebra plus the
 * card frame do the row separation. */
th,
td {
  border: 0;
  padding: var(--cell-pad-y) var(--cell-pad-x);
  text-align: left;
  /* middle, not top (MG ruling 2026-07-19): rows mixing text with taller
   * controls (the push pill, badges) read jarred when text hugs the top. */
  vertical-align: middle;
  font-size: var(--text-body);
}
thead th {
  border-bottom: var(--border-width) solid var(--color-border);
}
/* Ruling: the FlowDocs table recipe — see docs/ui-direction.md §11.
 * .sort-link needs no extra `th a` rule — its class selector (0,1,0)
 * already outranks the base `a { color: var(--color-text) }` rule (0,0,1)
 * regardless of source order, so it inherits this faint colour via its own
 * `color: inherit` as-is. */
th {
  background: var(--color-surface-header);
  text-transform: uppercase;
  font-size: var(--text-micro);
  letter-spacing: var(--letter-spacing-wide);
  color: var(--color-text-faint);
  font-weight: var(--font-weight-semibold);
}
/* Row separator + hover (ADR-031 operational-density retune, slice 0):
 * the zebra stripe is retired in favour of a hairline bottom border per row
 * (the DisclosureList's .drow anatomy) — tbody-scoped so thead's single row
 * never matches, and :last-child drops its own rule since the card frame
 * (.table-scroll) already owns the bottom edge. */
tbody tr {
  border-bottom: var(--border-width) solid var(--color-border);
}
tbody tr:last-child {
  border-bottom: 0;
}
tbody tr:hover {
  background: var(--color-surface-hover);
}
/* The order sheet's open row (slice 7a, spec S3): the vessels/departures
 * board's order rows are plain <tr>s, not the disclosure list's .drow — so
 * .drow.is-open's wash (above, and the schedule/exceptions sheets' own
 * precedent) does not reach them. Same recipe, row-scoped: a flat accent
 * wash, no border, no leading mark — the ref link itself carries
 * aria-current, the accessible half of the same signal. */
tbody tr.is-open,
tbody tr.is-open:hover { background: var(--color-accent-subtle); }

/* (.status retired with order_containers.html's expand panel — its only
 * consumer — when the per-box record moved into the container sheet, spec
 * 2026-09-03 §6.3. The sheet's gate lines print an already-humanised word
 * through the shared _container_story.html partial, so nothing needs a
 * capitalising treatment any more.) */

/* The table's accessible name, rendered as its section head. */
.table-caption {
  text-align: left;
  font-size: var(--text-body);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-muted);
  padding: var(--space-lg) var(--cell-pad-x);
}

/* Shell (ADR-0054): sidebar + slim topbar. Grid, not fixed positioning —
 * the sidebar column collapses via the body class (progressive enhancement;
 * expanded is the no-JS state). */

.shell { display: grid; grid-template-columns: var(--sidebar-width) 1fr; min-height: var(--shell-min-height); }
/* Collapsed = icon RAIL (mock-fidelity round 2), not display:none — nav
 * stays one click away while tables get the viewport. Labels, search, and
 * the group headings hide; icons centre in the rail. */
body.sidebar-collapsed .shell { grid-template-columns: var(--sidebar-rail-width) 1fr; }
body.sidebar-collapsed .sidebar { padding-left: var(--space-xs); padding-right: var(--space-xs); }
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .brand-name,
body.sidebar-collapsed .sidebar-group-label { display: none; }
body.sidebar-collapsed .sidebar .brand { justify-content: center; }
body.sidebar-collapsed .sidebar-nav a { justify-content: center; padding-left: var(--space-xs); padding-right: var(--space-xs); }

/* Soft close (2026-12-02; docs/ui-direction.md §11 S-47). The rules above are
 * the resting states and stand as they were. portal.js holds these transient
 * classes for --sidebar-motion and then lands on body.sidebar-collapsed (or
 * off it): the column eases to its new width, the labels fade and are clipped
 * by the narrowing column, never wrapped, and the icons stay where they are
 * until the landing (the two states put them within a hair of each other).
 * No JS, or reduced motion: the old instant change. */
body.sidebar-moving .shell { transition: grid-template-columns var(--sidebar-motion) ease; }
body.sidebar-moving .sidebar { overflow-x: hidden; }
body.sidebar-moving .sidebar .nav-label,
body.sidebar-moving .sidebar .brand-name,
body.sidebar-moving .sidebar-group-label { white-space: nowrap; overflow: hidden; }
body.sidebar-closing .shell { grid-template-columns: var(--sidebar-rail-width) 1fr; }
body.sidebar-closing .sidebar .nav-label,
body.sidebar-closing .sidebar .brand-name { opacity: 0; transition: opacity var(--sidebar-motion) ease; }
body.sidebar-opening .sidebar .nav-label,
body.sidebar-opening .sidebar .brand-name { animation: sidebar-label-in var(--sidebar-motion) ease; }
@keyframes sidebar-label-in {
  from { opacity: 0; }
}
@keyframes sidebar-overlay-in {
  from { transform: translateX(-100%); }
  to { transform: none; }
}
@keyframes sidebar-scrim-in {
  from { opacity: 0; }
}

/* The off-canvas scrim (spec R2): CSS-default-hidden (display:none), never
 * the [hidden] attribute — ONE mechanism, so a no-JS page never shows it
 * (JS only ever toggles body.sidebar-overlay-open, which the 768 block
 * above flips to display:block). Structural properties live on the bare
 * selector so the media rule only has to flip display. */
.sidebar-scrim {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--color-scrim);
  z-index: var(--z-scrim);
}
.sidebar {
  background: var(--shell-header-bg);
  border-right: var(--border-width) solid var(--sidebar-border);
  padding: var(--space-2xl) var(--space-lg);
  position: sticky; top: 0; height: var(--sidebar-height); overflow-y: auto; z-index: var(--z-sidebar);
}
/* Icon system (mock-fidelity slice 1). The sprite is definitions only —
 * never rendered where it stands; icons draw via <use> at the call site.
 * Geometry lives in _icons.html; every DESIGN value (size, stroke, colour)
 * lives here + tokens, so one icon serves any ink its context sets. */
.sprite { display: none; }
.icon {
  width: var(--icon-size);
  height: var(--icon-size);
  fill: none;
  stroke: currentColor;
  stroke-width: var(--icon-stroke);
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
  vertical-align: text-bottom;
}
.sidebar .brand { display: flex; align-items: center; gap: var(--space-sm); margin-bottom: var(--space-2xl); }
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--brand-mark-size);
  height: var(--brand-mark-size);
  border-radius: var(--radius-lg);
  background: var(--color-accent);
  color: var(--ramp-stone-0);
  font-size: var(--text-emphasis);
  font-weight: var(--font-weight-semibold); /* S-18: bold is h1's alone */
  flex: none;
}
.sidebar-nav .icon { color: var(--color-text-faint); }
.sidebar-nav a[aria-current="page"] .icon { color: inherit; }
.sidebar-nav { display: flex; flex-direction: column; gap: var(--space-3xs); }
/* Non-interactive section heading (slice 6, spec N1) — collapsible groups
 * were rejected outright, so this is a plain <span>, never
 * <details>/<summary>. Typography is the shared .micro-label recipe (slice
 * 8a B3 — its own weight lifted medium → semibold to join it); only the
 * padding stays here. Hidden in the rail alongside .nav-label/.brand-name
 * above. */
.sidebar-group-label {
  padding: var(--space-lg) var(--space-lg) var(--space-3xs);
}
/* One rule, not two: an earlier `display: flex` was silently beaten by a
 * later `display: block` at equal specificity (see slice 8a on file-order
 * winners), which pinned the icon+label to the top of the min-height box. */
.sidebar-nav a {
  display: flex; align-items: center; gap: var(--space-md);
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-lg); color: var(--color-text-muted);
  text-decoration: none; font-size: var(--text-emphasis); min-height: var(--target-min);
}
.sidebar-nav a:hover { background: var(--color-surface-hover); color: var(--color-text); }
.sidebar-nav a[aria-current="page"] {
  background: var(--color-accent-subtle); color: var(--color-accent-hover);
  font-weight: var(--font-weight-semibold);
}
.shell-main { min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: var(--z-topbar);
  background: var(--shell-header-bg);
  border-bottom: var(--border-width) solid var(--shell-header-border);
  height: var(--shell-header-height);
}
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 100%; padding: 0 var(--space-3xl);
  max-width: var(--shell-content-max-width);
}

/* inline-flex + min-height, not a bare inline box: the wordmark is a LINK, so
 * it owes the minimum pointer target (it measured under the minimum tall).
 * Lives in the sidebar now (ADR-0054) — .sidebar .brand above overrides
 * display to block so it stacks above the search field rather than trying to
 * centre inline beside anything. */
.brand {
  display: inline-flex;
  align-items: center;
  min-height: var(--target-min);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  text-decoration: none;
  line-height: var(--line-height-base);
}

.sidebar-toggle,
.nav-logout {
  flex: none;
}
/* Square icon buttons (round 2): the sidebar toggle, topbar placeholders,
 * and the board/table view toggle share one treatment. Disabled = the
 * placeholder state (a control that exists but has no surface yet). */
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: var(--target-min); min-height: var(--target-min);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-lg); background: var(--color-surface);
  color: var(--color-text-muted); cursor: pointer;
}
.icon-btn:hover { background: var(--color-surface-hover); color: var(--color-text); }
.icon-btn.is-active { background: var(--color-accent-subtle); color: var(--color-accent-hover); border-color: var(--color-accent-hover); }
.icon-btn:disabled { opacity: var(--opacity-muted); cursor: not-allowed; }
/* The topbar's one global search (slice 6, spec S1) — sits between the crumb
 * trail (.crumbs, below) and .topbar-tools. min-width: 0 on both lets the
 * form shrink inside the topbar's flex row rather than forcing an overflow. */
.topbar-search { display: flex; align-items: center; gap: var(--space-sm); min-width: 0; }
/* min-height + border-box: the base input recipe's padding around --text-body
 * lands this one a fraction UNDER the pointer floor, and the topbar's search
 * is the estate's only bare input outside a .filter-row or a bordered wrapper,
 * so nothing else gives the height back to it (render sweep, first run:
 * "control under the floor … input#topbar-q" on every authenticated page). */
/* The topbar's Search label reads as a heading for the box, not a muted
 * caption (MG visual review 2026-09-22). */
.topbar-search .toolbar-label { color: var(--color-text); font-weight: var(--font-weight-semibold); }
.topbar-search input {
  width: var(--topbar-search-width);
  min-width: 0;
  min-height: var(--target-min);
  box-sizing: border-box;
}
/* flex: none (spec R5): the tools are the page's only actions up there —
 * they keep their natural size and never wrap or get squeezed, even as
 * the crumbs/search shrink around them (both carry min-width: 0). */
.topbar-tools { display: flex; align-items: center; gap: var(--space-md); flex: none; }
.user-chip {
  display: inline-flex; align-items: center; justify-content: center;
  width: var(--target-min); height: var(--target-min);
  border-radius: var(--radius-full);
  background: var(--color-neutral-bg); color: var(--color-text);
  font-size: var(--text-meta); font-weight: var(--font-weight-semibold);
}

/* The toggle button and logout form sit at opposite ends of the slim topbar
 * via .topbar-inner's justify-content: space-between — no spacer trick
 * needed now the bar holds only two items. The button keeps the bar's
 * line-height so its text sits on the same optical centre as the toggle. */
.nav-logout button {
  line-height: var(--line-height-base);
}

/* Topbar bell + unread badge. */
.topbar-bell { position: relative; }
.bell-badge { position: absolute; top: calc(-1 * var(--bell-badge-offset)); right: calc(-1 * var(--bell-badge-offset)); min-width: var(--bell-badge-size); height: var(--bell-badge-size); border-radius: var(--radius-full); background: var(--color-danger-border); color: var(--color-surface); font-size: var(--bell-badge-font-size); font-weight: var(--font-weight-semibold); line-height: var(--bell-badge-size); text-align: center; padding-inline: var(--space-3xs); }


/* Content region (UI slice 3): centred at the shell max-width, same
 * horizontal rhythm as the topbar above it. */
.shell-content {
  max-width: var(--shell-content-max-width);
  margin: 0 auto;
  /* Slice 5.1: one step more air below the topbar. */
  padding: var(--space-4xl) var(--space-4xl) var(--space-3xl);
}

/* Auto-rail below 1024 (slice 6, spec R1) — a laptop-narrow viewport gets
 * the icon rail regardless of the cookie; a rail is always legible. Mirrors
 * the body.sidebar-collapsed rules above verbatim, minus the cookie gate.
 * Scoped under .sidebar/.sidebar-nav (not bare .nav-label/.brand-name) so
 * the vendor shell's own nav (external_portal, sharing this stylesheet) is
 * untouched here — its narrow rule is its own, at <=640 (spec R4). */
@media (max-width: 1024px) {
  .shell { grid-template-columns: var(--sidebar-rail-width) 1fr; }
  .sidebar { padding-left: var(--space-xs); padding-right: var(--space-xs); }
  .sidebar .nav-label,
  .sidebar .brand-name,
  .sidebar-group-label { display: none; }
  .sidebar .brand { justify-content: center; }
  .sidebar-nav a { justify-content: center; padding-left: var(--space-xs); padding-right: var(--space-xs); }
}

/* Off-canvas overlay (slice 6, spec R2): progressive enhancement over the
 * always-reachable rail above — without JS the rail persists at this width
 * too (the 1024 block already applies). With JS, the toggle
 * (portal.js:67-) adds body.sidebar-overlay-open instead of writing the
 * desktop cookie: the SAME #sidebar repositions as a fixed full-height
 * panel (no duplicate DOM), its labels return, and a scrim dims the page
 * behind it. Higher specificity than the 1024 block above wins regardless
 * of source order (three classes beat two). */
@media (max-width: 768px) {
  body.sidebar-overlay-open .sidebar {
    position: fixed; inset: 0 auto 0 0; width: var(--sidebar-width);
    z-index: var(--z-sidebar-overlay); background: var(--color-surface);
    padding-left: var(--space-lg); padding-right: var(--space-lg);
  }
  body.sidebar-overlay-open .sidebar .nav-label,
  body.sidebar-overlay-open .sidebar .brand-name,
  body.sidebar-overlay-open .sidebar-group-label { display: block; }
  body.sidebar-overlay-open .sidebar .brand { justify-content: flex-start; }
  body.sidebar-overlay-open .sidebar-nav a { justify-content: flex-start; padding-left: var(--space-md); padding-right: var(--space-md); }
  body.sidebar-overlay-open .sidebar-scrim { display: block; }
  /* Soft close (S-47): the drawer slides in from the left and out again, the
   * scrim fades with it. The closing class is portal.js's, held for the
   * slide and then dropped with the open class. */
  body.sidebar-overlay-open .sidebar { animation: sidebar-overlay-in var(--sidebar-motion) ease-out; }
  body.sidebar-overlay-open .sidebar-scrim { animation: sidebar-scrim-in var(--sidebar-motion) ease-out; }
  body.sidebar-overlay-closing .sidebar { transform: translateX(-100%); transition: transform var(--sidebar-motion) ease-in; }
  body.sidebar-overlay-closing .sidebar-scrim { opacity: 0; transition: opacity var(--sidebar-motion) ease-in; }
  /* The search's visible label is the one sanctioned label-hiding (spec
   * R5, guard (d)): a width-bound rule, not an accessibility exception —
   * the input's own aria-label keeps naming the scope regardless. */
  .topbar-search .toolbar-label { display: none; }
  /* S-34 (ui-direction §11): at the phone tier the topbar has no room for a
   * search — the toggle, the crumb trail or business switch, and the tools
   * already fill it, and the input was shrinking to an unusable sliver
   * (UI polish review 2026-11-09). The page toolbar's own search carries
   * the job on every list page; the global search returns above the tier. */
  .topbar-search { display: none; }
}

/* =========================================================================
 * COMPONENTS REGION starts here (slice 8a A4): buttons/inputs, notices,
 * filter-row/chips/toolbar+segmented, pills/dir-slabs/tclass, attention
 * glyph, gate-dot vocabulary, disclosure list, cards/facts/fields, digest
 * strip, pager/view-toggle, empty states, crumbs/section-nav, field-confirm/
 * bulk-bar, the sheet, codeblock — the shared vocabulary every page (with or
 * without its own pages/<name>.css) composes from. Rooted in the ADR-031
 * operational-density system (spec docs/superpowers/specs/
 * 2026-07-18-portal-operational-density-design.md) and grown since. Every
 * value a var(); dimension values live in tokens.css.
 * ========================================================================= */

/* MicroLabel — ONE recipe for uppercase micro-heading typography (slice 8a
 * B3, spec docs/superpowers/specs/2026-08-31-css-architecture-design.md):
 * --text-micro, uppercase, --letter-spacing-wide, --color-text-faint ink,
 * semibold weight. Nine character-identical hand-rolled copies collapse
 * into this one grouped rule; each member keeps only its OWN
 * non-typography extras (padding/margin/background/border) on its own
 * selector, in whichever file that selector lives. Two members
 * (.rl-label, .sched-group-head) live in pages/vessels.css and
 * pages/schedule.css — a page-scoped class styled from the shared file is
 * fine, CSS selectors are global regardless of which stylesheet declares
 * them. .mlhead's ink lifted muted → faint and .sidebar-group-label's
 * weight lifted medium → semibold to join the recipe exactly (the two
 * sanctioned unifications this merge makes).
 *
 * NOT collapsed here, on purpose:
 *   - .chip-label (moved to this file's chip component Task 7, 2026-09-04;
 *     originally pages/worklist.css), .cal-dayhead (pages/calendar.css),
 *     .sched-dow (pages/schedule.css) — a deliberately LIGHTER, unweighted
 *     register (no font-weight declaration): the estate's quieter tier,
 *     left unmigrated.
 *   - th (BASE region, above) — needs its own header-fill background, a
 *     property this recipe does not carry.
 *   - .dir-slab / .tclass (below) — capsules (pills), not labels: they
 *     carry a background/padding/border-radius box this recipe does not.
 *   - .toolbar-label (below) — a field label riding --text-body, a
 *     different rung of the type scale, not a micro-label at all. */
.micro-label,
.rl-label,
.field > label,
.facts dt,
.band-label,
.dhead,
.sched-group-head,
.sheet-h,
.mlhead,
.sidebar-group-label {
  text-transform: uppercase;
  font-size: var(--text-micro);
  letter-spacing: var(--letter-spacing-wide);
  color: var(--color-text-faint);
  font-weight: var(--font-weight-semibold);
}

/* In-card sub-head: a .micro-label HEADING that opens a block inside a card
 * BODY — the order page's OneStop tab is the first (Subscriptions / Vessel
 * readings / Container events, 2026-09-17). The recipe above is typography
 * only, and `h3` has no rule of its own in this file, so without this the
 * heading would fall back to the browser's default block margin. Region rhythm,
 * one tier down from `h2`: loose above, tight below. Scoped to `.card` so it
 * cannot reach `.card-head h3` (the head's own rule, further down, owns that
 * one and it never wears .micro-label) or the page-scoped members
 * (.sched-group-head keeps its own bottom margin in pages/schedule.css). */
.card h3.micro-label {
  margin: var(--space-3xl) 0 var(--space-lg);
}

/* Button system (ADR-031 §3.1). The base is a class-OR-element rule so a link
 * can be a button too (`<a class="btn">`); tier modifiers (.btn-primary /
 * .btn-solid / .btn-ghost) and the size modifier (.btn-sm) layer on top. The
 * base carries the box, the type, border-box sizing, single-line labels
 * (white-space: nowrap — a wrapping label was expanding table rows), and the
 * hover transition (responsive feedback). Quiet outline is the default tier. */
button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2xs);
  background: var(--color-surface);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-2xs) var(--space-md);
  min-height: var(--btn-height);
  box-sizing: border-box;
  font-family: inherit;
  font-size: var(--text-body);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-base);
  color: var(--color-text);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color var(--motion-fast) ease,
    border-color var(--motion-fast) ease,
    color var(--motion-fast) ease,
    box-shadow var(--motion-fast) ease;
}
/* Ruling: the hover system — see docs/ui-direction.md §11. The flip lives
 * here on the BASE so the quiet tiers (.btn, .btn-sm, .btn-row, .btn-ghost)
 * all follow; the filled tiers re-assert their surface ink in their own
 * :hover (accent text on a dark fill would be illegible), and
 * .btn-accent/.btn:disabled already declare their own hover ink. */
button:hover,
.btn:hover {
  background: var(--color-surface-subtle);
  color: var(--color-accent-hover);
}
@media (prefers-reduced-motion: reduce) {
  button,
  .btn {
    transition: none;
  }
}

/* Ruling: the disabled-tier policy — see docs/ui-direction.md §11.
 *
 * Beats every tier on SPECIFICITY, not source order: button:disabled is
 * (0,1,1) and .btn:disabled (0,2,0), against (0,1,0) for .btn-primary /
 * .btn-solid / .btn-accent / .btn-ghost. So a disabled control reads as
 * unavailable whatever tier it carries — including a filled one — and no
 * per-tier override is needed. At most one disabled control ever renders in
 * the whole portal: the status band's blocked current-rung button. */
button:disabled,
.btn:disabled {
  background: var(--color-surface-subtle);
  border-color: var(--color-border);
  color: var(--color-text-faint);
  cursor: not-allowed;
  box-shadow: none;
}
/* Hover must not animate an action that cannot be taken. */
button:disabled:hover,
.btn:disabled:hover {
  background: var(--color-surface-subtle);
  border-color: var(--color-border);
  color: var(--color-text-faint);
  box-shadow: none;
}

/* In-flight submit (2026-08-05, data-busy — spec 2026-08-05-push-busy-
 * indicator). A form the enhancement layer (portal.js) marked `is-busy` is
 * mid-POST; for orders' Push that POST holds a live CargoWise round-trip.
 * The state composes the disabled treatment above — one visual language for
 * "not clickable now" — and appends a spinning ring in currentColor. The
 * label swap ("Pushing…") happens in portal.js, never CSS content, so
 * assistive tech hears it (aria-busy rides with the class). pointer-events
 * refuses the re-click; the push subscriber's idempotency key already made a
 * double POST harmless — this is feedback, not a correctness guard. Scoped
 * to ANY button in the busy container: the whole form is in flight. */
.is-busy button,
.is-busy .btn {
  background: var(--color-surface-subtle);
  border-color: var(--color-border);
  color: var(--color-text-faint);
  box-shadow: none;
  cursor: not-allowed;
  pointer-events: none;
}
.is-busy button::after,
.is-busy .btn::after {
  content: "";
  display: inline-block;
  width: var(--busy-size);
  height: var(--busy-size);
  margin-left: var(--busy-gap);
  vertical-align: middle;
  border: var(--busy-stroke) solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: busy-spin var(--motion-spin) linear infinite;
}
@keyframes busy-spin {
  to {
    transform: rotate(360deg);
  }
}
/* Reduced motion: the state must stay VISIBLE (the ring), only the spin
 * stops — matching the button base, whose transition also turns off. */
@media (prefers-reduced-motion: reduce) {
  .is-busy button::after,
  .is-busy .btn::after {
    animation: none;
  }
}

/* Button hierarchy — the ghost (tertiary/cancel) tier; primary/solid/base
 * already exist above. (ADR-031 §3.1) */
.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--color-text-muted);
}
/* Hover ink is the ACCENT flip, same as every other quiet tier (MG, 2026-08-02
 * — the worklist's Amend row: Confirm flipped orange, the Cancel beside it did
 * not). The base `button:hover` (0,1,1) already declares the flip and its
 * comment names .btn-ghost among the tiers that follow, but this rule (0,2,0)
 * beat it on specificity and re-asserted --color-text, so the ghost tier was
 * the ONE quiet tier still on the old two-language hover — including the
 * `<a class="btn btn-ghost">` links on the schedule, where the override rode a
 * (0,2,0) source-order tie with `.btn:hover` rather than a specificity win.
 * The ground step stays; only the ink joins the estate. */
.btn-ghost:hover {
  background: var(--color-surface-subtle);
  color: var(--color-accent-hover);
}

/* Compact in-row / in-panel tier: the size modifier for actions inside tables
 * and disclosure panels — rides --btn-height-sm (= --control-height, so a
 * trailing button aligns with its field input; the base already sets
 * border-box). Hover feedback comes from the base transition, plus the
 * shadow-lift the filled tiers (.btn-primary/.btn-solid) add. */
.btn-sm {
  min-height: var(--btn-height-sm);
  padding: var(--space-3xs) var(--space-sm);
}
/* Row-scale tier (2026-07-25 UAT sweep §1.2): an action that lives INSIDE a
 * table cell and must not set the row's height. .btn-sm is the in-PANEL tier —
 * it rides --btn-height-sm (= --control-height, so it lines up with a field
 * input), which is taller than a table cell's text line box, so a .btn-sm in a
 * td pushes the whole row taller than its neighbours (MG on UAT: the push
 * button expands the row). .btn-row drops to --target-min instead — the WCAG
 * 2.2 minimum pointer target, i.e. the floor, not a preference: a button
 * cannot shrink to the bare line box without becoming an illegal target.
 * --btn-height-sm is deliberately NOT retuned: it is coupled to
 * --control-height, and that coupling is what aligns a trailing .btn-sm with
 * a .field input everywhere else. Pair this tier with .cell-action on the td. */
.btn-row {
  min-height: var(--target-min);
  padding: 0 var(--space-sm);
  font-size: var(--text-meta);
}

input,
select,
textarea {
  padding: var(--space-xs) var(--space-lg);
  border: var(--border-width) solid var(--color-border-control);
  border-radius: var(--radius-md);
  font-size: var(--text-body);
  background: var(--color-surface);
  color: var(--color-text);
  transition:
    border-color var(--motion-fast) ease,
    box-shadow var(--motion-fast) ease;
}
/* A hint is text, so it takes the text floor rather than the UA's grey
 * (which differs by browser, and Firefox thins it further with opacity). */
input::placeholder,
textarea::placeholder {
  color: var(--color-text-placeholder);
  opacity: 1;
}
/* The drawn chevron (S-48): one arrow on every browser in place of each UA's
 * own. A list-box select (multiple, or size set) has no arrow to replace and
 * keeps its native paint. Rules that tint a select must set background-color,
 * never the background shorthand, or they erase the chevron. */
select:not([multiple]):not([size]) {
  appearance: none;
  -webkit-appearance: none;
  padding-right: var(--select-pad-end);
  background-image: var(--select-chevron);
  background-repeat: no-repeat;
  background-position: right var(--select-chevron-inset) center;
  background-size: var(--select-chevron-size);
}
/* After the base rule on purpose: a media query adds no specificity, so the
 * earlier reduced-motion block (buttons) could not switch this one off. */
@media (prefers-reduced-motion: reduce) {
  input,
  select,
  textarea {
    transition: none;
  }
}
/* Checkboxes and radios are exempt from the text-input recipe above (a native
 * control ignores its padding/border/background anyway) and instead take the
 * minimum pointer target. Untouched they render at roughly HALF the required
 * edge — about a quarter of the required area — which the 2026-07-25 audit found on all 25 of
 * planning's Override toggles and on sign-in's Remember box. accent-color puts
 * the brand orange on the tick instead of the UA default blue. */
input[type="checkbox"],
input[type="radio"] {
  width: var(--target-min);
  height: var(--target-min);
  padding: 0;
  border: 0;
  accent-color: var(--color-accent);
}

/* Checkbox/radio focus ring (2026-07-27 review, a11y HIGH). The global
 * `input:focus { outline: none }` above strips the UA ring from these too, but
 * the compensating cues it pairs with are both text-input cues: the
 * border-colour flip cannot fire on a control declared `border: 0`, and the
 * remaining --ring-accent-soft box-shadow is a 10%-opacity halo that is
 * invisible on white. On a screen whose entire interaction is ticking boxes,
 * that left keyboard users with no position indicator at all. Restore a real
 * outline — :focus-visible, so a mouse click does not draw it. */
input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible {
  outline: var(--focus-ring-width) solid var(--color-focus-ring);
  outline-offset: var(--focus-ring-offset);
}

/* Primary action — the accent's third job, RATIONED (slice 5.1 / ADR-031
 * §3.1): a page-level CTA (Sign in) or the ONE encouraged action inside an
 * open disclosure panel (exceptions' Confirm event / Resolve mismatch,
 * planning's Book) — never row-repeated in an always-visible table. Fills
 * with the AA-dark accent step. */
.btn-primary {
  background: var(--color-accent-strong);
  border-color: var(--color-accent-strong);
  color: var(--color-surface);
}
.btn-primary:hover {
  background: var(--color-accent-strong-hover);
  border-color: var(--color-accent-strong-hover);
  /* Keep the surface ink: the base hover's accent flip must not put orange
   * text on the accent fill. */
  color: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

/* Strong neutral action (slice 5.1 / ADR-031 §3.1): the stone-solid tier for
 * a strong action that is not the panel's single rationed primary — the
 * open-panel alternative (exceptions' Acknowledge) or a standalone strong
 * action (orders' filter Apply) — strong without spending the accent
 * budget. Never row-repeated in an always-visible table (that tier is quiet
 * .btn instead). Add facility / Set capacity moved to their card's single
 * .btn-primary with the Settings mock-fidelity pass (spec 2026-09-06 §3.9). */
.btn-solid {
  background: var(--color-btn-solid);
  border-color: var(--color-btn-solid);
  color: var(--color-surface);
}
.btn-solid:hover {
  background: var(--color-btn-solid-hover);
  border-color: var(--color-btn-solid-hover);
  /* Keep the surface ink against the base hover's accent flip (as above). */
  color: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

/* Ruling: the ADR-032 tier note — see docs/ui-direction.md §11. Hover/focus
 * DARKEN the ink with the tint (AA on the tinted ground needs the deeper
 * orange), and focus needs its own border flip — the shared
 * button:focus-visible flips to --color-accent, which is this tier's
 * RESTING border (a no-op here). */
.btn-accent {
  border-color: var(--color-accent);
  color: var(--color-accent-strong);
}
.btn-accent:hover {
  background: var(--color-accent-subtle);
  border-color: var(--color-accent-strong);
  color: var(--color-accent-strong-hover);
}
.btn-accent:focus-visible {
  background: var(--color-accent-subtle);
  border-color: var(--color-accent-strong-hover);
  color: var(--color-accent-strong-hover);
}

/* The order sheet's push form (slice 7a, spec S3 — this class's only
 * consumer now that the board's per-row push form retired outright, P1):
 * checkbox, confirm sentence and the CTA on one wrapping row, the .bulk-bar
 * shape (orders.html) transposed into the sheet's own .sheet-foot flex row.
 * Colour/sizing come from the shared button hierarchy (.btn-primary
 * .btn-sm — the accent-budget's own accounting, tokens.css). */
.push-form {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-md);
}

/* Post-action notices (the push outcome message), restyled by slice 5.1 to
 * the note-not-banner anatomy (CSS only — the template block is byte-
 * identical): a compact fit-content card on the plain surface with a
 * hairline chrome border, a state-coloured left rail plus a matching dot,
 * and NEUTRAL ink. One rule per Django default message level tag — the
 * mapping is TOTAL (success / error→danger / warning / info / debug→chrome
 * neutral), each rule retargeting only the --_notice-state custom property;
 * pinned by apps/portal/tests/test_flash_messages.py. The grid puts the dot
 * in its own column so both anatomies in the wild (bare text in an <li>, and
 * the auth pages' <p> runs inside a notice <div>) line up beside it.
 * list-style/padding/margin 0 are structural primitives. */
.messages {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-2xl);
}
/* portal.js focuses the region on arrival so it is announced; that focus is
 * programmatic, not a keyboard landing, so the generic [tabindex] ring —
 * a full-width accent outline around the list (MG 2026-10-17) — is not drawn. */
.messages:focus,
.messages:focus-visible {
  outline: none;
}
.notice {
  display: grid;
  grid-template-columns: auto 1fr auto;
  column-gap: var(--space-sm);
  align-items: center;
  width: fit-content;
  max-width: var(--notice-max-width);
  background: var(--color-surface);
  border: var(--border-width) solid var(--color-border);
  border-left: var(--notice-edge-width) solid var(--_notice-state, var(--color-border));
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: var(--space-sm) var(--space-lg);
  margin-bottom: var(--space-sm);
  font-size: var(--text-body);
  font-weight: var(--font-weight-normal);
  color: var(--color-text);
}
.notice::before {
  content: "";
  width: var(--dot-size);
  height: var(--dot-size);
  border-radius: var(--radius-full);
  background: var(--_notice-state, var(--color-border));
}
.notice > p {
  grid-column: 2;
  margin: 0;
}
/* A notice a person settles on the server (the order page's customer-container
 * notice, MG 2026-12-02): its one-button form takes the third column, where a
 * flash carries its script-only dismiss. */
.notice > form {
  grid-column: 3;
  margin: 0 0 0 var(--space-sm);
}
/* The dismiss control portal.js appends to each notice (MG 2026-10-17): a
 * bare × in the third column, muted until hovered, pointer-target sized.
 * Script-only, like the print control — a no-JS page carries no dead button. */
.notice-dismiss {
  grid-column: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--target-min);
  min-height: var(--target-min);
  margin: 0 calc(-1 * var(--space-sm)) 0 var(--space-sm);
  padding: 0;
  border: 0;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--color-text-muted);
  font-size: var(--text-emphasis);
  line-height: 1;
  cursor: pointer;
}
.notice-dismiss::before {
  content: "\00d7";
}
.notice-dismiss:hover,
.notice-dismiss:focus-visible {
  color: var(--color-text);
  background: var(--color-surface-hover);
}
.notice.success {
  --_notice-state: var(--color-success-border);
}
.notice.error {
  --_notice-state: var(--color-danger-border);
}
.notice.warning {
  --_notice-state: var(--color-warning-border);
}
.notice.info {
  --_notice-state: var(--color-info-border);
}
/* Debug is diagnostic, not a state: it keeps the chrome-border colour for
 * rail and dot (no saturated triad exists for it by design). Unreachable at
 * the default MESSAGE_LEVEL, but the tag→class mapping stays total so a
 * dev-only debug flash can never render without its rail. */
.notice.debug {
  --_notice-state: var(--color-border);
}

/* The command bar's search box. Named for the ROLE, not the worklist that
 * shipped it first (continuity audit 2026-08-02): six screens carry a
 * .filter-row and every one of the other five exhibited exactly the behaviour
 * the token below was minted to prevent. Goes on the flex item — which is the
 * wrapping <label> where the search carries one, and the <input> where it
 * does not. */
.filter-search,
.filter-row label.filter-search {
  /* Fixed basis, shrink-only (MG refinement 2026-08-01): a grow-to-fill
   * search stranded the Apply button at the far right of a wide screen. */
  flex: 0 1 var(--filter-search-width);
  min-width: var(--space-6xl);
}

/* The filter form inside the toolbar — every one of the seven lives in a
 * `.toolbar`, so this is a toolbar rule, not a page one. `flex: 1 1 auto` is
 * load-bearing (2026-09-01 review, docs/ui-direction.md §11 S-24): the form is
 * itself a wrapping flex container, and as a flex ITEM without a grow factor
 * it takes a content-ish width and wraps INSIDE the free space beside it
 * rather than claiming it — which is how Notes still broke to two rows after
 * the pin came off. No bottom margin: the toolbar owns the band's spacing. */
.filter-row {
  display: flex;
  flex: 1 1 auto;
  gap: var(--space-lg);
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 0;
}
.filter-row label {
  display: flex;
  flex-direction: column;
  gap: var(--space-3xs);
  font-size: var(--text-body);
  color: var(--color-text-muted);
}
/* One control height across the toolbar so the selects, the text/date/search
 * inputs, Apply and Clear all line up (they sit on the flex-end baseline). A
 * bare <input> otherwise matches only the global control recipe — no
 * min-height, and a larger font than the selects — which renders it short and
 * mismatched on the strip. Shared by BOTH filter strips that grew inputs in
 * the 2026-07-25 UAT sweep: the orders search/CW-job boxes (§1.5) and the
 * intake search + custom date range (§4). input[type="hidden"] is
 * display:none, so the broad selector costs nothing there. */
.filter-row select,
.filter-row input {
  min-height: var(--control-height);
  font-size: var(--text-body);
  box-sizing: border-box;
  /* This copy of the control recipe was the only one of four that omitted
   * font-family, so every command-bar select rendered on the UA font while the
   * same select inside a panel rendered on the house stack — one screen, two
   * typefaces (continuity audit 2026-08-02). */
  font-family: inherit;
}

/* Sortable column headers (UI slice 2 T1): the whole th content is a plain
 * link riding the existing th treatment — no extra visual weight beyond the
 * ▲/▼ text indicator (never an icon asset). */
.sort-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--target-min);
  color: inherit;
  text-decoration: none;
}
.sort-link:hover {
  color: var(--color-accent-hover);
}

.chip {
  font-size: var(--text-body);
  padding: var(--space-3xs) var(--space-md);
  border-radius: var(--radius-full);
  border: var(--border-width) solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-muted);
  text-decoration: none;
}
.chip:hover {
  border-color: var(--color-accent);
  color: var(--color-accent-hover);
}

/* Ruling: the chip-selected treatment — see docs/ui-direction.md §11. */
.chip-on {
  background: var(--color-accent-subtle);
  border-color: var(--color-accent);
  color: var(--color-accent-strong);
  font-weight: var(--font-weight-medium);
}
.chip-on:hover {
  color: var(--color-accent-strong-hover);
}

/* Chip-row wrapper classes (values unchanged, relocated from
 * pages/worklist.css — container page Task 7, 2026-09-04): the Events tab
 * reuses the same "labelled chip groups in one row, Clear on the right"
 * toolbar shape Worklist built (slice 7b, spec H3). worklist.html keeps
 * using these selectors unchanged; they move here so BOTH pages resolve
 * them — portal.css is the one stylesheet every page's linkage-guard set
 * is guaranteed to include (see test_ui_styling_discipline.py). */
.chip-rows {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm) var(--space-xl);
  margin-block-end: var(--space-3xl);
}
/* Label + its chip set wrap as ONE unit — a bare label at a line's end
 * (the orphaned SORT, caught on the refinement's visual pass) reads as
 * belonging to the previous group. */
.chip-group {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.chip-label {
  font-size: var(--text-micro);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wide);
  color: var(--color-text-faint);
}
.chip-set { display: flex; flex-wrap: wrap; gap: var(--space-2xs); }

/* --------------------------------------------------------------------------
 * Toolbar (slice 5 T1, promoted 2026-08-31): the ESTATE's ONE toolbar recipe
 * (spec ADR-0070, provisioning spec 2026-08-31; moves to split shell §8).
 * Direction is a SCOPE (segmented control, positions Import · Export with All
 * third on record lists, default Import) + active-narrow chips (FILTERS).
 * .segmented is the rounded-rect group the Schedule direction toggle already
 * was; .toolbar-field is the bordered control for native inputs on the UI font
 * (a bare <input type=date> renders in the browser's monospace, a bare search
 * in Arial — the two fonts MG saw in one row).
 *
 * ONE RUN FROM THE LEFT EDGE (2026-09-01 review; docs/ui-direction.md §11
 * S-24): scope, then search, then the narrows, then Apply/Clear — read in the
 * order they are used. The retired recipe pinned scope left and nav right,
 * which on Orders wrapped the form for want of a few dozen pixels while more
 * than a third of the row sat empty between the two clusters (the measured
 * numbers are in §11 S-24). `flex: 1 1 auto` on the form is load-bearing: as
 * a wrapping flex container it is sized as a flex ITEM, and without a grow
 * factor it takes a content-ish width and wraps INSIDE the free space rather
 * than claiming it. flex-end alignment sits the scope control on the input
 * baseline (the labels ride above their fields), which is what stops the
 * segmented floating mid-band. A narrow screen wraps the run in reading
 * order. Only page-level affordances pin right — see .view-toggle below. */
.toolbar { display: flex; align-items: flex-end; justify-content: flex-start; gap: var(--space-lg) var(--space-4xl); flex-wrap: wrap; margin-bottom: var(--space-2xl); }
.toolbar-scope, .toolbar-nav { display: flex; align-items: flex-end; gap: var(--space-lg); flex-wrap: wrap; }
.toolbar-nav { flex: 1 1 auto; flex-wrap: nowrap; }
/* TWO SECTIONS, the sanctioned exception to the one run (MG, 2026-09-01;
 * docs/ui-direction.md §11 S-24). A toolbar whose clusters genuinely FILL the
 * row reads better as two groups than as one chain — the Schedule is the only
 * one today (scope + nav leave barely any slack, where Orders left more than a
 * third of the row empty). Opt in per page; never on a toolbar with no
 * `.toolbar-scope`, where it would recreate the fault it is excepted from —
 * guarded in test_one_toolbar.py.
 *
 * It also switches the cross-axis to CENTRE, and that is not decoration: this
 * shape carries no stacked labels, so its items are inline controls of three
 * different heights (a bare text span, the segmented, the bordered fields).
 * Bottom-aligning those gives three different optical centres — which is what
 * dropped the Schedule's week-range date below its neighbours. The one-run
 * shape keeps flex-end because there the labels ride ABOVE their fields and
 * the inputs are what must line up. */
.toolbar--split { justify-content: space-between; align-items: center; }
/* Neither cluster grows: the free space belongs to the gap between the two
 * sections, which is what makes them read as sections. Both still shrink, so
 * a narrow screen degrades the same way the one run does. */
.toolbar--split .toolbar-scope,
.toolbar--split .toolbar-nav { align-items: center; flex: 0 1 auto; }

/* Filter panel (UI sweep 2026-10-04, MG's mock): the .toolbar-card's run
 * made roomier and given an Active filters row. Every group labelled above
 * its control (.toolbar-group for the direction), the search a full-width
 * bordered field with its glass, and beneath a hairline a chip per filter
 * that removes only itself, then "Clear all filters". The modifier keeps the
 * ONE toolbar recipe (one run from the left, flex-end on the inputs) and
 * only redefines the control heights inside it, so the one-height guard's
 * composites all grow together. Specimen: /portal/styleguide § Toolbar
 * card — filter panel. */
.toolbar--panel {
  --control-height: var(--control-height-panel);
  --btn-height: var(--control-height-panel);
  /* Labels ride on top of every group, so the groups line up from the TOP:
   * when the narrows wrap to a second line, the scope stays level with the
   * first one instead of sinking to the last. */
  align-items: flex-start;
}
.toolbar--panel .toolbar-group,
.toolbar--panel .filter-row label,
.filter-active-label {
  gap: var(--space-2xs);
  font-size: var(--text-body);
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
}
.toolbar--panel .filter-row { gap: var(--space-lg); }
/* The narrows sit BESIDE the scope and wrap inside their own run: a zero
 * basis, rather than the max-content one that drops the whole run beneath
 * the scope as soon as it cannot fit on one line (1280, operator Orders). */
.toolbar--panel .toolbar-nav {
  flex: 1 1 0;
  min-width: 0;
}
/* The split shape (Schedule) keeps its two sections: neither grows. */
.toolbar--split.toolbar--panel .toolbar-nav { flex: 0 1 auto; }
.toolbar--panel .toolbar-group .week-range { margin-left: var(--space-xs); }
/* In a panel the Schedule's search label rides ABOVE its field like every
 * other group's, not beside it. */
.toolbar--panel .toolbar-group .toolbar-label {
  align-self: flex-start;
  color: inherit;
}
/* A page affordance in the run (Notes' "Leave a note") sits on the
 * controls' line at their height and the card head's quiet link voice. */
.toolbar--panel .toolbar-link {
  align-self: flex-end;
  min-height: var(--control-height);
  font-size: var(--text-meta);
  font-weight: var(--font-weight-medium);
  color: var(--color-accent-strong);
  text-decoration: none;
}
.toolbar--panel .toolbar-link:hover,
.toolbar--panel .toolbar-link:focus-visible { text-decoration: underline; }
/* The card stretches the scope to the run's height (its divider spans it);
 * its group stays at the top, level with the first line of narrows. */
.toolbar--panel .toolbar-scope { align-items: flex-start; }
/* One control language inside the panel: the control border (3:1 against
 * the surface) on the bordered search too, the panel's radius and inline
 * room on the plain inputs and selects. */
.toolbar--panel .filter-row input:not([type="hidden"]),
.toolbar--panel .filter-row select {
  border-radius: var(--radius-lg);
  padding-inline: var(--space-md);
}
.toolbar--panel .toolbar-field { border-color: var(--color-border-control); }
/* Apply and Clear wrap as one unit — never Clear alone on a line. */
.filter-actions {
  display: flex;
  align-items: flex-end;
  gap: var(--space-sm);
}
/* The search takes the row's spare width; it still wraps whole below its
 * basis on a narrow screen. */
.toolbar--panel .filter-row label.filter-search { flex: 1 1 var(--filter-search-width); }
.toolbar--panel .filter-search .toolbar-field {
  width: var(--width-full);
  gap: var(--space-sm);
  padding: 0 var(--space-md);
}
/* The wrapper carries the height; the input inside fills it (stretch), so
 * the filter row's input min-height must not add the border on top. */
.toolbar--panel .filter-row .toolbar-field input {
  flex: 1;
  width: var(--width-full);
  min-height: 0;
  padding: 0;
}
.toolbar--panel .toolbar-field:focus-within {
  box-shadow: 0 0 0 var(--focus-ring-width) var(--color-accent-subtle);
}
.toolbar--panel .filter-row select { min-width: var(--filter-select-min); }
.toolbar--panel .filter-row .btn,
.toolbar--panel .filter-row .btn-primary { padding: 0 var(--space-xl); }

.filter-active {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm) var(--space-lg);
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: var(--border-width) solid var(--color-border);
}
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin: 0;
  padding: 0;
  list-style: none;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  min-height: var(--target-min);
  box-sizing: border-box;
}
.filter-chip .icon {
  width: var(--filter-chip-icon);
  height: var(--filter-chip-icon);
}
.filter-clear-all {
  margin-left: auto;
  font-size: var(--text-meta);
  color: var(--color-text-muted);
}
.filter-clear-all:hover,
.filter-clear-all:focus-visible { color: var(--color-accent-strong); }
/* A phone: every group takes the full width, the select with it, and Apply
 * and Clear share the last line half and half. */
@media (max-width: 768px) {
  .toolbar--panel .toolbar-scope,
  .toolbar--panel .toolbar-nav,
  .filter-actions,
  .toolbar--panel .toolbar-group,
  .toolbar--panel .filter-row label,
  .toolbar--panel .filter-row label.filter-search { flex: 1 1 var(--width-full); }
  .toolbar--panel .filter-row select { width: var(--width-full); }
  .toolbar--panel .toolbar-group > .toolbar-field { width: var(--width-full); }
  .toolbar--panel .toolbar-nav { flex-wrap: wrap; }
  .toolbar-card .toolbar--panel .toolbar-scope {
    padding-right: 0;
    border-right: 0;
  }
  .toolbar--panel .segmented { display: flex; }
  .toolbar--panel .segmented-item { flex: 1 1 0; justify-content: center; }
  .filter-actions .btn,
  .filter-actions .btn-primary { flex: 1 1 0; }
}
/* The two page-level affordances that are NOT part of the filter run: the
 * Orders view toggle and Notes' "Leave a note" jump. They keep the right
 * edge so the run reads as filters and these read as the page's own. */
.view-toggle, .toolbar-link { margin-left: auto; }
/* The toolbar CARD (Vessels first; spec 2026-09-05 §3.1): a bounded surface
 * around the UNCHANGED toolbar run — the .card recipe's own values so the
 * band and the KPI tiles below it read as one surface language. The run
 * keeps its flow-left, flex-end, one-control-height mechanics (S-24, S-26);
 * the card only gives it a boundary and takes over its bottom margin. */
.toolbar-card {
  background: var(--color-surface);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  padding: var(--space-lg) var(--space-2xl);
  margin-bottom: var(--space-2xl);
}
.toolbar-card .toolbar { margin-bottom: 0; }
/* A stacked label for a control that is not a <label> — the Direction and
 * Window segmenteds. Character-identical to `.filter-row label`, so a
 * labelled segmented and a labelled input read as one register. */
.toolbar-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-3xs);
  font-size: var(--text-body);
  color: var(--color-text-muted);
}
/* One hairline between the scope and the narrows — U-1's own boundary
 * (direction is a scope; everything after it is a filter). Stretch, so the
 * line spans label and control. A knob (spec §12). */
.toolbar-card .toolbar-scope {
  padding-right: var(--space-4xl);
  border-right: var(--border-width) solid var(--color-border);
  align-self: stretch;
}
/* The view toggle rides the toolbar's one control height too (§11 S-26) —
 * scoped to .view-toggle, because the topbar's own .icon-btn chrome sits in a
 * different row and keeps the --target-min square it was sized for. */
.view-toggle .icon-btn {
  min-height: var(--control-height);
  min-width: var(--control-height);
  box-sizing: border-box;
}
/* Apply and Clear size to the wider of the two labels (§11 S-26): they were
 * already the same height, padding, border and radius — the only difference
 * was the glyph width of the words themselves, which is what read as Clear
 * being the smaller button. */
.filter-row > button,
.filter-row > .btn { min-width: var(--btn-min-width-sm); }
/* A quiet in-page jump link riding beside the filter form in `.toolbar-nav`
 * (Notes' "Leave a note" anchor, spec H5) — the same target-size floor
 * `.section-nav a` gives an anchor-only nav link (2026-07-25 audit), not a
 * `.btn` tier: this is a page-scroll, not a write action. */
.toolbar-link { display: inline-flex; align-items: center; min-height: var(--target-min); white-space: nowrap; }
.segmented {
  display: inline-flex;
  align-items: stretch;
  /* One control height across the toolbar (MG, 2026-09-01; §11 S-26). The
   * items' own --target-min floor left the group shorter than the inputs and
   * buttons beside it, so the row carried three heights. border-box because
   * the group paints its own border: without it the min-height would size the
   * CONTENT and the border would push the group past the inputs instead of
   * landing on them. The items stretch into whatever this leaves. */
  min-height: var(--control-height);
  box-sizing: border-box;
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  overflow: hidden;
}
.segmented-item {
  display: inline-flex;
  align-items: center;
  /* A width floor as well as a height one (render sweep, first run): the week
   * pager's chevrons and the Settings/Styleguide segmented carry a single
   * glyph, so the padding alone left them under the pointer floor sideways.
   * Centred, because the floor now makes the box wider than its glyph. */
  justify-content: center;
  min-height: var(--target-min);
  min-width: var(--target-min);
  padding: 0 var(--space-md);
  font-size: var(--text-body);
  color: var(--color-text-muted);
  text-decoration: none;
  white-space: nowrap;
}
.segmented-item + .segmented-item { border-left: var(--border-width) solid var(--color-border); }
.segmented-item:hover { background: var(--color-surface-hover); color: var(--color-text); }
.segmented-item.is-active { background: var(--color-accent-subtle); color: var(--color-accent-strong); font-weight: var(--font-weight-medium); }
.week-range { font-size: var(--text-body); color: var(--color-text-muted); font-variant-numeric: var(--font-numeric); white-space: nowrap; }
.toolbar-field {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  /* The toolbar's one control height (MG, 2026-09-01; §11 S-26), not the
   * bare --target-min floor: this field sits beside the segmented and the
   * filter inputs and has to land on their outline. */
  min-height: var(--control-height);
  box-sizing: border-box;
  padding: 0 var(--space-xs) 0 var(--space-sm);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  color: var(--color-text-muted);
}
.toolbar-field:focus-within { border-color: var(--color-accent); }
.toolbar-field input {
  border: none;
  background: none;
  font: inherit;
  font-size: var(--text-body);
  color: var(--color-text);
  min-width: 0;
  padding: 0;
  /* the input fills the wrapper's height so the bordered wrapper's box IS
   * the activation area (S-26; render sweep 2026-09-08) */
  align-self: stretch;
}
/* The wrapper draws the focus (border + ring, :focus-within); the input's own
 * ring from the global input:focus would be a second one inside it. */
.toolbar-field input:focus { outline: none; box-shadow: none; }
.toolbar-field input::placeholder { color: var(--color-text-faint); }
/* The jump-to-date keeps its intrinsic width; the search takes a fixed width
 * (an explicit width, not a flex-basis — the nav row sizes itself from its
 * children's intrinsic widths, and a basis alone leaves the search shrunk to
 * the input's default) and still shrinks on a narrow row. */
.toolbar-jump { flex: none; }
.toolbar-search { width: var(--toolbar-search-width); flex: 0 1 auto; }
.toolbar-search input { flex: 1; width: var(--width-full); }
.toolbar-go {
  display: inline-flex;
  align-items: center;
  border: none;
  background: none;
  padding: 0;
  /* Drop the BASE button min-height (--btn-height): this is a bare
   * icon inside .toolbar-field, and an invisible child that tall was what
   * inflated the Schedule's search and jump fields past every other control
   * in the row (MG, 2026-09-01; §11 S-26). --target-min keeps it a legal
   * pointer target (S-13) while fitting inside the field's own height. */
  min-height: var(--target-min);
  /* The same floor sideways (render sweep, first run: the button was barely
   * wider than its own glyph). It is an independent submit target inside
   * .toolbar-field — S-26's "the wrapper is the control" covers the field's
   * INPUTS, not this — and the field's input gives the width back by
   * shrinking (min-width: 0). */
  min-width: var(--target-min);
  justify-content: center;
  color: var(--color-text-muted);
  cursor: pointer;
}
/* Ink-flip on hover (slice 8a B4) — was --color-text, a near-miss off the
 * estate's one hover system: every other quiet text control (a:hover,
 * .sort-link:hover, .chip:hover, .auth-help/.auth-links a:hover) flips to
 * --color-accent-hover, not the plain text ink. */
.toolbar-go:hover { color: var(--color-accent-hover); }
.toolbar-clear { color: var(--color-text-muted); text-decoration: none; font-size: var(--text-body); padding: 0 var(--space-2xs); }
.toolbar-clear:hover { color: var(--color-accent-hover); }
.toolbar-label {
  font-size: var(--text-body);
  color: var(--color-text-muted);
  /* This label sits BESIDE its control (the Schedule's search), not above it,
   * so it centres against the box — the toolbar's flex-end baseline would
   * otherwise drop the text to the control's bottom edge. */
  align-self: center;
}
.kpi-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: var(--kpi-icon-size); height: var(--kpi-icon-size);
  border-radius: var(--radius-md);
  background: var(--_stage-dot, var(--color-neutral-text)); color: var(--color-surface);
}
.kpi-link { font-size: var(--text-meta); display: inline-flex; align-items: center; gap: var(--space-2xs); min-height: var(--target-min); }
.kpi-link .icon { width: var(--space-lg); height: var(--space-lg); }
/* The banner LEADS the Dashboard now, above the tiles (final review
 * 2026-09-26) — spacing below it, not above; and its sentence is body size:
 * at meta size the call to action read smaller than the greeting. */
.action-banner { display: flex; align-items: center; gap: var(--space-lg); margin-bottom: var(--space-lg); }
.banner-copy { flex: 1; min-width: 0; }
.banner-copy strong { font-size: var(--text-section); } /* S-44 */
.banner-copy p { margin: 0; font-size: var(--text-body); color: var(--color-text-muted); }

/* =========================================================================
 * Pill — ONE capsule geometry for every status-like token (review
 * 2026-08-30 T1; spec S1/S2). Stage modifiers (.stage-N, .stage-group-N)
 * and state tones (.pill--<tone>) both retarget --_stage-bg/-ink/-dot; the
 * pill itself is one rule. Ruling: text rides WITH the colour, never
 * colour-alone — see docs/ui-direction.md §11.
 * ========================================================================= */
.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-3xs) var(--space-md);
  border-radius: var(--radius-full);
  background: var(--_stage-bg, var(--color-neutral-bg));
  color: var(--_stage-ink, var(--color-neutral-text));
  font-size: var(--text-meta);
  font-weight: var(--font-weight-medium);
  white-space: nowrap;
  text-decoration: none;
}
.pill::before {
  content: "";
  width: var(--dot-size);
  height: var(--dot-size);
  border-radius: var(--radius-full);
  background: var(--_stage-dot, var(--color-neutral-text));
  flex: none;
}
/* A pill that is a link keeps its own ink on hover — the global accent flip
 * would contradict the tone inside the capsule (the old a.slab rule). */
a.pill:hover { color: var(--_stage-ink, var(--color-neutral-text)); }
.pill--success { --_stage-bg: var(--color-success-bg); --_stage-ink: var(--color-success-text); --_stage-dot: var(--color-success-border); }
.pill--info    { --_stage-bg: var(--color-info-bg);    --_stage-ink: var(--color-info-text);    --_stage-dot: var(--color-info-border); }
.pill--warning { --_stage-bg: var(--color-warning-bg); --_stage-ink: var(--color-warning-text); --_stage-dot: var(--color-warning-border); }
.pill--danger  { --_stage-bg: var(--color-danger-bg);  --_stage-ink: var(--color-danger-text);  --_stage-dot: var(--color-danger-border); }
.pill--neutral { --_stage-bg: var(--color-neutral-bg); --_stage-ink: var(--color-neutral-text); --_stage-dot: var(--color-text-faint); }

/* The container page's Documents tab (spec 2026-09-04 §4.6): a marker on an
 * order document whose extracted facts name this box. */
.doc-mark { font-size: var(--text-micro); color: var(--color-accent-strong); margin-left: var(--space-2xs); }

.stage-1 { --_stage-bg: var(--stage-1-bg); --_stage-ink: var(--stage-1-ink); --_stage-dot: var(--stage-1-dot); }
.stage-2 { --_stage-bg: var(--stage-2-bg); --_stage-ink: var(--stage-2-ink); --_stage-dot: var(--stage-2-dot); }
.stage-3 { --_stage-bg: var(--stage-3-bg); --_stage-ink: var(--stage-3-ink); --_stage-dot: var(--stage-3-dot); }
.stage-4 { --_stage-bg: var(--stage-4-bg); --_stage-ink: var(--stage-4-ink); --_stage-dot: var(--stage-4-dot); }
.stage-5 { --_stage-bg: var(--stage-5-bg); --_stage-ink: var(--stage-5-ink); --_stage-dot: var(--stage-5-dot); }
.stage-6 { --_stage-bg: var(--stage-6-bg); --_stage-ink: var(--stage-6-ink); --_stage-dot: var(--stage-6-dot); }
.stage-7 { --_stage-bg: var(--stage-7-bg); --_stage-ink: var(--stage-7-ink); --_stage-dot: var(--stage-7-dot); }
.stage-group-1 { --_stage-bg: var(--stage-group-1-bg); --_stage-ink: var(--stage-group-1-ink); --_stage-dot: var(--stage-group-1-dot); }
.stage-group-2 { --_stage-bg: var(--stage-group-2-bg); --_stage-ink: var(--stage-group-2-ink); --_stage-dot: var(--stage-group-2-dot); }
.stage-group-3 { --_stage-bg: var(--stage-group-3-bg); --_stage-ink: var(--stage-group-3-ink); --_stage-dot: var(--stage-group-3-dot); }
.stage-group-4 { --_stage-bg: var(--stage-group-4-bg); --_stage-ink: var(--stage-group-4-ink); --_stage-dot: var(--stage-group-4-dot); }

/* Fused status header (order detail, spec 2026-07-31): the H1 row carries
 * the order's identity chips — direction slab, state badge, and (exports
 * only) the sender's declared status — so identity is consumed before any
 * scrolling. A LEFT cluster, not .page-header's justified row. */
.order-head {
  display: flex;
  /* center, not baseline (MG visual review 2026-09-22): the slab and the
   * pill are padded capsules, and a baseline row seats them a hair below
   * the H1's centre line. */
  align-items: center;
  gap: var(--space-xl);
  flex-wrap: wrap;
}
.order-head h1 {
  margin: 0;
}
/* Direction slab: uppercase micro-type on a quiet tint. Unlike a danger-tone
 * pill (the licensed danger capsule, retired as .slab, 2026-08-30) it
 * carries no dot — direction is a fact, not a state. */
.dir-slab {
  display: inline-flex;
  align-items: center;
  padding: var(--space-3xs) var(--space-md);
  border-radius: var(--radius-full);
  font-size: var(--text-meta);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--letter-spacing-wide);
  text-transform: uppercase;
}
.dir-slab--import {
  background: var(--direction-import-bg);
  color: var(--direction-import-text);
}
.dir-slab--export {
  background: var(--direction-export-bg);
  color: var(--direction-export-text);
}
/* A chip in a table cell is compact (MG 2026-11-13, every surface): at its
 * full block padding a stage pill or a direction slab is taller than a line
 * of text, so any row holding one stood taller than its plain neighbours
 * (the customer Overview's Vessels card beside its Cost watch; the Orders
 * tables). In a desktop table cell the chip keeps a hairline of block
 * padding and gives that hairline back as margin, so the row is exactly a
 * text row's height. The narrow card (.table-cards below the tablet tier)
 * stacks its lines and keeps the full chip. */
@media (min-width: 769px) {
  td .pill,
  td .dir-slab {
    padding-block: var(--border-width);
    margin-block: calc(-1 * var(--border-width));
  }
}
/* The sender's own lifecycle claim beside our derived state (exports only) —
 * quiet meta voice; disagreement between the two is the signal. */
.declared-note {
  font-size: var(--text-meta);
  color: var(--color-text-muted);
}

/* Temperature-class chips — .tclass, NOT a danger-tone pill (formerly
 * .slab, the licensed danger capsule, dot + tint, used by intake/orders —
 * redefining it here once broke those screens, caught on the deploy's
 * visual pass). Class is a fact, not a state — no dot, its own quiet cool
 * pair from tokens. */
.tclass {
  display: inline-flex;
  align-items: center;
  font-size: var(--text-meta);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--letter-spacing-wide);
  padding: var(--space-3xs) var(--space-md);
  border-radius: var(--radius-full);
  text-transform: uppercase;
}
.tclass-ambient { background: var(--class-ambient-bg); color: var(--class-ambient-text); }
.tclass-chilled { background: var(--class-chilled-bg); color: var(--class-chilled-text); }
.tclass-frozen { background: var(--class-frozen-bg); color: var(--class-frozen-text); }

/* Priority star — .sched-flag. Named for the Schedule, where it was born
 * (a corner mark on a grid cell), but shipped on SIX surfaces now: that grid
 * cell, the Schedule's own list row, the Schedule sheet, the
 * Order -> Containers sheet, the order sheet's box list, and the container
 * page's own priority form. The component layer is therefore its home —
 * a page file cannot own a mark five other surfaces render.
 *
 * The base is IN FLOW, deliberately. It used to be `position: absolute` —
 * the grid CELL's shape — with every in-flow host expected to reset it to
 * static beside its own layout. That default is backwards: one host of six
 * wants absolute, and a host that forgets the reset does not degrade, it
 * escapes. The star anchors to the nearest positioned ancestor, which for a
 * sheet is the fixed panel (stars stack in its corner, unclippable) and for
 * the container page is nothing at all — so it landed at the document's
 * top-left, behind the brand mark, and a flagged container showed no star on
 * its own record page. Two hosts shipped that bug in two days.
 *
 * So: static here, and the one host that wants a corner mark opts IN
 * (`.sched-cell .sched-flag`, pages/schedule.css — the cell owns its own
 * shape, including the z-index and the line-height that sizes the badge). */
.sched-flag {
  color: var(--color-accent);
  font-size: var(--text-micro);
}

/* Swatch — a raw colour sample (styleguide's colour-tokens section only,
 * slice 8a Task 5). The pills/dir-slabs/tclass above render a TONE
 * (bg+ink+dot, mixed by the component); a swatch is the token's colour
 * ALONE, for reading the value itself. Semantic tokens only, kept to a
 * small set — the raw --ramp-* primitives have no consumer of their own
 * and stay unswatched (read them in tokens.css). */
.swatch {
  display: inline-flex;
  width: var(--space-2xl);
  height: var(--space-2xl);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-md);
  flex: none;
}
.swatch--accent  { background: var(--color-accent); }
.swatch--success { background: var(--color-success-border); }
.swatch--warning { background: var(--color-warning-border); }
.swatch--danger  { background: var(--color-danger-border); }
.swatch--info    { background: var(--color-info-border); }
.swatch--neutral { background: var(--color-neutral-bg); }

/* Attention glyph (spec S6): severity is the alert icon + a text label
 * (sr-only in dense ledgers, visible where there is room) — never a bare
 * colour dot. Replaces .dsev and .attn-icon (one status language,
 * 2026-08-30) — the vessel row's concern slabs/badges and the order row's
 * "N open exceptions" slab collapse to this ONE clickable alert icon, inked
 * by severity; the full labels move into title/aria (hover/screen-reader
 * detail) rather than rendering as body text. Sizing/ink only: geometry and
 * default stroke colour (currentColor) live on .icon itself (_icons.html's
 * sprite is stroke-based, no fill), so the tone modifiers only need to set
 * the ink — inline-flex keeps the icon's baseline aligned with its
 * neighbours exactly like every other .icon usage in this file. */
.attn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
}
.attn .icon { width: var(--icon-size); height: var(--icon-size); }
.attn--critical { color: var(--color-danger-border); }
.attn--warning { color: var(--color-warning-border); }
.attn--ack { color: var(--color-text-faint); }
a.attn { position: relative; }
a.attn::after {
  content: "";
  position: absolute;
  inset: calc((var(--icon-size) - var(--target-min)) / 2) calc(-1 * var(--space-2xs) / 2);
}

/* Ruling: the gate-dot vocabulary note — see docs/ui-direction.md §11.
 *
 * "pending" (both screens' not-yet-reached state) has no rule at THIS scope
 * — it is the bare .gate-dot hollow, so .gate-pending alone resolves to the
 * base. The status-band rungs step that up: see the band-scoped
 * .gate-dot.gate-pending override further down (status-band section) for
 * the stronger outline used there; the container gate strip keeps the base
 * hollow untouched. */
.gate-strip {
  display: flex;
  gap: var(--space-2xs);
  align-items: center;
}
/* The key beneath the containers table (MG 2026-09-22): gate names in scan
 * order, then the four dot states inline. The dots here are specimens of
 * the strip's own vocabulary, spaced so each word sits beside its dot. */
.gate-key { margin: var(--space-sm) 0 0; }
.gate-key-states { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--space-2xs) var(--space-md); margin-left: var(--space-sm); }
/* Each specimen is its own dot-and-word pair with a breath between the two
 * (MG 2026-09-22, round 2 — the dots sat against their words); the wider
 * gap above separates one pair from the next. */
.gate-key-item { display: inline-flex; align-items: center; gap: var(--space-2xs); }
/* display/vertical-align (review fix, 2026-09-04, Task 2 fix round 2): every
 * existing site is a flex/grid item, which blockifies the box the width/
 * height below already assumed — but a non-replaced inline element ignores
 * both outside such a container, so a plain inline parent (the Milestones
 * rail's Gates <dt>) collapsed the dot to a sliver. Safe estate-wide: flex/
 * grid containers still blockify their children regardless of this rule, so
 * every prior site (.gate-strip, .mlleg, the retired .band-step, the Schedule cells)
 * renders unchanged; only an inline parent newly gets the intended dot. */
.gate-dot {
  display: inline-block;
  vertical-align: middle;
  width: var(--space-sm);
  height: var(--space-sm);
  border-radius: var(--radius-full);
  background: var(--color-surface);
  border: var(--border-width) solid var(--color-border);
  flex: none;
}
.gate-done {
  background: var(--color-success-border);
  border-color: var(--color-success-border);
}
.gate-current {
  background: var(--color-surface);
  border-color: var(--color-accent);
  border-width: var(--border-width-thick);
}
/* Needs attention is a DIAMOND (MG ruling 16, 2026-09-26; ui-direction §11
 * S-32): done and needs-attention differed by hue alone, unreadable to a
 * colour-blind operator. Every other state stays a circle, so the one state
 * that asks for action is the one different shape. The clip is the shape;
 * the scale restores the visual weight a diamond loses (it covers half its
 * box) without moving layout, so strips keep their spacing. */
.gate-attention {
  background: var(--color-danger-border);
  border-color: var(--color-danger-border);
  border-radius: 0;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  transform: scale(1.25);
}
/* Ruling: the gate-dot vocabulary note (the board's fill-only variant) —
 * see docs/ui-direction.md §11. */
.gate-partial {
  background: linear-gradient(90deg, var(--color-warning-border) 50%, var(--color-surface) 50%);
  border-color: var(--color-warning-border);
}
.gate-idle {
  background: var(--color-surface);
  border-color: var(--color-text-faint);
}

/* DisclosureList — the expand-to-act list (ADR-031 §3.6). Real boxes + a
 * composed grid: the 2026-07-07 container-decomposition finding is that
 * display:contents breaks <details> closed-state hiding, so every element
 * keeps a box and columns align by shared grid-template-columns. Ruling:
 * action forms live in the PANEL, never in <summary> — see
 * docs/ui-direction.md §11. */
.disclosure-list {
  background: var(--color-surface);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.dhead,
.dscan {
  display: grid;
  /* Last column is a FIXED width (not auto): the summary's caret would
   * otherwise widen the auto column vs the header's empty one, compressing the
   * fr columns and nudging Status/Age left of their headers. First column
   * widened dot-size -> icon-size (one status language, 2026-08-30, spec S6):
   * the leading cell used to hold a bare .dsev dot, now the .attn glyph
   * (order_detail.html's un-scoped exceptions list is the one consumer). */
  grid-template-columns: var(--icon-size) 2.4fr 1fr 0.8fr var(--space-3xl);
  gap: var(--space-lg);
  align-items: center;
  padding: var(--cell-pad-y) var(--cell-pad-x);
}
/* Typography is the shared .micro-label recipe (slice 8a B3); only the
 * header fill and its bottom rule stay on this selector. */
.dhead {
  background: var(--color-surface-header);
  border-bottom: var(--border-width) solid var(--color-border);
}
.drow {
  border-bottom: var(--border-width) solid var(--color-border);
}
.drow:last-child {
  border-bottom: 0;
}
.dscan {
  cursor: pointer;
  list-style: none;
}
.dscan::-webkit-details-marker {
  display: none;
}
.dscan:hover {
  background: var(--color-surface-hover);
}
/* Acknowledged rows (§2.4) stay distinguishable at scan level: triaged reads
 * calmer — muted ink, neutral tint (held on hover so the row stays visually
 * stable, as the retired tr.acknowledged treatment did); the leading .attn
 * glyph's own .attn--ack modifier mutes its ink (one status language,
 * 2026-08-30 — replaces the retired .drow--ack .dsev rule). Two selector
 * shapes, same as .drow.is-completed below: the nested one for a
 * <details>/<summary> host (order_detail.html's un-migrated twin), the
 * compound one for a link-row host where .drow and .dscan are the SAME
 * element (exceptions.html, spec S2). */
.drow--ack > .dscan,
.drow--ack.dscan {
  background: var(--color-neutral-bg);
  color: var(--color-text-muted);
}
.drow--ack > .dscan:hover,
.drow--ack.dscan:hover {
  background: var(--color-neutral-bg);
}
/* …including the age: .dage--critical sets ink directly (inheritance can't
 * mute it), so the triaged row needs its own counterpart. */
.drow--ack > .dscan .dage,
.drow--ack.dscan .dage {
  color: var(--color-text-muted);
  font-weight: var(--font-weight-normal);
}
/* .dwhat/.dctx (the stacked headline + context cell) retired estate-wide on
 * 2026-09-04 — the last two consumers (the containers rows, the order
 * detail's exceptions list) moved onto single-line .dcell columns, the
 * shape every other row has had since 2026-08-01. */
.dname {
  font-weight: var(--font-weight-semibold);
  font-size: var(--text-emphasis);
}
/* A row's NAME is the row's headline, not a link in prose: when it is an
 * anchor (the dashboard rail) it keeps the slate ink and no underline, as the
 * whole disclosure row is the target (MG ruling 2026-10-19). */
a.dname {
  color: inherit;
  text-decoration: none;
}
.dstatus {
  font-size: var(--text-meta);
  color: var(--color-text-muted);
  text-transform: capitalize;
}
.dage {
  font-size: var(--text-meta);
  color: var(--color-text-muted);
  text-align: left;
}
.dage--critical {
  color: var(--color-danger-text);
  font-weight: var(--font-weight-semibold);
}
/* Caret via content swap (no transform) — matches the container-row precedent. */
.dcaret::before {
  content: "\25B8" / ""; /* ▸ closed */
  color: var(--color-text-faint);
}
.drow[open] .dcaret::before {
  content: "\25BE" / ""; /* ▾ open */
}
.dpanel {
  padding: var(--space-lg) var(--cell-pad-x);
  background: var(--color-surface-subtle);
  border-top: var(--border-width) solid var(--color-border);
  display: grid;
  gap: var(--space-2xl);
}
/* ActionGroup — a titled block of writes. Bare selectors, NOT .dpanel-scoped
 * (continuity audit 2026-08-02): PR #96 promoted .action-bar to a shared
 * component but left its three companions descendant-scoped, so every use
 * outside a disclosure panel — the schedule's and intake-detail's page-level
 * write blocks — rendered with no gap, no hairline and heading text at plain
 * body weight. The class was spelled correctly and did nothing, which is
 * invisible to a screen author. Each carries a class of its own, so there is
 * no specificity risk against .dpanel descendants. */
.action-group {
  display: grid;
  gap: var(--space-sm);
  padding-top: var(--space-lg);
  border-top: var(--border-width) dashed var(--color-border);
  max-width: var(--form-max-width);
}
.action-group .heading {
  font-size: var(--text-meta);
  color: var(--color-text-muted);
  font-weight: var(--font-weight-semibold);
}
/* ActionBar — the panel's aligned multi-form action row (worklist order
 * actions, exceptions actions; MG refinement 2026-08-01): each form is a
 * .field-row, all bottom-aligned on one wrapping line, a hairline between
 * forms so distinct verbs read as distinct without stranding the last one
 * at the panel's far edge. The shared .action-group form cap
 * (--form-max-width) is too tight for a one-row bar — a button wraps under
 * its own fields — so the --bar modifier opts out. Free-text reason inputs
 * take a fixed comfortable basis (never .grow: a grow factor inflates the
 * form's intrinsic width inside the bar and wraps its button — the
 * worklist's live-caught lesson). */
.action-group.action-group--bar {
  max-width: none;
}
.action-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-lg);
}
.action-bar > form + form {
  border-inline-start: var(--border-width) solid var(--color-border);
  padding-inline-start: var(--space-lg);
}
.action-bar input[type="text"] {
  width: var(--reason-input-width);
}
/* The narrow card (ADR-0074 §3, spec 2026-09-08-mobile-ready-design.md):
 * below the narrow tier a scan line is a three-line card — key and tags on
 * line 1 with the caret pinned right, context on line 2, facts on line 3 —
 * placed by ROLE, never by screen. The row becomes a wrapping flex line;
 * placement is `order`; the two line breaks are the row's own pseudo-
 * elements at full basis, so no page adds markup or CSS. An untagged cell
 * lands on the context line (order 5). A fact wears its accessible label:
 * the .sr-only span every fact already carries is restored to flow as a
 * micro-label, so a bare date reads "ETA: Tue 1 Sep"; a fact whose value
 * names itself (a pill, a gate strip) adds .role-bare to keep it hidden.
 *
 * Scoped :not(.digest-strip) for two reasons: the capacity digest's own
 * .dscan--digest line keeps its shape, and the selector lands at (0,3,0) —
 * above every .dscan.dscan--<screen> at (0,2,0) whatever file order does.
 * That order is what killed the old "tablet collapse" here: after the
 * slice-8a split the page files loaded AFTER this one at equal specificity
 * and their desktop grids won (found 2026-09-08 at iPhone width). Belt: the
 * page grids now live inside the desktop-only prelude — ui-direction §11 S-28.
 *
 * The @media prelude is the styling guard's ONE dimension carve-out
 * (tests/test_ui_styling_discipline.py); every declaration inside is a
 * token or a keyword. The recipe's declarations are pinned by
 * tests/test_narrow_viewport_discipline.py. */
@media (max-width: 768px) {
  .dhead {
    display: none;
  }
  .disclosure-list:not(.digest-strip) .dscan {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2xs) var(--space-md);
  }
  .disclosure-list:not(.digest-strip) .dscan > * {
    order: 5;
    min-width: 0;
  }
  /* Clipping relaxes on the card: nothing truncates, everything wraps. */
  .disclosure-list:not(.digest-strip) .dscan > .dcell-clip {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
  .disclosure-list:not(.digest-strip) .dscan > .role-key {
    order: 1;
  }
  .disclosure-list:not(.digest-strip) .dscan > .role-tag {
    order: 2;
  }
  .disclosure-list:not(.digest-strip) .dscan > .dcaret {
    order: 3;
    margin-left: auto;
  }
  .disclosure-list:not(.digest-strip) .dscan::before,
  .disclosure-list:not(.digest-strip) .dscan::after {
    content: "";
    flex-basis: 100%;
    height: 0;
  }
  .disclosure-list:not(.digest-strip) .dscan::before {
    order: 4;
  }
  .disclosure-list:not(.digest-strip) .dscan::after {
    order: 6;
  }
  .disclosure-list:not(.digest-strip) .dscan > .role-ctx {
    color: var(--color-text-muted);
  }
  .disclosure-list:not(.digest-strip) .dscan > .role-fact {
    order: 7;
  }
  .disclosure-list:not(.digest-strip) .dscan > .role-fact > .sr-only {
    position: static;
    width: auto;
    height: auto;
    margin: 0 var(--space-3xs) 0 0;
    overflow: visible;
    clip: auto;
    clip-path: none;
    white-space: normal;
    font-size: var(--text-micro);
    color: var(--color-text-faint);
  }
  .disclosure-list:not(.digest-strip) .dscan > .role-fact.role-bare > .sr-only {
    position: absolute;
    width: var(--border-width);
    height: var(--border-width);
    margin: calc(-1 * var(--border-width));
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
  }
  /* An actual date's ATA/ATD mark (spec 2026-09-13 R7) is aria-hidden on the
   * desktop row, where the sr-only prefix is invisible. On the card that
   * prefix is restored to flow above and already names the reading, so the
   * mark would say it twice: it hides, and the card reads "ATA: Tue 25 Aug". */
  .disclosure-list:not(.digest-strip) .dscan > .role-fact > .micro-label {
    display: none;
  }
  /* The content gutter tightens with the tier: --space-4xl each side left
   * 308 of 352 usable at phone width. */
  .shell-content {
    padding: var(--space-lg) var(--space-md) var(--space-2xl);
  }
  /* The toolbar's nav row wraps in the narrow tier (walk finding 2026-09-08:
   * the Schedule's row — pager, range, jump field, search — ran past the
   * viewport). Desktop keeps S-24's single run (nowrap, portal.css .toolbar-nav). */
  .toolbar-nav {
    flex-wrap: wrap;
  }
  /* The stepper's phone recipe lives beside its base rule (the .stepper block
   * further down): it used to sit here, BEFORE the base rule, and lost to it
   * on source order at equal specificity — the strip never rendered (found
   * on the order page, 2026-09-15). */
  /* A card head is a single row of title + actions on desktop; below the tier
   * the actions take their own line rather than crushing the title into a
   * one-word column (render sweep, first run: Settings' Capacity card
   * squeezed "Capacity planning" into a column barely one word wide and
   * still ran its week pager past the viewport). The actions wrap in turn,
   * so a pager and a date range take two lines rather than one over-wide
   * one. */
  .card-head,
  .head-actions {
    flex-wrap: wrap;
  }
  /* A segmented control WRAPS in the narrow tier rather than scrolling: every
   * tab stays visible (the objection to scrolling a grid in-frame applies to
   * a tab row too). Found by the render sweep's first CI run — the
   * Notifications tabs fit a phone viewport on macOS and overran it on the
   * Linux runner, whose text rasterises a few pixels wider. */
  .segmented {
    flex-wrap: wrap;
  }
}

/* The quiet fold (spec docs/superpowers/specs/
 * 2026-08-04-schedule-panel-split-v3-design.md §2): an inline <details>
 * disclosure whose summary reads as a quiet row, not a control. Merges the
 * character-identical treatments .vendor-ingest > summary and
 * .notes-exits > summary carried separately (the DigestStrip merge
 * precedent) — those bespoke rules retire with this. Declaration set is
 * TRANSCRIBED verbatim from the merged pair (git show 87178be), not
 * re-derived: same font-size token (--text-body, re-mapped from the
 * retired --font-size-sm — slice 8a B2), the same
 * --target-min WCAG pointer-target floor, same colour, same cursor — no
 * padding line (the originals carried none) and no [open] state rule (the
 * originals had none; not ours to invent). */
.fold > summary {
  cursor: pointer;
  font-size: var(--text-body);
  color: var(--color-text-muted);
  min-height: var(--target-min);
}

/* The movement ladder's list anatomy (spec v3 docs/superpowers/specs/
 * 2026-08-04-qube-movement-dhl-v3-design.md): milestone rungs inside the
 * rail's .dmoves-ladder. Rung state reuses the shared .gate-dot vocabulary
 * (dot states stay screen-agnostic, ADR-031); only the list anatomy is new.
 * Times read "reported …" — when Qube told us, never a claimed action time
 * (session rulings R2/R3). The current step gets both the accent dot
 * (.gate-current) and a bolded label (.mlleg.is-current) — DHL-style, so the
 * "you are here" step is unmistakable at a glance. Signals (.mlsub, defined
 * above beside the rail's other layout rules) are a visible SUBSET of their
 * milestone — smaller and lighter (--text-micro vs --text-body), clearly
 * subordinate (ruling W2). .mlhead's own typography is the shared
 * .micro-label recipe (slice 8a B3 — its ink lifted muted → faint to join
 * it, matching every other micro-heading in the estate).
 *
 * Three columns (MG walk 2026-09-03): every row is dot · step · report on
 * the SAME grid template, so the step column ends at one edge down the whole
 * ladder and every report — first, second, signal — starts under one
 * column, the way the sheet's .kv sections read. A second report fills the
 * report column alone; a signal puts its smaller label in the step column,
 * nudged in, and its report beside it. Long OneStop reports wrap inside the
 * report column, never past the step edge. */
.mllist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-2xs);
}
.mlleg,
.mlreport,
.mlsub {
  display: grid;
  grid-template-columns: var(--icon-size) var(--ml-step-col) minmax(0, 1fr);
  column-gap: var(--space-sm);
  align-items: start;
}
.mlleg {
  font-size: var(--text-body);
}
/* The dot sits on the label's first line, not the row's top edge, when a
 * report wraps beneath it. */
.mlleg > .gate-dot {
  justify-self: center;
  margin-top: var(--space-2xs);
}
.mlleg.is-current {
  font-weight: var(--font-weight-semibold);
}
.mlwhen {
  font-size: var(--text-meta);
  color: var(--color-text-muted);
  overflow-wrap: anywhere;
}

.mlsub {
  font-size: var(--text-micro);
  color: var(--color-text-muted);
}
.mlsub > span:first-child {
  grid-column: 2;
  padding-left: var(--space-sm);
}
.mlsub > .mlwhen {
  grid-column: 3;
}

/* A rung's SECOND (and later) report — spec 2026-09-03 §4.3: the same
 * physical moment told by another reporter, meta-sized like the rung's own
 * report line: it is the rung's own evidence, not a subordinate action. It
 * fills the report column alone, under the first report. */
.mlreport > .mlwhen {
  grid-column: 3;
}

/* ---- The activity timeline (spec 2026-09-03 §5/§6.4) ---------------------
 * An <ol> of every recorded container event, newest first: the one clock on
 * the left, the label · detail · reporter on the right, a hairline between
 * entries. Two surfaces (both sheets) — so it lives here, not in a page
 * file. Tokens only. */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
}
.tl-entry {
  display: grid;
  grid-template-columns: var(--sheet-label-col) minmax(0, 1fr);
  gap: var(--space-2xs) var(--space-md);
  padding: var(--space-2xs) 0;
  border-top: var(--border-width) solid var(--color-border);
  font-size: var(--text-meta);
}
.tl-entry:first-child {
  border-top: 0;
}
.tl-when {
  color: var(--color-text-muted);
  white-space: nowrap;
}
.tl-body {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xs) var(--space-xs);
  align-items: baseline;
  overflow-wrap: anywhere;
}
.tl-label {
  color: var(--color-text);
}
.tl-count,
.tl-detail {
  color: var(--color-text-muted);
}
.tl-who,
.tl-note {
  color: var(--color-text-faint);
  font-size: var(--text-micro);
}
.tl-earlier .tl-body {
  color: var(--color-text-faint);
}

/* The events table (container page, spec 2026-09-04 §5.3): the timeline
 * as a DataTable — a glyph cell the width of one icon, the when cell that
 * never wraps. */
.events-table td { padding-top: var(--space-md); padding-bottom: var(--space-md); }
/* The rail (MG polish 2026-09-04, the Events mockup): a faint vertical line
 * runs the glyph column's height, stopping at the first and last rows'
 * centres; each row's glyph sits in a ring on top of it, tinted by family
 * where a family has a tone (the families we KNOW — status colour would be
 * invented). */
.events-table .cell-glyph {
  position: relative;
  width: var(--glyph-size);
  padding-right: var(--space-xs);
}
.events-table .cell-glyph::before {
  content: "";
  position: absolute;
  left: calc(var(--cell-pad-x) + var(--glyph-size) / 2);
  top: 0;
  bottom: 0;
  border-left: var(--border-width) solid var(--color-border);
}
.events-table tbody tr:first-child .cell-glyph::before { top: 50%; }
.events-table tbody tr:last-child .cell-glyph::before { bottom: 50%; }
.events-table .cell-when { white-space: nowrap; }
/* Reporter and Note are short words that read wrong broken over two lines
 * (order-page review 2026-09-27); desktop only — the narrow card wraps. */
@media (min-width: 769px) {
  .events-table .cell-reporter,
  .events-table .cell-note { white-space: nowrap; }
}

/* The narrow card on a DataTable (.table-cards; order-page review
 * 2026-09-27). ADR-0074 section 3's card, placed by the SAME cell roles, for
 * a table whose rows are read rather than opened: below the narrow tier the
 * header hides, each row becomes a wrapping flex line — role-key then
 * role-tag on line 1, role-ctx on line 2, role-fact on line 3 in column
 * order — with the row's own pseudo-elements as the line breaks. A fact
 * carries its column's word as a .cell-label (a .micro-label), off on
 * desktop where the th names the column. Selectors sit at tbody depth so
 * they outrank a page's own td rules (the containers table's nowrap). */
.table-cards .cell-label { display: none; }
@media (max-width: 768px) {
  .table-cards thead { display: none; }
  .table-cards,
  .table-cards tbody { display: block; }
  .table-cards tbody tr {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2xs) var(--space-md);
    padding: var(--cell-pad-y) var(--cell-pad-x);
  }
  .table-cards tbody td {
    display: block;
    order: 5;
    min-width: 0;
    padding: 0;
    width: auto;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .table-cards tbody td.role-key { order: 1; }
  .table-cards tbody td.role-tag { order: 2; }
  .table-cards tbody tr::before,
  .table-cards tbody tr::after {
    content: "";
    flex-basis: 100%;
    height: 0;
  }
  .table-cards tbody tr::before { order: 4; }
  .table-cards tbody tr::after { order: 6; }
  .table-cards tbody td.role-ctx { color: var(--color-text-muted); }
  .table-cards tbody td.role-fact { order: 7; }
  .table-cards .cell-label {
    display: inline;
    margin-right: var(--space-3xs);
  }
  /* The events rail runs the glyph COLUMN's height; a card has no column. */
  .table-cards .cell-glyph::before { display: none; }
}
/* The Events tab's "Before this order" fold (MG ruling 2026-09-18) sits below
 * the events table (or its pager): the pager's own top rhythm, so the fold
 * never presses against the last row; the opened body gets one step of air. */
.events-previous { margin-top: var(--space-2xl); }
.events-previous > .fold-body { padding-top: var(--space-md); }

/* The Milestones table (container page, spec 2026-09-04 §4.4, Task 2):
 * every report on the rung's own row, stacked; a sub-event row (a truck
 * leg the rung absorbed, or an "also received" extra) reads as a nested
 * child of its parent rung. */
.milestones-table .cell-reports { display: grid; gap: var(--space-3xs); }
.report-line { font-size: var(--text-meta); color: var(--color-text-muted); white-space: nowrap; }
.row-sub .cell-key { padding-left: var(--space-2xl); color: var(--color-text-muted); }
.glyph {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: var(--glyph-size);
  height: var(--glyph-size);
  border-radius: var(--radius-full);
  background: var(--color-surface);
  border: var(--border-width) solid var(--color-border-strong);
  color: var(--color-text-muted);
  vertical-align: middle;
}
.glyph .icon {
  width: calc(var(--glyph-size) * 0.55);
  height: calc(var(--glyph-size) * 0.55);
}
.glyph--terminal { border-color: var(--color-info-border); color: var(--color-info-text); }
.glyph--gate { border-color: var(--color-success-border); color: var(--color-success-text); }
.glyph--movement { border-color: var(--color-accent); color: var(--color-accent-strong); }
.glyph--clocks { border-color: var(--color-warning-border); color: var(--color-warning-text); }
/* The order-grain families (the order page's Events tab, MG 2026-09-22 —
 * they rendered in the neutral ring the container tab never shows): the
 * feed in indigo, documents in purple, the shipment machine in the gate's
 * green (both are "state advanced"), CargoWise in the terminal's blue
 * (both are an external system's word). Stage-ramp inks are AA on white. */
.glyph--feed { border-color: var(--stage-2-dot); color: var(--stage-2-ink); }
.glyph--documents { border-color: var(--stage-3-dot); color: var(--stage-3-ink); }
.glyph--lifecycle { border-color: var(--color-success-border); color: var(--color-success-text); }
.glyph--cargowise { border-color: var(--color-info-border); color: var(--color-info-text); }

/* .dbooking/.ddeadline are plain scan-row data cells — they ride the shared
 * .dcell recipe (planning section below), one rule for "a plain data cell"
 * across every DisclosureList screen; only the overdue variant is theirs. */
/* An arrival/cutoff that has passed while the order is still unplanned
 * (planning walk 2026-08-29, ledger #12) — the Schedule's overdue ink,
 * on the Worklist's anchor cell. */
.dcell.is-overdue {
  color: var(--color-danger-text);
  font-weight: var(--font-weight-semibold);
}
.ddeadline.is-overdue {
  color: var(--color-danger-text);
  font-weight: var(--font-weight-semibold);
}

/* Status word in the ledger row: arbitrary-length FSM tokens
 * (delivery_facility_nominated) must clip, never invade the next column. */
.dcell-clip,
.clip {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* A date cell that may carry an ATA/ATD micro-label (MG, 2026-09-28): the
 * day and its mark stay on ONE line, so a row with an actual is the same
 * height as a row without. Its track is sized for both (tokens.css). */
.dcell-when { white-space: nowrap; }

/* A plain scan-row data cell — text-body ink, no severity/status/age
 * semantic (unlike .dstatus/.dage, which carry exceptions-specific meaning).
 * Exceptions/containers never needed this: every one of their columns
 * already had a dedicated semantic class. Planning's ETA/Route columns are
 * genuinely plain data, so this fills that gap — reusable by any future
 * DisclosureList screen with the same need. (ADR-031 fan-out addition,
 * planning.html) */
.dcell,
.dbooking,
.ddeadline {
  font-size: var(--text-body);
  color: var(--color-text);
  /* let the fr track shrink below content width instead of pushing the
   * trailing cells (deadline, caret) out of alignment — the guard the
   * retired .crow-cell carried. */
  min-width: 0;
}

/* Desktop-only by construction (ADR-0074 §4.2, ui-direction §11 S-28): the
 * narrow card recipe in portal.css owns this row below the tier. */
@media (min-width: 769px) {
  .dscan.dscan--exceptions,
  .dhead.dscan--exceptions {
    /* attn glyph | Exception | Order | Customer | Container | Dir | Status | Age |
     * caret (worklist-treatment transposition, MG ruling 2026-08-01: the
     * stacked headline/context pair becomes single-line ledger columns —
     * same screen-scoped override mechanism as --worklist). First track
     * widened dot-size -> icon-size (one status language, 2026-08-30, spec
     * S6): the leading cell is now the .attn glyph, not a bare .dsev dot. */
    grid-template-columns:
      var(--icon-size) minmax(0, 1fr) var(--sched-col-order)
      minmax(0, var(--exc-col-customer-max)) var(--sched-col-key) var(--sched-col-dir)
      var(--exc-col-status) var(--exc-col-age) var(--space-3xl);
    justify-content: space-between;
  }
  /* Review 2026-09-27: content-sized tracks (the Schedule list recipe, MG
   * 2026-09-26) replace the fr shares that clipped the headline; the
   * headline takes the spare width. A pill column's header starts where the
   * pill's TEXT starts (shared here with the Schedule, which set it first). */
  .dhead > .dhead-pill { padding-inline-start: var(--space-md); }
}

/* A list row is a LINK (the sheet, 2026-08-30): the same .dscan grid; the
 * open row is washed, its name and caret in the accent — nothing more (MG
 * in-play 2026-08-30: no leading mark, no border). */
a.drow { color: inherit; text-decoration: none; }
.drow.is-open,
.drow.is-open:hover { background: var(--color-accent-subtle); }
.drow.is-open .dname { color: var(--color-accent-strong); }
.drow.is-open .dcaret::before { content: "\25BE" / ""; color: var(--color-accent); }

/* A closed container reads as done work (spec 2026-08-29 §3.5) — the
 * .drow--ack muting precedent, on the Schedule board and the Order ->
 * Containers list alike, so it lives here rather than in either page file
 * (spec 2026-09-03 §6.3: the second consumer arrived and the verbatim copy
 * with it). The parent rule sets .dscan's own ink, but .dcell/.dbooking/
 * .ddeadline each re-declare `color: var(--color-text)` at higher
 * specificity (fix round 2, spec D5) — the muting has to reach the children
 * directly or it mutes nothing the operator can see. .dname declares no
 * color of its own but is named explicitly for symmetry with its siblings
 * and to survive a future .dname color rule without silently falling out of
 * the muted set; it is scoped off :is-open because opening a completed row
 * is normal (the sheet renders beside the list) and the open accent must
 * outrank the muting. */
.drow.is-completed > .dscan,
.drow.is-completed.dscan { color: var(--color-text-muted); }
.drow.is-completed .dcell,
.drow.is-completed .dbooking,
.drow.is-completed .ddeadline { color: var(--color-text-muted); }
.drow.is-completed:not(.is-open) .dname { color: var(--color-text-muted); }

/* Card — one recipe (retires the four copy-pastes as screens migrate). (§3.5)
 * Padding included so a bare .card needs no inline style (guard-clean). */
.card {
  background: var(--color-surface);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  padding: var(--space-2xl);
}
/* An h2 that OPENS a card takes no region-rhythm gap — the card's own padding
 * is the gap (UI/UX review 2026-08-30, spec D8). */
.card > h2:first-child { margin-top: 0; }

/* Facts grid — key-value data as a definition grid (retires the seven
 * order_detail data-tables as those screens migrate). (§3.4) */
.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(var(--facts-col-min), 1fr));
  gap: var(--space-lg) var(--space-4xl);
  margin: 0;
}
/* Typography is the shared .micro-label recipe (slice 8a B3); only the
 * spacing below the label stays here. */
.facts dt {
  margin-bottom: var(--space-3xs);
}
.facts dd {
  margin: 0;
  font-size: var(--text-body);
  color: var(--color-text);
  /* long unbroken tokens (references, engine detail strings) wrap instead of
   * overpainting the neighbouring column — the containment the retired
   * .table-scroll wrapper used to provide. */
  overflow-wrap: anywhere;
}
/* A long-sentence fact (an exception's three sentences) spans the whole grid
 * instead of squeezing into one auto-fit column (review 2026-09-27). */
.facts > .facts-wide { grid-column: 1 / -1; }

/* An exception row reached by its #exc- fragment (the order and container
 * pages, after an act-in-place write or a sheet's Order link) clears the
 * sticky topbar — the Vessels orders-row precedent and token. */
[id^="exc-"] { scroll-margin-top: calc(var(--space-6xl) * 2); }

/* The order sheet's readiness rail (container reach, spec R-3): the
 * container page's "Status at a glance" shape at order grain — one node per
 * GATE_ORDER gate, dots on the shared .gate-dot vocabulary unchanged so the
 * page legend still reads true. Lives here rather than a page-specific
 * stylesheet because `_order_sheet.html` is a shared partial (the Vessels
 * board and the Orders kanban card both render it): a class it uses must
 * resolve on every host page, and a page-specific sheet like
 * pages/vessels.css is not loaded by every host
 * (test_ui_styling_discipline.py's own effective-stylesheet check). Token
 * names verified against tokens.css directly (ruling E) — the brief's
 * first guess invented several that do not exist. */
.sheet-rail {
  display: flex;
  justify-content: space-between;
  gap: var(--space-xs);
  list-style: none;
  margin: 0;
  padding: var(--space-xs) 0 0;
}
.sheet-rail-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2xs);
  text-align: center;
  flex: 1 1 auto;
  min-width: 0;
}
/* Task 6 review fix, reworded at fix-wave item 5: was --text-micro on both
 * rungs. --text-micro's own tokens.css comment reserves it for UPPERCASE
 * labels, which neither rung here is — that mismatch is the reason the NAME
 * moved off it (it was tied with the state word beneath it at the same
 * floor size, weak hierarchy), not a case-based justification for the state
 * word staying. The state word stays at --text-micro on its own merits: it
 * is the quieter, secondary line under the name, and the size step down
 * from --text-meta to --text-micro (stacked with its already-muted colour)
 * is what reads it as secondary — matching the identical primary/secondary
 * pairing .blocker-gate/.blocker-why already use below. */
.sheet-rail-name {
  font-size: var(--text-meta);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
}
.sheet-rail-state {
  font-size: var(--text-micro);
  color: var(--color-text-muted);
}

/* Blockers (container reach, spec §4.2): a line per non-done gate carrying
 * its own concern sentence as visible text, its label still the deep link
 * to that gate's action home (the 7a ruling). The rows carry a full
 * sentence, not a short label, so — the same reason .action-group--bar
 * opts out above — .sheet-blockers opts out of --form-max-width too. */
.action-group.sheet-blockers {
  max-width: none;
}
.blocker-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
/* The PRA pages' warning list — the standalone PRA record pages (pages/
 * pra.css) and the order PRA page (pages/order_pra.css) each had their own
 * size (CSS review 2026-11-09, F7); one rule here, the pra.css values. The
 * "to fix" list shares it (2026-11-30): it had no size and no list metrics,
 * so its lines rendered larger than the warnings beside them. */
.pra-warnings,
.pra-blocks {
  margin: var(--space-xs) 0 0;
  padding-left: var(--space-lg);
  font-size: var(--text-meta);
}
.pra-warnings li { color: var(--color-warning-text); }
.blocker {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: baseline;
  gap: var(--space-xs);
  padding: var(--space-2xs) 0;
}
.blocker-gate {
  font-weight: var(--font-weight-semibold);
}
.blocker-why {
  color: var(--color-text-muted);
  font-size: var(--text-meta);
}

/* The order sheet's box list (container reach, spec R-4): EVERY box, so the
 * list scrolls rather than truncating. Lives here beside the rail/blockers
 * CSS above for the same reason (see that block's own comment):
 * `_order_sheet.html` is a shared partial and a page-specific stylesheet
 * like pages/vessels.css is not loaded by every host. Token names verified
 * against tokens.css directly (ruling E, same discipline as the
 * rail/blockers CSS) — several of the brief's guessed names do not exist:
 * --space-1/--space-2 -> --space-2xs/--space-xs, --font-size-xs ->
 * --text-meta, --color-text-meta -> --color-text-muted, --radius-sm (does
 * not exist) -> --radius-md.
 *
 * Fix wave item 6 (MG's browser walk against 24 real boxes): this rule
 * originally carried its own `max-height`/`overflow-y` cap (the retired
 * `--sheet-boxes-max-height` token). `.sheet-body` (below) is ALREADY
 * `overflow-y: auto` — the cap was a scroll nested inside a scroll, the
 * exact risk spec R-4's own risk register named and accepted, except this
 * one was never load-bearing: at the measured row height the cap clipped a
 * row mid-height (it ran into the facts block beneath it, reading as though
 * the facts belonged to the clipped box) while leaving real dead space
 * between the list and the footer above the cap's own limit. Removed
 * outright: `.sheet-body`'s existing scroll carries the list, one scroll,
 * no clipped row, no dead space, still every box.
 *
 * Fix wave item 7 (MG's browser walk): `.action-group` is a plain
 * single-column grid — every direct child gets its own row — which is right
 * for every OTHER `.action-group` (a heading over one list/rail/form) but
 * wrong here: `.sheet-boxes-all` ("Full list ›") stacked under the heading
 * on its own line, left-aligned, instead of sitting beside "Containers N" at
 * the row's right edge, which is what the block header actually intends.
 * `:has()` scopes the two-column grid to only the group carrying
 * `.sheet-boxes-all` — its one real consumer — so no other `.action-group`
 * is affected; `.sheet-boxes` itself still spans the full row beneath. */
.action-group:has(> .sheet-boxes-all) {
  grid-template-columns: 1fr auto;
  column-gap: var(--space-sm);
}
.action-group:has(> .sheet-boxes-all) > .sheet-boxes {
  grid-column: 1 / -1;
}
.sheet-boxes {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sheet-box-link {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-2xs) var(--space-xs);
  padding: var(--space-2xs) var(--space-xs);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
}
.sheet-box-link:hover {
  background: var(--color-surface-hover);
}
.sheet-box-id {
  font-size: var(--text-emphasis); /* an identifier (S-44) */
  font-weight: var(--font-weight-semibold);
  color: var(--color-accent);
}
/* (No .sched-flag reset needed here any more: the star's base is in flow —
 * see its own comment above. This host is why the default was inverted.) */
.sheet-box-meta {
  grid-column: 1;
  color: var(--color-text-muted);
  font-size: var(--text-meta);
}
.sheet-box-clock {
  grid-row: 2;
  grid-column: 2;
  font-size: var(--text-meta);
  color: var(--color-text-muted);
  text-align: right;
}
.sheet-box-clock.is-overdue {
  color: var(--color-warning-text);
}
.sheet-box.is-completed .sheet-box-id {
  color: var(--color-text-muted);
}
.sheet-boxes-all {
  grid-row: 1;
  grid-column: 2;
  align-self: baseline;
  font-size: var(--text-meta);
}

/* Field — one pattern: micro-label above, aligned control. (ADR-031 §3.3)
 * .field > label's typography is the shared .micro-label recipe (slice
 * 8a B3). */
.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-3xs);
}
/* An error under its control: danger ink at meta size, no box (the permit
 * form's recipe; CSS review 2026-11-09 F6 folded the deal booking form's and
 * the customer deal form's byte-identical copies here). */
.field-error {
  margin: 0;
  color: var(--color-danger-text);
  font-size: var(--text-meta);
}
.field-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-lg);
  align-items: flex-end;
  margin: 0;
}
/* Label-less variant: centre the row instead of bottom-aligning it. The base
 * .field-row's flex-end is specified for LABELLED fields — the label sits above
 * the control, so a trailing button aligned to the row's bottom lands on the
 * input's baseline. Drop the label (the worklist's inline Cancel, where the
 * placeholder carries the meaning) and there is nothing above the input to take
 * up the slack: flex-end then pins the short .btn-row to the taller input's
 * bottom edge and the button reads low against both the input and the Confirm
 * beside it (MG, 2026-08-02). Centring is the alignment a single-line row of
 * unequal-height controls wants. */
.field-row--center {
  align-items: center;
}
.field-row .field.grow {
  flex: 1 1 var(--field-grow-basis);
}
.field-row .field.grow input,
.field-row .field.grow textarea {
  width: 100%;
}
/* Field controls consume the operational-density type scale + the one control
 * height, so text/date/select inputs match in size; font-family: inherit pulls
 * the datetime control's native text onto the surface font. (fixes uneven
 * field sizes + the date font, and — same height as .btn-sm — aligns the
 * label row and the trailing button.) */
/* .plan-override-reason rides the same control recipe: it must stay a DIRECT
 * child of its .field-row (the :checked sibling reveal), so it can't be
 * wrapped in a .field — it joins the sizing rule instead. So does any other
 * bare control a row holds without a .field wrapper: unwrapped it fell back
 * to the base input recipe and landed under the pointer floor (render sweep,
 * first run: the styleguide's Reject fold, a fraction short). Checkbox and
 * radio are excluded — they carry the compact paint plus a labelled hit area
 * (ui-direction §11 S-14), not the control height. */
.field input,
.field select,
.field textarea,
.field-row > select,
.field-row > textarea,
.field-row > input:not([type="checkbox"]):not([type="radio"]),
.field-row > .plan-override-reason {
  font-family: inherit;
  font-size: var(--text-body);
  min-height: var(--control-height);
  padding: var(--space-xs) var(--space-lg);
  box-sizing: border-box;
}
/* Textareas invite prose the single-line control height would strangle: three
 * control-heights of room, derived from the token (the checkbox-lift
 * precedent — never a rows= literal in markup, never a dimension literal
 * here). Vertical resize only; horizontal would break the field grid.
 * (notes.html Detail field, ADR-047) */
.field textarea {
  min-height: calc(var(--control-height) * 3);
  resize: vertical;
}

/* Order-detail section grid (MG ruling 2026-07-19): the compact fact cards
 * (References / Carrier & voyage / Dates / Routing / Provenance) tile the
 * viewport instead of stacking as full-width rows of mostly empty space.
 * Exceptions, the status band, and the Products table stay full-width. Cards
 * in the same row stretch to equal height via the section flex. */
.detail-grid {
  display: grid;
  /* Two columns on a desktop, one on a phone (MG visual review 2026-09-22:
   * an auto-fit of four cards put three on the first row and the fourth
   * alone beneath on a 13" laptop, with a hole to its right). Two-by-two
   * tiles cleanly at every desktop width; the tier is the ADR-0074 768
   * registry's. */
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-2xl);
}
@media (min-width: 769px) {
  .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.detail-grid > section {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.detail-grid > section > .card {
  flex: 1;
}

/* Status band (spec 2026-07-31 §4.2): the import ladder as the page's first
 * card, above Open exceptions, so status is consumed on arrival. Since
 * 2026-09-15 the rungs are the shared .stepper (below, ~:3495); the earlier
 * .band-steps strip and its connector tokens were deleted at the CSS review
 * 2026-11-09 (F5). The card keeps its label and its one caption. */
.status-band {
  margin-block: var(--space-2xl) var(--space-4xl);
}
/* As the main column's FIRST card the band drops its top margin, so its
 * border lines up with the rail's first card (MG visual review 2026-09-22:
 * the Document pack card sat a step higher than the Export ladder). */
.page-main > .status-band:first-child { margin-top: 0; }
/* Typography is the shared .micro-label recipe (slice 8a B3); only the
 * spacing below the label stays here. */
.band-label {
  margin: 0 0 var(--space-lg);
}
/* The one caption: the current rung's honest guard reason (.meta voice).
 * margin-left auto seats it at the row's end while wide; when the row
 * wraps it lands on its own line. */
.band-caption {
  margin-left: auto;
  font-size: var(--text-meta);
  color: var(--color-text-muted);
}
/* The ladder's own note (ADR-0122: "planned outside Cadence"): a plain line
 * under the rungs, left-aligned like any other sentence on the page — the
 * caption above is right-seated because it annotates a control. */
.band-note { margin: var(--space-md) 0 0; }

/* =========================================================================
 * Dashboard (ADR-0054 slice 4): the KPI strip. The site cards and their
 * stage tiles retired with the 2026-09-16 redesign.
 * Group colours ride the same ordinal custom-property convention.
 * ========================================================================= */
.kpi-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(var(--kpi-tile-min), 1fr)); gap: var(--space-lg); margin-bottom: var(--space-5xl); }
.kpi-tile { background: var(--color-surface); border: var(--border-width) solid var(--color-border); border-radius: var(--radius-xl); box-shadow: var(--shadow-card); padding: var(--space-lg); display: flex; flex-direction: column; gap: var(--space-3xs); }
/* Tiles two-up on a phone, estate-wide (MG ruling 13, 2026-09-26): auto-fit
 * stacked them one per row, so five tiles ran most of a phone screen before
 * the first card (Vessels' first vessel sat three screens down). A tighter gap and pad keep a half-
 * width tile legible; an odd last tile takes its own half. */
@media (max-width: 768px) {
  .kpi-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-sm);
    margin-bottom: var(--space-3xl);
  }
  .kpi-tile { padding: var(--space-md); }
}
/* Coloured KPI icon/label modifiers (MG polish 2026-08-19): meaning-coded, not
 * decorative — info for volume awaiting action, danger for open exceptions,
 * warning for a cost clock closing in. The accent stays reserved for the
 * primary CTA, so none of these three ever reach for it. .kpi-icon/.kpi-label
 * already consume --_stage-dot/--_stage-ink with neutral fallbacks (below) —
 * these modifiers just supply the custom properties. */
.kpi-tile--info { --_stage-dot: var(--color-info-border); --_stage-ink: var(--color-info-text); }
.kpi-tile--danger { --_stage-dot: var(--color-danger-border); --_stage-ink: var(--color-danger-text); }
.kpi-tile--warning { --_stage-dot: var(--color-warning-border); --_stage-ink: var(--color-warning-text); }
/* The container page's Milestones tab (spec 2026-09-04 §4.4, Task 2): the
 * Completed tile needs the same tint treatment as its siblings — success
 * had no modifier rule until this tab used it. */
.kpi-tile--success { --_stage-dot: var(--color-success-border); --_stage-ink: var(--color-success-text); }
.kpi-label { font-size: var(--text-meta); color: var(--_stage-ink, var(--color-text-muted)); font-weight: var(--font-weight-medium); }
/* S-18 figure-tier EXCEPTION PENDING (CSS review 2026-11-09, F1): the big
 * KPI figure wears bold outside h1; MG owes the ruling (demote, or amend S-18
 * with a figure tier). `.lane-count` (pages/customer.css) is its sibling. */
.kpi-value { font-size: var(--text-title); font-weight: var(--font-weight-bold); font-variant-numeric: var(--font-numeric); }
.kpi-share { font-size: var(--text-meta); color: var(--color-text-muted); }

/* Emphasised primary-key column — the DataTable half of the density retune
 * (§3.6): a table's one identifying column (orders' reference) reads
 * slightly larger/heavier than the rest of the row, the same identifier
 * weight the DisclosureList's .dname carries, so the operator's scan target
 * stands out without spending any colour. (new, orders.html fan-out) */
.cell-key {
  font-size: var(--text-emphasis);
  font-weight: var(--font-weight-semibold);
}
/* A key that is a LINK is the row's way in, not a headline (MG visual review
 * 2026-09-23 on the order page's containers table, made estate-wide
 * 2026-10-19): body size, medium weight, the base link ink — the semibold
 * emphasis-size key with the browser underline read as a black heavy CTA. */
.cell-key a {
  font-size: var(--text-body);
  font-weight: var(--font-weight-medium);
}

/* A run of identifiers inside one cell (the planner run's Unplannable table,
 * 2026-09-08): a list that reads as a wrapped ROW of numbers, never a bulleted
 * column - UAT run 1 put 47 boxes under three missing facts, one line each,
 * and read as unformatted text. Each item stays whole (nowrap), so a
 * container number never breaks across lines; the gap, not a separator
 * glyph, spaces them. The <ul> keeps the count for a screen reader. */
.box-run {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3xs) var(--space-lg);
  margin: 0;
  padding: 0;
  list-style: none;
}
.box-run > li {
  white-space: nowrap;
}

/* A cell whose content is a row ACTION rather than text (2026-07-25 UAT sweep
 * §1.2). The button brings its own box, so the shared --cell-pad-y stacks on
 * top of it and re-inflates the row that .btn-row just shrank. Tighten the
 * VERTICAL padding to the smallest step and keep --cell-pad-x, so the column
 * still sits on the table's horizontal rhythm. Beats the bare `th, td`
 * element rule on specificity ((0,1,0) against (0,0,1)), source order aside. */
.cell-action {
  padding: var(--space-3xs) var(--cell-pad-x);
}

/* Table-cell selection tick (S-14, MG ruling 2026-07-27, applied to the Orders
 * CW-Job column 2026-09-01): the painted box is traditional-sized and the
 * full-cell <label> carries the --target-min hit area. A box painted at the
 * full target reads OVERSIZED in a dense grid — the fault MG reported — but
 * shrinking the input alone would drop the pointer target below the floor the
 * 2026-07-25 audit set, so the label takes that job instead.
 *
 * Not centred: the cell's other two states are a left-aligned job number and a
 * left-aligned em dash, so a centred tick would make the column disagree with
 * itself. Stone ink, not the accent — a row-repeated accent FILL in an
 * always-visible table is what ADR-032's outline tier exists to forbid; at 25
 * rows the ticks would put 25 orange fills against the single Push CTA (the
 * same reasoning notes.css's .cell-eval records).
 *
 * Third instance of this recipe: notes.css's `.cell-eval` and worklist.css's
 * `.wl-boxpick` are the same shape and could fold in here — not done now, it
 * is a refactor of two working surfaces rather than part of this fix. */
.cell-pick {
  display: flex;
  align-items: center;
  min-height: var(--target-min);
  cursor: pointer;
}
.cell-pick input[type="checkbox"] {
  width: var(--checkbox-size-compact);
  height: var(--checkbox-size-compact);
  margin: 0;
  accent-color: var(--color-text);
}

/* A cell carrying free prose (notes' Detail — the one long-text column in the
 * DataTable anatomy): cap it at the form width and wrap anywhere, so a pasted
 * paragraph grows the row DOWN, never the table WIDE (which would bury the
 * evaluation columns off-scroll). The cap sits on a block INSIDE the cell —
 * td max-width is not honoured in auto table layout. (ADR-047) */
.cell-detail {
  max-width: var(--form-max-width);
  overflow-wrap: anywhere;
}

/* DigestStrip — see the component definition further down this file. The
 * worklist's site-capacity strip and the intake page's health strip were two
 * byte-identical triples under different names; the continuity audit
 * 2026-08-02 merged them into .digest-strip / .dscan--digest / .digest-line,
 * the way PR #96 promoted .action-bar. Nothing screen-scoped survives here. */

/* =========================================================================
 * DigestStrip — page-level aggregate state as ONE collapsed-by-default
 * disclosure row (spec 2026-07-29-intake-health-compact-design, generalised
 * by the continuity audit 2026-08-02): the queue is the page's primary
 * content, so the aggregate compresses to a scan line (label + digest) with
 * the full grid behind the expand. Composes the DisclosureList anatomy above;
 * only the column set is its own (label | digest | caret).
 *
 * ONE component, two consumers. It shipped first as the intake health strip,
 * then the worklist's site-capacity strip copied it — and the copy diverged in
 * NAME only: .capacity-strip / .dscan--capacity / .capacity-digest were the
 * same three declarations in the same order with the same tokens, character
 * for character. Merged here on the .action-bar precedent (PR #96). Any screen
 * with page-level aggregate state composes this; it is not intake's.
 * ========================================================================= */
.digest-strip {
  /* The strip is a page-level sibling of .filter-row, which brings no top
   * margin of its own — the strip owns the gap, matching the page rhythm. */
  margin-bottom: var(--space-2xl);
}
.dscan.dscan--digest {
  grid-template-columns: max-content 1fr var(--space-3xl);
}
.digest-line {
  font-size: var(--text-meta);
  color: var(--color-text-muted);
}

/* Pagination footer (UI slice 2 T1): Prev/Next + the "Page x of y — n
 * orders" line, below the table. */
.pager {
  display: flex;
  gap: var(--space-2xl);
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-top: var(--space-2xl);
  font-size: var(--text-body);
  color: var(--color-text-muted);
}

.view-toggle { display: inline-flex; gap: var(--space-3xs); }

/* Pager anatomy (mock-fidelity slice 4): range copy · numbered pages ·
 * rows-per-page. Numbered steps share one small square treatment. */
.pager-pages, .pager-size { display: inline-flex; align-items: center; gap: var(--space-xs); }
.pager-num {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: var(--target-min); min-height: var(--target-min);
  border-radius: var(--radius-md); padding: 0 var(--space-2xs);
  font-variant-numeric: var(--font-numeric);
}
.pager-num.is-active { background: var(--color-accent-subtle); color: var(--color-accent-hover); font-weight: var(--font-weight-semibold); }
.pager-gap { color: var(--color-text-faint); }
.view-toggle .is-active { background: var(--color-accent-subtle); color: var(--color-accent-hover); }

/* Empty states (slice 5.1; ruling: no italics anywhere — see
 * docs/ui-direction.md §11): the main list empties get the centred card
 * block. The in-table `.empty` cell (the `{% empty %}` branch of a loop
 * nested inside `{% if rows %}`) retired — unreachable dead markup, never
 * rendered (slice 5 T5). */
.empty-state {
  background: var(--color-surface);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  text-align: center;
  padding: var(--space-6xl) var(--space-2xl);
}
.empty-state .empty-title {
  margin: 0;
  font-size: var(--text-section); /* S-44 */
  font-weight: var(--font-weight-semibold);
}
.empty-state .empty-hint {
  margin: var(--space-2xs) 0 0;
  color: var(--color-text-muted);
  font-size: var(--text-body);
}

/* Title row (slice 5.1): h1 with right-aligned page meta (the exceptions
 * feed chip). Wraps on narrow viewports. */
.page-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2xl);
  flex-wrap: wrap;
  margin-bottom: var(--space-2xl);
}
.page-header h1 {
  margin: 0;
}
/* A page whose subtitle sits directly under its title (Vessels, spec
 * 2026-09-05 §8): the header gives back its margin so the two read as one
 * block; `.page-subtitle` keeps its own bottom margin as the gap below. */
.page-header--subtitled { margin-bottom: var(--space-3xs); }

/* The order-detail summary strip (spec H1): a jump link per section WITH
 * content, composed from .crumbs' own recipe just below (flex + gap, meta-
 * scale muted ink, target-min links) — but WRAPPING rather than truncating,
 * since this is a destination list, not a location trail; a dense order's
 * full link set must all stay reachable, never clipped. When Open
 * exceptions is clean it contributes no link, and the strip instead carries
 * the relocated "No open exceptions." note as a bare .meta child — margin
 * zeroed so a <p> doesn't misalign the flex row. */
.section-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--text-meta);
  color: var(--color-text-muted);
}
.section-nav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--target-min);
}
.section-nav .meta {
  margin: 0;
}

/* The crumb trail, moved into the topbar (slice 6, spec N3): ancestor links
 * with `>` separators and the current page as static text, sitting between
 * the sidebar toggle and the search. Empty on every top-level surface
 * (`page_crumbs` stays unfilled there), so it costs the row nothing when
 * there is nothing to show. min-width: 0 plus the overflow trio let a long
 * trail truncate rather than push the search/tools off the row — narrower
 * viewports are a later slice's work (spec R5), untouched here. */
.crumbs {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: var(--text-body);
  color: var(--color-text-muted);
}
.crumbs .sep { color: var(--color-text-faint); }
.crumbs [aria-current="page"] {
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Standalone navigation links, not prose — so WCAG 2.2's inline-link exemption
 * does not cover them and they owe the minimum target (they measured under the minimum
 * tall). The flex row already aligns them, so a min-height only grows the hit
 * area; it does not move the text. */
.crumbs a,
.pager a {
  display: inline-flex;
  align-items: center;
  min-height: var(--target-min);
}
/* ...and wide: a three-letter trail head ("PRA", ADR-0110) measured just under
 * the minimum wide in the render sweep. Left-aligned, so a longer link is unchanged and a short one
 * only grows its hit area past the text. */
.crumbs a {
  min-width: var(--target-min);
  /* A link squeezed on a phone clips its own text: unclipped, a three-level
   * trail (Booking requests › reference › Record booking) wrote each link over
   * the next (UAT walk 2026-12-02). */
  overflow: hidden;
}
/* The pager is a control, not a link in prose (MG ruling 2026-10-19): Prev /
 * Next and the page numbers share one slate ink with no underline, so the
 * row reads as one stepper rather than a run of orange words; the hover is
 * the ink-flip the sort headers use. */
.pager a {
  color: var(--color-text);
  text-decoration: none;
}
.pager a:hover,
.pager a:focus-visible { color: var(--color-accent-hover); }

/* Feed health as a status CHIP on the title row (slice 5.1) — out of the
 * notice system entirely: a saturated state dot beside calm ink text, never
 * a tinted slab. Healthy is muted ambient signal; degraded speaks in the
 * danger ink and KEEPS role="alert" plus its visible detail line (the dot
 * carries the state colour, the ink carries the words). */
.status-chip {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-xs);
  font-size: var(--text-body);
  color: var(--color-text-muted);
}
.status-chip::before {
  content: "";
  width: var(--dot-size);
  height: var(--dot-size);
  border-radius: var(--radius-full);
  background: var(--color-text-faint);
  flex: none;
}
.feed-health.healthy::before {
  background: var(--color-success-border);
}
.feed-health.degraded {
  color: var(--color-danger-text);
  font-weight: var(--font-weight-medium);
}
.feed-health.degraded::before {
  background: var(--color-danger-border);
}
/* The degraded detail drops to a second muted full-width line inside the
 * chip's wrap flow. */
.feed-health .detail {
  flex-basis: 100%;
  color: var(--color-text-muted);
  font-weight: var(--font-weight-normal);
}

.ack-form {
  display: flex;
  gap: var(--space-xs);
  align-items: center;
  flex-wrap: wrap;
}

/* Ruling: no italics anywhere — see docs/ui-direction.md §11. */
.ack-note {
  color: var(--color-text-muted);
  /* an unsized paragraph inherits the base size, not the body size
   * (review 2026-09-27) */
  font-size: var(--text-body);
}

.meta {
  color: var(--color-text-muted);
  font-size: var(--text-body);
}

/* Page furniture (mock-fidelity slice 2): subtitle under the H1 row and the
 * section head with its legend (the dashboard's own header-row controls were
 * retired into the estate's one toolbar — slice 5, ADR-0070 U-1). */
.page-subtitle { margin: 0 0 var(--space-3xl); font-size: var(--text-meta); color: var(--color-text-muted); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-2xl); flex-wrap: wrap; margin-bottom: var(--space-lg); }
.section-head h2 { margin: 0; font-size: var(--text-section); }
.stage-legend { display: flex; align-items: center; gap: var(--space-lg); flex-wrap: wrap; }
.legend-item { display: inline-flex; align-items: center; gap: var(--space-2xs); font-size: var(--text-meta); color: var(--color-text-muted); }
.legend-dot { width: var(--dot-size); height: var(--dot-size); border-radius: var(--radius-full); background: var(--_stage-dot, var(--color-neutral-text)); flex: none; }

.plan-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs) var(--space-sm);
}
/* Reject / Cancel sit behind compact inline folds (planning walk
 * 2026-08-29): stacked open, a booked box's action cell ran to some 300 pixels
 * (reason input + button, twice) and eight booked boxes made a 2,400-pixel
 * panel. Confirm — the common act — stays one click; the reasoned acts
 * open in place. */
.plan-actions > .fold {
  display: inline-block;
}
.plan-actions > .fold[open] {
  flex-basis: var(--width-full);
}
.plan-actions > .fold > summary {
  display: inline-flex;
  align-items: center;
  min-height: var(--target-min);
  padding-inline: var(--space-sm);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  cursor: pointer;
  list-style: none;
}
.plan-actions > .fold > summary::-webkit-details-marker {
  display: none;
}

/* Sit the label on the Book button's optical centre by giving it the button's
 * HEIGHT and centring its text inside, rather than nudging it with a margin.
 * Font-metric independent: a hand-tuned lift only lands while the label's line
 * box stays exactly the height it was measured at. */
.plan-override-label {
  display: inline-flex;
  align-items: center;
  min-height: var(--btn-height-sm);
  font-size: var(--text-body);
  color: var(--color-text-muted);
  white-space: nowrap;
}
/* Centre the checkbox on that same line (MG ruling 2026-07-19, re-derived
 * 2026-07-25). The row is align-items: flex-end, so it aligns BOTTOM edges:
 * centring a short box on a taller one therefore means lifting it by half
 * their height difference — no more, no less. Expressed from the two tokens so
 * it self-corrects if either changes.
 *
 * The previous fixed lift was calibrated against the native checkbox's old
 * ~half-size box. Once the box grew to --target-min for the pointer-target fix
 * that same lift became an OVER-lift, leaving the checkbox a few pixels above
 * the label and button centre line — visibly top-aligned rather than centred.
 * A replaced element cannot centre its own content, so the margin is the tool
 * here; the checkbox must also stay a DIRECT child of .field-row (the
 * :checked sibling reveal below), so it cannot be wrapped in a flex box.
 * accent-color puts the brand orange on the tick, not the UA default blue. */
.plan-override-toggle {
  margin-bottom: calc((var(--btn-height-sm) - var(--target-min)) / 2);
  accent-color: var(--color-accent);
}
/* The override-reason reveal — CSS only, no JS. Hidden while the Override
 * checkbox (a PRECEDING sibling in the same .field-row) is unticked; ticking
 * it reveals the input AND its label — a label with no visible field beside
 * it read as a dangling instruction (review fix wave, 2026-08-30).
 * :not(:checked) hides rather than :checked shows, so a stylesheet failure
 * fails OPEN (the input and its label render, the flow still works).
 * display:none keeps the field IN the submission — an empty override_reason
 * is exactly what an unticked booking posts today, so the server-side
 * reason-required-when-ticked friction is untouched. */
.plan-override-toggle:not(:checked) ~ .plan-override-reason,
.plan-override-toggle:not(:checked) ~ .plan-override-reason-label {
  display: none;
}
/* The confirm pair inside a row panel's action form (schedule Complete /
 * Record-movement; 2026-08-02 polish). The Notes checkbox convention (MG
 * ruling 2026-08-01: THE standard): the painted box is a traditional size,
 * stone ink, and the pointer-target minimum rides the label. Unlike the
 * planning Override toggle there is no :checked sibling reveal here, so the
 * pair CAN wrap in its own flex box: given the control height, the row's
 * flex-end alignment lands the box, the sentence and the CTA on one centre
 * line — the .plan-override-label height trick, without the margin lift. */
.field-confirm {
  display: flex;
  align-items: center;
  /* Centre the pair ON THE INPUT LINE (MG, 2026-08-04): the row's other
   * children are label-over-input stacks, so a row-centred pair floats
   * between label and input. Bottom-align the box and let its
   * --control-height (matching the inputs) centre the content on the input's
   * band — the same coupling that aligns a trailing .btn-sm with a .field
   * input everywhere else (see the button-tier note above). */
  align-self: flex-end;
  gap: var(--space-xs);
  min-height: var(--control-height);
}
.field-confirm input[type="checkbox"] {
  width: var(--checkbox-size-compact);
  height: var(--checkbox-size-compact);
  /* A fixed-size box must not be a shrinkable flex item: at phone width the
   * sentence beside it squeezed the painted box out of square (render sweep,
   * first run: 13 wide against its 14.4 tall). The label wraps instead. */
  flex: none;
  margin: 0;
  accent-color: var(--color-text);
}
.field-confirm label {
  display: inline-flex;
  align-items: center;
  min-height: var(--target-min);
  cursor: pointer;
  /* The form's data voice — unset, it inherited the body size and read
   * oversized beside the micro-labelled fields (MG, 2026-08-04). */
  font-size: var(--text-meta);
}
/* The Orders table's bulk Push bar (spec P1-P3, slice 7a): the meta count,
 * the ONE .field-confirm pair, and the ONE CTA on a single row above the
 * table — never per row (U-3's accent budget; U-7's one-checkbox-per-form).
 * flex-wrap so a narrow viewport stacks rather than clipping the confirm
 * sentence; align-items:center (unlike .action-bar's flex-end) keeps the
 * checkbox, its label and the button on one line at their natural
 * heights — there is no field-input stack beside it to align against. */
.bulk-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}
/* The schedule's tracker body (approach B §4; S1 folds it into the row's own
 * .dpanel — the .manual-panel row wrapper it used to sit inside retired with
 * the ?record=/?complete=/?movements= panels). */
.manual-tracker {
  display: grid;
  gap: var(--space-2xs);
  padding: var(--cell-pad-y) var(--cell-pad-x);
}

/* ---- The container sheet -----------------------------------------------
 * Ruling: the sheet purpose — see docs/ui-direction.md §11. Three rows
 * (head · scrolling body · footer), so the verbs never scroll away and the
 * list stays in view. The z-index sits above the sidebar and below the
 * skip link (see §11 · z-order). */
.sheet {
  position: fixed;
  top: var(--shell-header-height);
  right: 0;
  bottom: 0;
  z-index: var(--z-sheet);
  width: var(--sheet-width);
  max-width: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: var(--color-surface);
  border-left: var(--border-width) solid var(--color-border);
  box-shadow: var(--shadow-sheet);
  /* Ruling: the sheet motion — see docs/ui-direction.md §11. Reduced
   * motion: no slide either way (the media block below). */
  animation: sheet-in var(--sheet-motion) ease-out;
}
.sheet:focus { outline: none; }
@keyframes sheet-in {
  from { transform: translateX(100%); }
  to { transform: none; }
}
.sheet.is-closing { transform: translateX(100%); transition: transform var(--sheet-motion) ease-in; }
@media (prefers-reduced-motion: reduce) {
  body.sidebar-overlay-open .sidebar,
  body.sidebar-overlay-open .sidebar-scrim { animation: none; }
  .sheet { animation: none; }
  .sheet.is-closing { transition: none; }
}
/* Ruling: the sheet overlay — see docs/ui-direction.md §11. */
/* The styleguide's specimen: the same anatomy, in the flow of the page. */
.sheet--inline {
  position: static;
  width: auto;
  max-width: var(--sheet-width);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
}
.sheet-head {
  display: grid;
  gap: var(--space-2xs);
  padding: var(--space-lg) var(--space-xl) var(--space-md);
  border-bottom: var(--border-width) solid var(--color-border);
}
.sheet-title-row { display: flex; align-items: center; gap: var(--space-sm); }
/* The sheet's title star is bigger than the micro base — it sits beside an
 * h2, not inside a scan row. Position is no longer overridden: the base is
 * in flow. */
.sheet-title-row .sched-flag { font-size: var(--text-body); line-height: 1; }
.sheet-title { margin: 0; font-size: var(--text-section); font-weight: var(--font-weight-semibold); }
/* The sheet title as its record's link (container reach): the identity carries
   the escalation, so it must read as clickable without shouting. */
.sheet-title a { color: inherit; text-decoration: none; }
.sheet-title a:hover, .sheet-title a:focus-visible { text-decoration: underline; }
.sheet-close {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--target-min);
  height: var(--target-min);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-lg);
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: var(--text-emphasis);
}
.sheet-close:hover { background: var(--color-surface-subtle); color: var(--color-accent-hover); }
.sheet-sub {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2xs);
  font-size: var(--text-meta);
  color: var(--color-text-muted);
}
.sheet-dot { color: var(--color-text-faint); }
/* A separator and the item AFTER it wrap as one unit, so a wrapped header
 * never ends a line on an orphaned dot (Schedule final review 2026-09-26;
 * the other sheets' headers can adopt it). */
.sheet-sub-pair { display: inline-flex; align-items: center; gap: var(--space-2xs); }
.sheet-body {
  overflow-y: auto;
  padding: var(--space-md) var(--space-xl) var(--space-lg);
  display: grid;
  gap: var(--space-sm);
  align-content: start;
}
/* Section titles: quiet, ruled above — the sheet's only structure.
 * Typography is the shared .micro-label recipe (slice 8a B3); only the
 * divider and its spacing stay here. */
.sheet-h {
  margin: var(--space-sm) 0 0;
  padding-top: var(--space-sm);
  border-top: var(--border-width) solid var(--color-border);
}
.sheet-alerts {
  padding: var(--space-sm) var(--space-md);
  border: var(--border-width) solid var(--color-danger-border);
  border-radius: var(--radius-md);
  background: var(--color-danger-bg);
}
.sheet-alerts-title {
  margin: 0 0 var(--space-3xs);
  font-size: var(--text-meta);
  font-weight: var(--font-weight-semibold);
  color: var(--color-danger-text);
}
/* The alert list itself (moved from pages/schedule.css, 2026-09-26): the
 * styleguide renders this specimen without the Schedule's page sheet, so
 * the base rule lives beside its only host, .sheet-alerts. */
.sched-alerts { margin: 0; padding-left: var(--space-3xl); color: var(--color-danger-text); font-size: var(--text-meta); }
.sheet-alerts .sched-alerts { padding-left: var(--space-lg); }
/* Label · value pairs in two tight columns — no stacked pairs, no empty
 * real estate (the retired in-row panel stacked six of them per column). */
.kv {
  display: grid;
  grid-template-columns: var(--sheet-label-col) minmax(0, 1fr);
  gap: var(--space-2xs) var(--space-md);
  margin: 0;
  font-size: var(--text-meta);
}
.kv dt { color: var(--color-text-muted); }
.kv dd { margin: 0; color: var(--color-text); overflow-wrap: anywhere; }
/* An overdue clock reading (ADR-0079's Detention block, and any future
 * .kv pair that needs it) — the SAME treatment as .container-facts
 * .fact-overdue (pages/container.css), scoped to .kv so it also applies
 * on the sheet, which opens from list pages that never load container.css. */
.kv .fact-overdue { color: var(--color-danger-text); font-weight: var(--font-weight-semibold); }
.sheet-body .manual-tracker { font-size: var(--text-meta); }
/* The verbs: the primary pair first, quiet links after, More at the far edge. */
.sheet-foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-xs);
  padding: var(--space-md) var(--space-xl);
  border-top: var(--border-width) solid var(--color-border);
  background: var(--color-surface-subtle);
}
.sheet-verb { margin: 0; display: inline-flex; }
/* The More menu (spec 2026-09-04 §5.2): a <details> of quiet links, born on
 * the Schedule sheet's footer (as .sheet-more/.sheet-menu, retired names)
 * and generalised the day a page head needed it. Opens DOWN by default; a
 * sheet footer flips it UP (there is no room below a footer). */
.more-menu { position: relative; }
.more-menu > summary { list-style: none; cursor: pointer; }
.more-menu > summary::-webkit-details-marker { display: none; }
.more-menu-list {
  position: absolute;
  right: 0;
  top: calc(100% + var(--space-2xs));
  z-index: var(--z-menu);
  min-width: var(--more-menu-width);
  display: grid;
  padding: var(--space-2xs);
  background: var(--color-surface);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
.more-menu-list a,
.more-menu-list button {
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-md);
  color: var(--color-text);
  text-decoration: none;
  font-size: var(--text-meta);
  white-space: nowrap;
}
/* An item can be a POST verb — a <button> in its own <form> (the customer
 * business selector, ADR-0095 d10): the button base's box (border, surface,
 * centred label, --btn-height) gives way to the link item's flat row, so a
 * verb and a link in a menu read as the same item. */
.more-menu-list button {
  justify-content: flex-start;
  width: 100%;
  min-height: var(--target-min);
  border-color: transparent;
  background: transparent;
  font-weight: var(--font-weight-normal);
  text-align: left;
}
.more-menu-list a:hover,
.more-menu-list button:hover { background: var(--color-surface-hover); color: var(--color-accent-hover); }
.sheet-foot .more-menu { margin-left: auto; }
.sheet-foot .more-menu-list { top: auto; bottom: calc(100% + var(--space-2xs)); }
/* An act section: the ONE secondary form the URL named, at the top of the
 * body, washed so it reads as "you are doing this now". */
.sheet-act {
  display: grid;
  gap: var(--space-sm);
  padding: var(--space-md);
  border: var(--border-width) solid var(--color-accent);
  border-radius: var(--radius-md);
  background: var(--color-accent-subtle);
}
.sheet-act-title { margin: 0; font-size: var(--text-emphasis); font-weight: var(--font-weight-semibold); }
.sheet-act-form { display: grid; gap: var(--space-sm); }
.sheet-act-foot { display: flex; align-items: center; gap: var(--space-xs); }
/* Phone: the sheet IS the screen. */
@media (max-width: 768px) {
  .sheet { top: 0; width: 100%; }
}

/* =========================================================================
 * Stepper (the container page's Status at a glance — MG polish 2026-09-04,
 * the Overview mockup): one node per gate on a continuous connector. The
 * connector is two pseudo-halves per step so its colour can follow the
 * state: solid success out of a done node and into the next, dashed and
 * muted from the current node on. Labels centre beneath the node: the gate,
 * its status word, its change time. The order page's status band keeps its
 * own shape (it carries a control on the current rung); this component is
 * the read-only ladder.
 * ========================================================================= */
.stepper {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
}
/* Below the tier (ADR-0074, 768; S-30): the ladder scrolls inside its own
 * frame rather than compressing its labelled nodes into the phone's content
 * column — auto-fit tracks at minmax(0, 1fr) let the labels win and the card
 * ran past the viewport (render sweep, first run: the container page at
 * phone width). grid-auto-flow: column with a --step-min track keeps every
 * step legible and its connector halves drawn; the overflow is the frame's,
 * not the page's. Placed AFTER the base rule on purpose: same specificity,
 * so source order is what lets it win. */
@media (max-width: 768px) {
  .stepper {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(var(--step-min), 1fr);
    overflow-x: auto;
  }
}
.step {
  position: relative;
  display: grid;
  justify-items: center;
  text-align: center;
  row-gap: var(--space-3xs);
  padding: 0 var(--space-xs);
}
.step::before,
.step::after {
  content: "";
  position: absolute;
  top: calc(var(--step-node) / 2);
  border-top: var(--border-width-thick) dashed var(--color-border-strong);
}
.step::before { left: 0; right: calc(50% + var(--step-node) / 2); }
.step::after { left: calc(50% + var(--step-node) / 2); right: 0; }
.step:first-child::before,
.step:last-child::after { display: none; }
.step--done::after,
.step--done + .step::before {
  border-top-style: solid;
  border-top-color: var(--color-success-border);
}
.step-node {
  width: var(--step-node);
  height: var(--step-node);
  border-radius: var(--radius-full);
  border: var(--border-width-thick) solid var(--color-border-strong);
  background: var(--color-surface);
  display: inline-grid;
  place-items: center;
  color: var(--color-surface);
  margin-bottom: var(--space-2xs);
}
.step-node .icon {
  width: calc(var(--step-node) * 0.6);
  height: calc(var(--step-node) * 0.6);
}
.step--done .step-node {
  background: var(--color-success-border);
  border-color: var(--color-success-border);
}
.step--current .step-node { border-color: var(--color-accent); }
.step--attention .step-node { border-color: var(--color-danger-border); }
.step--current .step-node::after,
.step--attention .step-node::after {
  content: "";
  width: calc(var(--step-node) * 0.4);
  height: calc(var(--step-node) * 0.4);
  border-radius: var(--radius-full);
  background: var(--color-accent);
}
.step--attention .step-node::after { background: var(--color-danger-border); }
/* Partial (MG 2026-09-22): some of the order's boxes have reached this rung,
 * not all — the .gate-partial amber, as a ring with the same inner dot the
 * current rung carries, so "in progress" reads at a glance without claiming
 * the rung is done. The connector out of it stays dashed. */
.step--partial .step-node { border-color: var(--color-warning-border); }
.step--partial .step-node::after {
  content: "";
  width: calc(var(--step-node) * 0.4);
  height: calc(var(--step-node) * 0.4);
  border-radius: var(--radius-full);
  background: var(--color-warning-border);
}
.step--partial .step-when { color: var(--color-warning-text); }
/* Loaded (ADR-0083, MG 2026-09-23): the Vessel departed rung with every box
 * on board and the sailing not yet observed — half the node filled with the
 * done green, no check: two facts make the milestone and one is in. The
 * connector out of it stays dashed (nothing follows). */
.step--loaded .step-node {
  border-color: var(--color-success-border);
  background: linear-gradient(
    to right,
    var(--color-success-border) 50%,
    var(--color-surface) 50%
  );
}
.step--loaded .step-when { color: var(--color-success-text); }
.step-label {
  font-size: var(--text-body);
  font-weight: var(--font-weight-medium);
}
.step--pending .step-label,
.step--skipped .step-label,
.step--own .step-label {
  color: var(--color-text-muted);
  font-weight: var(--font-weight-normal);
}
/* Skipped (ADR-0122): a planning rung the import passed over because the
 * terminal reported the box gone before anyone recorded it. Not done and not
 * still to do — a dashed ring, the connector's own "not travelled" stroke, so
 * it reads apart from an outstanding fact rung's solid one. */
.step--skipped .step-node,
.step--own .step-node { border-style: dashed; }
/* Own (ADR-0125): on the customer's ladder, a step the customer arranges itself
 * and nothing has reported. The skipped rung's look, its status line reading
 * "Arranged by you". */
.step-status {
  font-size: var(--text-meta);
  color: var(--color-text-muted);
}
.step-when {
  font-size: var(--text-meta);
  color: var(--color-text-faint);
}

/* Summary grid (the Overview's Operational summary — the same polish): two
 * columns of icon · label · value rows with the three tracks aligned, where
 * .facts stacks a micro-label over each value for dense records. */
.summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: var(--space-4xl);
  row-gap: var(--space-md);
  margin: 0;
}
.summary-row {
  display: grid;
  grid-template-columns: var(--icon-size) var(--summary-label-col) minmax(0, 1fr);
  align-items: start;
  column-gap: var(--space-sm);
  font-size: var(--text-body);
}
.summary-row .icon {
  color: var(--color-text-faint);
  margin-top: var(--space-3xs);
}
.summary-row dt { color: var(--color-text-muted); }
.summary-row dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 768px) {
  .summary { grid-template-columns: minmax(0, 1fr); }
}

/* =========================================================================
 * Container page (spec 2026-09-04 §3, §5.2): the record grain's frame.
 * A tab bar of LINKS (aria-current marks the active one — no tablist, no
 * JS), a main + rail grid, the footer clock line, the head's action
 * cluster. The events table lives with the timeline family below.
 * ========================================================================= */
.tabs {
  display: flex;
  gap: var(--space-xl);
  overflow-x: auto;
  border-bottom: var(--border-width) solid var(--color-border);
  margin-bottom: var(--space-2xl);
}
.tab {
  display: inline-flex;
  align-items: center;
  min-height: var(--target-min);
  padding: var(--space-xs) var(--space-2xs);
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: var(--text-body);
  white-space: nowrap;
}
.tab:hover { color: var(--color-text); }
/* The active underline is an inset shadow, not a border, so inactive tabs
 * need no colourless placeholder border to keep the row's height. */
.tab[aria-current="page"] {
  color: var(--color-accent-strong);
  font-weight: var(--font-weight-medium);
  box-shadow: inset 0 calc(-1 * var(--border-width-thick)) 0 var(--color-accent);
}
.page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--rail-col);
  gap: var(--space-2xl);
  align-items: start;
}
.page-grid--single { grid-template-columns: minmax(0, 1fr); }
.page-main,
.page-rail { display: grid; gap: var(--space-2xl); min-width: 0; }
/* A grid item's automatic minimum size is its CONTENT, so a card holding a
 * wide table or a long heading refuses to shrink below it and pushes the page
 * sideways — the scroll frame inside never gets the chance to scroll, because
 * its host is already too wide (render sweep, first run: site-profile 504 and
 * styleguide 568 against a 402 viewport). Cards are grid items here; giving
 * them a zero floor is what lets S-30's frames do their job. */
.page-main > *,
.page-rail > *,
.card-pair > * { min-width: 0; }
.page-main--full { grid-column: 1 / -1; }
.page-foot { margin-top: var(--space-3xl); }
.head-actions {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
}
/* A one-click write in the head (New PRA, I50): the form is layout-transparent
 * so its button sits in the cluster like any other action. */
.head-actions .pra-start-form {
  display: contents;
}
/* The card-head navigation link ("View vessel ›", "All containers ›", "Work
 * these on the exceptions screen ›"): meta size and medium weight beside the
 * card's own type (MG visual review 2026-09-22); ink and hover come from the
 * base link rule. Buttons in .head-actions are untouched. */
.head-actions a:not(.btn):not(.btn-primary) {
  font-size: var(--text-meta);
  font-weight: var(--font-weight-medium);
}
@media (max-width: 1024px) {
  .page-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Codeblock — verbatim payload display (the XML pages, spec 2026-07-28 §4.1).
 * Content arrives ESCAPED from the template; this component only gives it a
 * readable, scrollable body. Wide payloads scroll inside the block — the page
 * itself never scrolls sideways (same containment rule as .table-scroll). */
.codeblock {
  background: var(--color-surface-subtle);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-md);
  overflow-x: auto;
}
.codeblock pre {
  margin: 0;
  padding: var(--space-md) var(--space-lg);
  font-family: var(--font-family-mono);
  font-size: var(--text-body);
  color: var(--color-text);
}

/* Print (spec 2026-09-04 §5.5): the estate's first print rules. The shell
 * chrome, the tab bar, the menus, chips and pagers go; the page grid drops
 * its rail into one column; links keep their text. The @media prelude is
 * the guard's carve-out; the declarations inside are keywords and tokens.
 * Page-only classes are hidden by their own page stylesheet's print block,
 * which loads after this one. */
@media print {
  .sidebar,
  .sidebar-scrim,
  .topbar,
  .tabs,
  .more-menu,
  .pager,
  .chip-rows,
  .messages,
  .sheet,
  [data-print-slot] { display: none; }
  .shell { display: block; }
  .shell-content { max-width: none; padding: 0; }
  .page-grid { grid-template-columns: minmax(0, 1fr); }
}

/* =========================================================================
 * Settings + Site profile mock fidelity (spec 2026-09-06 §3). Estate
 * components — each has a styleguide specimen and a REQUIRED_COMPONENTS
 * entry; page-only rules live in pages/settings.css.
 * ========================================================================= */

/* Icon tile (§3.1): the one quiet square chip — neutral ground, muted ink —
 * for a card head, a banner, or an About-list row. Colour marks state on
 * this estate, never decoration, so there is exactly one tile. (.site-icon
 * retired with the dashboard's per-site card, 2026-09-16.) */
.icon-tile, .banner-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: var(--icon-tile-size); height: var(--icon-tile-size);
  border-radius: var(--radius-lg);
  background: var(--color-neutral-bg); color: var(--color-text-muted);
  flex: none;
}

/* Card head (§3.1): tile · title block · .head-actions. The h2/h3 sits at
 * the section size with no margin; the one-line .meta beneath it takes a
 * hairline gap. A head that is the whole card (Administration) gives back
 * its bottom margin. */
.card-head {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  margin-bottom: var(--space-2xl);
}
.card-head:last-child { margin-bottom: 0; }
.card-head-title { flex: 1; min-width: 0; }
.card-head h2,
.card-head h3,
.card-inset-copy h3 {
  margin: 0;
  font-size: var(--text-section);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--letter-spacing-tight);
}
.card-head .meta,
.card-inset-copy .meta { margin: var(--space-3xs) 0 0; }

/* Inset panel (§3.2): a form that lives inside a card. --split lays a copy
 * block left and the field row right, wrapping to one column when narrow. */
.card-inset {
  background: var(--color-surface-subtle);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
}
.card-inset > .card-head { margin-bottom: var(--space-lg); }
.card-inset--split {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2xl) var(--space-4xl);
  flex-wrap: wrap;
}
.card-inset--split .card-inset-copy { flex: 1 1 var(--inset-copy-min); min-width: 0; }
.card-inset--split .field-row { flex: 0 1 auto; }

/* Switch (§3.3): a native checkbox restyled as a toggle, CSS only —
 * keyboard, label association, :checked and the focus ring are the
 * checkbox's own (input[type="checkbox"]:focus-visible above still applies).
 * The attribute-qualified selector is deliberate: the global
 * input[type="checkbox"] rule sets --target-min width/height at (0,1,1) and
 * a bare .switch (0,1,0) would lose to it. Filled with the AA-dark accent
 * step when on — a filled affordance, the same tier as .btn-primary. */
input[type="checkbox"].switch {
  appearance: none;
  -webkit-appearance: none;
  width: var(--switch-width);
  height: var(--switch-height);
  margin: 0;
  padding: var(--switch-pad);
  box-sizing: border-box;
  border: 0;
  border-radius: var(--radius-full);
  background: var(--color-border-control);
  cursor: pointer;
  vertical-align: middle;
  transition: background-color var(--motion-fast) ease;
}
input[type="checkbox"].switch::before {
  content: "";
  display: block;
  width: var(--switch-knob);
  height: var(--switch-knob);
  border-radius: var(--radius-full);
  background: var(--color-surface);
  box-shadow: var(--shadow-xs);
  transition: transform var(--motion-fast) ease;
}
input[type="checkbox"].switch:checked { background: var(--color-accent-strong); }
input[type="checkbox"].switch:checked::before {
  transform: translateX(calc(var(--switch-width) - var(--switch-knob) - var(--switch-pad) * 2));
}

/* Read-only field (PRA record, UI polish 2026-10-16): a value the operator
 * cannot type — a fact another system supplied — in the SAME label-over-value
 * rhythm as an input (.field's micro-label, the control height and padding),
 * on the subtle ground with no focus affordance, so a form can keep its
 * fields in their real order and a locked cell lines up with an open one. */
.field--readonly .field-value {
  display: flex;
  align-items: center;
  min-height: var(--control-height);
  padding: var(--space-2xs) var(--space-sm);
  box-sizing: border-box;
  font-size: var(--text-body);
  color: var(--color-text);
  background: var(--color-surface-subtle);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-md);
  overflow-wrap: anywhere;
}

/* Form foot (PRA record, UI polish 2026-10-16, MG ruling R-c): a long form's
 * verbs pinned to the bottom of the viewport while the form scrolls — the
 * sheet's .sheet-foot anatomy floated as a card. Secondary verb first, the
 * ONE .field-confirm + primary pushed right; an optional .form-foot-note
 * runs full width beneath. Sticky to its form, so it scrolls away with it. */
.form-foot {
  position: sticky;
  bottom: var(--space-md);
  z-index: var(--z-form-foot);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm) var(--space-lg);
  padding: var(--space-md) var(--space-xl);
  background: var(--color-surface);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
.form-foot-commit {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm) var(--space-md);
}
.form-foot-commit .field-confirm { align-self: center; }
.form-foot-note { flex-basis: 100%; margin: 0; }
/* Phone: the bar must not eat the viewport. The confirm sentence takes the
 * first row, the two verbs share the second (commit's children join the
 * bar's own flex row via display: contents), and the note — guidance the
 * page already gives — drops out. */
@media (max-width: 768px) {
  .form-foot { bottom: 0; padding: var(--space-sm) var(--space-md); gap: var(--space-xs) var(--space-sm); }
  .form-foot-commit { display: contents; }
  .form-foot-commit .field-confirm { order: -1; flex-basis: 100%; }
  .form-foot > .btn,
  .form-foot-commit > .btn-primary { flex: 1 1 0; }
  .form-foot-note { display: none; }
}
/* A disabled fieldset (a closed record) reads as closed, not as a live form. */
fieldset:disabled .field input,
fieldset:disabled .field select,
fieldset:disabled .field textarea {
  background-color: var(--color-surface-subtle);
  color: var(--color-text-muted);
  cursor: not-allowed;
}

/* Empty-state icon (§3.4): an optional ringed tile above .empty-title. An
 * empty state INSIDE a card is an inset, not a card-in-card: no shadow,
 * the subtle ground. */
.empty-state .empty-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: var(--empty-icon-size); height: var(--empty-icon-size);
  border-radius: var(--radius-full);
  background: var(--color-neutral-bg); color: var(--color-text-muted);
  margin: 0 auto var(--space-lg);
}
.empty-state .empty-icon .icon {
  width: calc(var(--empty-icon-size) / 2);
  height: calc(var(--empty-icon-size) / 2);
}
.card .empty-state {
  box-shadow: none;
  background: var(--color-surface-subtle);
}

/* Facts strip (§3.5): the facts grid as divided cells — a hairline between
 * neighbours, a value that may lead with an icon or hold a pill. */
.facts--strip { gap: var(--space-lg) 0; }
.facts--strip > div {
  padding: 0 var(--space-3xl);
  border-left: var(--border-width) solid var(--color-border);
}
.facts--strip > div:first-child { padding-left: 0; border-left: 0; }
.facts--strip dd { display: flex; align-items: center; gap: var(--space-xs); }
@media (max-width: 768px) {
  .facts--strip > div { padding: 0; border-left: 0; }
}

/* Card pair (§3.7): two sibling cards side by side, one column when narrow. */
.card-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2xl);
}
@media (max-width: 1024px) {
  .card-pair { grid-template-columns: minmax(0, 1fr); }
}

/* Form cards (New order, Edit order, Record booking; MG 2026-12-02): a long
 * form's cards two to a row, so a card is as wide as the few fields it holds
 * and not the page. The first card (who the order is for) spans the row, and
 * so does a last card left on its own. One column below the narrow tier. */
.form-cards {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}
.form-cards > .card { margin: 0; min-width: 0; }
@media (min-width: 769px) {
  .form-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-cards > .card:first-child,
  .form-cards > .card:last-child:nth-child(even) { grid-column: 1 / -1; }
}
/* Split entry (New shipment from a mailed set, ADR-0141): the set's documents
 * card beside the form's field cards. On a wide desktop the documents sit in a
 * narrower left column and stay in view (sticky) while the fields scroll; at
 * the laptop tier and below the card sits above the fields, full width. The
 * desktop grid is declared at the 769 tier and folded back at the 1024 tier,
 * which comes after it: the registry has no wider prelude (ADR-0074 §4.1). */
.split-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-lg);
}
.split-entry > .card { margin: 0; min-width: 0; }
@media (min-width: 769px) {
  .split-entry {
    grid-template-columns: var(--split-entry-aside-width) minmax(0, 1fr);
    align-items: start;
  }
  .split-entry > .card {
    position: sticky;
    top: calc(var(--shell-header-height) + var(--space-lg));
    /* A long set stays reachable on a short window: the card scrolls inside. */
    max-height: var(--split-entry-aside-max-height);
    overflow: auto;
  }
}
@media (max-width: 1024px) {
  .split-entry { grid-template-columns: minmax(0, 1fr); }
  .split-entry > .card { position: static; max-height: none; overflow: visible; }
}
/* Field grid: a card's fields on equal columns of the field basis. auto-fill,
 * never auto-fit: a lone field keeps one column's width and does not stretch
 * across its card. A textarea (.field--wide) takes two columns, or the card's
 * width in the narrow tier's single column. */
.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--field-grow-basis), 1fr));
  gap: var(--space-lg);
  /* start, unlike .field-row's end: a locked field's reason hangs under its
   * control and must not lift it above its neighbours'. */
  align-items: start;
}
.field-grid .field { min-width: 0; }
.field-grid .field input,
.field-grid .field select,
.field-grid .field textarea { width: 100%; }
.field-grid .field--wide { grid-column: 1 / -1; }
/* Rows shared across a grid row (MG 2026-12-04): a .field--rows field is two
 * rows of the grid it sits in (its label, then its .field-body: control, hint,
 * errors), so every label in a row ends on one line and every control starts
 * on the next, however many lines one label wraps to. The field's own small
 * label gap replaces the grid's row gap between its two rows. */
.field-grid .field--rows {
  display: grid;
  grid-row: span 2;
  grid-template-rows: subgrid;
  row-gap: var(--space-3xs);
}
.field-grid .field--rows > label,
.field-grid .field--rows > .micro-label { align-self: end; }
.field-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-3xs);
  min-width: 0;
}
@media (min-width: 769px) {
  .field-grid .field--wide { grid-column: span 2; }
  /* A half-width card of two or four fields sets them in pairs: two columns
   * fill the card, and four fields make two even rows and not three and one. */
  .form-cards > .card:not(:first-child):not(:last-child:nth-child(even)) > .field-grid--pairs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* CTA fold (§5 Closure dates): a .fold whose summary IS the card's primary
 * button and whose body opens as a popover form under it — the .more-menu
 * anatomy (relative wrapper, absolute panel, --z-sheet), so the header row
 * never grows. The summary re-asserts the button's ink and height over
 * .fold > summary's quiet recipe by specificity (.fold.fold--cta > summary
 * is 0,2,1 against 0,1,1), not by source order. */
.fold--cta { position: relative; }
.fold.fold--cta > summary {
  list-style: none;
  color: var(--color-surface);
  min-height: var(--btn-height-sm);
}
.fold.fold--cta > summary::-webkit-details-marker { display: none; }
/* The filled summary draws the ring clear of its fill, as button:focus-visible
 * does for the filled button tiers — summary:focus-visible's inward ring is
 * invisible against this summary's own dark fill. */
.fold.fold--cta > summary:focus-visible {
  outline-offset: var(--focus-ring-offset);
  box-shadow: var(--ring-accent-soft);
}
.fold--cta > .fold-body {
  position: absolute;
  right: 0;
  top: calc(100% + var(--space-2xs));
  z-index: var(--z-menu);
  min-width: var(--fold-body-width);
  padding: var(--space-2xl);
  background: var(--color-surface);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

/* Fact pill (§5 header): a pill that names a FACT (the facility kind), so
 * no tone dot — the styleguide's direction-slab rule. Qualified by .pill so
 * its specificity (0,2,0) beats .pill--neutral::before's tie by specificity,
 * not file order. */
.pill.pill--fact::before { display: none; }

/* =========================================================================
 * Schedule grid — the site x day tile grid (spec docs/superpowers/specs/
 * 2026-08-29-schedule-board-design.md), promoted from pages/schedule.css when
 * the customer Warehousing page became its second consumer (2026-10-05).
 * The plain form: day heads, a site column, a tile per site and day holding
 * its numerals (confirmed in bold, planned as "+n"), the Total row. The
 * operator's layer over it — ceiling suffix, allocation fill, load states,
 * alert badge, priority star, beyond-plan marks — stays in pages/schedule.css,
 * which loads after this file. Declared LAST in this file so every rule sits
 * where the page file had it relative to the rest of portal.css. Tokens only.
 * ========================================================================= */

/* The card chrome (surface, hairline, radius, shadow) belongs to the
 * .table-scroll wrapper — the same box that owns the horizontal scroll, so
 * the grid never widens the PAGE. The grid itself is only the track list and
 * its inset; .sched-scroll carries the rhythm to the next region. The
 * grid's card is lighter than a data table's: the grid is a control, so it
 * takes the hairline shadow rather than the card's lifted one. */
.sched-scroll { margin-bottom: var(--space-5xl); box-shadow: var(--shadow-xs); }
.sched-grid {
  display: grid;
  /* Column one holds a SITE label ("NEWCOLD 30/day"), not a clock face — the
   * booking calendar's --cal-time-col is sized for "09:00" and clipped the
   * code while wrapping the ceiling suffix (controller's walk, round 1). */
  grid-template-columns: var(--sched-site-col) repeat(7, minmax(var(--cal-cell-min), 1fr));
  gap: var(--space-3xs) var(--space-2xs);
  align-items: stretch;
  padding: var(--space-sm) var(--space-md) var(--space-md);
}
/* The grid's top-left corner: deliberately empty (the day headers start in
 * column two), so it needs a box but no treatment. Its ground is the sticky
 * column's opaque surface, below — it sits over the day heads when the grid
 * scrolls sideways. */
/* Two-tier day head — weekday over the date numeral, the way a calendar
 * component draws it (polish 2026-08-30): nothing to wrap, and "today" is
 * the filled numeral rather than a word. */
.sched-dayhead {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3xs);
  padding: var(--space-2xs) 0;
  border-radius: var(--radius-md);
  text-decoration: none;
}
.sched-dow {
  font-size: var(--text-micro);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wide);
  color: var(--color-text-faint);
}
.sched-dom {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--sched-today-size);
  height: var(--sched-today-size);
  border-radius: var(--radius-full);
  font-size: var(--text-body);
  font-weight: var(--font-weight-semibold);
  font-variant-numeric: var(--font-numeric);
  color: var(--color-text);
}
.sched-dayhead.is-today .sched-dom { background: var(--color-accent-strong); color: var(--color-surface); }
.sched-dayhead.is-today .sched-dow { color: var(--color-accent-strong); }
.sched-dayhead.is-selected { background: var(--color-accent-subtle); }
.sched-dayhead.is-past { color: var(--color-text-muted); }
/* The parent's color is defeated by .sched-dom's own `color: var(--color-text)`
 * at higher specificity (fix round 2, spec D5) — same shape as the ledger's
 * is-completed bug. .sched-dow declares its own `--color-text-faint` always,
 * past day or not — it was never the full-strength ink the parent rule was
 * trying to mute, so it needs no override here. */
.sched-dayhead.is-past .sched-dom { color: var(--color-text-muted); }
.sched-site {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
  padding-left: var(--space-2xs);
  border-radius: var(--radius-md);
  color: var(--color-text);
  text-decoration: none;
}
/* The site column stays put while the grid scrolls sideways (MG ruling 14,
 * 2026-09-26): on a phone the week scrolls inside .sched-scroll and the site
 * names used to scroll away with it. Sticky within that scroller, so it is
 * inert wherever the grid fits; it needs an opaque ground or the cells
 * passing beneath show through (the selected wash below is opaque too). The
 * Total label rides the same column. */
.sched-site,
.sched-corner,
.sched-total-label {
  position: sticky;
  left: 0;
  z-index: calc(var(--z-local-raise) + 1); /* over the cells' own raised badges */
  background: var(--color-surface);
}
.sched-site-code { font-size: var(--text-meta); font-weight: var(--font-weight-semibold); }
/* The accent wash is translucent; layered over the surface so the pinned
 * column stays opaque (ruling 14). */
.sched-site.is-selected {
  background: linear-gradient(var(--color-accent-subtle), var(--color-accent-subtle)), var(--color-surface);
}
.sched-cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--target-min);
  /* The operator's corner badges ride a BAND of their own along the top
   * rather than overlaying the number (controller's walk, round 1): a cell is
   * as narrow as --cal-cell-min, so an overlaid ! landed on top of "6/6"
   * exactly where the pressure mattered most. Reserving the band keeps the
   * count fully legible at every column width, and the badges no longer hang
   * outside the box, where the .table-scroll clip ate them on the last column. */
  padding: var(--sched-cell-pad-top) var(--space-2xs) var(--space-2xs);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  text-decoration: none;
  /* The operator's allocation fill is the cell's own ground: clip it to the
   * rounded box. The badges ride the reserved band INSIDE the box, so
   * nothing is lost to the clip. */
  overflow: hidden;
}
.sched-cell:hover { background: var(--color-surface-hover); }
.sched-cell.is-dimmed { color: var(--color-text-muted); }
/* An empty day is GROUND, not figure (polish 2026-08-30): no border, no
 * glyph, a barely-there tint — so the booked cells are what the eye lands on
 * instead of eighteen dashed boxes. */
.sched-cell--empty { border-color: transparent; background: var(--color-surface-subtle); }
/* A past day is what HAPPENED (spec §3.3): the grey deliberately outranks the
 * operator's pressure tints — pressure is a planning signal, and there is
 * nothing left to plan there. A state's saturated border stays, so the day
 * is still readable. */
.sched-cell.is-past { background: var(--color-surface-subtle); }
/* The selected scope, drawn by GRAIN (the grid's modifier): a day or a site
 * is a WASH down the column / along the row (a calendar's own idiom), and a
 * single cell is the same wash on its own — the accent ground is enough,
 * no ring (MG in-play 2026-08-30). Declared after .is-past so the wash
 * wins on a past day that is selected. */
.sched-cell.is-selected { background: var(--color-accent-subtle); }
.sched-count { font-size: var(--text-meta); font-variant-numeric: var(--font-numeric); }
.sched-count b { font-size: var(--text-body); font-weight: var(--font-weight-semibold); }
/* The planned figure ("+n"; a planned-only cell reads "n"), quieter than
 * the confirmed numeral beside it. */
.sched-planned { color: var(--color-text-muted); }
/* The total row (MG 2026-09-26): each day's load across every site. A
 * summary, not a cell — no border, no fill, no state tint — set off from the
 * site rows by a hairline rule across the whole row, like a table's footer.
 * It follows the selection wash of its day column, and a past day greys like
 * its cells. */
.sched-total-label,
.sched-total {
  border-top: var(--border-width) solid var(--color-border);
  padding-top: var(--space-2xs);
  margin-top: var(--space-2xs);
}
.sched-total-label {
  display: flex;
  align-items: center;
  padding-left: var(--space-2xs);
  font-size: var(--text-meta);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
}
.sched-total {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--target-min);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  color: var(--color-text);
  text-decoration: none;
}
.sched-total:hover { background: var(--color-surface-hover); }
.sched-total.is-selected { background: var(--color-accent-subtle); }
.sched-total.is-past { color: var(--color-text-muted); }
