/* ==========================================================================
   V2T Cargo Tracking, design system.

   One stylesheet, one visual language. Everything below is built from the
   token block; no colour is ever written at the point of use, and a test
   (dev/tests/test_status_colours.py) fails the build if one is.

   Contrast is measured, never eyeballed. Ratios are recorded beside each
   token so a future change can be checked rather than guessed at.
   ========================================================================== */

:root {
  /* --- brand ---------------------------------------------------------
     #08C4BE measures 2.18:1 on white, so it is a SURFACE colour only.
     It never carries text, and white never sits on it. Text uses the
     deeper ramp. Section 6a of CLAUDE.md. */
  --brand: #08C4BE;
  --brand-hover: #06b3ad;
  --brand-deep: #05716E;      /* 5.84:1 on white, links and text */
  --brand-darker: #064F4C;    /* 9.41:1 on white, headings */
  --brand-ink: #06322f;       /* 6.41:1 on brand, text sitting on teal */
  --brand-wash: #eafaf9;
  --brand-line: #b6e8e6;

  /* --- neutrals, measured on white -----------------------------------
     n-400  2.61:1  borders and dividers only
     n-500  4.47:1  large text only
     n-600  6.55:1  body text, muted
     n-700  9.63:1  body text
     n-800 13.62:1  headings
     n-900 17.33:1  primary ink */
  --n-0: #ffffff;
  --n-25: #fbfcfc;
  --n-50: #f6f8f8;
  --n-100: #eef1f2;
  --n-200: #e2e7e8;
  --n-300: #cbd3d4;
  --n-400: #94a3a4;
  --n-500: #6b7a7b;
  --n-600: #526061;
  --n-700: #3b4748;
  --n-800: #243031;
  --n-900: #131c1d;

  /* --- semantic surfaces --------------------------------------------- */
  --bg: #f6f8f8;
  --surface: #ffffff;
  --surface-sunken: #f6f8f8;
  --ink: #131c1d;
  --ink-strong: #131c1d;
  --ink-body: #3b4748;
  --ink-muted: #526061;       /* 6.55:1, safe for small text */
  --ink-faint: #6b7a7b;
  --line: #e2e7e8;
  --line-strong: #cbd3d4;

  /* --- sidebar, measured on #111c1e ----------------------------------
     brand 7.98:1, white 17.37:1, n-400 6.65:1 */
  --nav-bg: #111c1e;
  --nav-bg-hover: #1b292b;
  /* The sidebar is dark in BOTH themes, so its inks are absolute rather than
     borrowed from the neutral ramp. --n-0 used to carry the brand name here, and
     that broke the moment dark mode inverted the ramp: --n-0 became near-black and
     the wordmark vanished into the sidebar. A token that means "white" must say so. */
  --nav-ink-strong: #f2f6f6;
  --nav-ink: #cbd3d4;
  --nav-ink-muted: #94a3a4;
  --nav-ink-active: #06322f;
  --nav-active: #08C4BE;
  --nav-line: #243031;

  /* --- feedback ------------------------------------------------------- */
  --ok: #127a4a;
  --ok-wash: #e8f6ee;
  --ok-line: #c2e3d1;
  --warn: #8a5a00;
  --warn-wash: #fdf3e0;
  --warn-line: #ecd7a8;
  --bad: #a32020;
  --bad-wash: #fceded;
  --bad-line: #eebcbc;
  --info: #1f5f8b;
  --info-wash: #eaf2f8;
  --info-line: #c3d8e8;

  /* --- status colours -------------------------------------------------
     Four hues plus two fill-less treatments. The count is a measured
     result: seven hues were tried and rejected, because under deuteranopia
     the closest pair sat 17 apart and four sat within 0.006 luminance of
     each other, indistinguishable in greyscale. Colour encodes urgency,
     text encodes the specific status. Spec section 3.14.
       progress   5.84:1 on white, 5.29:1 on its wash
       complete   6.65:1 on white, 5.91:1 on its wash
       exception  8.32:1 on white, 7.16:1 on its wash
       delay      7.98:1 on white, 7.12:1 on its wash
     Colour never stands alone: every badge carries text, and the timeline
     marker carries a shape, because exception and delay sit only 21 apart
     under protanopia. */
  --status-progress: #05716E;
  --status-progress-wash: #e6f7f6;
  --status-progress-line: #c2e8e6;
  --status-complete: #0f6a40;
  --status-complete-wash: #e6f5ec;
  --status-complete-line: #bfe2cd;
  --status-exception: #96201f;
  --status-exception-wash: #fbeaea;
  --status-exception-line: #edc4c4;
  --status-delay: #7a4300;
  --status-delay-wash: #fdf0e2;
  --status-delay-line: #ecd4b4;
  --status-forecast: #5a6b6a;
  --status-forecast-wash: #f2f5f5;
  --status-unknown: #5a6b6a;

  /* Demo marker. Deliberately not a status hue, and measured on all three axes the
     way 6f measured the palette: 11.64:1 on white, 9.75:1 on its own wash, a worst
     case separation of 51 from every status ink under deuteranopia, protanopia and
     tritanopia, and a greyscale gap of at least 0.036 from every one of them.

     Two colours were rejected on measurement rather than taste. The existing --warn
     amber, because it sits beside --status-delay #7a4300, the "slipping" colour, and a
     demo badge in almost the slipping colour on the page whose whole subject is
     slipping is the one confusion this marker must never create. And #5e35b1, which
     passed contrast and colour vision but landed within 0.0005 luminance of
     --status-delay, so the two were identical in greyscale. */
  --demo: #40277d;
  --demo-wash: #ede9f7;
  --demo-line: #c3b5e4;

  /* --- sea and air, Phase 33 ------------------------------------------
     Red means sea and blue means air, on the sea/air switch and the mode marker on a
     row. Measured in dev/tests/test_phase33_design.py, never eyeballed:
       sea #c72c20  white on it 5.51:1, on the sunken page 5.17:1, luminance .140
       air #153978  white on it 11.12:1, on the sunken page 10.43:1, luminance .044
     Sea against air: ΔE 99 normal, 95 deuteranopia, 71 protanopia, 105 tritanopia
     (Machado 2009 then CIE76), and 0.096 apart in greyscale.
     The known cost: sea is a red, and so is --status-exception. They sit ΔE 15 to 21
     apart under simulation, about as close as exception and delay already are, so the
     two are kept apart by lightness (0.064 in greyscale, over 6f's 0.03 floor) and by
     never letting the sea red carry a status: it appears only with the ship icon and
     the word "Sea", and an exception always carries its own words and diamond. */
  --sea: #c72c20;
  --sea-on: #ffffff;
  --sea-wash: #fdecea;
  --air: #153978;
  --air-on: #ffffff;
  --air-wash: #e8eef8;

  /* Tap targets and icon sizes, Phase 33. 44px is the smallest target a person with
     unsteady hands or a touch screen can hit reliably; primary controls go bigger. */
  --tap: 44px;
  --logo-chip: #ffffff;      /* the chip behind a carrier logo is white in BOTH themes: logos are drawn for white */
  --tap-lg: 56px;
  --icon: 20px;
  --icon-lg: 24px;
  /* Phase 34: the route map's height, fleet and single shipment. */
  --map-h: 520px;
  --map-h-single: 360px;
  /* Phase 36: the widest a single-column form grows. */
  --form-w: 880px;

  /* --- shape and rhythm, a 4px scale ---------------------------------- */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
  --s5: 20px; --s6: 24px; --s7: 32px; --s8: 40px; --s9: 56px;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-pill: 999px;
  --gap: 16px;

  --shadow-sm: 0 1px 2px rgba(19, 28, 29, .05);
  --shadow: 0 1px 2px rgba(19, 28, 29, .04), 0 2px 8px rgba(19, 28, 29, .05);
  --shadow-lg: 0 8px 24px rgba(19, 28, 29, .10), 0 2px 6px rgba(19, 28, 29, .06);
  --ring: 0 0 0 3px rgba(8, 196, 190, .32);

  --nav-w: 264px;  /* Phase 33: wider for 15px labels and 20px icons */
  --topbar-h: 60px;

  /* The SYSTEM stack, and "Inter" is deliberately gone from the front of it.
     Nothing in this project ever loaded Inter: there is no @font-face and no network
     request for one, so naming it first meant the app rendered in Inter for whoever
     happened to have it installed locally and in something else for everybody else.
     Two people looking at the same screen saw different type. The system stack is also
     the actual mechanism behind "looks like the OS designed it", not a coincidence, and
     it costs no request, which is the same no-runtime-dependency rule that vendored
     React and chose FileField over ImageField. */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text",
          "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
          "Liberation Mono", monospace;

  /* --- type scale -----------------------------------------------------
     A closed set, replacing the twelve ad-hoc font-sizes this stylesheet
     had grown (13px, 12.5px, 11.5px, 10.5px and so on, 134 declarations
     in total). Sizes carry their line-height, because the two are one
     decision and splitting them is how vertical rhythm drifts. */
  --t-2xs: 10.5px;  --lh-2xs: 1.4;
  --t-xs:  11.5px;  --lh-xs:  1.45;
  --t-sm:  12.5px;  --lh-sm:  1.5;
  --t-base:13.5px;  --lh-base:1.55;
  --t-md:  15px;    --lh-md:  1.5;
  --t-lg:  18px;    --lh-lg:  1.4;
  --t-xl:  22px;    --lh-xl:  1.3;
  --t-2xl: 28px;    --lh-2xl: 1.22;
  --t-3xl: 34px;    --lh-3xl: 1.15;

  --w-normal: 400;
  --w-medium: 500;
  --w-semi:   600;
  --w-bold:   680;

  /* Optical tightening. Large type needs negative tracking to stop looking
     loose; small caps-style labels need positive tracking to stay legible. */
  --track-tight: -.018em;
  --track-snug:  -.011em;
  --track-wide:  .08em;

  /* --- motion ---------------------------------------------------------
     Short and consistent. Anything longer than ~250ms on a hover reads as
     lag rather than polish on an operational tool somebody uses all day. */
  --ease: cubic-bezier(.2, 0, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --dur-fast: 120ms;
  --dur: 180ms;
  --dur-slow: 260ms;
  --motion: var(--dur) var(--ease);
}

/* Respect the operating system's own answer to "please stop moving things".
   A transition that cannot be turned off is an accessibility defect, not polish. */
@media (prefers-reduced-motion: reduce) {
  :root { --dur-fast: 0ms; --dur: 0ms; --dur-slow: 0ms; }
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
}


/* ==========================================================================
   Dark theme. Phase 16.

   Three cases, and the order matters:
     1. bare :root above is light, and is the default for everybody.
     2. a SYSTEM user on a dark device gets the media query below.
     3. an explicit choice writes data-theme on <html> and wins over both.

   The media query is scoped to :not([data-theme="light"]) so that somebody who
   explicitly chose Light on a dark-mode laptop actually gets light. Without
   that, an explicit Light preference would be silently overridden by the
   operating system, which is the opposite of what choosing means.

   The customer tracking page at /track/<token>/ has no login and therefore no
   stored preference. It reaches case 2 and nothing else, deliberately: spec
   3.23. It must never look for a UserProfile, because there is not one.

   The two blocks below carry IDENTICAL token bodies and a test asserts they
   stay identical, because two hand-maintained copies of a palette is precisely
   the "second source of truth that agrees today and drifts tomorrow" defect
   this project keeps finding.
   ========================================================================== */

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  /* --- dark surfaces -------------------------------------------------
     Measured on --surface #151e1e, not eyeballed:
       ink-strong 15.56:1   ink-body 12.85:1
       ink-muted   7.73:1   ink-faint 5.81:1
     A near-black with a trace of the brand's green, rather than pure
     #000: an operational tool read for hours is easier on a surface that
     is not maximum contrast, and pure black plus pure white is where
     halation comes from. */
  --bg: #0d1414;
  --surface: #151e1e;
  --surface-sunken: #101818;
  --surface-raised: #1c2726;

  --n-0: #0d1414;
  --n-25: #101818;
  --n-50: #151e1e;
  --n-100: #1c2726;
  --n-200: #26312f;
  --n-300: #33403e;
  --n-400: #4d5d5b;
  --n-500: #6f807e;
  --n-600: #8b9a99;
  --n-700: #a3b2b1;
  --n-800: #d8e2e1;
  --n-900: #f1f6f5;

  --ink: #f1f6f5;
  --ink-strong: #f1f6f5;
  --ink-body: #d8e2e1;
  --ink-muted: #a3b2b1;
  --ink-faint: #8b9a99;
  --line: #26312f;
  --line-strong: #33403e;

  /* The teal is still never text at its raw value in light mode; on dark it
     measures 7.81:1 on the surface, so a lighter ramp carries links and the
     raw brand stays for fills and markers. */
  --brand-deep: #4fd9d2;      /* 9.86:1 on surface */
  --brand-darker: #94e5e1;    /* 11.77:1, headings and hovers */
  --brand-wash: #0c2523;
  --brand-line: #1c4a47;

  /* The sidebar is already dark in light mode, so it barely moves. It is
     nudged to sit on the darker page rather than float above it. */
  --nav-bg: #0a1011;
  --nav-bg-hover: #16211f;
  --nav-line: #1f2a29;
  --nav-ink-strong: #f2f6f6;

  /* --- feedback, on dark --------------------------------------------- */
  --ok: #71d6a3;
  --ok-wash: #0d2419;
  --ok-line: #1d4633;
  --warn: #e29b38;
  --warn-wash: #281c0b;
  --warn-line: #4a3718;
  --bad: #f05751;
  --bad-wash: #2b1312;
  --bad-line: #4d2423;
  --info: #7cc0ea;
  --info-wash: #0f2130;
  --info-line: #1f3f57;

  /* --- status, restaged for dark -------------------------------------
     Every one measured on the dark surface AND on its own wash, and then
     spread in luminance the way 6f spread the light palette. The first
     dark candidates all passed AA and failed THAT test: progress and
     delay sat 0.0114 apart in greyscale and complete and exception
     0.0143, well inside 6f's 0.03 floor, so four badges would have been
     one grey smear on a black-and-white printout. These were searched for
     by walking each hue until its luminance hit a target, not picked.
       exception #f05751  5.00:1 on surface, 5.14:1 on wash, lum .259
       delay     #e29b38  7.26:1 on surface, 7.12:1 on wash, lum .399
       complete  #71d6a3  9.58:1 on surface, 9.23:1 on wash, lum .542
       progress  #94e5e1 11.77:1 on surface, 11.16:1 on wash, lum .678
     Worst greyscale gap between any two: 0.1352, against a 0.03 floor. */
  --status-progress: #94e5e1;
  --status-progress-wash: #0c2523;
  --status-progress-line: #1c4a47;
  --status-complete: #71d6a3;
  --status-complete-wash: #0d2419;
  --status-complete-line: #1d4633;
  --status-exception: #f05751;
  --status-exception-wash: #2b1312;
  --status-exception-line: #4d2423;
  --status-delay: #e29b38;
  --status-delay-wash: #281c0b;
  --status-delay-line: #4a3718;
  --status-forecast: #a8b8b7;
  --status-forecast-wash: #1a2322;
  --status-unknown: #a8b8b7;

  --demo: #bfa9f5;            /* 8.26:1 on surface, 8.44:1 on its wash */
  --demo-wash: #1d1630;
  --demo-line: #342a52;

  /* Sea and air on dark: lighter fills carrying dark ink, measured like the light pair.
     Sea stays 0.069 lighter than dark exception in greyscale. */
  --sea: #e87c75;
  --sea-on: #140807;
  --sea-wash: #2b1413;
  --air: #8cb9eb;
  --air-on: #06121f;
  --air-wash: #0f1c2e;

  /* Shadow does almost nothing on a dark ground, so depth comes from a
     lighter raised surface plus a hairline. Keeping a heavy black shadow
     here is the usual reason dark themes look flat and muddy. */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .34);
  --shadow: 0 1px 2px rgba(0, 0, 0, .30), 0 2px 10px rgba(0, 0, 0, .28);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, .46), 0 2px 8px rgba(0, 0, 0, .34);
  --ring: 0 0 0 3px rgba(79, 217, 210, .34);
  }
}

:root[data-theme="dark"] {
  /* --- dark surfaces -------------------------------------------------
     Measured on --surface #151e1e, not eyeballed:
       ink-strong 15.56:1   ink-body 12.85:1
       ink-muted   7.73:1   ink-faint 5.81:1
     A near-black with a trace of the brand's green, rather than pure
     #000: an operational tool read for hours is easier on a surface that
     is not maximum contrast, and pure black plus pure white is where
     halation comes from. */
  --bg: #0d1414;
  --surface: #151e1e;
  --surface-sunken: #101818;
  --surface-raised: #1c2726;

  --n-0: #0d1414;
  --n-25: #101818;
  --n-50: #151e1e;
  --n-100: #1c2726;
  --n-200: #26312f;
  --n-300: #33403e;
  --n-400: #4d5d5b;
  --n-500: #6f807e;
  --n-600: #8b9a99;
  --n-700: #a3b2b1;
  --n-800: #d8e2e1;
  --n-900: #f1f6f5;

  --ink: #f1f6f5;
  --ink-strong: #f1f6f5;
  --ink-body: #d8e2e1;
  --ink-muted: #a3b2b1;
  --ink-faint: #8b9a99;
  --line: #26312f;
  --line-strong: #33403e;

  /* The teal is still never text at its raw value in light mode; on dark it
     measures 7.81:1 on the surface, so a lighter ramp carries links and the
     raw brand stays for fills and markers. */
  --brand-deep: #4fd9d2;      /* 9.86:1 on surface */
  --brand-darker: #94e5e1;    /* 11.77:1, headings and hovers */
  --brand-wash: #0c2523;
  --brand-line: #1c4a47;

  /* The sidebar is already dark in light mode, so it barely moves. It is
     nudged to sit on the darker page rather than float above it. */
  --nav-bg: #0a1011;
  --nav-bg-hover: #16211f;
  --nav-line: #1f2a29;
  --nav-ink-strong: #f2f6f6;

  /* --- feedback, on dark --------------------------------------------- */
  --ok: #71d6a3;
  --ok-wash: #0d2419;
  --ok-line: #1d4633;
  --warn: #e29b38;
  --warn-wash: #281c0b;
  --warn-line: #4a3718;
  --bad: #f05751;
  --bad-wash: #2b1312;
  --bad-line: #4d2423;
  --info: #7cc0ea;
  --info-wash: #0f2130;
  --info-line: #1f3f57;

  /* --- status, restaged for dark -------------------------------------
     Every one measured on the dark surface AND on its own wash, and then
     spread in luminance the way 6f spread the light palette. The first
     dark candidates all passed AA and failed THAT test: progress and
     delay sat 0.0114 apart in greyscale and complete and exception
     0.0143, well inside 6f's 0.03 floor, so four badges would have been
     one grey smear on a black-and-white printout. These were searched for
     by walking each hue until its luminance hit a target, not picked.
       exception #f05751  5.00:1 on surface, 5.14:1 on wash, lum .259
       delay     #e29b38  7.26:1 on surface, 7.12:1 on wash, lum .399
       complete  #71d6a3  9.58:1 on surface, 9.23:1 on wash, lum .542
       progress  #94e5e1 11.77:1 on surface, 11.16:1 on wash, lum .678
     Worst greyscale gap between any two: 0.1352, against a 0.03 floor. */
  --status-progress: #94e5e1;
  --status-progress-wash: #0c2523;
  --status-progress-line: #1c4a47;
  --status-complete: #71d6a3;
  --status-complete-wash: #0d2419;
  --status-complete-line: #1d4633;
  --status-exception: #f05751;
  --status-exception-wash: #2b1312;
  --status-exception-line: #4d2423;
  --status-delay: #e29b38;
  --status-delay-wash: #281c0b;
  --status-delay-line: #4a3718;
  --status-forecast: #a8b8b7;
  --status-forecast-wash: #1a2322;
  --status-unknown: #a8b8b7;

  --demo: #bfa9f5;            /* 8.26:1 on surface, 8.44:1 on its wash */
  --demo-wash: #1d1630;
  --demo-line: #342a52;

  /* Sea and air on dark: lighter fills carrying dark ink, measured like the light pair.
     Sea stays 0.069 lighter than dark exception in greyscale. */
  --sea: #e87c75;
  --sea-on: #140807;
  --sea-wash: #2b1413;
  --air: #8cb9eb;
  --air-on: #06121f;
  --air-wash: #0f1c2e;

  /* Shadow does almost nothing on a dark ground, so depth comes from a
     lighter raised surface plus a hairline. Keeping a heavy black shadow
     here is the usual reason dark themes look flat and muddy. */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .34);
  --shadow: 0 1px 2px rgba(0, 0, 0, .30), 0 2px 10px rgba(0, 0, 0, .28);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, .46), 0 2px 8px rgba(0, 0, 0, .34);
  --ring: 0 0 0 3px rgba(79, 217, 210, .34);
}

/* Tell the browser which way round the page is, so form controls, scrollbars
   and the space past the end of the page match rather than flashing white. */
:root[data-theme="dark"] { color-scheme: dark; }
:root[data-theme="light"] { color-scheme: light; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { color-scheme: dark; }
}

* { box-sizing: border-box; }

html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink-body);
  font: 400 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
a { color: var(--brand-deep); text-decoration: none; }
a:hover { color: var(--brand-darker); text-decoration: underline;
  text-underline-offset: 2px; }
code, .mono { font-family: var(--mono); font-size: .92em; }
h1, h2, h3 { margin: 0; color: var(--ink-strong); letter-spacing: -.011em; }
h1 { font-size: 22px; font-weight: 650; line-height: 1.25; }
h2 { font-size: 15px; font-weight: 640; }
h3 { font-size: 13px; font-weight: 640; }
p { margin: 0 0 var(--s2); }
p:last-child { margin-bottom: 0; }
.muted { color: var(--ink-muted); }
.faint { color: var(--ink-faint); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--radius-sm); }

/* ==========================================================================
   Shell: fixed sidebar, sticky topbar, scrolling content
   ========================================================================== */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--nav-w); flex: none; background: var(--nav-bg);
  display: flex; flex-direction: column; position: sticky; top: 0;
  height: 100vh; overflow-y: auto;
}
.sidebar__brand {
  display: flex; align-items: center; gap: var(--s3);
  padding: 0 var(--s5); height: var(--topbar-h); flex: none;
  color: var(--nav-ink-strong); text-decoration: none; border-bottom: 1px solid var(--nav-line);
}
.sidebar__brand:hover { color: var(--nav-ink-strong); text-decoration: none; }
.sidebar__mark {
  width: 30px; height: 30px; border-radius: 8px; background: var(--brand);
  color: var(--brand-ink); display: grid; place-items: center;
  font-size: 11px; font-weight: 800; letter-spacing: -.02em; flex: none;
}
.sidebar__name { font-size: 14px; font-weight: 650; line-height: 1.2; }
.sidebar__name small { display: block; font-size: 11px; font-weight: 500;
  color: var(--nav-ink-muted); letter-spacing: .02em; }

.sidebar__section { padding: var(--s5) var(--s3) var(--s2); }
.sidebar__label {
  padding: 0 var(--s3) var(--s2); font-size: 10px; font-weight: 700;
  letter-spacing: .09em; text-transform: uppercase; color: var(--nav-ink-muted);
}
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav__item {
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s2) var(--s3); border-radius: var(--radius-sm);
  color: var(--nav-ink); font-size: 13.5px; font-weight: 500;
  text-decoration: none; transition: background .12s ease, color .12s ease;
}
.nav__item:hover { background: var(--nav-bg-hover); color: var(--nav-ink-strong);
  text-decoration: none; }
.nav__item--active { background: var(--nav-active); color: var(--nav-ink-active);
  font-weight: 640; }
.nav__item--active:hover { background: var(--nav-active); color: var(--nav-ink-active); }
.nav__icon { width: 16px; height: 16px; flex: none; }
.nav__count {
  margin-left: auto; font-size: 11px; font-weight: 700; padding: 1px 7px;
  border-radius: var(--radius-pill); background: var(--nav-bg-hover);
  color: var(--nav-ink);
}
.nav__item--active .nav__count { background: rgba(6, 50, 47, .18);
  color: var(--nav-ink-active); }

.sidebar__foot { margin-top: auto; padding: var(--s4) var(--s5);
  border-top: 1px solid var(--nav-line); color: var(--nav-ink-muted);
  font-size: 11px; }

.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: var(--topbar-h); flex: none; background: var(--surface);
  border-bottom: 1px solid var(--line); display: flex; align-items: center;
  gap: var(--s4); padding: 0 var(--s7); position: sticky; top: 0; z-index: 20;
}
.topbar__title { font-size: 14px; font-weight: 600; color: var(--ink-strong); }
.topbar__spacer { margin-left: auto; }
.topbar__user { display: flex; align-items: center; gap: var(--s3);
  font-size: 13px; color: var(--ink-muted); }
.avatar {
  width: 28px; height: 28px; border-radius: var(--radius-pill);
  background: var(--brand-wash); color: var(--brand-darker);
  display: grid; place-items: center; font-size: 11px; font-weight: 700;
  border: 1px solid var(--brand-line);
}
.linkish { background: none; border: 0; color: var(--brand-deep); cursor: pointer;
  font: inherit; font-size: 13px; padding: 0; }
.linkish:hover { color: var(--brand-darker); text-decoration: underline; }

.content { padding: var(--s7); max-width: 1440px; width: 100%; }
.footer { padding: 0 var(--s7) var(--s6); color: var(--ink-faint); font-size: 11px; }

/* ==========================================================================
   Page headers
   ========================================================================== */
.page-head { display: flex; align-items: flex-end; gap: var(--s4);
  flex-wrap: wrap; margin-bottom: var(--s6); }
.page-head__sub { margin: var(--s2) 0 0; color: var(--ink-muted);
  font-size: var(--t-base); line-height: var(--lh-base); }
.page-head__actions { margin-left: auto; display: flex; gap: var(--s2);
  align-items: center; }
.crumb { margin: 0 0 var(--s3); font-size: 13px; }
.crumb a { color: var(--ink-muted); }
.crumb a:hover { color: var(--brand-deep); }

.detail-head { display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--s4); margin-bottom: var(--s5); flex-wrap: wrap; }
.detail-head__eyebrow { color: var(--ink-faint); font-size: 11px; margin: 0 0 var(--s1);
  text-transform: uppercase; letter-spacing: .07em; font-weight: 650; }
.detail-head h1 { font-family: var(--mono); font-size: 24px; letter-spacing: -.01em; }
.detail-head__actions { display: flex; align-items: center; gap: var(--s3);
  flex-wrap: wrap; }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  padding: 8px var(--s4); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--ink-body);
  font: var(--w-medium) var(--t-base)/1 var(--font); cursor: pointer;
  text-decoration: none; white-space: nowrap;
  transition: background var(--motion), border-color var(--motion),
              color var(--motion), box-shadow var(--motion), transform var(--dur-fast); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 0; box-shadow: var(--ring); }
.btn:hover { background: var(--n-50); border-color: var(--n-400);
  color: var(--ink-strong); text-decoration: none; }
.btn--primary { background: var(--brand); border-color: var(--brand);
  color: var(--brand-ink); font-weight: 650; }
.btn--primary:hover { background: var(--brand-hover); border-color: var(--brand-hover);
  color: var(--brand-ink); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--ink-muted); }
.btn--ghost:hover { background: var(--n-100); color: var(--ink-strong); }
.btn--danger { color: var(--bad); border-color: var(--bad-line); background: var(--bad-wash); }
.btn--danger:hover { background: var(--bad-wash); border-color: var(--bad); }
.btn--sm { padding: 5px 10px; font-size: 12.5px; }
.btn--block { width: 100%; }
.btn--disabled, .btn[disabled] { color: var(--ink-faint); background: var(--n-50);
  border-color: var(--line); cursor: default; }
.btn--disabled:hover { background: var(--n-50); border-color: var(--line);
  color: var(--ink-faint); }

/* ==========================================================================
   Cards and panels
   ========================================================================== */
.panel { background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  margin-bottom: var(--s5); overflow: hidden; }
.panel__head { display: flex; align-items: center; gap: var(--s3);
  padding: var(--s4) var(--s5); border-bottom: 1px solid var(--line); }
.panel__title { font-size: var(--t-2xs); text-transform: uppercase;
  letter-spacing: var(--track-wide); color: var(--ink-faint);
  font-weight: var(--w-bold); margin: 0; }
.panel__body { padding: var(--s5); }
.panel__actions { margin-left: auto; display: flex; gap: var(--s2); }
.panel--quiet { background: transparent; border-color: transparent; box-shadow: none; }
.panel--quiet .panel__head { padding-left: 0; padding-right: 0; }
.panel--form { max-width: 620px; }

/* Metric tiles for the dashboard */
/* Phase 16. The number is the point, so it is the biggest thing in the tile by a clear
   margin, and the accent is a full edge rather than a 3px sliver: at a glance across a
   desk the colour has to be findable before the digits are read. */
.tiles { display: grid; gap: var(--s4); margin-bottom: var(--s6);
  grid-template-columns: repeat(auto-fit, minmax(212px, 1fr)); }
.tile {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: var(--s5) var(--s5) var(--s5) var(--s6);
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: var(--s2); text-decoration: none;
  transition: border-color var(--motion), box-shadow var(--motion),
              transform var(--motion);
}
/* The accent lives on a pseudo-element so the tile keeps a single uniform border and
   the colour can run the full height without fighting the radius. */
.tile::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px;
  background: var(--line-strong); }
a.tile:hover { border-color: var(--brand-line); box-shadow: var(--shadow);
  transform: translateY(-1px); text-decoration: none; }
a.tile:focus-visible { outline: 0; box-shadow: var(--ring); }
.tile__label { font-size: var(--t-2xs); text-transform: uppercase;
  letter-spacing: var(--track-wide); color: var(--ink-faint);
  font-weight: var(--w-bold); }
.tile__value { font-size: var(--t-3xl); font-weight: var(--w-bold);
  color: var(--ink-strong); line-height: 1; font-variant-numeric: tabular-nums;
  letter-spacing: var(--track-tight); }
.tile__meta { font-size: var(--t-sm); line-height: var(--lh-sm); color: var(--ink-muted); }
.tile--alert::before { background: var(--status-exception); }
.tile--warn::before { background: var(--status-delay); }
.tile--ok::before { background: var(--status-complete); }
.tile--brand::before { background: var(--brand); }
/* A tile reporting a real problem gets a tinted ground as well as an edge, because
   colour on an edge alone is easy to miss on a wide screen. The text on it is the
   measured status ink, never the raw brand. */
.tile--alert { background: color-mix(in srgb, var(--status-exception-wash) 62%, var(--surface)); }
.tile--warn { background: color-mix(in srgb, var(--status-delay-wash) 55%, var(--surface)); }

.split { display: grid; gap: var(--s4); grid-template-columns: 2fr 1fr;
  align-items: start; }
@media (max-width: 1100px) { .split { grid-template-columns: 1fr; } }

/* ==========================================================================
   Tables, dense by design: this is operational work
   ========================================================================== */
.table-scroll { overflow-x: auto; }
.panel > .table-scroll { border-radius: 0; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th, .table td { text-align: left; padding: 11px var(--s4);
  border-bottom: 1px solid var(--line); font-size: var(--t-base); white-space: nowrap;
  vertical-align: middle; }
/* A cell carrying a sentence (an import row's reason) wraps instead of running off the panel. */
.table td.cell--prose { white-space: normal; min-width: 18rem; }
.table thead th {
  position: sticky; top: 0; z-index: 1;
  background: var(--surface-sunken); color: var(--ink-faint); font-size: var(--t-2xs);
  font-weight: var(--w-bold); text-transform: uppercase; letter-spacing: var(--track-wide);
  border-bottom: 1px solid var(--line-strong); padding-top: 9px; padding-bottom: 9px;
}
.table tbody tr { transition: background var(--dur-fast) var(--ease); }
.table tbody tr:hover { background: var(--surface-sunken); }
.table tbody tr:last-child td { border-bottom: 0; }
.table--compact th, .table--compact td { padding: 7px var(--s3); font-size: 12.5px; }
.cell-ref { font-family: var(--mono); font-weight: 600; }
.cell-ref a { color: var(--ink-strong); }
.cell-ref a:hover { color: var(--brand-deep); }
.cell-route { font-family: var(--mono); font-size: 12.5px; color: var(--ink-body); }
.cell-route .arrow { color: var(--n-400); margin: 0 var(--s1); }
.cell-stack { display: flex; flex-direction: column; gap: 1px; }
.cell-stack small { color: var(--ink-faint); font-size: 11.5px; }
.row--synthetic { background: var(--warn-wash); }
.row--synthetic:hover { background: var(--warn-wash); }
.result-count { color: var(--ink-muted); font-size: 13px; margin: 0 0 var(--s3); }

/* ==========================================================================
   Filters and forms
   ========================================================================== */
/* Phase 16. A filter bar is a SECONDARY control and now looks like one: it sits on the
   sunken surface with no shadow, rather than being a raised card competing with the
   panels that hold the actual answer. It also renders below the page title now, on both
   the dashboard and Schedule Watch, where it used to render above it: a filter bar above
   the h1 makes the title read as a caption for the filters. Found by looking at the
   rendered page, which is the only thing that catches a hierarchy mistake. */
.filters { display: flex; flex-wrap: wrap; gap: var(--s4); align-items: flex-end;
  background: var(--surface-sunken); border: 1px solid var(--line);
  border-radius: var(--radius); padding: var(--s3) var(--s4);
  margin-bottom: var(--s5); }
.filters__field { display: flex; flex-direction: column; gap: var(--s1); }
.filters__field label { font-size: var(--t-2xs); font-weight: var(--w-bold);
  letter-spacing: var(--track-wide);
  text-transform: uppercase; color: var(--ink-faint); }
.filters__field--check { justify-content: flex-end; }
.filters__field--check label { text-transform: none; letter-spacing: 0;
  font-size: var(--t-base);
  font-weight: var(--w-medium); color: var(--ink-body); display: flex; align-items: center;
  gap: var(--s2); cursor: pointer; }
.filters__actions { display: flex; gap: var(--s2); margin-left: auto; }

/* Phase 16. One control style for every form in the application, promoted out of the
   sign-in card so Add Shipment, the filters and the account forms all match. A field
   that reads as a hairline is the most common way a form looks unfinished; these sit on
   the sunken surface so their edges are visible in both themes, and lift to the raised
   surface on focus so the active field is obvious without relying on colour alone. */
select, input[type="text"], input[type="password"], input[type="email"], textarea {
  padding: 9px var(--s3); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font: var(--w-normal) var(--t-base)/1.4 var(--font);
  background: var(--surface-sunken); color: var(--ink-strong); min-width: 180px;
  transition: background var(--motion), border-color var(--motion),
              box-shadow var(--motion);
}
select:hover, input:hover, textarea:hover { border-color: var(--ink-faint); }
select:focus, input:focus, textarea:focus { outline: none; border-color: var(--brand);
  background: var(--surface); box-shadow: var(--ring); }
select:disabled, input:disabled { opacity: .6; cursor: not-allowed; }
::placeholder { color: var(--ink-faint); opacity: 1; }
.field { margin-bottom: var(--s5); }
.field label { display: block; font-size: var(--t-sm); font-weight: var(--w-medium);
  color: var(--ink-body); margin-bottom: var(--s2); }
.field input, .field select { width: 100%; }
.field__hint { font-size: var(--t-sm); color: var(--ink-muted); margin-top: var(--s2); }
.field__error { font-size: 12.5px; color: var(--bad); margin-top: 5px; font-weight: 500; }
.form-actions { display: flex; gap: var(--s2); align-items: center;
  margin-top: var(--s5); padding-top: var(--s4); border-top: 1px solid var(--line); }

/* ==========================================================================
   Badges, pills, tags
   ========================================================================== */
.badge { display: inline-flex; align-items: center; padding: 2px 8px;
  border-radius: var(--radius-pill); font-size: 10.5px; font-weight: 700;
  letter-spacing: .03em; border: 1px solid transparent; }
.badge--demo { background: var(--warn-wash); color: var(--warn);
  border-color: var(--warn-line); }
.badge--stale { background: var(--bad-wash); color: var(--bad);
  border-color: var(--bad-line); }
.badge--pending { background: var(--n-100); color: var(--ink-muted);
  border-color: var(--line-strong); }
/* Classification badges: cargo mode and direction. Deliberately hueless.
   Section 6a caps the palette at four hues because seven failed colour-vision
   simulation, and the rule it protects is that colour encodes URGENCY. Sea versus
   air, and inbound versus outbound, carry none: they are facts about a shipment,
   not a call to act. Giving them hues would spend a measured, scarce resource and
   compete with the status colours that do mean something. These read by their words
   on the already-measured neutral tokens, so there is no new ratio to verify and
   nothing here can stand on colour alone. Phase 12 plan, 12a. */
.badge--class { background: var(--n-100); color: var(--ink-muted);
  border-color: var(--line-strong); font-weight: 600; letter-spacing: .02em; }

/* Phase 50: where a date came from. Icon and word, so colour never stands alone; the three tints are the
   existing status inks (planned reads as a forecast, a live estimate as progress, an actual as complete). */
.src-chip { display: inline-flex; align-items: center; gap: var(--s1); padding: 0 var(--s2);
  border-radius: var(--radius-pill); font-size: var(--t-xs); font-weight: var(--w-bold); white-space: nowrap;
  vertical-align: middle; border: 1px solid transparent; }
.src-chip__icon { width: var(--s3); height: var(--s3); flex: none; }
.src-chip--planned { background: var(--status-forecast-wash); color: var(--status-forecast); }
.src-chip--live-estimate { background: var(--status-progress-wash); color: var(--status-progress); }
.src-chip--actual { background: var(--status-complete-wash); color: var(--status-complete); }
.schedule-card__slip { font-weight: var(--w-bold); }

/* Customer scope toggle. A view switch, not a permission control, so it is styled
   like the rest of the filter furniture and never like a lock. */
.scope { display: inline-flex; align-items: center; gap: var(--s2);
  padding: var(--s2) var(--s3); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); }
.scope__label { font-size: 12px; color: var(--ink-muted); font-weight: 600; }
.scope__opt { font-size: 12.5px; padding: 2px var(--s3); border-radius: var(--radius-pill);
  color: var(--brand-deep); text-decoration: none; border: 1px solid transparent; }
.scope__opt--on { background: var(--brand-wash); border-color: var(--brand-line);
  color: var(--brand-darker); font-weight: 700; }
.scope__edit { font-size: 12px; color: var(--ink-muted); margin-left: var(--s2); }
.picker { margin-top: var(--s3); border-top: 1px solid var(--line); padding-top: var(--s3); }
.picker > summary { cursor: pointer; font-size: 13px; font-weight: 600;
  color: var(--brand-deep); }
.picker__grid { display: grid; gap: var(--s2) var(--s4); margin: var(--s3) 0;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.picker__item { display: flex; align-items: center; gap: var(--s2); font-size: 13px; }
.picker__hint { font-size: 12px; color: var(--ink-muted); margin-bottom: var(--s2); }
.filters--inline { margin-bottom: var(--s4); padding: var(--s3) var(--s4); }

.status-badge { display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: var(--radius-pill); font-size: 12.5px;
  font-weight: 600; border: 1px solid transparent; white-space: nowrap; }
.status-badge::before { content: ""; width: 6px; height: 6px;
  border-radius: var(--radius-pill); background: currentColor; flex: none; }
.status-badge--progress { background: var(--status-progress-wash);
  color: var(--status-progress); border-color: var(--status-progress-line); }
.status-badge--complete { background: var(--status-complete-wash);
  color: var(--status-complete); border-color: var(--status-complete-line); }
.status-badge--exception { background: var(--status-exception-wash);
  color: var(--status-exception); border-color: var(--status-exception-line); }
.status-badge--delay { background: var(--status-delay-wash);
  color: var(--status-delay); border-color: var(--status-delay-line); }
.status-badge--forecast { background: var(--status-forecast-wash);
  color: var(--status-forecast); border-color: var(--line); }
/* Unknown is deliberately unresolved: no fill, a dashed edge and italic text,
   so it reads as "needs review" rather than as one more normal status. */
.status-badge--unknown { background: transparent; color: var(--status-unknown);
  border: 1px dashed var(--status-unknown); font-style: italic; font-weight: 500; }
.status-badge--unknown::before { background: transparent;
  border: 1px dashed currentColor; }

.pill { display: inline-flex; align-items: center; gap: 7px; padding: 5px 13px;
  border-radius: var(--radius-pill); font-size: 13.5px; font-weight: 640;
  border: 1px solid transparent; }
.pill--progress { background: var(--status-progress-wash); color: var(--status-progress);
  border-color: var(--status-progress-line); }
.pill--complete { background: var(--status-complete-wash); color: var(--status-complete);
  border-color: var(--status-complete-line); }
.pill--exception { background: var(--status-exception-wash); color: var(--status-exception);
  border-color: var(--status-exception-line); }
.pill--forecast { background: var(--status-forecast-wash); color: var(--status-forecast);
  border-color: var(--line); }
.pill--unknown { background: transparent; color: var(--status-unknown);
  border: 1px dashed var(--status-unknown); font-style: italic; font-weight: 500; }
.pill--brand { background: var(--brand); color: var(--brand-ink); }
.pill--muted { background: var(--n-100); color: var(--ink-muted);
  border-color: var(--line-strong); }

.tag { display: inline-flex; align-items: center; padding: 2px 9px;
  border-radius: var(--radius-pill); font-size: 11px; font-weight: 700; }
.tag--success { background: var(--ok-wash); color: var(--ok); }
.tag--empty, .tag--running { background: var(--warn-wash); color: var(--warn); }
.tag--blocked, .tag--failed { background: var(--bad-wash); color: var(--bad); }
.status-raw { color: var(--ink-muted); font-style: italic; }

/* ==========================================================================
   State banners, empty and error states
   ========================================================================== */
.state { display: flex; gap: var(--s3); align-items: flex-start;
  padding: var(--s3) var(--s4); border-radius: var(--radius);
  margin-bottom: var(--s4); font-size: 13.5px; border: 1px solid var(--line);
  background: var(--surface); }
.state strong { display: block; margin-bottom: 2px; color: var(--ink-strong);
  font-weight: 640; }
.state p { margin: 0 0 var(--s1); color: var(--ink-body); }
.state__detail { font-family: var(--mono); font-size: 11.5px;
  color: var(--ink-muted); word-break: break-word; }
.state__dot { width: 8px; height: 8px; border-radius: var(--radius-pill);
  margin-top: 7px; flex: none; }
.state--ok { background: var(--ok-wash); border-color: var(--ok-line); }
.state--ok .state__dot { background: var(--ok); }
.state--warn { background: var(--warn-wash); border-color: var(--warn-line); }
.state--warn .state__dot { background: var(--warn); }
.state--bad { background: var(--bad-wash); border-color: var(--bad-line); }
.state--bad .state__dot { background: var(--bad); }
.state--info { background: var(--info-wash); border-color: var(--info-line); }
.state--info .state__dot { background: var(--info); }
.state--neutral .state__dot { background: var(--ink-faint); }
.state--demo { background: var(--warn-wash); border-color: var(--warn-line); }
.state--demo .state__dot { background: var(--warn); }

.empty { background: var(--surface); border: 1px dashed var(--line-strong);
  border-radius: var(--radius); padding: var(--s9) var(--s6); text-align: center;
  color: var(--ink-muted); }
.empty__icon { width: 40px; height: 40px; margin: 0 auto var(--s3);
  color: var(--n-400); }
.empty__title { font-weight: 650; color: var(--ink-strong); font-size: 15px;
  margin: 0 0 var(--s1); }

.alert { padding: 10px var(--s3); border-radius: var(--radius-sm); font-size: 13.5px; }
.alert--error { background: var(--bad-wash); color: var(--bad);
  border: 1px solid var(--bad-line); }

.messages { margin-bottom: var(--s4); display: flex; flex-direction: column;
  gap: var(--s2); }
.msg { padding: 10px var(--s4); border-radius: var(--radius);
  font-size: 13.5px; border: 1px solid var(--line); background: var(--surface); }
.msg--success { background: var(--ok-wash); border-color: var(--ok-line); color: var(--ok); }
.msg--error { background: var(--bad-wash); border-color: var(--bad-line); color: var(--bad); }
.msg--warning { background: var(--warn-wash); border-color: var(--warn-line); color: var(--warn); }
.msg--info { background: var(--info-wash); border-color: var(--info-line); color: var(--info); }

/* ==========================================================================
   Definition grids, lists
   ========================================================================== */
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--s5); margin: 0; }
.summary dt { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--ink-faint); font-weight: 700; }
.summary dd { margin: var(--s1) 0 0; color: var(--ink-strong); font-size: 13.5px; }
.summary code { background: var(--n-100); padding: 1px 6px;
  border-radius: 4px; color: var(--ink-body); }

.containers, .legs, .eta-history { list-style: none; padding: 0; margin: 0; }
.containers li, .legs li, .eta-history li {
  display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center;
  padding: var(--s3) 0; border-bottom: 1px solid var(--line); }
.containers li:first-child, .legs li:first-child, .eta-history li:first-child {
  padding-top: 0; }
.containers li:last-child, .legs li:last-child, .eta-history li:last-child {
  border-bottom: 0; padding-bottom: 0; }
.container-no { background: var(--brand-wash); color: var(--brand-darker);
  padding: 3px 9px; border-radius: var(--radius-sm); font-weight: 640;
  font-family: var(--mono); }

.pagination { display: flex; gap: var(--s4); align-items: center;
  justify-content: center; padding: var(--s5) 0 0; }
.pagination__pos { color: var(--ink-muted); font-size: 13px; }

/* ==========================================================================
   Auth
   ========================================================================== */
/* Phase 16. Two panels on a wide screen, one column on a narrow one.

   The left panel is the only decorative surface in the whole application, and it earns
   that here: the sign-in page is the first thing anyone sees, including the client, and
   it is the one screen with no data on it to carry the weight instead. Everything past
   this point stays sober.

   Anonymous by definition, so there is no stored theme preference to read: the page
   follows prefers-color-scheme alone, the same rule the customer tracking page follows
   and for the same reason. Spec 3.23. */
.auth { min-height: 100vh; display: grid; background: var(--bg);
  grid-template-columns: 1fr; }
@media (min-width: 900px) {
  .auth { grid-template-columns: 1.05fr .95fr; }
}

.auth__aside { display: none; position: relative; overflow: hidden;
  padding: var(--s9) var(--s8); color: var(--nav-ink);
  background:
    radial-gradient(120% 90% at 12% 8%,
      color-mix(in srgb, var(--brand) 26%, transparent) 0%, transparent 58%),
    radial-gradient(90% 80% at 92% 96%,
      color-mix(in srgb, var(--brand-deep) 34%, transparent) 0%, transparent 62%),
    var(--nav-bg);
}
@media (min-width: 900px) { .auth__aside { display: flex; flex-direction: column; } }
/* A hairline of the brand down the seam, so the two panels read as one object. */
.auth__aside::after { content: ""; position: absolute; inset: 0 0 0 auto; width: 1px;
  background: color-mix(in srgb, var(--brand) 45%, transparent); }
.auth__aside-brand { display: flex; align-items: center; gap: var(--s3);
  color: var(--nav-ink-strong); }
.auth__aside-name { font-size: var(--t-md); font-weight: var(--w-semi);
  letter-spacing: var(--track-snug); color: var(--nav-ink-strong); }
.auth__headline { margin: auto 0 var(--s6); font-size: var(--t-2xl);
  line-height: var(--lh-2xl); font-weight: var(--w-bold);
  letter-spacing: var(--track-tight); color: var(--nav-ink-strong);
  max-width: 19ch; text-wrap: balance; }
.auth__points { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s4); }
.auth__point { display: flex; gap: var(--s3); align-items: flex-start;
  font-size: var(--t-base); line-height: var(--lh-base); color: var(--nav-ink); }
.auth__point svg { width: 17px; height: 17px; flex: none; margin-top: 2px;
  color: var(--brand); }
.auth__aside-foot { margin-top: var(--s8); font-size: var(--t-xs);
  color: var(--nav-ink-muted); }

.auth__main { display: grid; place-items: center; padding: var(--s7) var(--s5); }
.auth__card { width: 100%; max-width: 384px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: var(--s8) var(--s7); box-shadow: var(--shadow-lg); }
/* The card carries its own brand only where the aside is hidden, so a narrow screen
   still knows whose system it is without the wordmark appearing twice. */
.auth__brand { display: flex; align-items: center; gap: var(--s3);
  margin-bottom: var(--s6); }
@media (min-width: 900px) { .auth__brand { display: none; } }
.auth__card h1 { font-size: var(--t-xl); line-height: var(--lh-xl);
  letter-spacing: var(--track-snug); font-weight: var(--w-bold); }
.auth__sub { color: var(--ink-muted); font-size: var(--t-base);
  line-height: var(--lh-base); margin: var(--s2) 0 var(--s7); }
.auth__foot { margin-top: var(--s6); padding-top: var(--s4);
  border-top: 1px solid var(--line); font-size: var(--t-xs); color: var(--ink-faint); }

/* Inputs get real presence: a sign-in field that looks like a hairline is the single
   most common way a login page reads as unfinished. */
.auth__card .field { margin-bottom: var(--s5); }
.auth__card label { display: block; margin-bottom: var(--s2);
  font-size: var(--t-sm); font-weight: var(--w-medium); color: var(--ink-body); }
.auth__card input[type="text"],
.auth__card input[type="password"] {
  width: 100%; padding: 11px var(--s4); font-size: var(--t-md);
  color: var(--ink-strong); background: var(--surface-sunken);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  transition: border-color var(--motion), box-shadow var(--motion),
              background var(--motion);
}
.auth__card input[type="text"]:hover,
.auth__card input[type="password"]:hover { border-color: var(--ink-faint); }
.auth__card input[type="text"]:focus,
.auth__card input[type="password"]:focus {
  outline: 0; background: var(--surface);
  border-color: var(--brand); box-shadow: var(--ring);
}
.auth__card .btn--block { padding: 11px var(--s4); font-size: var(--t-md);
  font-weight: var(--w-semi); }

/* Second factor, phase 13. Every value below comes from the token block at the top of
   this file: a test fails the build on a hard-coded colour, radius or spacing value. */
.auth__card--wide { max-width: 520px; }

/* Branding, phase 14. The logo is constrained rather than trusted: an upload is validated
   for type and size but not for dimensions, so a tall or enormous image has to be bounded
   here or it would push the whole shell out of shape. object-fit keeps the aspect ratio
   inside that box instead of stretching it. */
.brand__logo { max-height: 32px; max-width: 132px; width: auto; height: auto;
  object-fit: contain; display: block; }
/* The support console. Every value from the token block at the top of this file. */
.page__eyebrow { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-faint); margin: 0 0 var(--s1); }
.brand__preview { display: flex; align-items: center; gap: var(--s3);
  padding: var(--s4); margin-bottom: var(--s5); background: var(--surface-sunken);
  border: 1px solid var(--line); border-radius: var(--radius); flex-wrap: wrap; }
.brand__preview-label { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-faint); }
.field__help { font-size: 12px; color: var(--ink-muted); margin: var(--s1) 0 0; }
.field--inline { display: inline-flex; align-items: center; gap: var(--s2);
  margin-right: var(--s3); }
.track__logo { max-height: 40px; max-width: 160px; width: auto; height: auto;
  object-fit: contain; display: block; }
/* The same card rendered inside the signed-in shell rather than on the dark sign-in
   ground: no full-height centring, no second background behind it. */
.auth--inline { max-width: 520px; }
.auth--inline .auth__card { box-shadow: none; border: 1px solid var(--line);
  padding: var(--s6); }
.auth__steps { margin: 0 0 var(--s5); padding-left: var(--s5);
  color: var(--ink-body); font-size: 13.5px; line-height: 1.7; }
.auth__steps li { margin-bottom: var(--s3); }
/* The enrolment key is the one string on this page a person retypes by hand into a
   phone, so it is monospace, spaced out, and large enough to read across a desk. */
.auth__secret { display: block; margin-top: var(--s2); padding: var(--s3);
  background: var(--surface-sunken); border: 1px solid var(--line);
  border-radius: var(--radius-sm); font-family: var(--mono); font-size: 15px;
  letter-spacing: 0.08em; word-break: break-all; color: var(--ink-strong); }
.auth__details { margin-bottom: var(--s5); font-size: 12.5px; color: var(--ink-muted); }
.auth__uri { display: block; margin-top: var(--s2); padding: var(--s2);
  background: var(--surface-sunken); border-radius: var(--radius-sm);
  font-family: var(--mono); font-size: 11px; word-break: break-all;
  color: var(--ink-body); }
/* Two columns, because ten codes in one column pushes the confirm button off a laptop
   screen and the button is the thing that proves they were read. */
.auth__codes { list-style: none; margin: 0 0 var(--s6); padding: var(--s4);
  background: var(--surface-sunken); border: 1px solid var(--line);
  border-radius: var(--radius); display: grid; gap: var(--s2);
  grid-template-columns: repeat(2, 1fr); }
.auth__codes li { font-family: var(--mono); font-size: 14px;
  letter-spacing: 0.04em; color: var(--ink-strong); }

/* ==========================================================================
   Account management (phase 15)
   ========================================================================== */
/* Every value below comes from the token block at the top of this file. A test fails the
   build on a hard-coded colour, radius or spacing value. */
.panel--accent { border-color: var(--brand); }
/* The temporary password is read aloud off this screen, so it is large, monospace and
   loosely spaced: the failure mode being designed against is mis-transcription, not
   somebody squinting at it from across the room. */
.account__secret { font-family: var(--mono); font-size: 20px; letter-spacing: 0.08em;
  padding: var(--s4); margin: 0 0 var(--s3); background: var(--surface-sunken);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  color: var(--ink-strong); word-break: break-all; }
.account__actions { display: grid; gap: var(--s4); }
/* Each action carries its own sentence saying what it does and does not touch, so the row
   wraps rather than forcing the explanation off the end of the line. */
.account__action { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap;
  margin: 0; padding-bottom: var(--s4); border-bottom: 1px solid var(--line); }
.account__action:last-child { border-bottom: 0; padding-bottom: 0; }
.account__action .muted { font-size: 12.5px; flex: 1 1 260px; }

/* ==========================================================================
   Review queue
   ========================================================================== */
.review { border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--s4) var(--s5); margin-bottom: var(--s3); background: var(--surface); }
.review__phrase { display: flex; gap: var(--s3); align-items: center;
  flex-wrap: wrap; }
.review__phrase code { background: var(--brand-wash); color: var(--brand-darker);
  padding: 3px 10px; border-radius: var(--radius-sm); font-weight: 640; }
.review__reason { margin: var(--s3) 0; color: var(--ink-body); font-style: italic;
  padding-left: var(--s3); border-left: 2px solid var(--line-strong); }
.review__actions { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }
.review__actions label { font-size: 10.5px; font-weight: 700; color: var(--ink-faint);
  text-transform: uppercase; letter-spacing: .06em; }
.review__meta { font-size: 11.5px; margin-top: var(--s3); color: var(--ink-faint); }

/* ==========================================================================
   Server-rendered loading placeholder, before React mounts
   ========================================================================== */
.react-root { min-height: 150px; }
.react-placeholder__label { color: var(--ink-muted); margin: 0 0 var(--s3);
  font-size: 13px; }
.react-placeholder__row { height: 46px; margin-bottom: var(--s2);
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--n-100) 25%, var(--n-50) 37%, var(--n-100) 63%);
  background-size: 400% 100%; animation: shimmer 1.4s ease infinite; }
@keyframes shimmer { 0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; } }
@media (prefers-reduced-motion: reduce) { .react-placeholder__row { animation: none; } }

/* ==========================================================================
   Timeline board (the one React surface)
   ========================================================================== */
.tl__container { border: 1px solid var(--line); border-radius: var(--radius);
  margin-bottom: var(--s4); overflow: hidden; }
.tl__container:last-child { margin-bottom: 0; }
.tl__head { display: flex; align-items: center; gap: var(--s3);
  padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line);
  background: var(--n-50); }
.tl__head code { background: var(--surface); color: var(--brand-darker);
  padding: 3px 9px; border-radius: var(--radius-sm); font-weight: 640;
  border: 1px solid var(--brand-line); }
.tl__type { color: var(--ink-muted); font-size: 12.5px; }
.tl__count { margin-left: auto; color: var(--ink-faint); font-size: 11.5px;
  font-weight: 640; }
.tl__list { list-style: none; margin: 0; padding: var(--s2) var(--s5) var(--s4); }
.tl__item { display: flex; gap: var(--s4); padding: var(--s4) 0;
  border-bottom: 1px solid var(--line); position: relative; }
.tl__item:last-child { border-bottom: 0; }
.tl__item::before { content: ""; position: absolute; left: 5px; top: 28px;
  bottom: -1px; width: 2px; background: var(--line); }
.tl__item:last-child::before { display: none; }
.tl__marker { width: 12px; height: 12px; border-radius: var(--radius-pill);
  margin-top: 5px; flex: none; background: var(--brand);
  border: 2px solid var(--surface); box-shadow: 0 0 0 2px var(--brand); z-index: 1; }
.tl__item--progress .tl__marker { background: var(--status-progress);
  box-shadow: 0 0 0 2px var(--status-progress); }
.tl__item--complete .tl__marker { background: var(--status-complete);
  box-shadow: 0 0 0 2px var(--status-complete); }
/* A diamond, not a circle. Shape is the cue that survives protanopia, where
   the exception and delay hues sit only 21 apart. */
.tl__item--exception .tl__marker { background: var(--status-exception);
  box-shadow: 0 0 0 2px var(--status-exception); border-radius: 2px;
  transform: rotate(45deg); }
.tl__item--forecast .tl__marker { background: var(--surface);
  box-shadow: 0 0 0 2px var(--status-forecast); }
.tl__item--unknown .tl__marker { background: var(--surface);
  box-shadow: 0 0 0 2px var(--status-unknown); border-radius: 2px; }
.tl__body { min-width: 0; }
.tl__when { display: flex; gap: var(--s2); align-items: baseline; flex-wrap: wrap; }
.tl__when time { font-weight: 700; color: var(--ink-strong);
  font-variant-numeric: tabular-nums; }
.tl__time { color: var(--ink-faint); font-size: 11.5px; }
.tl__time--absent { font-style: italic; }
.tl__what { font-weight: 640; margin-top: 3px; color: var(--ink-strong); }
.tl__item--exception .tl__what { color: var(--status-exception); }
.tl__item--unknown .tl__what { font-style: italic; color: var(--status-unknown); }
.tl__tag { display: inline-flex; font-size: 10.5px; font-weight: 700;
  color: var(--warn); background: var(--warn-wash); border: 1px solid var(--warn-line);
  border-radius: var(--radius-pill); padding: 1px 9px; margin-top: 5px; }
.tl__raw { color: var(--ink-muted); margin-top: 3px; font-size: 13px; }
.tl__meta { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: 6px;
  color: var(--ink-faint); font-size: 11.5px; }
.tl__meta code { background: var(--n-100); padding: 1px 6px; border-radius: 4px; }

/* ==========================================================================
   Track Now
   ========================================================================== */
.tracknow { display: inline-flex; align-items: center; gap: var(--s2); margin: 0; }
.tracknow__wait { font-size: 11.5px; color: var(--ink-faint); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 960px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: row;
    align-items: center; gap: var(--s3); overflow-x: auto; padding-right: var(--s4); }
  .sidebar__brand { border-bottom: 0; padding-right: var(--s3); }
  .sidebar__name small { display: none; }
  .sidebar__section { display: flex; align-items: center; gap: var(--s2);
    padding: var(--s2) 0; }
  .sidebar__label, .sidebar__foot { display: none; }
  .nav { flex-direction: row; gap: var(--s1); }
  .nav__item { white-space: nowrap; }
  .topbar { padding: 0 var(--s4); }
  .content { padding: var(--s5) var(--s4); }
  .footer { padding: 0 var(--s4) var(--s5); }
  .filters__actions { margin-left: 0; width: 100%; }
  .filters__field, .filters__field select { width: 100%; min-width: 0; }
}

/* ==========================================================================
   Schedule Watch (the second and last React surface)

   Colour vocabulary is limited to what 6f already measured. No new hue was
   introduced because none was needed:
     later    --status-delay      the same amber 6e uses for a slip
     earlier  --status-complete   the same green 6e uses for a pull-in
     no data  --status-unknown    the 6f unresolved treatment, dashed and unfilled
     stable   a neutral, deliberately not a status hue
   ========================================================================== */
.sw__controls { display: flex; align-items: center; gap: var(--s2);
  flex-wrap: wrap; padding: 0 0 var(--s4); }
.sw__label { font-size: 10.5px; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--ink-faint); margin-right: var(--s1); }
.sw__gap { width: var(--s5); }
.sw__empty { border: 0; padding: var(--s8) var(--s6); }
.sw__table th { white-space: nowrap; }
.sw__ribbon-h { min-width: 220px; }
.sw__ribbon { width: 36%; min-width: 220px; }
.sw__client { max-width: 170px; overflow: hidden; text-overflow: ellipsis; }
.sw__dates { font-family: var(--mono); font-size: 12.5px; color: var(--ink-muted); }
.sw__dates strong { color: var(--ink-strong); }
.sw__arrow, .sw__from { color: var(--ink-faint); }
.sw__row--recent { background: var(--status-delay-wash); }
.sw__row--recent:hover { background: var(--status-delay-wash); }
.badge--recent { background: var(--status-delay-wash); color: var(--status-delay);
  border-color: var(--status-delay-line); margin-left: var(--s2); }

/* The ribbon. The x axis is the calendar and the scale is shared across rows, so a
   14 day slip is literally twice the length of a 7 day slip. */
.rib { position: relative; height: 22px; }
.rib__track { position: absolute; left: 0; right: 0; top: 10px; height: 2px;
  background: var(--line-strong); border-radius: var(--radius-pill); }
.rib__fill { position: absolute; top: 8px; height: 6px;
  border-radius: var(--radius-pill); }
.rib__fill--later { background: var(--status-delay-wash);
  border: 1px solid var(--status-delay-line); }
.rib__fill--earlier { background: var(--status-complete-wash);
  border: 1px solid var(--status-complete-line); }
.rib__pt { position: absolute; top: 6px; width: 10px; height: 10px; margin-left: -5px;
  border-radius: var(--radius-pill); background: var(--surface);
  border: 2px solid var(--n-400); }
/* Original is hollow and fixed; current is filled and larger, because it is the value
   that matters right now. */
.rib__pt--original { border-color: var(--ink-faint); }
.rib__pt--step { width: 7px; height: 7px; top: 8px; margin-left: -3px;
  border-width: 1.5px; }
.rib__pt--current { width: 14px; height: 14px; top: 4px; margin-left: -7px;
  border-width: 3px; }
.rib__pt--current.rib__pt--later { background: var(--status-delay);
  border-color: var(--status-delay); }
.rib__pt--current.rib__pt--earlier { background: var(--status-complete);
  border-color: var(--status-complete); }
.rib__pt--current.rib__pt--stable { background: var(--ink-faint);
  border-color: var(--ink-faint); }
/* No data reuses 6f's unresolved language rather than inventing a pattern. */
.rib--nodata { display: flex; align-items: center; }
.rib__nodata { display: inline-block; width: 100%; text-align: center;
  border: 1px dashed var(--status-unknown); border-radius: var(--radius-pill);
  color: var(--status-unknown); font-style: italic; font-size: 11.5px; padding: 2px 0; }

.drift { display: inline-flex; align-items: center; padding: 3px 11px;
  border-radius: var(--radius-pill); font-size: 13px; font-weight: 700;
  font-variant-numeric: tabular-nums; border: 1px solid transparent; }
.drift--later { background: var(--status-delay-wash); color: var(--status-delay);
  border-color: var(--status-delay-line); }
.drift--earlier { background: var(--status-complete-wash); color: var(--status-complete);
  border-color: var(--status-complete-line); }
.drift--stable { background: var(--n-100); color: var(--ink-muted);
  border-color: var(--line-strong); font-weight: 600; }
.drift--no_data { background: transparent; color: var(--status-unknown);
  border: 1px dashed var(--status-unknown); font-style: italic; font-weight: 500; }

.chip { display: inline-flex; align-items: center; padding: 2px 9px;
  border-radius: var(--radius-pill); font-size: 11.5px; font-weight: 700;
  background: var(--brand-wash); color: var(--brand-darker);
  border: 1px solid var(--brand-line); }

/* ==========================================================================
   Recently changed strip

   Server rendered, not React: a static list with no interaction would gain nothing
   from a component and would need a second React root on this page. Reuses the
   Schedule Watch drift badge rather than defining a parallel one.
   ========================================================================== */
.strip { background: var(--surface); border: 1px solid var(--status-delay-line);
  border-left: 3px solid var(--status-delay); border-radius: var(--radius);
  padding: var(--s4) var(--s5); margin-bottom: var(--s4);
  box-shadow: var(--shadow-sm); }
.strip__head { display: flex; align-items: center; gap: var(--s2);
  margin-bottom: var(--s3); }
.strip__title { font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--status-delay); font-weight: 700; margin: 0; }
.strip__count { font-size: 11px; font-weight: 700; padding: 1px 8px;
  border-radius: var(--radius-pill); background: var(--status-delay-wash);
  color: var(--status-delay); border: 1px solid var(--status-delay-line); }
.strip__items { display: flex; flex-wrap: wrap; gap: var(--s2); }
.strip__item { display: inline-flex; align-items: center; gap: var(--s3);
  padding: var(--s2) var(--s3); border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--n-25);
  text-decoration: none; color: var(--ink-body); font-size: 13px; }
.strip__item:hover { border-color: var(--status-delay-line);
  background: var(--status-delay-wash); text-decoration: none; }
.strip__ref { font-family: var(--mono); font-weight: 640; color: var(--ink-strong); }
.strip__meta { font-family: var(--mono); font-size: 12px; color: var(--ink-muted); }
.strip__meta strong { color: var(--ink-strong); }
.strip__when { font-size: 11.5px; color: var(--ink-faint); }

/* Enlarged single-shipment ribbon on the detail page. Same markers and the same
   measured colours as the dashboard, just given room to be read. */
.rib--lg { height: 34px; }
.rib--lg .rib__track { top: 16px; height: 3px; }
.rib--lg .rib__fill { top: 13px; height: 9px; }
.rib--lg .rib__pt { top: 11px; width: 13px; height: 13px; margin-left: -6.5px; }
.rib--lg .rib__pt--step { width: 9px; height: 9px; top: 13px; margin-left: -4.5px; }
.rib--lg .rib__pt--current { width: 18px; height: 18px; top: 8px; margin-left: -9px; }
.rib--lg.rib--nodata .rib__nodata { padding: 6px 0; font-size: 12.5px; }
.rib__scale { display: flex; justify-content: space-between; margin-top: var(--s1);
  font-family: var(--mono); font-size: 11px; color: var(--ink-faint); }
.eta-summary { margin-top: var(--s4); }

/* ==========================================================================
   Fleet summary strip (Schedule Watch page)

   Server rendered. Reuses the measured state colours from 6f/7b rather than
   introducing any of its own: this is a rollup of states that already exist.
   ========================================================================== */
.fleet { display: flex; flex-wrap: wrap; align-items: stretch; gap: var(--s4);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: var(--s5); margin-bottom: var(--s4);
  box-shadow: var(--shadow-sm); }
.fleet__total { padding-right: var(--s5); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: var(--s1); min-width: 150px; }
.fleet__states { display: flex; flex-wrap: wrap; gap: var(--s6); flex: 1 1 auto; }
.fleet__state { display: flex; flex-direction: column; gap: var(--s1); min-width: 92px; }
.fleet__count { font-size: 26px; font-weight: 660; line-height: 1;
  font-variant-numeric: tabular-nums; color: var(--ink-strong); }
.fleet__label { font-size: 10.5px; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--ink-faint); }
.fleet__state--later .fleet__count { color: var(--status-delay); }
.fleet__state--earlier .fleet__count { color: var(--status-complete); }
.fleet__state--stable .fleet__count { color: var(--ink-muted); }
.fleet__state--no_data .fleet__count { color: var(--status-unknown); font-style: italic; }
/* A zero count is not news. Dim it so the eye goes to the states that have rows. */
.fleet__state--zero .fleet__count { color: var(--n-400); font-style: normal; }
.fleet__state--zero .fleet__label { color: var(--n-400); }

.sw__more { margin: var(--s4) 0 0; color: var(--ink-faint); font-size: 12.5px; }

/* Fleet strip counts are links that set the filter. Whole-fleet counts always, so
   every state stays clickable including the one currently applied. */
.fleet__total, .fleet__state { text-decoration: none; color: inherit;
  border-radius: var(--radius-sm); padding: var(--s2) var(--s3);
  margin: calc(var(--s2) * -1) calc(var(--s3) * -1);
  transition: background .12s ease, box-shadow .12s ease; }
.fleet__total:hover, .fleet__state:hover { background: var(--n-50);
  text-decoration: none; }
.fleet__total--active, .fleet__state--active { background: var(--brand-wash);
  box-shadow: inset 0 0 0 1px var(--brand-line); }
.fleet__total { margin-right: 0; }

.sw__controls--find { padding-top: 0; gap: var(--s2); }
.sw__search { min-width: 260px; flex: 1 1 260px; max-width: 420px; }
.sw__select { min-width: 160px; }
.sw__showing { margin-left: auto; font-size: 12.5px; color: var(--ink-faint);
  font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .sw__search, .sw__select { min-width: 100%; flex-basis: 100%; }
  .sw__showing { margin-left: 0; }
}

/* Row drill-in. The expanded panel reuses the enlarged ribbon and the revision table
   the detail page already shows, so someone working a filtered list sees the same
   accounting without losing their place. */
.sw__row--clickable { cursor: pointer; }
.sw__row--open { background: var(--brand-wash); }
.sw__row--open:hover { background: var(--brand-wash); }
.sw__caret { display: inline-block; width: 12px; margin-right: var(--s1);
  color: var(--ink-faint); font-size: 11px; }
.sw__exp-row > td { padding: 0 !important; background: var(--n-25);
  border-bottom: 1px solid var(--line); }
.sw__exp { padding: var(--s5) var(--s5) var(--s5) calc(var(--s5) + 12px);
  border-left: 3px solid var(--brand); }
.sw__exp-note { margin: var(--s4) 0 0; font-size: 13px; }
.sw__exp-link { margin: var(--s4) 0 0; font-size: 13px; }
.sw__exp .table-scroll { margin-top: var(--s4); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); }

/* Fleet drift trend -------------------------------------------------------
   Stacked columns, one per day. Every colour is a token defined at the top of this
   file: delay amber, complete green, muted ink, and 6f's unresolved treatment for no
   schedule data. No hue was added for this chart. */
.trend { border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); padding: var(--s5); margin-bottom: var(--s5); }
.trend__head { display: flex; align-items: center; justify-content: space-between;
  gap: var(--s4); flex-wrap: wrap; }
.trend__title { margin: 0; font-size: 15px; color: var(--brand-darker); }
.trend__sub { margin: var(--s2) 0 var(--s4); font-size: 13px; color: var(--ink-muted); }
.trend__plot { display: flex; gap: var(--s3); height: 140px; }
.trend__axis { display: flex; flex-direction: column; justify-content: space-between;
  font-size: 11px; color: var(--ink-muted); flex: none; }
.trend__cols { display: flex; align-items: flex-end; gap: 2px; flex: 1;
  border-bottom: 1px solid var(--line); min-width: 0; }
.trend__col { flex: 1 1 0; min-width: 0; height: 100%;
  display: flex; flex-direction: column; justify-content: flex-end; }
.trend__seg { width: 100%; }
.trend__seg--later { background: var(--status-delay); }
.trend__seg--earlier { background: var(--status-complete); }
.trend__seg--stable { background: var(--ink-muted); opacity: 0.45; }
/* Unfilled and hatched, the same "we were never told" treatment 6f gave UNKNOWN.
   Stable and no-data ink are too close to read as two solid greys in one column. */
.trend__seg--no_data { background: repeating-linear-gradient(45deg,
  var(--status-unknown) 0 1px, transparent 1px 4px); }
.trend__dates { display: flex; justify-content: space-between; margin-top: var(--s2);
  font-size: 11px; color: var(--ink-muted); }
.trend__legend { display: flex; flex-wrap: wrap; gap: var(--s4); list-style: none;
  margin: var(--s4) 0 0; padding: 0; font-size: 12px; color: var(--ink-muted); }
.trend__key { display: flex; align-items: center; gap: var(--s2); }
.trend__swatch { width: 12px; height: 12px; border-radius: 2px; flex: none; }
.trend__swatch--later { background: var(--status-delay); }
.trend__swatch--earlier { background: var(--status-complete); }
.trend__swatch--stable { background: var(--ink-muted); opacity: 0.45; }
.trend__swatch--no_data { background: repeating-linear-gradient(45deg,
  var(--status-unknown) 0 1px, transparent 1px 4px);
  border: 1px dashed var(--status-unknown); }
.trend__flat { margin: var(--s4) 0 0; font-size: 13px; color: var(--ink-muted);
  background: var(--surface-sunken); border-radius: var(--radius-sm);
  padding: var(--s3) var(--s4); }
.sw__controls--trend { margin: 0; }

@media (max-width: 700px) {
  .trend__plot { height: 110px; }
  .trend__legend { gap: var(--s3); }
}
.trend__note { margin: var(--s3) 0 0; font-size: 12.5px; color: var(--ink-muted);
  font-style: italic; }


/* Demo data mode ----------------------------------------------------------
   Off unless the URL says so. The banner states it once at the top and every row
   states it again, because a banner alone leaves a screenshot of the table looking
   like real cargo. */
.demo-banner { display: flex; align-items: center; gap: var(--s3);
  background: var(--demo-wash); border: 1px solid var(--demo-line);
  border-left: 4px solid var(--demo); border-radius: var(--radius);
  padding: var(--s3) var(--s4); margin-bottom: var(--s4); color: var(--demo);
  font-size: 13.5px; }
.demo-banner__tag { font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  font-size: 11px; }
.demo-banner__text { color: var(--ink-body); }
.demo-banner a { color: var(--demo); font-weight: 600; margin-left: auto;
  white-space: nowrap; }
.sw__demo { display: inline-block; margin-left: var(--s2); padding: 1px var(--s2);
  border-radius: var(--radius-sm); background: var(--demo-wash); color: var(--demo);
  border: 1px solid var(--demo-line); font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase; vertical-align: middle; }
.sw__row--demo td:first-child { box-shadow: inset 3px 0 0 var(--demo); }
.trend__seg--demo { background: repeating-linear-gradient(-45deg,
  var(--demo) 0 2px, transparent 2px 5px); }
.btn--demo-on { background: var(--demo-wash); color: var(--demo);
  border-color: var(--demo-line); font-weight: 600; }

/* Customer tracking link ---------------------------------------------------
   The one public page. Standalone, wider line length and larger type than the
   internal tables: this is read once by somebody who is not at work in the system,
   not scanned by an operator working fifty rows. Every colour is an existing token. */
/* Phase 16. The one page a customer sees, so it is the one page that has to look like
   it came from a company rather than from a database. Three changes, none of which
   touches a word of copy or a state rule:

     1. The card centres on a tall viewport instead of hanging from the top of an
        otherwise empty screen.
     2. The arrival date is promoted out of the fact list into its own block. It is the
        single thing the customer opened the link to find out, and it was previously a
        table row the same weight as "Shipping line".
     3. Two hard-coded rgba values are gone. `box-shadow: rgba(16,24,32,.04)` and the
        revision rule's `rgba(16,24,32,.08)` were light-theme values written at the point
        of use, which CLAUDE.md section 6a forbids precisely because of what they do in
        the other theme: a near-black hairline on a near-black card is invisible. */
.track { min-height: 100vh; background: var(--surface-sunken); padding: var(--s6) var(--s4);
  display: flex; justify-content: center; align-items: center; }
.track__card { width: 100%; max-width: 720px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--s7);
  box-shadow: var(--shadow); position: relative; overflow: hidden; }
/* A brand hairline across the top of the card. The forwarder's colour, carrying no
   text, which is the only thing section 6a allows the raw brand to do. */
.track__card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: var(--brand); }
.track__head { display: flex; align-items: center; gap: var(--s4);
  padding-bottom: var(--s5); border-bottom: 1px solid var(--line); }
.track__mark { display: grid; place-items: center; width: 42px; height: 42px; flex: none;
  border-radius: var(--radius-sm); background: var(--brand); color: var(--brand-ink);
  font-weight: var(--w-bold); font-size: var(--t-base); letter-spacing: 0.02em; }
.track__eyebrow { margin: 0; font-size: var(--t-2xs); letter-spacing: var(--track-wide);
  text-transform: uppercase; color: var(--ink-faint); font-weight: var(--w-bold); }
.track__ref { margin: 2px 0 0; font-size: var(--t-xl); line-height: var(--lh-xl);
  color: var(--brand-darker);
  font-family: var(--mono); letter-spacing: var(--track-snug); }

/* The answer, given the weight of an answer. */
.track__arrival { margin: var(--s5) 0 0; padding: var(--s5); border-radius: var(--radius);
  background: var(--surface-sunken); border: 1px solid var(--line);
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--s4); flex-wrap: wrap; }
.track__arrival-label { font-size: var(--t-2xs); text-transform: uppercase;
  letter-spacing: var(--track-wide); color: var(--ink-faint);
  font-weight: var(--w-bold); }
.track__arrival-value { font-size: var(--t-2xl); line-height: var(--lh-2xl);
  font-weight: var(--w-bold); color: var(--ink-strong);
  letter-spacing: var(--track-tight); }
/* "Not yet published by the carrier" is a sentence, not a date, and setting it at 28px
   would shout an absence. It keeps the italic treatment the fact list gives every
   unreported value, so the two read as the same kind of statement. */
.track__arrival-value--pending { font-size: var(--t-md); line-height: var(--lh-md);
  font-weight: var(--w-normal); font-style: italic; color: var(--ink-muted);
  letter-spacing: normal; }

.track__state { margin: var(--s5) 0; padding: var(--s5); border-radius: var(--radius);
  border-left: 4px solid var(--ink-muted); background: var(--surface-sunken); }
.track__state--on_schedule { border-left-color: var(--status-complete);
  background: var(--status-complete-wash); }
.track__state--changed { border-left-color: var(--status-delay);
  background: var(--status-delay-wash); }
.track__state--no_estimate { border-left-color: var(--status-unknown);
  background: var(--surface-sunken); }
.track__state--unavailable { border-left-color: var(--status-exception);
  background: var(--status-exception-wash); }
.track__headline { margin: 0; font-size: var(--t-lg); line-height: var(--lh-lg);
  font-weight: var(--w-semi); color: var(--ink-strong); }
.track__explain { margin: var(--s3) 0 0; font-size: var(--t-md); line-height: var(--lh-md);
  color: var(--ink-muted); }
.track__revision { margin: var(--s4) 0 0; padding-top: var(--s4);
  border-top: 1px solid var(--line); font-size: var(--t-md);
  font-weight: var(--w-semi);
  line-height: var(--lh-md); color: var(--ink-body); }
.track__facts { margin: var(--s5) 0 0; padding: 0; }
.track__fact { display: flex; justify-content: space-between; gap: var(--s4);
  padding: var(--s3) 0; border-bottom: 1px solid var(--line); }
.track__fact:last-child { border-bottom: 0; }
.track__fact dt { margin: 0; font-size: var(--t-base); line-height: var(--lh-base);
  color: var(--ink-muted); flex: none; }
.track__fact dd { margin: 0; font-size: var(--t-md); line-height: var(--lh-md);
  text-align: right; color: var(--ink-body); font-weight: var(--w-medium); }
.track__pending { color: var(--ink-muted); font-style: italic; font-weight: var(--w-normal); }
.track__foot { margin-top: var(--s5); padding-top: var(--s5);
  border-top: 1px solid var(--line); font-size: var(--t-sm); line-height: 1.6;
  color: var(--ink-faint); }
.track__foot p { margin: 0 0 var(--s2); }
.track__source { margin-bottom: 0; }

@media (max-width: 560px) {
  .track { padding: var(--s3); }
  .track__card { padding: var(--s5); }
  .track__fact { flex-direction: column; gap: 2px; }
  .track__fact dd { text-align: left; }
  .track__arrival { flex-direction: column; align-items: flex-start; gap: var(--s2); }
}
.share__intro { margin: 0 0 var(--s3); font-size: 13px; }
.share__url { width: 100%; padding: var(--s3); border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--surface-sunken);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px;
  color: var(--ink-body); }
.track__ref--plain { font-family: inherit; font-size: 20px; letter-spacing: normal; }
.share__confirm { display: flex; align-items: flex-start; gap: var(--s2);
  margin: var(--s4) 0 var(--s3); font-size: 12.5px; color: var(--ink-muted);
  line-height: 1.5; }
.share__confirm input { margin-top: 2px; flex: none; }
.share__rotated { margin: var(--s3) 0 0; font-size: 12px; color: var(--ink-muted); }

/* Action queue -------------------------------------------------------------
   A list of decisions, not a table of rows. Each item states why it is here in
   words, because a queue that shows a coloured dot and expects the reader to infer
   the reason is a table with extra steps. Every colour is an existing token. */
.queue { display: flex; flex-direction: column; gap: var(--s3); }
.queue__count { font-size: 12.5px; }
.queue__item { border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--s4); border-left: 3px solid var(--ink-muted); background: var(--surface); }
.queue__item--exception { border-left-color: var(--status-exception); }
.queue__item--check_failing { border-left-color: var(--status-delay); }
.queue__item--schedule_moved { border-left-color: var(--status-delay); }
.queue__item--no_estimate { border-left-color: var(--status-unknown); }
.queue__head { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.queue__ref { font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 600; font-size: 14px; }
.queue__customer { color: var(--ink-muted); font-size: 13px; margin-left: auto; }
.queue__why { margin: var(--s3) 0 0; display: flex; flex-wrap: wrap; gap: var(--s2); }
.queue__reason { font-size: 11.5px; font-weight: 600; padding: 2px var(--s2);
  border-radius: var(--radius-sm); background: var(--surface-sunken);
  color: var(--ink-body); border: 1px solid var(--line); }
.queue__detail { margin: var(--s2) 0 0; font-size: 13px; color: var(--ink-muted);
  line-height: 1.5; }
.queue__back { margin: var(--s2) 0 0; font-size: 12px; color: var(--ink-muted);
  font-style: italic; }
.queue__form { margin: var(--s3) 0 0; }
.queue__reason--exception { background: var(--status-exception-wash);
  color: var(--status-exception); border-color: var(--status-exception-line); }
.queue__reason--check_failing, .queue__reason--schedule_moved {
  background: var(--status-delay-wash); color: var(--status-delay);
  border-color: var(--status-delay-line); }
.queue__reason--no_estimate { background: transparent; color: var(--status-unknown);
  border: 1px dashed var(--status-unknown); font-style: italic; }
.archive__intro { margin: 0 0 var(--s3); font-size: 13px; }
.archive__state { margin: 0 0 var(--s4); font-size: 13px; color: var(--ink-body);
  line-height: 1.55; }
.panel--archived { border-left: 3px solid var(--ink-muted); background: var(--surface-sunken); }
.track__state--archived, .track__state--paused { border-left-color: var(--ink-muted);
  background: var(--surface-sunken); }
.track__stopped { margin: var(--s3) 0 0; font-size: var(--t-base);
  color: var(--ink-muted); font-style: italic; }

/* Fleet drift trend, day drill-down ----------------------------------------
   Click to open, matching the row drill-in from 8c rather than a tooltip that
   vanishes on mouse-out and cannot be reached on a touch screen at all. */
.trend__col--openable { cursor: pointer; }
.trend__col--openable:hover .trend__seg { filter: brightness(0.92); }
.trend__col--openable:focus-visible { outline: none; box-shadow: var(--ring); }
.trend__col--open { box-shadow: inset 0 -3px 0 var(--brand-deep); }
.trend__day { margin-top: var(--s5); padding-top: var(--s4);
  border-top: 1px solid var(--line); }
.trend__day-head { display: flex; align-items: center; justify-content: space-between;
  gap: var(--s3); }
.trend__day-title { margin: 0; font-size: 14px; color: var(--brand-darker); }
.trend__day-empty { margin: var(--s3) 0 0; font-size: 13px; color: var(--ink-muted);
  line-height: 1.55; }
.trend__day-list { list-style: none; margin: var(--s3) 0 0; padding: 0;
  display: flex; flex-direction: column; gap: var(--s2); }
.trend__change { border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: var(--s3); background: var(--surface); }
.trend__change-head { display: flex; align-items: center; gap: var(--s2);
  flex-wrap: wrap; }
.trend__change-ref { font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 600; font-size: 13px; }
.trend__change-dates { margin: var(--s2) 0 0; font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--ink-body); }
.trend__change-state { margin: 2px 0 0; font-size: 12px; color: var(--ink-muted); }
.trend__day--loading .muted { font-size: 13px; }

/* ==========================================================================
   Theme switch, and the shared utilities the redesign leans on. Phase 16.
   ========================================================================== */

/* Present to a screen reader, absent to the eye. The three theme buttons are
   icon-only by design, so each carries its real label here rather than relying
   on a title attribute, which most screen readers do not announce. */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.themeswitch {
  display: inline-flex; align-items: center; gap: 2px; margin: 0;
  padding: 3px; background: var(--surface-sunken);
  border: 1px solid var(--line); border-radius: var(--radius-pill);
}
.themeswitch__btn {
  display: inline-grid; place-items: center; width: 28px; height: 28px;
  padding: 0; border: 0; border-radius: var(--radius-pill); cursor: pointer;
  background: transparent; color: var(--ink-faint);
  transition: background var(--motion), color var(--motion);
}
.themeswitch__btn:hover { background: var(--n-100); color: var(--ink-body); }
.themeswitch__btn:focus-visible { outline: 0; box-shadow: var(--ring); }
.themeswitch__btn.is-on { background: var(--surface); color: var(--brand-deep);
  box-shadow: var(--shadow-sm); }
.themeswitch__icon { width: 15px; height: 15px; }

/* Phase 27's sea/air switch, restyled in Phase 33 as the flagship control: it changes the
   whole page, so it is the biggest thing at the top of it. Red is sea and blue is air, and
   the colour is never the only cue: a ship, a plane or a globe and the words sit in every
   segment. Inactive segments show their colour on the icon alone, so the one filled
   segment is unmistakably the one in force. */
.mode-switch {
  display: flex; width: fit-content; max-width: 100%; align-items: stretch; gap: var(--s2);
  margin: 0 0 var(--s5); padding: var(--s1); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.mode-switch__item {
  display: inline-flex; align-items: center; gap: var(--s3);
  min-height: var(--tap-lg); padding: 0 var(--s6) 0 var(--s5);
  border: 2px solid transparent; border-radius: var(--radius);
  color: var(--ink-body); font-size: var(--t-lg); font-weight: var(--w-bold);
  text-decoration: none;
  transition: background var(--motion), color var(--motion), border-color var(--motion);
}
.mode-switch__icon { width: var(--icon-lg); height: var(--icon-lg); flex: none; }
.mode-switch__item--sea .mode-switch__icon { color: var(--sea); }
.mode-switch__item--air .mode-switch__icon { color: var(--air); }
.mode-switch__item--all .mode-switch__icon { color: var(--ink-muted); }
.mode-switch__item:hover { text-decoration: none; color: var(--ink-strong); }
.mode-switch__item--sea:hover { background: var(--sea-wash); border-color: var(--sea); }
.mode-switch__item--air:hover { background: var(--air-wash); border-color: var(--air); }
.mode-switch__item--all:hover { background: var(--n-100); border-color: var(--line-strong); }
.mode-switch__item:focus-visible { outline: 0; box-shadow: var(--ring); }
.mode-switch__item--active.mode-switch__item--sea,
.mode-switch__item--active.mode-switch__item--sea:hover {
  background: var(--sea); border-color: var(--sea); color: var(--sea-on); }
.mode-switch__item--active.mode-switch__item--air,
.mode-switch__item--active.mode-switch__item--air:hover {
  background: var(--air); border-color: var(--air); color: var(--air-on); }
.mode-switch__item--active.mode-switch__item--all,
.mode-switch__item--active.mode-switch__item--all:hover {
  background: var(--n-800); border-color: var(--n-800); color: var(--surface); }
.mode-switch__item--active .mode-switch__icon { color: inherit; }
.mode-switch__count {
  min-width: 2em; padding: 2px var(--s2); border-radius: var(--radius-pill);
  background: color-mix(in srgb, currentColor 14%, transparent);
  font-size: var(--t-md); font-weight: var(--w-bold); text-align: center;
  font-variant-numeric: tabular-nums; }

/* Phase 32. The one red action: archiving a delivered shipment. Exception ink and wash
   from the status tokens, so it reads as destructive and distinct from every other
   button, with its word always on it. Phase 33 owns the final look. */
.btn--danger { background: var(--status-exception); border-color: var(--status-exception);
  color: var(--surface); }
.btn--danger:hover { background: var(--status-exception); color: var(--surface);
  filter: brightness(0.92); }
.inline-form { display: inline; margin: 0; }

/* Phase 30. The three-stage shipment timeline (includes/stage_timeline.html). Shape
   carries the state as well as colour: a filled dot is done, a ringed dot is current,
   a hollow one is still to come, so it survives greyscale and a black-and-white print.
   Restyling belongs to phase 33; this is functional, from existing tokens only. */
.stages { margin: 0 0 var(--s3); }
.stages__track { display: flex; gap: var(--s2); margin: 0; padding: 0; list-style: none; }
.stages__step { flex: 1; display: flex; flex-direction: column; gap: var(--s1);
  padding-top: var(--s2); border-top: 3px solid var(--line); color: var(--ink-muted); }
.stages__step--done { border-top-color: var(--status-progress); color: var(--ink); }
.stages__step--current { border-top-color: var(--status-progress); color: var(--ink);
  font-weight: 600; }
.stages__dot { width: 10px; height: 10px; border-radius: var(--radius-pill);
  border: 2px solid var(--line-strong); background: var(--surface); }
.stages__step--done .stages__dot { background: var(--status-progress);
  border-color: var(--status-progress); }
.stages__step--current .stages__dot { border-color: var(--status-progress);
  box-shadow: 0 0 0 3px var(--brand-wash); }
.stages__milestone { font-size: var(--t-xs); color: var(--ink-muted); font-weight: 400; }
.stages__note { margin: var(--s2) 0 0; font-size: var(--t-xs); color: var(--ink-muted);
  font-style: italic; }
.stages__note--exception { color: var(--status-exception); font-style: normal; font-weight: 600; }
.stages--exception .stages__step--current { border-top-color: var(--status-exception); }
.stages--compact { margin: 0; min-width: 240px; }
.stages--compact .stages__label { font-size: var(--t-xs); }

/* Phase 30. The customer PDF (workspace_customer_pdf.html), printed by Chromium. */
.pdf { background: var(--surface); color: var(--ink); padding: 0; margin: 0; }
.pdf__head { border-bottom: 2px solid var(--line-strong); margin-bottom: var(--s5);
  padding-bottom: var(--s3); }
.pdf__brand { margin: 0; font-weight: 700; color: var(--brand-darker); }
.pdf__title { margin: var(--s1) 0; }
.pdf__meta { margin: 0; color: var(--ink-muted); font-size: var(--t-xs); }
.pdf__shipment { break-inside: avoid; border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--s4); margin-bottom: var(--s4); }
.pdf__ref { margin: 0 0 var(--s3); font-size: 1em; }

/* ==========================================================================
   Style guide. Phase 16's proof that the tokens and the toggle work before a
   single real page is touched.
   ========================================================================== */
.sg__grid { display: grid; gap: var(--s4);
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.sg__swatch { border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; background: var(--surface); }
.sg__chip { height: 54px; }
.sg__meta { padding: var(--s3); font-size: var(--t-xs); line-height: var(--lh-xs);
  color: var(--ink-muted); }
.sg__meta strong { display: block; color: var(--ink-strong);
  font-size: var(--t-sm); font-weight: var(--w-semi); }
.sg__meta code { color: var(--ink-body); }
.sg__ratio { float: right; font-variant-numeric: tabular-nums;
  color: var(--ink-faint); }
.sg__type > * { margin: 0 0 var(--s3); }
.sg__row { display: flex; flex-wrap: wrap; gap: var(--s3);
  align-items: center; margin-bottom: var(--s4); }
.sg__box { display: grid; place-items: center; width: 100%; height: 64px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); font-size: var(--t-xs); color: var(--ink-muted); }

/* ==========================================================================
   Phase 18: the email wording editor.

   Two panels side by side, the draft and the preview, because the whole point is
   seeing the populated email rather than the markup. Every value is a token from
   the Phase 16 system; this introduces no second visual language and no colour of
   its own, per section 5 of the phase plan.
   ========================================================================== */
.tmpl__grid { display: grid; gap: var(--s5); align-items: start;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 1150px) { .tmpl__grid { grid-template-columns: 1fr; } }

.tmpl__actions { display: flex; align-items: center; gap: var(--s3);
  margin-top: var(--s5); flex-wrap: wrap; }
.tmpl__nosend { font-size: var(--t-sm); }

/* The variable row. Monospace because these are literal tokens that get typed into
   the message, and reading them as prose is what makes somebody retype one wrong. */
.vars { margin: var(--s5) 0; padding: var(--s4); border-radius: var(--radius);
  background: var(--surface-sunken); border: 1px solid var(--line); }
.vars__label { margin: 0 0 var(--s3); font-size: var(--t-2xs);
  text-transform: uppercase; letter-spacing: var(--track-wide);
  color: var(--ink-faint); font-weight: var(--w-bold); }
.vars__row { display: flex; flex-wrap: wrap; gap: var(--s2); }
.vars__btn { font-family: var(--mono); font-size: var(--t-xs);
  padding: 5px var(--s3); border-radius: var(--radius-sm);
  border: 1px solid var(--brand-line); background: var(--brand-wash);
  color: var(--brand-darker); cursor: pointer;
  transition: background var(--motion), border-color var(--motion),
              transform var(--dur-fast); }
.vars__btn:hover { border-color: var(--brand); transform: translateY(-1px); }
.vars__btn:focus-visible { outline: 0; box-shadow: var(--ring); }
.vars__help { margin: var(--s3) 0 0; font-size: var(--t-sm);
  line-height: var(--lh-sm); }

/* Trix ships its own toolbar styling. These rules only bind it to this project's
   tokens so it does not sit on the page as a foreign white box in dark mode. */
.tmpl__editor { min-height: 260px; background: var(--surface-sunken);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: var(--s4); color: var(--ink-body); font-size: var(--t-base);
  line-height: var(--lh-base); }
.tmpl__editor:focus { outline: 0; background: var(--surface);
  border-color: var(--brand); box-shadow: var(--ring); }
trix-toolbar .trix-button-group { border-color: var(--line-strong);
  background: var(--surface); }
trix-toolbar .trix-button { border-color: var(--line); background: var(--surface);
  color: var(--ink-body); }
trix-toolbar .trix-button:not(:disabled):hover { background: var(--surface-sunken); }
trix-toolbar .trix-button.trix-active { background: var(--brand-wash);
  color: var(--brand-darker); }
/* Trix draws its icons as background images in a filter-sensitive way. In dark mode
   they are near-black on a dark button, which is invisible; inverting the glyph is
   the smallest fix that does not fork the vendored file. */
:root[data-theme="dark"] trix-toolbar .trix-button::before { filter: invert(1); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) trix-toolbar .trix-button::before { filter: invert(1); }
}
/* Attachments are disabled in the page script, so the control must not be offered. */
trix-toolbar .trix-button--icon-attach { display: none; }

/* The preview. Deliberately styled as a quoted document rather than as more of the
   form, so nobody mistakes it for something they can type into. */
.tmpl__preview { position: sticky; top: var(--s5); }
@media (max-width: 1150px) { .tmpl__preview { position: static; } }
.preview__label { margin: var(--s4) 0 var(--s2); font-size: var(--t-2xs);
  text-transform: uppercase; letter-spacing: var(--track-wide);
  color: var(--ink-faint); font-weight: var(--w-bold); }
.preview__label:first-child { margin-top: 0; }
.preview__subject { margin: 0; font-size: var(--t-md); line-height: var(--lh-md);
  font-weight: var(--w-semi); color: var(--ink-strong); }
.preview__body { padding: var(--s4); border-radius: var(--radius);
  background: var(--surface-sunken); border: 1px solid var(--line);
  color: var(--ink-body); font-size: var(--t-base); line-height: 1.6;
  overflow-wrap: anywhere; }
.preview__body a { color: var(--brand-deep); }
.preview__note { margin: var(--s4) 0 0; font-size: var(--t-sm); }
.preview__err { padding: var(--s3) var(--s4); margin-bottom: var(--s4);
  border-radius: var(--radius-sm); border: 1px solid var(--bad-line);
  background: var(--bad-wash); color: var(--bad);
  font-size: var(--t-sm); line-height: var(--lh-sm); }
.backlink { display: inline-block; margin-bottom: var(--s3);
  font-size: var(--t-sm); color: var(--ink-muted); text-decoration: none; }
.backlink:hover { color: var(--brand-deep); }
.tmpl__links { display: flex; gap: var(--s3); flex-wrap: wrap; }
.tmpl__links .btn { gap: var(--s2); }

/* Phase 18: the per-customer opt-out list. */
.optout { list-style: none; margin: 0 0 var(--s5); padding: 0; }
.optout__row { display: flex; align-items: center; gap: var(--s4);
  padding: var(--s3) 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.optout__row:last-child { border-bottom: 0; }
.optout__label { display: flex; align-items: center; gap: var(--s3);
  cursor: pointer; font-size: var(--t-base); color: var(--ink-body);
  font-weight: var(--w-medium); min-width: 220px; }
.optout__email { font-size: var(--t-sm); color: var(--ink-muted); margin-left: auto; }

/* Trix lays its toolbar out as fixed-width button groups that do not wrap, so on a
   narrower column the undo/redo group is simply cut off at the panel edge: found by
   looking at the rendered page, not by a test. Wrapping beats scrolling here because a
   toolbar is scanned rather than read, and a control nobody can see is a control nobody
   has. */
/* Scoped under .tmpl deliberately, to outrank Trix's own `trix-toolbar
   .trix-button-row`, which is the same specificity as an unscoped override and loads
   AFTER this file: the vendored stylesheet is linked from the scripts block at the foot
   of the page. Trix's rule sets `flex-wrap: nowrap` with `overflow-x: auto`, so the
   toolbar does not actually break, it scrolls sideways, which on a half-width column
   hides undo and redo behind a scroll nobody can see they need. */
.tmpl trix-toolbar .trix-button-row { flex-wrap: wrap; gap: var(--s2); }
.tmpl trix-toolbar .trix-button-group { margin-bottom: 0; }
.tmpl trix-toolbar .trix-button-group:not(:first-child) { margin-left: 0; }
/* The spacer exists to push history-tools to the far right on one line. Once the row
   wraps it only produces a ragged gap. */
.tmpl trix-toolbar .trix-button-group-spacer { display: none; }

/* A checkbox and its label are one phrase and must not break in the middle of it. */
.field--inline label { white-space: nowrap; }

/* ==========================================================================
   Phase 33. Bigger, more literal controls for people who are not necessarily
   comfortable with software. Every target a person clicks is at least --tap (44px)
   tall, icons are --icon (20px) or larger, and the words stay beside them. Nothing
   here adds a colour: sizes come from the tokens and colours from the palette.
   ========================================================================== */
.nav { gap: var(--s1); }
.nav__item { min-height: var(--tap); padding: 0 var(--s3); gap: var(--s3);
  font-size: var(--t-md); border-radius: var(--radius); }
.nav__icon { width: var(--icon); height: var(--icon); }
.sidebar__label { font-size: var(--t-2xs); }

.btn { min-height: var(--tap); padding: 0 var(--s5); font-size: var(--t-md);
  border-radius: var(--radius); }
.btn--sm { min-height: var(--s8); padding: 0 var(--s3); font-size: var(--t-base); }
.btn__icon { width: var(--icon); height: var(--icon); flex: none; }

/* The archive action. Still the one red button, and now unmistakably an archive:
   a box icon, the full words "Archive shipment", and the largest target on the panel. */
.btn--archive { min-height: var(--tap-lg); padding: 0 var(--s6); font-size: var(--t-md);
  font-weight: var(--w-bold); gap: var(--s3); }
.btn--archive .btn__icon { width: var(--icon-lg); height: var(--icon-lg); }

.tile { padding: var(--s6) var(--s6) var(--s6) var(--s7); gap: var(--s3); }
.tile__label { font-size: var(--t-xs); }
.tile__meta { font-size: var(--t-base); }

/* The three-stage timeline, bigger: a 16px dot, a 4px track and 15px words. The shapes
   still carry the state (filled done, ringed current, hollow to come). */
.stages__step { border-top-width: 4px; padding-top: var(--s3); gap: var(--s2);
  font-size: var(--t-md); }
.stages__dot { width: var(--s4); height: var(--s4); border-width: 3px; }
.stages__milestone { font-size: var(--t-sm); }
.stages__note { font-size: var(--t-sm); }
/* In a table row the timeline stays dense: dot and word on one line, the milestone
   under it, so a list of twenty shipments still fits a screen. Tables are dense on
   purpose (6a); the big version is for the shipment and customer pages. */
.stages--compact .stages__step { flex-direction: row; flex-wrap: wrap; align-items: center;
  column-gap: var(--s1); row-gap: 0; padding-top: var(--s1); font-size: var(--t-sm);
  border-top-width: 3px; }
.stages--compact .stages__dot { width: var(--s3); height: var(--s3); border-width: 2px; }
.stages--compact .stages__label { font-size: var(--t-sm); }
.stages--compact .stages__milestone { flex-basis: 100%; font-size: var(--t-xs); }

/* The mode marker on a row or a page title: the same icon, colour and word as the
   switch, so a shipment's mode reads the same wherever it appears. */
.mode-mark { display: inline-flex; align-items: center; gap: var(--s1); vertical-align: middle;
  font-weight: var(--w-bold); font-size: var(--t-sm); white-space: nowrap; }
.mode-mark__icon { width: var(--icon); height: var(--icon); flex: none; }
.mode-mark--sea { color: var(--sea); }
.mode-mark--air { color: var(--air); }
.mode-split { display: flex; flex-wrap: wrap; gap: var(--s4); }
.mode-split .mode-mark { font-size: var(--t-md); }

/* On a phone the switch is three equal columns, icon over word, so it stays one row and
   every segment keeps its full target rather than wrapping into a ragged stack. */
@media (max-width: 640px) {
  .mode-switch { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; }
  .mode-switch__item { flex-direction: column; justify-content: center; gap: var(--s1);
    padding: var(--s2) var(--s1); font-size: var(--t-base); text-align: center; }
  .mode-switch__count { font-size: var(--t-sm); }
}

/* ==========================================================================
   Phase 34. The route map (includes/route_map.html, js/route_map.js). Pins reuse the
   Phase 33 sea red and air blue with the ship and plane, so the map reads like the rest
   of the app and colour is never the only cue. The honesty line is styled as part of the
   component, not as fine print: it says the map is not a live position.
   ========================================================================== */
.route-map { display: flex; flex-direction: column; gap: var(--s3); margin-bottom: var(--s4); }
.route-map__honesty { display: flex; gap: var(--s2); align-items: flex-start; margin: 0;
  padding: var(--s3) var(--s4); border: 1px solid var(--info-line); border-radius: var(--radius);
  background: var(--info-wash); color: var(--ink-body); font-size: var(--t-base); }
.route-map__honesty-icon { width: var(--icon); height: var(--icon); flex: none; color: var(--info); }
.route-map__canvas { height: var(--map-h); border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--surface-sunken); z-index: 0; }
.route-map--single .route-map__canvas { height: var(--map-h-single); }
.route-map__tiles { margin: 0; color: var(--ink-muted); font-size: var(--t-sm); }
.route-map__legend { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); margin: 0; padding: 0;
  list-style: none; font-size: var(--t-sm); color: var(--ink-body); }
.route-map__legend li { display: inline-flex; align-items: center; gap: var(--s2); }
.route-map__line { display: inline-block; width: var(--s7); height: 0; border-top: 3px solid var(--ink-muted); }
.route-map__line--current { border-top-style: dashed; border-top-width: 4px; }
.route-map__line--ahead { border-top-style: dotted; border-top-color: var(--ink-faint); }

.route-pin { display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-pill); border: 2px solid var(--surface); box-shadow: var(--shadow); }
.route-pin svg { width: 62%; height: 62%; }
.route-pin--sea { background: var(--sea); color: var(--sea-on); }
.route-pin--air { background: var(--air); color: var(--air-on); }
.route-pin--key { width: var(--s6); height: var(--s6); flex: none; }

/* Leaflet's own chrome, onto the tokens so it follows both themes. */
/* Phase 52: the permanent place label on one shipment's map. Wraps inside the map instead of overflowing it. */
.route-map .leaflet-tooltip.route-map__place { white-space: normal; width: max-content; max-width: min(16rem, 70vw); text-align: center;
  font-size: var(--t-sm); background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.route-map .leaflet-container { font: inherit; background: var(--surface-sunken); }
.route-map .leaflet-popup-content-wrapper, .route-map .leaflet-popup-tip,
.route-map .leaflet-bar a, .route-map .leaflet-control-attribution {
  background: var(--surface); color: var(--ink-body); }
.route-map .leaflet-popup-content { margin: var(--s3) var(--s4); font-size: var(--t-sm);
  line-height: var(--lh-sm); }
.route-map .leaflet-control-attribution a, .route-map .leaflet-popup-content a { color: var(--brand-deep); }
.route-map .leaflet-bar a { border-bottom-color: var(--line); width: var(--tap); height: var(--tap);
  line-height: var(--tap); font-size: var(--t-lg); }
/* Standard map tiles are drawn for a light page; on the dark theme they are dimmed rather
   than inverted, so land and sea keep their usual meaning. Same two selectors as the dark
   palette (6c), so an explicit Light choice on a dark device is never overridden. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .route-map .leaflet-tile-pane { filter: brightness(.72) contrast(1.08) saturate(.85); }
}
:root[data-theme="dark"] .route-map .leaflet-tile-pane { filter: brightness(.72) contrast(1.08) saturate(.85); }

/* ==========================================================================
   Phase 36. "Powered by V2T": bottom-left, just above the version, on every page in the
   shell and on the sign-in page. The sidebar is dark in both themes, so its inks are the
   sidebar's own absolute tokens (6c), never the neutral ramp that inverts.
   ========================================================================== */
.sidebar__foot { display: flex; flex-direction: column; gap: var(--s2); }
.powered { display: flex; align-items: center; gap: var(--s2); color: var(--nav-ink); }
.powered__logo { height: var(--icon-lg); width: auto; border-radius: var(--radius-sm); }
.powered__mark { display: inline-flex; align-items: center; justify-content: center;
  height: var(--icon-lg); padding: 0 var(--s2); border-radius: var(--radius-sm);
  background: var(--nav-active); color: var(--nav-ink-active); font-weight: var(--w-bold);
  font-size: var(--t-xs); letter-spacing: var(--track-wide); }
.powered__text { font-size: var(--t-xs); font-weight: var(--w-medium); color: var(--nav-ink); }
.sidebar__version { font-size: var(--t-2xs); color: var(--nav-ink-muted); }
.auth__powered { position: absolute; left: var(--s7); bottom: var(--s6); display: flex;
  flex-direction: column; gap: var(--s1); }
.auth__version { font-size: var(--t-2xs); color: var(--nav-ink-muted); }
.pdf__customer { margin: var(--s6) 0 var(--s3); font-size: var(--t-lg); color: var(--brand-darker);
  border-bottom: 1px solid var(--line); padding-bottom: var(--s2); break-after: avoid; }

/* Phase 36. Add Shipment, restyled from Phase 33's pieces: numbered sections with literal
   icons, and the first section's edge in the chosen mode's colour (red sea, blue air),
   always beside the ship or plane and the words, never colour alone. */
.addform { display: flex; flex-direction: column; gap: var(--s5); max-width: var(--form-w); }
.addform__step { display: flex; align-items: center; gap: var(--s3); margin: 0;
  font-size: var(--t-lg); font-weight: var(--w-bold); color: var(--ink-strong); }
.addform__num { display: inline-flex; align-items: center; justify-content: center;
  width: var(--s8); height: var(--s8); border-radius: var(--radius-pill);
  background: var(--sea); color: var(--sea-on); font-size: var(--t-md); }
.addform--air .addform__section--what .addform__num { background: var(--air); color: var(--air-on); }
.addform__num--who, .addform--air .addform__num--who { background: var(--n-800); color: var(--surface); }
.addform__icon { width: var(--icon-lg); height: var(--icon-lg); color: var(--sea); }
.addform--air .addform__section--what .addform__icon { color: var(--air); }
.addform__section--who .addform__icon { color: var(--ink-muted); }
.addform__section--what { border-left: var(--s2) solid var(--sea); }
.addform--air .addform__section--what { border-left-color: var(--air); }
.addform__who { display: grid; gap: var(--s4) var(--s6); grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.addform__label-icon { width: var(--icon); height: var(--icon); vertical-align: -4px; color: var(--ink-muted); }
.addform__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); }
.addform__actions .field__hint { flex-basis: 100%; margin: 0; }
.addform select, .addform input[type="text"] { min-height: var(--tap); font-size: var(--t-md); }
.btn--lg { min-height: var(--tap-lg); padding: 0 var(--s7); font-size: var(--t-md); font-weight: var(--w-bold); }

/* Phase 36. Customer assignments: agents on an account as removable chips, a dropdown to add
   one, and an Add customer panel that opens in place. */
.addcust { margin-bottom: var(--s5); padding: 0; }
.addcust__summary { list-style: none; margin: var(--s4); display: inline-flex; }
.addcust__summary::-webkit-details-marker { display: none; }
.addcust[open] .addcust__summary { margin-bottom: 0; }
.addcust__grid { display: grid; gap: var(--s4) var(--s6); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.addcust__form select, .addcust__form input[type="text"], .addcust__form input[type="email"] { min-height: var(--tap); font-size: var(--t-md); }
.assign-table td { vertical-align: top; }
.chip { display: inline-flex; align-items: center; gap: var(--s2); margin: 0 var(--s2) var(--s2) 0;
  padding: var(--s1) var(--s1) var(--s1) var(--s3); border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill); background: var(--surface-sunken); font-size: var(--t-base); }
.chip__icon { width: var(--icon); height: var(--icon); color: var(--brand-deep); }
.chip__remove { display: inline-flex; align-items: center; justify-content: center;
  min-width: var(--s8); min-height: var(--s8); border: 0; border-radius: var(--radius-pill);
  background: transparent; color: var(--ink-muted); font-size: var(--t-lg); cursor: pointer; }
.chip__remove:hover { background: var(--bad-wash); color: var(--bad); }
.chip__remove:focus-visible { outline: 0; box-shadow: var(--ring); }
.assign { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.assign select { min-height: var(--tap); font-size: var(--t-md); }

/* ==========================================================================
   Phase 37. The air render mode of the progress widget (includes/stage_timeline_air.html).
   Same component as the sea one, a different shape: four tight steps instead of three
   wide ones, a time to the minute under each lit step, a plane on the leg in the air and
   connection airports as waypoints. Colour is Phase 33's air blue, no third colour, and
   every state is also a shape (filled dot done, ring current, hollow to come, plane in the
   air) so it survives greyscale.
   ========================================================================== */
.stages--air .stages__track { gap: var(--s1); align-items: flex-start; }
.stages--air .stages__step { flex: 0 1 auto; min-width: 0; padding: var(--s2) var(--s3) 0 0;
  border-top: 3px solid var(--line-strong); }
.stages--air .stages__step--done, .stages--air .stages__step--current { border-top-color: var(--air); }
.stages--air .stages__step--done .stages__dot { background: var(--air); border-color: var(--air); }
.stages--air .stages__step--current .stages__dot { border-color: var(--air);
  box-shadow: 0 0 0 3px var(--air-wash); }
.stages--air .stages__plane { width: var(--icon-lg); height: var(--icon-lg); color: var(--air);
  flex: none; transform: rotate(90deg); }
.stages--air .stages__step--flying { border-top-style: dashed; }
.stages__when { font-size: var(--t-xs); color: var(--ink-muted); font-variant-numeric: tabular-nums;
  white-space: nowrap; }
.stages__stn { font-family: var(--mono); color: var(--ink-faint); }
.stages__via { display: flex; flex-direction: column; justify-content: center; gap: var(--s1);
  padding: var(--s2) var(--s2) 0; border-top: 3px dotted var(--air); flex: 0 1 auto; }
.stages__waypoint { display: inline-flex; align-items: center; gap: var(--s1); font-size: var(--t-xs);
  color: var(--ink-muted); white-space: nowrap; }
.stages__waypoint--reached { color: var(--ink); }
.stages__waypoint-dot { width: var(--s2); height: var(--s2); border-radius: var(--radius-pill);
  border: 2px solid var(--air); background: var(--surface); }
.stages__waypoint--reached .stages__waypoint-dot { background: var(--air); }
.stages--air.stages--compact { min-width: 0; }
.stages--air.stages--compact .stages__when { display: none; }
.stages--air.stages--compact .stages__step--current .stages__when { display: inline; }
.stages--air.stages--compact .stages__plane { width: var(--icon); height: var(--icon); }
.stages--air.stages--exception .stages__step--current { border-top-color: var(--status-exception); }

/* ==========================================================================
   Phase 37. The honest "not tracked" state (includes/not_tracked.html). A muted icon and a
   short label saying why, in place of a gap. The SHAPE carries the kind (dashed clock: not
   yet, dashed slash: not reported, dashed pin: no position, dashed pages: awaiting review),
   so it never relies on colour; the ink is the muted token, which is the colour of "this is
   known and just not available", not of a fault.
   ========================================================================== */
.untracked { display: inline-flex; align-items: center; gap: var(--s1); color: var(--ink-muted);
  font-size: inherit; font-style: normal; white-space: nowrap; vertical-align: middle; }
.untracked__icon { width: var(--icon); height: var(--icon); flex: none; color: var(--ink-faint); }
.untracked__label { font-weight: var(--w-medium); }
.untracked__detail { display: block; flex-basis: 100%; white-space: normal; font-size: var(--t-sm);
  font-weight: var(--w-normal); color: var(--ink-faint); }
.untracked:has(.untracked__detail) { flex-wrap: wrap; white-space: normal; }
.stages__note.untracked { display: flex; font-style: normal; }
.cell-route .untracked { font-size: var(--t-sm); }
.route-map__gaps { margin: 0; font-size: var(--t-sm); }
.route-map__gaps span { white-space: normal; }

/* Phase 37 section 3: the import report's inline fix rows and the add-customer dialog. */
.fixrow { border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s4); margin-top: var(--s3); background: var(--surface-sunken); }
.fixrow__why { margin: 0 0 var(--s3); color: var(--ink-body); }
.fixrow__fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--s4); align-items: start; }
.fixrow__fields > .btn--primary { align-self: start; margin-top: var(--s5); }
.fixrow__fields .field { display: flex; flex-direction: column; gap: var(--s1); }
.fixrow__fields select, .fixrow__fields input { min-height: var(--tap); }
.fixrow__fields .btn { min-height: var(--tap); }
.btn--link { align-self: start; background: none; border: 0; color: var(--brand-deep); padding: var(--s2) 0; min-height: var(--tap); text-decoration: underline; cursor: pointer; }
.dialog { border: 1px solid var(--line-strong); border-radius: var(--radius-lg); background: var(--surface); color: var(--ink-body); box-shadow: var(--shadow-lg); padding: var(--s6); max-width: 440px; width: calc(100% - var(--s7)); }
.dialog::backdrop { background: rgba(19, 28, 29, .45); }
.dialog__form { display: grid; gap: var(--s4); }
.dialog__actions { display: flex; justify-content: flex-end; gap: var(--s3); }
.dialog__actions .btn { min-height: var(--tap); }

/* Phase 37 section 4: the open-problem banner a V2T admin sees on every shell page. */
.alertbar { display: flex; align-items: center; gap: var(--s3); min-height: var(--tap); padding: var(--s3) var(--s4); margin-bottom: var(--s4); border: 1px solid var(--warn-line); border-radius: var(--radius); background: var(--warn-wash); color: var(--warn); text-decoration: none; }
.alertbar--critical { border-color: var(--bad-line); background: var(--bad-wash); color: var(--bad); }
.alertbar > span:first-of-type { flex: 1; }
.alertbar__go { font-weight: 600; text-decoration: underline; white-space: nowrap; }

/* Phase 37 section 5: CSV and Excel links sit quietly beside the PDF button. */
.exportlinks { display: inline-flex; align-items: center; gap: var(--s3); }

/* Phase 38: the House B/L under a carrier reference on staff surfaces. */
.housebl { display: block; font-size: 12px; color: var(--ink-muted); margin-top: var(--s1); font-weight: 400; }
.housebl__label { text-transform: uppercase; letter-spacing: .04em; font-size: 10.5px; color: var(--ink-faint); margin-right: var(--s1); }


/* Phase 39: the customer portal shell and the sections added to the no-login tracking page.
   Tokens only; the same two themes as the rest of the stylesheet. */
.portal__contact-label { margin: 0 0 var(--s2); font-size: 12px; text-transform: uppercase;
  letter-spacing: .04em; color: var(--ink-faint); font-weight: 700; }
.portal__agents { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s1); }
.portal__headline { margin: 0 0 var(--s2); font-size: 18px; color: var(--ink-strong); }
.portal__note { margin-left: var(--s2); font-size: 12px; }
.portal__switch { margin: var(--s4) 0 0; }
.track__section { margin-top: var(--s6); padding-top: var(--s5); border-top: 1px solid var(--line); }
.track__h2 { margin: 0 0 var(--s3); font-size: 14px; color: var(--ink-strong); }
.addcust__login { margin: var(--s4) 0 0; border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--s4); }
.addcust__login legend { padding: 0 var(--s2); font-size: 13px; font-weight: 600; color: var(--ink-strong); }

/* Phase 40: the Team page's active roster and its collapsed disabled section. */
.team__group { margin: var(--s4) 0 var(--s2); font-size: 14px; color: var(--ink-strong); font-weight: 700; }
.team__disabled { margin-top: var(--s5); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 var(--s4); background: var(--surface-sunken); }
.team__disabled > summary { display: flex; align-items: baseline; gap: var(--s3); min-height: var(--tap); cursor: pointer; list-style: none; }
.team__disabled > summary::-webkit-details-marker { display: none; }
.team__disabled > summary::before { content: "\25B8"; color: var(--ink-faint); }
.team__disabled[open] > summary::before { content: "\25BE"; }
.team__disabled .team__group { margin: 0; }
.team__disabled .table { margin-bottom: var(--s4); }

/* Phase 40: the map popup's who-and-actions block. Exactly two buttons, tokens only. */
.route-popup__who { display: grid; grid-template-columns: auto 1fr; gap: var(--s1) var(--s3); margin: var(--s3) 0 0; font-size: 13px; }
.route-popup__who dt { color: var(--ink-faint); font-weight: 600; }
.route-popup__who dd { margin: 0; color: var(--ink-strong); }
.route-popup__actions { display: flex; gap: var(--s2); margin-top: var(--s3); }
.route-popup__actions .btn { padding: 0 var(--s4); font-size: 13px; }

/* ==========================================================================
   Phase 40: Schedule Watch in the big-icon design system. Visual only: the same data,
   the same filters, the same CSV. The summary strip becomes the Dashboard's card
   treatment with a literal icon per state, and the page's parts become section cards
   with an icon and a title. Tokens only, both themes.
   ========================================================================== */
.fleet { display: grid; grid-template-columns: repeat(auto-fit, minmax(176px, 1fr)); gap: var(--s4);
  background: none; border: 0; padding: 0; box-shadow: none; margin-bottom: var(--s5); }
.fleet__states { display: contents; }
.fleet__total, .fleet__state { position: relative; display: grid; grid-template-columns: 1fr auto;
  grid-template-areas: "count icon" "label label"; align-items: center; row-gap: var(--s2);
  margin: 0; min-height: 116px; padding: var(--s5); background: var(--surface);
  border: 1px solid var(--line); border-left: 4px solid var(--line-strong);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.fleet__total:hover, .fleet__state:hover { background: var(--surface-sunken); }
.fleet__total--active, .fleet__state--active { background: var(--brand-wash);
  border-color: var(--brand-line); box-shadow: inset 0 0 0 1px var(--brand-line); }
.fleet__count { grid-area: count; font-size: 36px; font-weight: 700; }
.fleet__label { grid-area: label; font-size: 11.5px; }
.fleet__icon { grid-area: icon; display: grid; place-items: center; width: 48px; height: 48px;
  border-radius: var(--radius-pill); background: var(--surface-sunken); color: var(--ink-muted); }
.fleet__icon svg { width: 26px; height: 26px; fill: none; stroke: currentColor; }
.fleet__state--later { border-left-color: var(--status-delay); }
.fleet__state--later .fleet__icon { background: var(--status-delay-wash); color: var(--status-delay); }
.fleet__state--earlier { border-left-color: var(--status-complete); }
.fleet__state--earlier .fleet__icon { background: var(--status-complete-wash); color: var(--status-complete); }
.fleet__state--stable { border-left-color: var(--ink-muted); }
.fleet__state--no_data { border-left-color: var(--status-unknown); border-left-style: dashed; }
.fleet__state--no_data .fleet__icon { background: none; border: 1px dashed var(--status-unknown); color: var(--status-unknown); }
.fleet__total { border-left-color: var(--brand); }
.fleet__total .fleet__icon { background: var(--brand-wash); color: var(--brand-deep); }
.fleet__state--zero { opacity: .72; }

.sw-card { margin-bottom: var(--s5); }
.panel__icon { width: 22px; height: 22px; margin-right: var(--s2); vertical-align: -5px;
  fill: none; stroke: var(--brand-deep); }
.sw-card .panel__title { display: flex; align-items: center; font-size: var(--t-xs); }
.sw-card .trend--bare { border: 0; padding: 0; margin: 0; background: none; }
.sw-card .panel__actions { align-items: center; gap: var(--s3); }
.sw-card .btn--sm, .sw-card .sw__chip, .sw-card .sw__search, .sw-card .sw__select,
.sw-card .panel__actions .btn { min-height: var(--tap); }
.sw-card .sw__chip { padding: 0 var(--s4); border-radius: var(--radius); }
.sw-card .sw__controls { padding-bottom: var(--s4); gap: var(--s3); }
.sw-card .sw__controls--find { padding-bottom: 0; }
.sw-card .sw__table th { padding: var(--s3) var(--s4); }
.sw-card .sw__table td { padding: var(--s4); }
.sw__showing { font-size: 12.5px; color: var(--ink-muted); }
.sw__mode { width: 20px; height: 20px; margin-right: var(--s2); vertical-align: -5px; fill: none; stroke: currentColor; }
.sw__mode--sea { color: var(--sea); }
.sw__mode--air { color: var(--air); }

/* ==========================================================================
   Phase 40: Company Overview as a company home. Cards on Phase 33's tokens, no new colours.
   ========================================================================== */
.co-profile { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--s5); padding: var(--s6); margin-bottom: var(--s5); }
.co-profile__id { display: flex; align-items: center; gap: var(--s5); min-width: 0; flex: 1 1 420px; }
.co-profile__mark, .co-profile .brand__logo { display: grid; place-items: center; width: 72px; height: 72px;
  flex: none; border-radius: var(--radius-lg); background: var(--brand); color: var(--brand-ink);
  font-size: 22px; font-weight: 700; object-fit: contain; }
.co-profile .brand__logo { background: var(--surface); border: 1px solid var(--line); padding: var(--s2); }
.co-profile__name { margin: 0; font-size: 26px; color: var(--ink-strong); }
.co-profile__meta { margin: var(--s2) 0 0; font-size: 13px; line-height: 1.5; }
.co-profile__prefix { font-weight: 700; color: var(--brand-darker); background: var(--brand-wash);
  border: 1px solid var(--brand-line); border-radius: var(--radius-sm); padding: 1px var(--s2); }
.co-profile__facts { list-style: none; margin: 0; padding: 0; display: flex; gap: var(--s6); flex-wrap: wrap; }
.co-profile__facts li { display: flex; flex-direction: column; font-size: 12px; color: var(--ink-muted);
  text-transform: uppercase; letter-spacing: .05em; }
.co-profile__facts strong { font-size: 28px; line-height: 1.1; color: var(--ink-strong); letter-spacing: 0; }

.co-h2 { display: flex; align-items: center; gap: var(--s3); margin: var(--s7) 0 var(--s4);
  font-size: 15px; color: var(--ink-strong); }
.co-h2__icon { width: 24px; height: 24px; flex: none; fill: none; stroke: var(--brand-deep); }
.co-note { margin: var(--s3) 0 0; }

.co-tiles { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.co-tile { position: relative; display: grid; grid-template-columns: 1fr auto; grid-template-areas: "value icon" "label label" "meta meta";
  row-gap: var(--s1); align-items: center; padding: var(--s5); text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--line-strong);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); min-height: 132px; }
a.co-tile:hover { background: var(--surface-sunken); text-decoration: none; }
.co-tile__value { grid-area: value; font-size: 40px; font-weight: 700; line-height: 1; color: var(--ink-strong); font-variant-numeric: tabular-nums; }
.co-tile__icon { grid-area: icon; display: grid; place-items: center; width: 52px; height: 52px;
  border-radius: var(--radius-pill); background: var(--surface-sunken); color: var(--ink-muted); }
.co-tile__icon svg { width: 28px; height: 28px; fill: none; stroke: currentColor; }
.co-tile__label { grid-area: label; margin-top: var(--s2); font-size: 13px; font-weight: 700; color: var(--ink-strong); }
.co-tile__meta { grid-area: meta; font-size: 12.5px; color: var(--ink-muted); }
.co-tile--delay { border-left-color: var(--status-delay); }
.co-tile--delay .co-tile__icon { background: var(--status-delay-wash); color: var(--status-delay); }
.co-tile--ok { border-left-color: var(--status-complete); }
.co-tile--ok .co-tile__icon { background: var(--status-complete-wash); color: var(--status-complete); }
.co-tile--attention { border-left-color: var(--status-delay); background: var(--status-delay-wash); }
.co-tile--attention .co-tile__icon { background: var(--surface); color: var(--status-delay); }

.co-people { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.co-person { display: grid; grid-template-columns: auto 1fr; gap: var(--s4); align-items: center;
  padding: var(--s5); background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.co-person__avatar { display: grid; place-items: center; width: 52px; height: 52px; border-radius: var(--radius-pill);
  background: var(--brand-wash); color: var(--brand-darker); font-weight: 700; font-size: 16px; }
.co-person__name { margin: 0; font-size: 15px; color: var(--ink-strong); }
.co-person__customers { margin: var(--s1) 0 0; font-size: 12.5px; color: var(--ink-muted); }
.co-person__stats { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3);
  margin: 0; padding-top: var(--s4); border-top: 1px solid var(--line); }
.co-person__stats dt { font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-faint); }
.co-person__stats dd { margin: var(--s1) 0 0; font-size: 22px; font-weight: 700; color: var(--ink-strong); }

.co-alerts { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.co-card__title { margin: 0 0 var(--s2); font-size: 15px; color: var(--ink-strong); }
.co-card .btn { margin-top: var(--s3); }
.co-addresses { list-style: none; margin: var(--s2) 0 0; padding: 0; display: grid; gap: var(--s1); font-size: 13px; }
.co-warn { display: flex; gap: var(--s3); align-items: flex-start; margin: var(--s2) 0; color: var(--status-delay); }

.co-shortcuts { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.co-short { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "icon label" "icon meta"; column-gap: var(--s4);
  align-items: center; padding: var(--s4) var(--s5); min-height: var(--tap-lg); text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.co-short:hover { background: var(--surface-sunken); border-color: var(--brand-line); text-decoration: none; }
.co-short__icon { grid-area: icon; display: grid; place-items: center; width: 48px; height: 48px;
  border-radius: var(--radius); background: var(--brand-wash); color: var(--brand-deep); }
.co-short__icon svg { width: 26px; height: 26px; fill: none; stroke: currentColor; }
.co-short__label { grid-area: label; font-weight: 700; color: var(--ink-strong); }
.co-short__meta { grid-area: meta; font-size: 12.5px; color: var(--ink-muted); }

/* Phase 40 polish. The trend card's window chips sit in the card head, so they must not
   carry the bottom padding the filter controls use. The map popup's primary button is
   dark ink on teal like every other primary (the popup's generic link colour would put
   teal text on teal, which fails contrast). The wider cells made the table scroll sooner. */
.sw-card .panel__head .sw__controls { padding: 0; }
.sw-card .panel__head { min-height: 64px; }
.route-map .leaflet-popup-content .route-popup__actions a.btn--primary { color: var(--brand-ink); }
.sw-card .sw__ribbon, .sw-card .sw__ribbon-h { min-width: 180px; width: 30%; }
.sw-card .sw__table td { padding: var(--s4) var(--s3); }
.sw-card .sw__chip { background: var(--surface); border: 1px solid var(--line-strong); box-shadow: none; color: var(--ink-body); }
.sw-card .sw__chip--on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.co-profile .brand__logo { width: auto; max-width: 168px; height: 72px; }

/* Phase 41: Company Settings. The Active mark is a check icon AND the word, on a green wash:
   colour is never the only cue. The section cards are Company Overview's. */
.cs-readonly { display: flex; align-items: center; gap: var(--s3); margin: 0; flex: 1 1 260px; }
.cs-alert-form { margin-top: var(--s5); padding-top: var(--s5); border-top: 1px solid var(--line); }
.cs-lines-note { margin: 0 0 var(--s4); }
.cs-lines { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.cs-lines__mode { width: 24px; height: 24px; margin-right: var(--s2); vertical-align: -6px; fill: none; stroke: currentColor; }
.cs-lines__mode--sea { color: var(--sea); }
.cs-lines__mode--air { color: var(--air); }
.cs-lines__list { list-style: none; margin: 0; padding: 0; display: grid; }
.cs-lines__list li { display: flex; align-items: center; gap: var(--s3); min-height: var(--tap); padding: var(--s2) 0;
  border-top: 1px solid var(--line); }
.cs-lines__list li:first-child { border-top: 0; }
.cs-lines__name { font-weight: 600; color: var(--ink-strong); }
.cs-lines__code { font-size: 12px; color: var(--ink-faint); }
.cs-active { margin-left: auto; display: inline-flex; align-items: center; gap: var(--s1); padding: var(--s1) var(--s3);
  border-radius: var(--radius-pill); background: var(--status-complete-wash); color: var(--status-complete);
  border: 1px solid var(--status-complete); font-size: 12px; font-weight: 700; }
.cs-active svg { width: 16px; height: 16px; fill: none; stroke: currentColor; }

/* Phase 41: the Accounts page. A role icon beside every role word, and the two filters as chips
   that are links (so the address carries them and they work with no script). */
.role-icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; color: var(--brand-deep); }
.role-icon--org_admin { color: var(--brand-deep); }
.role-icon--sales_agent { color: var(--ink-muted); }
.role-icon--customer { color: var(--status-delay); }
.role-cell { display: inline-flex; align-items: center; gap: var(--s2); }
.team-filters .panel__body { display: flex; flex-wrap: wrap; gap: var(--s5) var(--s7); align-items: center; }
.team-filters__group { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.team-filters__label { font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-faint); margin-right: var(--s2); }
.team-chip { display: inline-flex; align-items: center; gap: var(--s2); min-height: var(--tap); padding: 0 var(--s4);
  border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); color: var(--ink-body);
  text-decoration: none; font-weight: 600; font-size: 13px; }
.team-chip:hover { background: var(--surface-sunken); text-decoration: none; }
.team-chip--on { background: var(--brand-wash); border-color: var(--brand); color: var(--brand-darker); }
.team-chip__n { font-weight: 700; color: var(--ink-muted); background: var(--surface-sunken); border-radius: var(--radius-pill); padding: 0 var(--s2); }
.team-chip--on .team-chip__n { background: var(--surface); }

/* Phase 41: the Beta badge, next to the Powered by V2T mark. Outlined, not filled, so it never
   looks like a second logo. On the dark sidebar and sign-in panel it uses the navigation inks
   (absolute, never the inverting neutral ramp); on the light public pages the amber pair. */
.beta-badge { display: inline-flex; align-items: center; height: var(--icon-lg); padding: 0 var(--s2);
  border: 1px solid var(--nav-ink-muted); border-radius: var(--radius-pill); color: var(--nav-ink);
  font-size: var(--t-2xs); font-weight: var(--w-bold); letter-spacing: var(--track-wide); text-transform: uppercase; }
.beta-badge--light { border-color: var(--status-delay); color: var(--status-delay); background: var(--status-delay-wash); }
.track__beta { margin: 0 0 var(--s3); }

/* Phase 41 follow-up: the two tiers of carriers that are not live. Neither is green; each has an
   icon AND words, and the two differ in both ("Not yet enabled" is the clock, "Not available" the
   crossed circle), so colour is never what tells them apart. */
.cs-lines--others { margin-top: var(--s4); }
.cs-tier-note { margin: 0 0 var(--s3); font-size: 13px; }
.cs-lines__list .cs-lines__mode { width: 18px; height: 18px; margin: 0; vertical-align: 0; flex: none; }
.cs-soon, .cs-none { margin-left: auto; display: inline-flex; align-items: center; gap: var(--s1); padding: var(--s1) var(--s3);
  border-radius: var(--radius-pill); font-size: 12px; font-weight: 700; border: 1px solid var(--line-strong); }
.cs-soon { background: var(--status-delay-wash); color: var(--status-delay); border-color: var(--status-delay); }
.cs-none { background: none; color: var(--status-unknown); border-style: dashed; border-color: var(--status-unknown); }
.cs-soon svg, .cs-none svg { width: 16px; height: 16px; fill: none; stroke: currentColor; }

/* Phase 42: V2T's Carrier Access section reuses the Phase 41 tier cards. */
.ca-row { display: flex; align-items: center; gap: var(--s2); flex: 1 1 auto; min-height: var(--tap); cursor: pointer; }
.ca-row input { width: 20px; height: 20px; flex: none; accent-color: var(--brand-deep); }
.ca-history { font-size: 12px; flex-basis: 100%; padding-left: calc(20px + var(--s2)); }
.cs-lines__list li { flex-wrap: wrap; }
.ca-log { margin-top: var(--s4); }
.ca-log summary { cursor: pointer; min-height: var(--tap); display: flex; align-items: center; }

/* ==========================================================================
   Phase 43: the V2T admin's platform dashboard. Tokens only; every state is an icon AND a word, the
   colours are the measured status inks, so nothing here needs a new contrast measurement.
   ========================================================================== */
.pd-pulse { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s6);
  padding: var(--s6); margin-bottom: var(--s5); border-radius: var(--radius-lg); border: 1px solid var(--line);
  border-left-width: 6px; background: var(--surface); box-shadow: var(--shadow-sm); }
.pd-pulse--ok { border-left-color: var(--status-complete); background: var(--status-complete-wash); }
.pd-pulse--attn { border-left-color: var(--status-exception); background: var(--status-exception-wash); }
.pd-pulse__lead { display: flex; align-items: center; gap: var(--s5); flex: 1 1 320px; min-width: 0; }
.pd-pulse__icon { display: grid; place-items: center; width: 64px; height: 64px; flex: none; border-radius: var(--radius-pill);
  background: var(--surface); }
.pd-pulse--ok .pd-pulse__icon { color: var(--status-complete); }
.pd-pulse--attn .pd-pulse__icon { color: var(--status-exception); }
.pd-pulse__icon svg { width: 36px; height: 36px; fill: none; stroke: currentColor; }
.pd-pulse__word { margin: 0; font-size: 24px; color: var(--ink-strong); }
.pd-pulse__sub { margin: var(--s1) 0 0; color: var(--ink-muted); font-size: 14px; }
.pd-pulse__facts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s6); }
.pd-pulse__facts li { display: flex; flex-direction: column; min-width: 120px; }
.pd-fact__label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-muted); }
.pd-pulse__facts strong { font-size: 24px; line-height: 1.2; color: var(--ink-strong); font-variant-numeric: tabular-nums; }
.pd-fact__ver { font-size: 14px !important; font-family: var(--font-mono, monospace); }
.pd-fact__meta { font-size: 12px; color: var(--ink-muted); }

.pd-attn { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.pd-card { padding: var(--s5); display: flex; flex-direction: column; gap: var(--s3); border-left: 6px solid var(--line-strong); }
.pd-card--act { border-left-color: var(--status-exception); }
.pd-card--look { border-left-color: var(--status-delay); }
.pd-card__head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.pd-card__count { font-size: 36px; font-weight: 700; line-height: 1; color: var(--ink-strong); font-variant-numeric: tabular-nums; }
.pd-card__title { margin: 0; display: flex; align-items: center; gap: var(--s2); font-size: 16px; color: var(--ink-strong); }
.pd-card__icon { width: 22px; height: 22px; flex: none; fill: none; stroke: var(--brand-deep); }
.pd-card__text { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--ink-muted); }
.pd-level, .pd-pill { display: inline-flex; align-items: center; gap: var(--s1); padding: var(--s1) var(--s3);
  border-radius: var(--radius-pill); border: 1px solid var(--line-strong); font-size: 12px; font-weight: 700; width: fit-content; }
.pd-level svg, .pd-pill svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; }
.pd-level--act, .pd-pill--bad { background: var(--status-exception-wash); color: var(--status-exception); border-color: var(--status-exception); }
.pd-level--look, .pd-pill--warn { background: var(--status-delay-wash); color: var(--status-delay); border-color: var(--status-delay); }
.pd-pill--ok { background: var(--status-complete-wash); color: var(--status-complete); border-color: var(--status-complete); }
.pd-pill--off { background: none; color: var(--status-unknown); border-style: dashed; border-color: var(--status-unknown); }
.pd-rows { list-style: none; margin: 0; padding: 0; display: grid; }
.pd-rows li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); min-height: var(--tap); padding: var(--s1) 0;
  border-top: 1px solid var(--line); }
.pd-rows li:first-child { border-top: 0; }
.pd-rows__note { margin-left: auto; font-size: 12.5px; }
.pd-mode { display: inline-flex; align-items: center; gap: var(--s1); font-size: 12.5px; font-weight: 600; }
.pd-mode svg, svg.pd-mode { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; }
.pd-more { font-size: 12.5px; color: var(--ink-muted); padding-top: var(--s2); }
.pd-mode--sea { color: var(--sea); }
.pd-mode--air { color: var(--air); }
.pd-card .btn { align-self: flex-start; margin-top: auto; }

.pd-tenants { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); }
.pd-tenant { padding: var(--s5); display: flex; flex-direction: column; gap: var(--s3); }
.pd-tenant--off { opacity: .85; border-style: dashed; }
.pd-tenant__head { display: flex; align-items: center; gap: var(--s4); }
.pd-tenant__mark, .pd-tenant__logo { display: grid; place-items: center; width: 52px; height: 52px; flex: none;
  border-radius: var(--radius); background: var(--brand); color: var(--brand-ink); font-weight: 700; font-size: 17px; object-fit: contain; }
.pd-tenant__logo { background: var(--surface); border: 1px solid var(--line); padding: var(--s1); }
.pd-tenant__id { display: flex; flex-direction: column; gap: var(--s1); min-width: 0; }
.pd-tenant__name { margin: 0; font-size: 18px; }
.pd-tenant__stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3) var(--s5); margin: 0; }
.pd-tenant__stats div { display: flex; flex-direction: column; }
.pd-tenant__stats dt { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-muted); }
.pd-tenant__stats dd { margin: 0; font-size: 26px; font-weight: 700; line-height: 1.15; color: var(--ink-strong); font-variant-numeric: tabular-nums; }
.pd-tenant__stats dd.pd-tenant__split { display: flex; gap: var(--s3); font-size: 12.5px; font-weight: 600; }
.pd-tenant__seen { margin: 0; font-size: 12.5px; }
.pd-problems { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s2); }
.pd-tenant__links { margin: auto 0 0; display: flex; flex-wrap: wrap; gap: var(--s2); }

.pd-note { margin: 0 0 var(--s3); }
.pd-cov { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); align-items: start; }
.pd-cov .cs-lines__list li { flex-wrap: wrap; }
.pd-feed { list-style: none; margin: 0; padding: 0; display: grid; }
.pd-feed li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); min-height: var(--tap); padding: var(--s2) 0;
  border-top: 1px solid var(--line); }
.pd-feed li:first-child { border-top: 0; }
.pd-feed__icon { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: var(--radius-pill);
  background: var(--surface-sunken); color: var(--ink-muted); }
.pd-feed__icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; }
.pd-feed__kind { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-muted); min-width: 96px; }
.pd-feed__text { flex: 1 1 320px; min-width: 0; }
.pd-feed__when { font-size: 12.5px; margin-left: auto; }
.pd-shortcuts .co-tile { min-height: 120px; }
.pd-shortcuts .co-tile__meta { grid-area: meta; font-size: 12.5px; }

/* Phase 44: the bar a V2T admin sees on a tenant-side page, naming the tenant. Tokens only. */
.scopebar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); min-height: var(--tap);
  padding: var(--s2) var(--s4); margin-bottom: var(--s4); border: 1px solid var(--brand-line);
  border-radius: var(--radius); background: var(--brand-wash); color: var(--ink-strong); font-size: 13.5px; }
.scopebar .nav__icon { width: 20px; height: 20px; flex: none; color: var(--brand-deep); }
.scopebar__back { margin-left: auto; font-weight: 700; }

/* ==========================================================================
   Phase 44: the Tenants list and the tenant hub. Tokens only. Every state is an icon AND a word; the
   status colours are the measured status inks, so nothing here needs a new contrast measurement.
   ========================================================================== */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.tn-summary { margin-bottom: var(--s5); }
.tn-tile--bad { border-left-color: var(--status-exception); }
.tn-toolbar .panel__body { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s4); }
.tn-search { display: flex; gap: var(--s2); flex: 1 1 260px; min-width: 0; }
.tn-search input[type="search"] { flex: 1 1 auto; min-height: var(--tap); min-width: 0; }
.tn-chips, .tn-toggle { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.tn-chip { display: inline-flex; align-items: center; gap: var(--s2); min-height: var(--tap); padding: 0 var(--s4);
  border: 1px solid var(--line-strong); border-radius: var(--radius-pill); background: var(--surface);
  color: var(--ink-strong); font-size: 13px; font-weight: 600; text-decoration: none; }
.tn-chip svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; }
.tn-chip:hover { background: var(--surface-sunken); text-decoration: none; }
.tn-chip.is-on { background: var(--brand-wash); border-color: var(--brand-line); color: var(--brand-darker); }
.tn-chip__n { color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.tn-chip__add { margin-left: auto; }
.tn-create { margin-bottom: var(--s5); }
.tn-create__summary { display: flex; align-items: center; gap: var(--s3); min-height: var(--tap-lg, var(--tap)); padding: 0 var(--s5);
  cursor: pointer; font-weight: 700; color: var(--ink-strong); list-style: none; }
.tn-create__summary::-webkit-details-marker { display: none; }
.tn-create__summary svg { width: 24px; height: 24px; fill: none; stroke: var(--brand-deep); }
.tn-create__form { max-width: 560px; }
.tn-grid { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); }
.tn-card { padding: var(--s5); display: flex; flex-direction: column; gap: var(--s3); border-left: 6px solid var(--line-strong); }
.tn-card--needs_attention { border-left-color: var(--status-exception); }
.tn-card--not_set_up { border-left-color: var(--status-delay); }
.tn-card--active { border-left-color: var(--status-complete); }
.tn-card--suspended { border-left-color: var(--status-unknown); border-style: dashed; border-left-style: solid; opacity: .92; }
.tn-card__head, .hub-head__id { display: flex; align-items: center; gap: var(--s4); }
.tn-card__head { flex-wrap: wrap; }
.tn-card__mark, .tn-card__logo, .hub-head__mark, .hub-head__logo { display: grid; place-items: center; width: 56px; height: 56px; flex: none;
  border-radius: var(--radius); background: var(--brand); color: var(--brand-ink); font-weight: 700; font-size: 18px; object-fit: contain; }
.tn-card__logo, .hub-head__logo { background: var(--surface); border: 1px solid var(--line); padding: var(--s1); }
.tn-card__id { flex: 1 1 140px; min-width: 0; display: flex; flex-direction: column; }
.tn-card__name { margin: 0; font-size: 18px; }
.tn-card__slug { font-size: 12px; }
.tn-status { display: inline-flex; align-items: center; gap: var(--s1); padding: var(--s1) var(--s3); border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong); font-size: 12.5px; font-weight: 700; width: fit-content; }
.tn-status svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; }
.tn-status--needs_attention { background: var(--status-exception-wash); color: var(--status-exception); border-color: var(--status-exception); }
.tn-status--not_set_up { background: var(--status-delay-wash); color: var(--status-delay); border-color: var(--status-delay); }
.tn-status--active { background: var(--status-complete-wash); color: var(--status-complete); border-color: var(--status-complete); }
.tn-status--suspended { background: none; color: var(--status-unknown); border-style: dashed; border-color: var(--status-unknown); }
.tn-card__stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s3); margin: 0; }
.tn-card__stats div { display: flex; flex-direction: column; }
.tn-card__stats dt { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-muted); }
.tn-card__stats dd { margin: 0; font-size: 24px; font-weight: 700; line-height: 1.15; color: var(--ink-strong); font-variant-numeric: tabular-nums; }
.tn-card__stats dd.tn-card__split { display: flex; gap: var(--s2); font-size: 12px; font-weight: 600; }
.tn-ready { display: flex; flex-direction: column; gap: var(--s1); }
.tn-bar { width: 100%; height: 10px; accent-color: var(--brand-deep); }
.tn-ready__text { font-size: 12.5px; color: var(--ink-muted); display: flex; flex-wrap: wrap; gap: var(--s3); align-items: baseline; }
.tn-ready__text strong { color: var(--ink-strong); }
.tn-card__seen { margin: 0; font-size: 12.5px; }
.tn-card__links { margin: auto 0 0; display: flex; flex-wrap: wrap; gap: var(--s2); }
.tn-tablewrap { overflow-x: auto; }
.tn-table td, .tn-table th { vertical-align: middle; }

.hub-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s5); padding: var(--s5); margin-bottom: var(--s4); }
.hub-head__mark, .hub-head__logo { width: 72px; height: 72px; font-size: 22px; }
.hub-head__name { margin: 0; font-size: 26px; color: var(--ink-strong); }
.hub-head__meta { margin: var(--s1) 0 0; font-size: 13px; }
.hub-head__state { display: flex; flex-direction: column; gap: var(--s2); min-width: 220px; align-items: flex-start; }
.hub-nav { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: var(--s2); padding: var(--s2);
  margin-bottom: var(--s4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.hub-nav__item { display: inline-flex; align-items: center; gap: var(--s2); min-height: var(--tap); padding: 0 var(--s4);
  border-radius: var(--radius-pill); color: var(--ink-strong); font-size: 13px; font-weight: 600; text-decoration: none; }
.hub-nav__item svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--brand-deep); }
.hub-nav__item:hover { background: var(--surface-sunken); text-decoration: none; }
.hub-section { margin-bottom: var(--s5); scroll-margin-top: calc(var(--tap) + var(--s6)); }
.hub-section--danger { border-left: 6px solid var(--status-exception); }
.hub-icon { width: 24px; height: 24px; margin-right: var(--s2); vertical-align: -6px; fill: none; stroke: var(--brand-deep); }
.hub-h3 { margin: var(--s5) 0 var(--s3); font-size: 14px; color: var(--ink-strong); }
.hub-h3:first-child { margin-top: 0; }
.hub-two { display: grid; gap: var(--s6); grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); margin-top: var(--s5); }
.hub-tiles { margin-bottom: var(--s2); }
.hub-list { list-style: none; margin: 0; padding: 0; display: grid; }
.hub-list__row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); min-height: var(--tap); padding: var(--s1) 0; border-top: 1px solid var(--line); }
.hub-list__row:first-child { border-top: 0; }
.hub-list__go { margin-left: auto; font-weight: 700; }
.hub-forms { display: grid; gap: var(--s6); }
.hub-form { max-width: 640px; }
.hub-form .field input[type="text"], .hub-form .field input[type="email"], .hub-form .field textarea { width: 100%; }
.hub-bulk { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); margin: var(--s3) 0 var(--s4); }
.hub-inline { display: inline-flex; align-items: center; gap: var(--s2); margin: 0; }
.hub-links { margin-bottom: var(--s3); }
.hub-link { min-height: 96px; }
.hub-bullets { margin: 0 0 var(--s4); padding-left: var(--s5); display: grid; gap: var(--s2); }
.hub-confirm { display: flex; align-items: center; gap: var(--s3); min-height: var(--tap); margin: var(--s3) 0; font-weight: 600; }
.hub-confirm input { width: 20px; height: 20px; flex: none; }
.co-h2__all { margin-left: auto; font-size: 13px; font-weight: 700; }
.hub-mode { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); margin: var(--s3) 0 0; font-size: 13px; color: var(--ink-muted); }
.tn-chip__add svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; }
.tn-chip__add { display: inline-flex; align-items: center; gap: var(--s2); }
.tn-summary { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.tn-chip__add, .tn-card__links .btn, .hub-bulk .btn, .hub-inline .btn, .tn-search .btn { min-height: var(--tap); }

/* --- Phase 45: Scheduler page. Tokens only. --- */
.sch-facts { align-items: stretch; }
.sch-time { font-size: var(--t-lg); }
.sch-sub { display: block; margin-top: var(--s2); }
.sch-estimate { padding: var(--s3) var(--s4); border-left: 6px solid var(--status-progress); background: var(--status-progress-wash); }
.sch-counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: var(--s3); margin: var(--s4) 0; }
.sch-counts > div { padding: var(--s3); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.sch-counts dt { color: var(--ink-muted); font-size: var(--t-sm); }
.sch-counts dd { margin: 0; font-size: var(--t-lg); font-weight: var(--w-bold); font-variant-numeric: tabular-nums; }
.sch-facts { margin-top: var(--s5); }
.sch-reason { overflow-wrap: anywhere; max-width: 60ch; }

/* --- Phase 46: ASB job sheet import. Tokens only. --- */
.js-tiles { margin-bottom: var(--s4); }
.js-inline { display: inline-block; margin: var(--s2) var(--s2) 0 0; }
.js-actions { display: flex; gap: var(--s3); align-items: center; flex-wrap: wrap; }
.js-chips { margin: var(--s5) 0 var(--s3); }
.js-rows { table-layout: auto; }
.js-rows td { vertical-align: top; }
/* An issue is a sentence, not a badge: it wraps inside its cell instead of widening the table. */
.js-rows .pd-pill { display: flex; align-items: flex-start; width: fit-content; max-width: 100%;
  margin: 0 0 var(--s1) 0; white-space: normal; border-radius: var(--radius); text-align: left; }
.js-rows .pd-pill svg { margin-top: 2px; }
.js-tablewrap { overflow-x: auto; }
.js-issues-row td { padding-top: 0; border-top: 0; }
.js-diff { margin: var(--s2) 0 0; padding-left: var(--s4); font-size: var(--t-sm); }
.js-pager { margin-top: var(--s4); display: flex; gap: var(--s4); }

/* Phase 48b. Job fields on every shipment list: the Job date column and its type and direction marks. Tokens only.
   Import and export are an arrow and a word, never colour alone. */
.cell-jobdate { width: calc(var(--s9) * 2); white-space: normal; }
.cell-jobdate .job-date { white-space: nowrap; }
.job-date { font-weight: var(--w-bold); color: var(--ink-strong); font-variant-numeric: tabular-nums; }
.job-mark { display: inline-flex; align-items: center; gap: var(--s1); margin: var(--s1) var(--s2) 0 0;
  padding: 0 var(--s2); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--n-100); color: var(--ink-body); font-size: var(--t-2xs); font-weight: var(--w-bold);
  letter-spacing: .02em; white-space: nowrap; }
.job-mark__icon { width: var(--icon); height: var(--icon); flex: none; }
.job-warn { display: flex; align-items: center; gap: var(--s1); color: var(--status-delay);
  font-size: var(--t-2xs); font-weight: var(--w-bold); white-space: nowrap; }
.job-warn svg { width: var(--icon); height: var(--icon); flex: none; }
.job-sub { display: block; font-size: var(--t-2xs); line-height: 1.3; max-width: calc(var(--s9) * 3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-sub__item + .job-sub__item::before { content: " \00b7 "; }
.filters__field--set { border: 0; padding: 0; margin: 0; min-width: 0; display: flex; flex-flow: row wrap;
  align-items: center; gap: 0 var(--s3); }
.filters__field--set legend { font-size: var(--t-2xs); font-weight: var(--w-bold); text-transform: uppercase;
  letter-spacing: .04em; color: var(--ink-muted); padding: 0; flex-basis: 100%; float: none; }
.filters__check { display: inline-flex; align-items: center; gap: var(--s1); min-height: var(--tap);
  margin-right: var(--s3); font-size: var(--t-sm); color: var(--ink-body); }
.filters__quick { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); flex-basis: 100%; }
.job-card { margin-top: var(--s4); }
.job-card dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(calc(var(--s9) * 3), 1fr)); gap: var(--s3) var(--s5); margin: 0; }
.job-card dt { font-size: var(--t-2xs); text-transform: uppercase; letter-spacing: .04em; color: var(--ink-muted); font-weight: var(--w-bold); }
.job-card dd { margin: 0; color: var(--ink-body); overflow-wrap: anywhere; }
.job-strip { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); margin: var(--s3) 0; }
.job-strip .job-date { font-size: var(--t-md); }

/* Phase 52: the customer's own reference, edited in place. Quiet until focused, never a bare box. */
.custref { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin: 0; }
.custref__label { display: contents; }
.custref__input { min-width: 10rem; flex: 1 1 10rem; min-height: var(--tap); padding: 0 var(--s3); border: 1px solid transparent;
  border-bottom-color: var(--line-strong); background: transparent; color: var(--ink); font: inherit; border-radius: var(--radius); }
.custref__input::placeholder { color: var(--ink-muted); font-style: italic; }
.custref__input:hover, .custref__input:focus { border-color: var(--line-strong); background: var(--surface); }
.custref__save { min-height: var(--tap); }
.custref__error { flex-basis: 100%; color: var(--status-exception); font-size: var(--t-sm); }
.cell-custref { min-width: 17rem; }
.cell-custref .custref { flex-wrap: nowrap; }
.cell-custref .custref__input { min-width: 0; }

/* Phase 53: the My customers page and the Customer PDF dialog. Tokens only. */
.custlist__tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s4); margin-bottom: var(--s4); }
.custsearch { position: relative; flex: 1 1 260px; max-width: 420px; display: block; }
.custsearch__icon { position: absolute; left: var(--s3); top: 50%; transform: translateY(-50%); width: var(--icon); height: var(--icon); color: var(--ink-muted); pointer-events: none; }
.custsearch__input { width: 100%; min-height: var(--tap); padding: 0 var(--s3) 0 calc(var(--s3) + var(--icon) + var(--s2)); }
.custlist { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s3); }
.custrow { position: relative; display: grid; grid-template-columns: minmax(12rem, 1.4fr) 3fr auto; align-items: center; gap: var(--s5);
  padding: var(--s4) var(--s5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); transition: border-color .12s, box-shadow .12s; }
.custrow:hover, .custrow:focus-within { border-color: var(--brand-deep); box-shadow: var(--shadow); }
.custrow[hidden] { display: none; }
.custrow__name { display: inline-flex; align-items: center; gap: var(--s2); font-size: var(--t-lg); font-weight: var(--w-semi); color: var(--brand-deep); text-decoration: none; }
.custrow__name::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius-lg); }   /* the whole row is the link */
.custrow__name:hover { text-decoration: underline; }
.custrow__chevron { width: var(--icon); height: var(--icon); flex: none; }
.custrow__figs { display: flex; flex-wrap: wrap; gap: var(--s3) var(--s7); margin: 0; }
.custrow__figs dt { font-size: var(--t-xs); text-transform: uppercase; letter-spacing: .04em; color: var(--ink-muted); }
.custrow__figs dd { margin: 0; font-size: var(--t-md); color: var(--ink); }
.custrow__actions { position: relative; z-index: 1; }   /* above the stretched link so the button stays its own target */
.custrow__actions .btn { min-height: var(--tap); }
.custlist__none { margin-top: var(--s4); }
.custempty { display: grid; justify-items: center; text-align: center; gap: var(--s3); padding: var(--s8) var(--s5); }
.custempty__icon { width: var(--s8); height: var(--s8); color: var(--ink-muted); }
@media (max-width: 760px) { .custrow { grid-template-columns: 1fr; gap: var(--s3); } }
.dialog--wide { max-width: 640px; }
.pdfpick__bar { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.pdfpick__bar .btn { min-height: var(--tap); }
.pdfpick__count { font-weight: var(--w-medium); color: var(--ink); }
.pdfpick__list { list-style: none; margin: 0; padding: 0; max-height: 50vh; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.pdfpick__list li + li { border-top: 1px solid var(--line); }
.pdfpick__list li > div { display: flex; align-items: flex-start; gap: var(--s3); padding: var(--s3) var(--s4); min-height: var(--tap); }

.pdfpick__list input { margin-top: var(--s1); flex: none; }
.pdfpick__main { display: grid; gap: var(--s1); min-width: 0; }
.pdfpick__ref { color: var(--brand-deep); font-weight: var(--w-medium); }

/* Phase 56: the customer service pairing choice on the account page. */
.pairing { border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s3) var(--s4); display: grid; gap: var(--s2); }
.pairing legend { font-weight: var(--w-medium); padding: 0 var(--s2); }
.pairing__option { display: flex; align-items: center; gap: var(--s2); min-height: var(--tap); }

/* Phase 56: the Allocation page. */
.alloc__bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); margin-bottom: var(--s4); }
.alloc__pick { display: flex; align-items: center; gap: var(--s2); font-weight: var(--w-medium); }
.alloc__bar select, .alloc__bar input[type=text], .alloc__bar input[type=email] { min-height: var(--tap); }
.alloc__log { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }

/* Phase 58: Pending page. */
.chip--new { background: var(--brand); color: var(--brand-ink); font-size: var(--t-xs); font-weight: var(--w-medium); padding: 0 var(--s2); border-radius: var(--radius); }
.inline-form { display: inline-flex; gap: var(--s2); margin: 0; }

/* Phase 58: the handover stage chip a customer reads. Text always carries it; colour is the status inks, never alone. */
.stage-chip { display: inline-flex; align-items: center; padding: 1px var(--s2); border-radius: var(--radius); font-size: var(--t-sm); font-weight: var(--w-medium); border: 1px solid transparent; }
.stage-chip--pending { color: var(--status-delay); background: var(--status-delay-wash); border-color: var(--status-delay); }
.stage-chip--documents_ready { color: var(--status-complete); background: var(--status-complete-wash); border-color: var(--status-complete); }
.stage-line { margin: var(--s2) 0; }

/* Phase 58: the Map pop-up. The map is as wide as the dialog and never taller than the screen. */
.dialog--map { max-width: min(860px, calc(100% - var(--s6))); padding: var(--s4); }
.mappop { display: grid; gap: var(--s3); }
.mappop__head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.mappop__title { margin: 0; font-size: var(--t-lg); }
.mappop__note { margin: 0; font-size: var(--t-sm); }
.mappop__canvas { height: min(60vh, 460px); }
.mappop__nolocation { padding: var(--s5); border: 1px dashed var(--line-strong); border-radius: var(--radius); }

/* Phase 59: carrier logos on a chip. A dark logo sits on a light chip and a white one on a dark chip, in both themes. */
.carrier-logo { display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; height: 24px;
  padding: 2px var(--s2); margin-right: var(--s2); border-radius: var(--radius); border: 1px solid var(--line); background: var(--logo-chip); }
.carrier-logo--light { background: var(--brand-ink); border-color: var(--brand-ink); }
.carrier-logo img { display: block; max-height: 18px; max-width: 72px; width: auto; height: auto; }

/* Phase 59: the selection switch. A real checkbox (role=switch) over a track and thumb; the label is the 44px hit area. */
.switch { position: relative; display: inline-flex; align-items: center; justify-content: center; min-width: var(--tap); min-height: var(--tap); cursor: pointer; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.switch__track { position: relative; width: 40px; height: 24px; border-radius: 999px; background: var(--n-300, var(--line-strong)); border: 1px solid var(--line-strong);
  transition: background-color .18s ease, border-color .18s ease; }
.switch__track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--surface);
  box-shadow: var(--shadow-sm); transition: transform .18s ease; }
.switch input:checked + .switch__track { background: var(--brand-deep); border-color: var(--brand-deep); }
.switch input:checked + .switch__track::after { transform: translateX(16px); }
.switch input:indeterminate + .switch__track { background: var(--brand); border-color: var(--brand-deep); }
.switch input:indeterminate + .switch__track::after { transform: translateX(8px); }
.switch input:focus-visible + .switch__track { outline: 3px solid var(--brand-deep); outline-offset: 2px; }
.switch input:disabled + .switch__track { opacity: .5; }
@media (prefers-reduced-motion: reduce) { .switch__track, .switch__track::after { transition: none; } }
[data-select-item].is-selected { background: var(--surface-sunken); }
.selbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); margin: 0 0 var(--s3); padding: var(--s2) var(--s3); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.selbar__count { font-weight: var(--w-medium); min-width: 8rem; }
.selbar .btn { min-height: var(--tap); }


/* ==========================================================================
   Phase 60: layout, from the UI audit (docs/UI_AUDIT_FINDINGS.md)
   ========================================================================== */
/* Wide screens. Lists, tables and dashboards fill the width up to a very large cap and then CENTRE, so nothing stays
   stuck to the left with a blank block on the right (it capped at 1440 px, left-aligned, before). Text-heavy pages
   (forms, settings, profile) cap at a readable width and centre. */
.content { max-width: 2200px; margin-inline: auto; }
.content--narrow { max-width: 1040px; }
.footer { max-width: 2200px; margin-inline: auto; width: 100%; }
@media (min-width: 1800px) { .content { padding-inline: var(--s8); } }
.panel--form { max-width: 720px; }
.content--narrow .panel--form { max-width: none; }

/* Tables never clip and never widen the page: a panel scrolls its own contents sideways. The staff lists also
   scroll in their own box, with a sticky header and a sticky first column. */
.panel > .panel__body, .panel > .table-scroll { overflow-x: auto; max-width: 100%; }
.panel > .panel__body > .table { min-width: 100%; }
.table-scroll { max-width: 100%; }
.table-scroll--sticky { max-height: calc(100vh - 200px); overflow: auto; }
.table-scroll--sticky .table thead th { position: sticky; top: 0; z-index: 3; background: var(--surface); box-shadow: 0 1px 0 var(--line); }
.table-scroll--sticky .table tbody td:first-child, .table-scroll--sticky .table thead th:first-child { position: sticky; left: 0; background: var(--surface); }
.table-scroll--sticky .table thead th:first-child { z-index: 4; }
.table-scroll--sticky .table tbody td:first-child { z-index: 2; }
.table td, .table th { overflow-wrap: anywhere; }
.table td.nowrap, .table th.nowrap, .table .mono { overflow-wrap: normal; }
.cell-clip { max-width: 22rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Headers wrap on small screens instead of running off the right edge. */
.page-head > div { min-width: 0; }
.page-head__actions { flex-wrap: wrap; max-width: 100%; }
.detail-head > * { min-width: 0; }
dl.summary > div { min-width: 0; overflow-wrap: anywhere; }

/* Tablet and phone. Touch targets are at least 32 px, the top bar keeps only what fits, the phone navigation can be scrolled
   along without clipping, and wide controls stack. */
@media (max-width: 1100px) {
  .themeswitch__btn { min-width: 36px; min-height: 36px; }
  .linkish, .topbar__user a { min-height: 32px; display: inline-flex; align-items: center; padding: 0 var(--s2); }
  .table a:not(.btn), .panel__body p a:not(.btn) { display: inline-block; padding-block: 8px; }
  .btn, .btn--sm, .chip__remove { min-height: 36px; }
  .nav__item { min-height: 36px; }
}
@media (max-width: 640px) {
  .topbar { gap: var(--s2); }
  .topbar__user > span:not(.avatar) { display: none; }
  .topbar__title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  .page-head__actions { margin-left: 0; width: 100%; }
  .page-head__actions .btn { flex: 1 1 auto; }
  .sidebar { padding-right: var(--s2); scroll-padding: var(--s3); }
  .tiles { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .tile { padding: var(--s4) var(--s4) var(--s4) var(--s5); }
  .dialog, .dialog--wide, .dialog--map { max-width: calc(100% - var(--s4)); width: calc(100% - var(--s4)); margin-inline: auto; }
  .mappop__canvas { height: min(55vh, 420px); }
  .fleet { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
  .stages { overflow-x: auto; }
}
/* A control that must be a block on narrow screens. */
@media (max-width: 760px) {
  .filters, .alloc__bar { gap: var(--s2); }
  .alloc__bar > * { flex: 1 1 100%; min-width: 0; }
}

/* Phase 60: the welcome note, the feedback button, the About line and the error pages. */
.welcome { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3) var(--s5); margin-bottom: var(--s5); padding: var(--s4) var(--s5);
  background: var(--brand-wash); border: 1px solid var(--brand-line); border-radius: var(--radius-lg); color: var(--ink-strong); }
.welcome__body { flex: 1 1 28rem; display: grid; gap: var(--s1); line-height: var(--lh-base); }
.welcome__form { margin: 0; }
.sidebar__feedback { width: 100%; justify-content: flex-start; margin-bottom: var(--s3); color: var(--nav-ink); border-color: var(--nav-line); background: transparent; }
.sidebar__feedback:hover { background: var(--nav-bg-hover); color: var(--nav-ink-strong); }
.footer .linkish { font-size: inherit; }
.errpage { min-height: 100vh; display: grid; place-items: center; padding: var(--s6); background: var(--bg); }
.errpage__card { max-width: 34rem; width: 100%; padding: var(--s7); text-align: center; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.errpage__code { font-size: var(--t-3xl); font-weight: var(--w-bold); color: var(--brand-deep); margin: 0; }
.errpage__title { margin: var(--s2) 0; }
.errpage__actions { display: flex; flex-wrap: wrap; gap: var(--s3); justify-content: center; margin-top: var(--s5); }
.alert--info { padding: var(--s3) var(--s4); border: 1px solid var(--brand-line); border-radius: var(--radius); background: var(--brand-wash); color: var(--ink-strong); }

/* Phase 60 (2): absolutely positioned helpers (the visually-hidden labels) inside a table must be contained by the panel or the
   scroll box that holds the table, or they widen the whole page. Direct panel children scroll sideways instead of clipping. */
.panel, .table-scroll { position: relative; }
.panel > div:not(.panel__head) { min-width: 0; max-width: 100%; overflow-x: auto; }
.strip, .strip__list { flex-wrap: wrap; }
.strip__item { max-width: 100%; flex-wrap: wrap; }
.strip__when { white-space: normal; }
.route-map, .route-map__legend { max-width: 100%; }

/* Phase 60 (3): a grid track must be allowed to shrink below its content, or one wide table widens the whole dashboard. */
.split { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.split > * { min-width: 0; }
@media (max-width: 1100px) { .split { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 1100px) {
  a.btn--link, a.queue__ref, a.mono, .custrow__name, .crumb a, .strip__item, .queue__item a { display: inline-flex; align-items: center; min-height: 32px; }
  input:not([type=checkbox]):not([type=radio]):not([type=hidden]), select { min-height: 36px; }
}
/* Phase 60 (4): on a phone or tablet the sidebar is a strip. Its foot (powered-by, version, feedback) was still showing and made the strip
   150 px tall; it is hidden there, and the footer carries Send feedback and the version instead. */
@media (max-width: 960px) { .shell > .sidebar .sidebar__foot { display: none; } }

/* Phase 61: the customer's Updates card and the email template pages. Tokens only. */
.updates { display: grid; gap: var(--s3); margin: var(--s3) 0; max-width: 34rem; justify-items: start; }
.updates__row { display: grid; grid-template-columns: auto 5.5rem 17rem; justify-content: start; gap: var(--s3); align-items: center; }
.updates__field { display: grid; gap: var(--s1); margin: 0; }
.updates__field input { width: 100%; min-height: var(--tap); padding: var(--s1) var(--s3); }
.updates .btn { width: auto; }
@media (max-width: 640px) { .updates__row { grid-template-columns: auto 1fr; } .updates__field { grid-column: 1 / -1; } }
.tabs-lite { display: flex; gap: var(--s2); margin: 0 0 var(--s4); }
.tabs-lite__tab { min-height: var(--tap); padding: 0 var(--s4); display: inline-flex; align-items: center; border-bottom: 3px solid transparent; color: var(--brand-deep); font-weight: 600; text-decoration: none; }
.tabs-lite__tab--active { border-bottom-color: var(--brand-deep); color: var(--ink-strong); }
.tabs-lite__tab--off { color: var(--ink-muted); cursor: not-allowed; font-weight: 400; }
.mailframe { width: 100%; min-height: 34rem; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); }

/* Phase 63: the shipments page. Filter bar, pills, chips, summary and the table. Tokens only. */
.listbar { display: grid; gap: var(--s3); margin: var(--s4) 0 var(--s3); }
.listbar__search { position: relative; width: 100%; max-width: 44rem; }
.listbar__search input { width: 100%; height: var(--tap); box-sizing: border-box; padding: 0 var(--s7) 0 var(--s7); border: 1px solid var(--line-strong);
  border-radius: var(--radius); background: var(--surface); color: var(--ink-body); outline: none; }
.listbar__search input:hover { border-color: var(--n-500); }
.listbar__search input:focus { border-color: var(--brand-deep); box-shadow: 0 0 0 3px var(--brand-line); }
.listbar__icon { position: absolute; left: var(--s3); top: 50%; width: 16px; height: 16px; margin-top: -8px; color: var(--ink-muted); pointer-events: none; }
.listbar__clear { position: absolute; right: var(--s1); top: 50%; transform: translateY(-50%); width: var(--tap); height: var(--tap); display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: none; color: var(--ink-muted); cursor: pointer; }
.listbar__clear[hidden] { display: none; }
.listbar__clear svg { width: 14px; height: 14px; }
.listbar__pills { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.listbar__switch { display: inline-flex; align-items: center; gap: var(--s2); min-height: var(--tap); color: var(--ink-body); }
.pill { position: relative; }
.pill > summary { list-style: none; }
.pill > summary::-webkit-details-marker { display: none; }
.pill__btn { display: inline-flex; align-items: center; gap: var(--s2); min-height: var(--tap); padding: 0 var(--s3); border: 1px solid var(--line-strong); border-radius: var(--radius-pill);
  background: var(--surface); color: var(--ink-body); cursor: pointer; white-space: nowrap; }
.pill__btn:hover { border-color: var(--n-500); }
.pill__btn:focus-visible { outline: 3px solid var(--brand-deep); outline-offset: 2px; }
.pill--on .pill__btn { border-color: var(--brand-deep); background: var(--brand-wash); }
.pill__label { color: var(--ink-muted); }
.pill__value { font-weight: var(--w-bold); max-width: 14rem; overflow: hidden; text-overflow: ellipsis; }
.pill__chev, .pill__icon { width: 14px; height: 14px; color: var(--ink-muted); }
.pill[open] > .pill__btn { border-color: var(--brand-deep); }
.pill__pop { position: absolute; z-index: 30; top: calc(100% + var(--s1)); left: 0; min-width: 15rem; max-width: 22rem; max-height: 20rem; overflow: auto;
  padding: var(--s2); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.pill__pop--right { left: auto; right: 0; }
.pill__pop--dates { display: grid; gap: var(--s2); min-width: 17rem; }
.pill__search { width: 100%; box-sizing: border-box; min-height: var(--tap); margin-bottom: var(--s2); }
.pill__list { list-style: none; margin: 0; padding: 0; }
.pill__opt { display: flex; align-items: center; gap: var(--s2); min-height: var(--tap); padding: 0 var(--s2); border-radius: var(--radius); cursor: pointer; }
.pill__opt:hover { background: var(--surface-sunken); }
.pill__opt--switch { justify-content: space-between; }
.pill__opt input[type=radio] { accent-color: var(--brand-deep); }
.pill__date { display: grid; gap: var(--s1); }
.pill__note { margin: var(--s2) var(--s2) 0; }
.listsummary { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); margin: 0 0 var(--s3); }
.listsummary__spacer { flex: 1 1 auto; }
.listsummary__count { color: var(--ink-body); }
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); list-style: none; margin: 0; padding: 0; }
.fchip { display: inline-flex; align-items: center; gap: var(--s1); min-height: 28px; padding: 0 var(--s2); border-radius: var(--radius-pill); background: var(--brand-wash);
  border: 1px solid var(--brand-line); color: var(--brand-darker); text-decoration: none; }
.fchip:hover { border-color: var(--brand-deep); }
.fchip__k { color: var(--ink-muted); }
.fchip svg { width: 10px; height: 10px; }
.is-loading { opacity: .55; transition: opacity .15s; }
@media (max-width: 640px) { .pill__pop { position: fixed; left: var(--s3); right: var(--s3); top: auto; bottom: var(--s3); max-width: none; } }

/* The table. Fixed heights and centring for every chip, ellipsis for long text, and pinned shipment columns. */
.shiplist { max-height: calc(100vh - 16rem); }
.shiplist__table { width: 100%; border-collapse: separate; border-spacing: 0; }
.shiplist__table th, .shiplist__table td { padding: var(--s2) var(--s3); vertical-align: middle; text-align: left; border-bottom: 1px solid var(--line); }
.shiplist__table th.num, .shiplist__table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.shiplist__table tbody tr:hover td { background: var(--surface-sunken); }
.shiplist .table tbody td:first-child, .shiplist .table thead th:first-child { position: static; left: auto; }
.shiplist .col-select { position: sticky; left: 0; z-index: 2; width: 3.25rem; min-width: 3.25rem; background: var(--surface); }
.shiplist .col-ref { position: sticky; left: 3.25rem; z-index: 2; min-width: 12rem; max-width: 16rem; background: var(--surface); box-shadow: 1px 0 0 var(--line); }
.shiplist thead th.col-select, .shiplist thead th.col-ref { z-index: 5; }
.shiplist tbody tr:hover td.col-select, .shiplist tbody tr:hover td.col-ref { background: var(--surface-sunken); }
.shiplist .cell-ellipsis { max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shiplist .col-status { min-width: 10rem; white-space: nowrap; }
.shiplist .col-map { width: 5.5rem; white-space: nowrap; }
.shiplist .cell-jobdate { min-width: 8.5rem; white-space: nowrap; }
.shiplist .status-badge, .shiplist .badge, .shiplist .job-mark { display: inline-flex; align-items: center; min-height: 24px; line-height: 1; white-space: nowrap; vertical-align: middle; }
.shiplist .job-mark { margin: 0 var(--s1) 0 0; }
.pagination--modern { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); justify-content: flex-end; margin: var(--s3) 0; }
.pagination__per { display: inline-flex; align-items: center; gap: var(--s2); color: var(--ink-muted); }
/* Phase 63 follow-up after looking at the page: an idle pill shows only its name (the chosen value appears once it is on), so the bar fits in about one row at 1366 wide; the shipment column wraps long House B/L numbers instead of running into the carrier. */
.pill:not(.pill--on) .pill__value { display: none; }
.pill[open]:not(.pill--on) .pill__value { display: none; }
.shiplist .col-ref { width: 16rem; overflow-wrap: anywhere; }
.shiplist .col-ref .mono, .shiplist .col-ref a { overflow-wrap: anywhere; }
.listbar { gap: var(--s2); margin-bottom: var(--s2); }
/* Phase 63: the filters live in one rounded box, and the list scrolls on to its end instead of paging. */
.listpanel { margin: var(--s3) 0 var(--s4); padding: var(--s4); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm); }
.listpanel .listbar { margin: 0 0 var(--s3); }
.listpanel .listsummary { margin: 0; padding-top: var(--s3); border-top: 1px solid var(--line); }
.listend { text-align: center; margin: var(--s3) 0; }
/* Phase 63 redesign: no inner scroll box. The page scrolls; every header cell (Job date included) is pinned the same way
   while it does. Only on narrow screens does the table get its own sideways scroll. */
.shiplist { max-height: none; overflow: visible; }
.shiplist .table thead th, .shiplist .table thead th:first-child { position: sticky; top: 0; z-index: 3; background: var(--surface); box-shadow: 0 1px 0 var(--line); }
.shiplist .table thead th.col-select, .shiplist .table thead th.col-ref { z-index: 5; }
.shiplist__table th, .shiplist__table td { padding: var(--s2) var(--s2); }
.shiplist .cell-ellipsis { max-width: 11rem; }
.shiplist .col-ref { width: 13rem; min-width: 10rem; }
.shiplist .nowrap, .shiplist .cell-route { white-space: normal; }
.shiplist .cell-jobdate { min-width: 7rem; }
@media (max-width: 1180px) { .shiplist { overflow-x: auto; } }
/* The panel around the list must not clip: its rounded clip is what stopped the header from pinning. Sideways overflow
   scrolls inside the table box only; overflow-y: clip keeps that box from becoming a vertical scroller of its own. */
.panel:has(> [data-select-group] .shiplist), .panel:has(.shiplist) { overflow: visible; }
.shiplist { overflow-x: auto; overflow-y: clip; }
@media (max-width: 1180px) { .shiplist { overflow-x: auto; overflow-y: clip; } }
/* Final shape of the list (Phase 63): no ancestor of the header may scroll or the header cannot pin to the screen, so on
   wide screens the table is laid out to FIT (fixed layout, percentage columns, wrapping and ellipsis) and nothing scrolls
   sideways; only below 1180px does the table get its own sideways scroll. */
.panel > div[data-select-group] { overflow: visible; max-width: none; }
.shiplist { overflow: visible; }
.shiplist__table { table-layout: fixed; width: 100%; }
.shiplist th.col-date { width: 9%; }
.shiplist th.col-select { width: 3.25rem; }
.shiplist th.col-ref { width: 14%; min-width: 0; }
.shiplist th[data-col="company"] { width: 8%; }
.shiplist th[data-col="carrier"] { width: 11%; }
.shiplist th[data-col="customer"] { width: 10%; }
.shiplist th[data-col="agent"] { width: 8%; }
.shiplist th[data-col="custref"] { width: 9%; }
.shiplist th[data-col="route"] { width: 16%; }
.shiplist th[data-col="arrival"] { width: 9%; }
.shiplist th.col-status { width: 11%; min-width: 0; }
.shiplist th[data-col="progress"] { width: 9%; }
.shiplist th[data-col="units"] { width: 6%; }
.shiplist th.col-map { width: 5.5rem; }
.shiplist .col-ref { min-width: 0; max-width: none; }
.shiplist .cell-ellipsis { max-width: none; }
.shiplist .col-status { min-width: 0; white-space: normal; }
.shiplist .cell-jobdate { min-width: 0; }
.shiplist td { overflow-wrap: anywhere; }
@media (max-width: 1180px) {
  .panel > div[data-select-group] { overflow-x: auto; }
  .shiplist { overflow-x: auto; }
  .shiplist__table { table-layout: auto; min-width: 70rem; }
}
/* Cells that held content wider than their column: stack the job chips, let the status chip wrap, trim the Map button. */
.shiplist .cell-jobdate .job-mark { display: flex; width: fit-content; margin: var(--s1) 0 0; }
.shiplist .status-badge { white-space: normal; text-align: left; height: auto; padding-top: var(--s1); padding-bottom: var(--s1); }
.shiplist th.col-map { width: 6.75rem; }
.shiplist .col-map .btn { padding-left: var(--s2); padding-right: var(--s2); }
.shiplist th[data-col="agent"] { width: 9%; }
/* Phase 63 fixes: nothing on this page may push the page sideways. Every cell clips to its own column (a long value wraps or
   gets an ellipsis first), the progress timeline shrinks to its column, the House B/L-less shipment cell stacks its badges,
   and the page itself never scrolls left-right. Only the narrow-screen table box may. */
html, body { overflow-x: clip; }
.content, .main { min-width: 0; overflow-x: clip; }
.shiplist td, .shiplist th { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.shiplist .col-ref a { display: block; }
.shiplist .col-ref .badge { display: inline-flex; margin: var(--s1) var(--s1) 0 0; }
.shiplist th[data-col="progress"] { width: 15%; }
.shiplist td[data-col="progress"] .stages { margin: 0; }
.shiplist td[data-col="progress"] .stages__track { gap: var(--s1); }
.shiplist td[data-col="progress"] .stages__step { min-width: 0; }
.shiplist td[data-col="progress"] .stages__label, .shiplist td[data-col="progress"] .stages__milestone { font-size: var(--t-2xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shiplist td[data-col="progress"] .stages__note { font-size: var(--t-2xs); margin-top: var(--s1); }
.shiplist td[data-col="arrival"], .shiplist td[data-col="carrier"], .shiplist td[data-col="route"] { overflow-wrap: anywhere; white-space: normal; }
.shiplist .status-badge, .shiplist .badge { max-width: 100%; }
@media (max-width: 1180px) { html, body { overflow-x: clip; } .shiplist td, .shiplist th { overflow: visible; } }
.shiplist th[data-col="progress"] { width: 18%; }
.shiplist td[data-col="progress"] .stages__label, .shiplist td[data-col="progress"] .stages__milestone { white-space: normal; overflow-wrap: anywhere; text-overflow: clip; line-height: 1.2; }
/* Phase 63, final: natural column widths. The table is as wide as its columns need and scrolls sideways INSIDE its own box
   when the screen is narrower; the page itself never scrolls sideways. Nothing is squeezed: every column keeps a readable
   minimum so text never overlaps. (A box that scrolls sideways cannot also pin the header to the screen; the shipment
   number and the select switch stay pinned on the left instead.) */
.shiplist { overflow-x: auto; overflow-y: hidden; }
.shiplist__table { table-layout: auto; width: max-content; min-width: 100%; }
.shiplist td, .shiplist th { overflow: visible; text-overflow: clip; min-width: 0; overflow-wrap: normal; }
.shiplist th, .shiplist td { width: auto; }
.shiplist th.col-date, .shiplist td.cell-jobdate { min-width: 8.5rem; }
.shiplist th.col-select, .shiplist td.col-select { width: 3.25rem; min-width: 3.25rem; }
.shiplist th.col-ref, .shiplist td.col-ref { width: auto; min-width: 14rem; max-width: 18rem; overflow-wrap: anywhere; }
.shiplist [data-col="company"] { min-width: 9rem; }
.shiplist [data-col="carrier"] { min-width: 12rem; }
.shiplist [data-col="customer"] { min-width: 11rem; max-width: 16rem; }
.shiplist [data-col="agent"] { min-width: 9rem; }
.shiplist [data-col="custref"] { min-width: 9rem; max-width: 14rem; }
.shiplist [data-col="route"] { min-width: 16rem; }
.shiplist [data-col="arrival"] { min-width: 9.5rem; }
.shiplist th.col-status, .shiplist td.col-status { min-width: 11rem; }
.shiplist [data-col="progress"] { min-width: 16rem; }
.shiplist [data-col="units"] { min-width: 6.5rem; }
.shiplist th.col-map, .shiplist td.col-map { width: auto; min-width: 7rem; }
.shiplist .cell-ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shiplist td[data-col="arrival"], .shiplist td[data-col="carrier"], .shiplist td[data-col="route"] { overflow-wrap: normal; }
.shiplist td[data-col="progress"] .stages__label, .shiplist td[data-col="progress"] .stages__milestone { white-space: nowrap; overflow: visible; }
@media (max-width: 1180px) { .shiplist { overflow-x: auto; } }
/* Phase 64: the small "Updated" chip beside a shipment number when an import changed it in the last 3 days. */
.badge--updated { background: var(--status-progress-wash); color: var(--status-progress); border: 1px solid var(--status-progress-line); }
/* Phase 65: the 14-day health strip. Icon-free but never colour alone: each day carries its word. */
.healthstrip { display: flex; gap: var(--s2); list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.healthstrip__day { display: grid; gap: var(--s1); justify-items: center; min-width: 3.25rem; padding: var(--s2); border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); }
.healthstrip__day em { font-style: normal; font-size: var(--t-2xs); color: var(--ink-muted); text-transform: uppercase; }
.healthstrip__day--green { background: var(--status-complete-wash); border-color: var(--status-complete-line); }
.healthstrip__day--amber { background: var(--status-delay-wash); border-color: var(--status-delay-line); }
.healthstrip__day--red { background: var(--status-exception-wash); border-color: var(--status-exception-line); }

/* Phase 68: the On / Off switch on every tenant (list row and card). Same switch control as elsewhere, with the word beside it. */
.tn-switchform { display: inline-flex; align-items: center; gap: var(--s2); margin: 0; }
.tn-switchform__word { font-weight: var(--w-bold); color: var(--ink-strong); min-width: var(--s6); }

/* Phase 70: the manual checks audit list under the shipment head. Tokens only. */
.track-today { margin: 0 0 var(--s4); font-size: 12.5px; color: var(--ink-muted); }
.track-today summary { cursor: pointer; min-height: var(--s6); }
.track-today ul { margin: var(--s2) 0; padding-left: var(--s5); }

/* Phase 70 Part B: shared responsive fixes from the multi-size sweep. Tokens only. */
.errcell { min-width: 16rem; max-width: 34rem; white-space: normal; overflow-wrap: anywhere; }
.tn-tablewrap, .js-tablewrap { max-width: 100%; }
@media (max-width: 1100px) {
  /* touch targets: at least 32 px on tablet and phone */
  .main input[type=checkbox]:not([role=switch]), .main input[type=radio] { width: var(--s7); height: var(--s7); }
  .main label:has(input[type=checkbox]:not([role=switch])), .main label:has(input[type=radio]) { min-height: var(--s7); display: inline-flex; align-items: center; gap: var(--s2); }
  .main summary { min-height: var(--s7); display: flex; align-items: center; }
  .page-head a, .panel__head a, .crumb a, .tn-tablewrap td > a, .page-head__actions a { min-height: var(--s7); display: inline-flex; align-items: center; }
  .main .tracknow .btn, .main .btn { min-height: var(--s7); }
}
.js-bulk .panel__body { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); }
@media (max-width: 1100px) {
  /* standalone links (a table cell's name link, a status pill link, an export button) are 32 px tall and wide; a link inside a sentence keeps its line */
  .main td > a, .main th > a, .main .pd-pill, .main a.btn--link, .main .hub-bullets a, .main :is(h1, h2, h3, h4) > a, .main .pd-fact__meta a, .main .pd-feed__text a, .main .hub-list__row a, .main :is(div, p) > a:only-child { min-height: var(--s7); min-width: var(--s7); display: inline-flex; align-items: center; }
  .nav__item { min-height: var(--s7); }
}
