/* Body Shop Dashboard shell + components.
 *
 * LOOK (Jeremy's ruling 2026-10-28 19:20 CT): the CC-DT_Inventory dashboard's styling plus
 * the recent CC-Fuel_Tracker updates.
 *   - Shell from DT_Inventory: viewport-pinned 216px ink rail, white logo plate with the
 *     app caption BESIDE the logo, dense glyph rows (5px / 18px line), identity foot
 *     (name + email), 52px white sticky title bar, a 38px context strip under it (SHOWING
 *     chip + the data stamp), DT's buttons, alerts, badges and centred sign-in card.
 *   - Page components from the Scorecard system DT_Inventory designed and Fuel Tracker
 *     ported (Fuel: scorecard.css, 2026-10-12/14): sc tokens and tones, compact KPI cards
 *     in ONE auto-fill grid (Fuel d01e2c8, Jeremy 2026-10-14), 14px/700 card heads,
 *     11px/700 uppercase section labels, title-case 11px/700 table headers, the state-word
 *     treatment (grey, weight 400), the group subtotal row.
 * MECHANICS follow dashboard-mobile-design.md where DT_Inventory departs from it: light
 * band at 900, hamburger at 840 expanding IN PLACE (DT uses an overlay drawer, which the
 * guide forbids; Fuel Tracker uses the guide's band), phone pass at 640. Desktop-first; the
 * three max-width blocks are at the END of the file. 840 here and nav.js's 841 move together.
 * Text clipping (dashboard-text-clipping.md): no right-aligned inputs; any clipped element
 * at weight 600+ carries padding-right: 0.12em; badges after text sit in a gapped flex row.
 * Brand tokens: /static/brand/*.css (byte-identical to DT_Inventory's brand/tokens).
 * BUMP ASSET_VERSION (bodyshop/web/templating.py) on every change to this file.
 */

*, *::before, *::after { box-sizing: border-box; }

:root {
  /* Arial first (DT decision 35 / dashboard-mobile-design.md §11): some dealer boxes
     carry a broken Helvetica that renders faux bold-oblique. */
  --font-sans: Arial, 'Helvetica Neue', Helvetica, sans-serif;
  --gutter: 24px;
  --topbar-h: 52px;
  --shadow-float: 0 2px 14px rgba(0, 0, 0, .14);

  /* Scorecard tokens (DT_Inventory static/pages/scorecard.css = Fuel app/static/scorecard.css) */
  --sc-ink: #1B1F1E; --sc-body: #222927; --sc-sec: #5A6461; --sc-label: #6B7370; --sc-foot: #98A09D;
  --sc-page: #F4F5F4; --sc-card: #FFFFFF; --sc-head: #F7F8F7; --sc-hover: #F6FAF9;
  --sc-fill: #EEF0EF;
  --sc-rule-card: #DDE1DF; --sc-rule-row: #E6E9E7; --sc-rule-ctl: #C9CFCC;
  --sc-teal: #17A38C; --sc-link: #0E7C6B; --sc-link-hover: #128A76;
  --sc-red: #B42318; --sc-red-fill: #FBE3E0; --sc-red-border: #F1B8B1;
  --sc-amber: #B54708; --sc-amber-fill: #FDEBCB;
  --sc-green: #027A48; --sc-green-fill: #DCF3E6;
  --sc-notice: #8A6D1F; --sc-notice-fill: #FBF3D9; --sc-notice-border: #E8D89A;
}

html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--sc-page); color: var(--sc-body); font-family: var(--font-sans); font-size: 13px; line-height: 1.5; }
a { color: var(--sc-link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }
h1, h2, h3, p { margin: 0; }
.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;
}
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--sc-label); }
:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* ================================================================ shell (DT_Inventory) */
.shell { display: flex; min-height: 100vh; }

/* Viewport-pinned rail: the rail sticks, the content scrolls, and .nav is the one band
   that scrolls internally, so the logo plate and the identity foot never leave the
   screen on a long page. 100dvh second so it wins where supported. */
.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w); background: var(--mg-ink); color: var(--mg-ink-text);
  display: flex; flex-direction: column; position: sticky; top: 0; z-index: 10;
  height: 100vh; height: 100dvh;
}
.brand-row { display: flex; align-items: center; flex: none; background: #fff; border-bottom: 3px solid var(--mg-teal); }
.logo-plate { display: flex; align-items: center; gap: 10px; flex: 1 1 auto; min-width: 0; padding: 12px 16px; text-decoration: none; }
.logo-plate:hover { text-decoration: none; }
.logo-plate img { display: block; height: 26px; width: auto; }
.app-name { font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: var(--mg-text-2); font-weight: 600; white-space: nowrap; }
.hamburger { display: none; }

.nav-panel { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.nav { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 10px 0; }
/* The rail reads as scrollable on a Mac (DT 2026-10-20): light-on-dark native bars, a thin
   always-visible thumb. Firefox gets the standard properties inside @supports, because
   Chrome 121+ ignores ::-webkit-scrollbar on any element that sets them. */
.sidebar, .nav { color-scheme: dark; }
.nav::-webkit-scrollbar { width: 8px; }
.nav::-webkit-scrollbar-track { background: var(--mg-ink); }
.nav::-webkit-scrollbar-thumb { background: var(--mg-ink-muted); border: 2px solid var(--mg-ink); border-radius: 4px; min-height: 32px; }
@supports (-moz-appearance: none) { .nav { scrollbar-width: thin; scrollbar-color: var(--mg-ink-muted) var(--mg-ink); } }
.nav-group { display: flex; flex-direction: column; }
.nav-group + .nav-group { margin-top: 4px; }
.nav-label { padding: 8px 16px 3px; font-size: 10px; line-height: 15px; letter-spacing: 1px; text-transform: uppercase; color: var(--mg-ink-label); }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 5px 16px 5px 13px; border-left: 3px solid transparent;
  color: var(--mg-ink-text); font-size: 13px; line-height: 18px; text-decoration: none;
  transition: var(--transition-hover);
}
.nav a:hover { background: var(--mg-ink-hover); color: var(--mg-ink-text-strong); text-decoration: none; }
.nav a.active { background: var(--mg-ink-hover); border-left-color: var(--mg-teal); color: #fff; }
.nav a:focus-visible { outline: 2px solid var(--mg-teal); outline-offset: -2px; box-shadow: none; }
.glyph { width: 16px; flex: none; text-align: center; color: var(--mg-ink-muted); }
.nav a.active .glyph { color: var(--mg-teal); }

/* Rail foot (switcher-canonical §2): ONE row, the nine dots hard against the rail's left
   edge, then identity (name + email only). min-width: 0 + flex: 1 let the ellipsis engage. */
.sidebar-foot {
  flex: none; margin-top: auto; display: flex; align-items: center; gap: 8px;
  padding: 12px 10px 12px 8px; border-top: 1px solid var(--mg-ink-divider);
  font-family: Helvetica, Arial, sans-serif; font-size: 13px; line-height: 1.5; color: var(--mg-ink-text);
}
.sidebar-foot-id { min-width: 0; flex: 1; }
.sidebar-user { font-weight: 600; color: var(--mg-ink-text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 0.12em; }
.sidebar-email { margin-top: 2px; font-size: 12px; color: var(--mg-ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

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

/* Consistent header height on every route (canonical §7). */
.topbar {
  display: flex; align-items: center; gap: 12px; min-height: var(--topbar-h); padding: 0 var(--gutter);
  background: #fff; border-bottom: 1px solid var(--mg-border); position: sticky; top: 0; z-index: 5;
}
.topbar h1 {
  flex: 1 1 auto; min-width: 0; font-size: 17px; font-weight: 600; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 0.12em;
}
.h1-sub { margin-left: 6px; font-size: 12px; font-weight: 400; letter-spacing: 1px; color: var(--sc-label); }

/* ==========================================================================
   App switcher -- nine dots (_switcher.html, static/switcher.js).

   Transcribed from docs/handoffs/switcher-canonical.md (v4), the SINGLE SOURCE OF TRUTH
   for this component; body ported verbatim from CC-DT_Inventory's app.css (this app's
   LOOK reference), whose --mg-* tokens are byte-identical to ours (brand/colors.css):
   every value is the canonical literal or a token with the IDENTICAL value (teal #17A38C,
   teal-deep #0E7C6B, teal-tint #E2F3EF, teal-tint-border #B9E0D7, ink-hover #2E3836,
   ink-text #B9C2BF, ink-text-strong #E8ECEA, row-hover #F6FAF9, text #222927,
   text-2 #5A6461, text-muted #6B7370, border #DDE1DF, card #FFFFFF, the amber trio,
   radius 4px, radius-md 6px, --shadow-float 0 2px 14px rgba(0,0,0,.14)).

   base.html mounts the partial TWICE: .switcher--foot in the dark rail foot and
   .switcher--band in the sticky logo band, immediately left of the hamburger (as on
   fuel.martingp.com; Jeremy 2026-10-29: the title bar scrolls away on a phone). Exactly
   one is visible at any width; the swap is in the 900px block (where the rail foot
   leaves the edge).
   ========================================================================== */

/* The trigger and its panel share ONE position:relative wrapper -- that wrapper
   is the panel's positioning context, so the panel is never clipped by .nav's
   scroller or any other overflow box (canonical §3; a clipped panel shipped live
   on Fleet 2026-08-23 and rendered tiles with the page bleeding through). */
.switcher { position: relative; display: inline-flex; }

/* --- §1 the dots trigger. The <summary> IS the button, so the marker is
   suppressed and the box is the canonical 6px pad, not a 36px tap square. */
.switcher-btn {
  display: inline-flex;
  padding: 6px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: none;
  cursor: pointer;
  list-style: none;
  transition: background-color 80ms linear, color 80ms linear, border-color 80ms linear;
}
.switcher-btn::-webkit-details-marker { display: none; }
/* Nine spans on a 3x3 grid painted with currentColor, so one color change on the
   button recolors all nine dots at once. */
.switcher-glyph { display: grid; grid-template-columns: repeat(3, 3px); gap: 3px; }
.switcher-dot { width: 3px; height: 3px; border-radius: 999px; background: currentColor; }

/* §0 focus ring: :focus-visible ONLY, so a mouse press never draws it. Shared by
   the trigger, the pill and the tile links. */
.switcher-btn:focus-visible,
.switcher-pill:focus-visible,
.switcher-back:focus-visible,
.switcher-app:focus-visible {
  outline: 2px solid var(--mg-teal);
  outline-offset: 1px;
  border-radius: 3px;
  box-shadow: none;
}

/* Trigger colors are per SURFACE (§1): rest is that surface's own nav-text
   color -- never brand teal at rest, never a filled rest button -- and hover and
   open share ONE treatment. */
.switcher--foot > .switcher-btn { color: var(--mg-ink-text); }
.switcher--foot > .switcher-btn:hover,
.switcher--foot[open] > .switcher-btn,
.switcher--foot.is-open > .switcher-btn { background: var(--mg-ink-hover); color: var(--mg-ink-text-strong); }
.switcher--band > .switcher-btn { color: var(--mg-text-muted); }
.switcher--band > .switcher-btn:hover,
.switcher--band[open] > .switcher-btn,
.switcher--band.is-open > .switcher-btn { background: var(--mg-row-hover); color: var(--mg-text); }

/* --- §3 the panel. One opaque box. No max-height/overflow: it must not scroll
   or clip. */
.switcher-panel {
  color-scheme: light;  /* the rail is color-scheme: dark; this panel is white */
  position: absolute;
  width: 268px;
  padding: 10px;
  background: var(--mg-card);
  color: var(--mg-text);
  border: 1px solid var(--mg-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-float);
  z-index: 40;
  font-family: Helvetica, Arial, sans-serif;
}
/* Opens UPWARD, left-aligned: at the foot of a pinned rail there is no room
   below. */
.switcher--foot .switcher-panel { bottom: calc(100% + 6px); left: 0; }
/* Opens DOWNWARD, right-anchored: the band mount sits at the band's right end (beside
   the hamburger), so anchoring right is what keeps it on screen. */
.switcher--band .switcher-panel { top: calc(100% + 6px); right: 0; max-width: calc(100vw - 28px); }

/* --- §4 the head row: "Switch Sites" + the sign-out pill. ALWAYS rendered,
   even with an empty app list -- sign-out has to survive a registry failure. */
.switcher-head-row { display: flex; align-items: center; gap: 8px; padding: 0 6px 8px; }
.switcher-head-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--mg-text-muted);
  min-width: 0;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* §5b drilled view: the back button stands in for the label with the label's
   exact look, but HUGS its text (margin-right:auto keeps the pill hard right) so
   the hit area is the words, not the row. */
.switcher-back {
  min-width: 0;
  margin: 0 auto 0 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--mg-text-muted);
  font-family: inherit;
  font-size: 10px;
  line-height: 1.5;
  letter-spacing: 1px;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.switcher-back:hover { color: var(--mg-text); }
/* The label, back buttons and member grids are all server-rendered; JS swaps
   them with the `hidden` attribute, which the display rules here (and the
   <380px `.switcher--band .switcher-grid` rule) would otherwise out-rank. */
.switcher .switcher-panel [hidden] { display: none; }
.switcher-signout { margin: 0; flex: none; }
/* The estate's ONE sign-out affordance at every width: the submit button of this
   app's existing POST /auth/logout form. */
.switcher-pill {
  flex: none;
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border: 1px solid var(--mg-teal);
  border-radius: 999px;
  background: var(--mg-teal);
  color: #FFFFFF;
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  line-height: 1.5;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  min-height: 0;
  transition: background-color 80ms linear, color 80ms linear, border-color 80ms linear;
}
.switcher-pill:hover { background: var(--mg-teal-deep); border-color: var(--mg-teal-deep); color: #FFFFFF; }

/* --- §5 the tile grid. */
.switcher-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.switcher-app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 4px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 11px;
  text-align: center;
  transition: background-color 80ms linear, color 80ms linear, border-color 80ms linear;
}
/* Long app names WRAP inside the tile rather than ellipsizing. */
.switcher-name { line-height: 1.2; }
a.switcher-app { color: var(--mg-text-2); text-decoration: none; }
/* The hover trio -- background, border, text -- plus the icon recolor. The global
   a:hover underline is cancelled: a tile is a box, not body copy. */
a.switcher-app:hover { background: var(--mg-row-hover); border-color: var(--mg-teal-tint-border); color: var(--mg-text); text-decoration: none; }
a.switcher-app:hover .switcher-icon { color: var(--mg-teal-deep); }
/* Current app: the same box as its neighbors, tinted and INERT (it renders as a
   div -- nothing to click, nothing to tab to). No hover change. */
.switcher-app.is-current {
  background: var(--mg-teal-tint);
  border-color: var(--mg-teal-tint-border);
  color: var(--mg-teal-deep);
  font-weight: 600;
  cursor: default;
}
.switcher-app.is-current .switcher-icon { color: var(--mg-teal-deep); }
/* §5b group tile: the §5 box as a <button>. The reset keeps the browser's
   button chrome (grey fill, line-height normal, shrink-to-fit, system font) off
   the tile -- and keeps .switcher-app's 11px: never the `font: inherit`
   shorthand here, which would out-specify it. */
button.switcher-app {
  width: 100%;
  margin: 0;
  background: none;
  color: var(--mg-text-2);
  font-family: inherit;
  font-weight: inherit;
  line-height: 1.5;
  cursor: pointer;
}
/* A group holding THIS app: the current tile's tint, but still a live button. */
.switcher-group.has-current {
  background: var(--mg-teal-tint);
  border-color: var(--mg-teal-tint-border);
  color: var(--mg-teal-deep);
  font-weight: 600;
}
.switcher-group.has-current .switcher-icon { color: var(--mg-teal-deep); }
/* Hover is the §5 link-tile trio + icon recolor, and it OVERRIDES the tint:
   button.switcher-group:hover (0,2,1) out-ranks .switcher-group.has-current. */
button.switcher-group:hover { background: var(--mg-row-hover); border-color: var(--mg-teal-tint-border); color: var(--mg-text); }
button.switcher-group:hover .switcher-icon { color: var(--mg-teal-deep); }
/* The trailing "›" drill-in cue; inherits the tile color. */
.switcher-cue { margin-left: 2px; }
/* The icon slot is the ONLY place registry markup is injected; currentColor on
   the artwork is what lets the tile states recolor it. */
.switcher-icon { width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; color: var(--mg-text-muted); }
.switcher-icon svg { width: 24px; height: 24px; display: block; }
/* No-icon fallback: the app name's first character in the same slot. */
.switcher-letter { font-size: 13px; font-weight: 700; }
/* A maintenance row STAYS a clickable link and gains this badge. */
.switcher-maint {
  display: inline-block;
  margin-top: 2px;
  padding: 2px 6px;
  border: 1px solid var(--mg-amber-border);
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--mg-amber-text);
  background: var(--mg-amber-tint);
}
/* Desktop-first: the band mount is the NARROW-width one, so it is off by default
   and the 900px block swaps the pair. */
.switcher--band { display: none; }


/* Context strip (DT §2.2): the SHOWING chip left, the data stamp right. */
.ctx-strip {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px 16px; min-height: 38px; padding: 5px var(--gutter);
  background: #fff; border-bottom: 1px solid var(--mg-border);
}
.scope-chip {
  display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; padding: 2px 8px;
  font-size: 12px; background: var(--mg-strip); border: 1px solid var(--mg-border); border-radius: var(--radius);
}
.scope-chip-label { font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--sc-label); font-weight: 600; }
.scope-chip-value { color: var(--sc-body); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 0.12em; }
.scope-chip.is-all .scope-chip-value { color: var(--sc-sec); font-weight: 400; }
.scope-chip-clear {
  display: inline-flex; align-items: center; gap: 4px; margin-left: 4px; padding: 1px 8px;
  font-size: 11px; font-weight: 700; color: var(--sc-link); background: #fff; border: 1px solid var(--sc-rule-ctl);
  border-radius: 3px; white-space: nowrap;
}
.scope-chip-clear::before { content: "\D7"; font-size: 13px; line-height: 1; }
.scope-chip-clear:hover { color: var(--sc-link-hover); border-color: var(--sc-teal); background: var(--sc-hover); text-decoration: none; }
.ctx-stamp { margin-left: auto; min-width: 0; }
.as-of { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 8px; font-size: 12px; color: var(--sc-label); }
.as-of b { color: var(--sc-body); font-weight: 700; }
.as-of--none { color: var(--mg-amber-text); }

.content { flex: 1 1 auto; min-width: 0; padding: 20px var(--gutter) 40px; display: flex; flex-direction: column; gap: 14px; }

/* ================================================================ controls (DT) */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 8px 14px;
  border-radius: var(--radius); border: 1px solid var(--mg-border-control); background: #fff; color: var(--sc-body);
  font: inherit; font-size: 13px; font-weight: 600; text-decoration: none; cursor: pointer; transition: var(--transition-hover);
}
.btn:hover { background: var(--mg-strip); color: var(--sc-body); text-decoration: none; }
.btn-primary { background: var(--mg-teal); border-color: var(--mg-teal); color: #fff; }
.btn-primary:hover { background: var(--mg-teal-hover); border-color: var(--mg-teal-hover); color: #fff; }
.btn-block { display: flex; width: 100%; }
form { margin: 0; }

.alert { padding: 8px 12px; border-radius: var(--radius); border: 1px solid; font-size: 13px; }
.alert-error { background: var(--mg-red-tint); border-color: var(--mg-red-border); color: var(--mg-red); }
.alert-ok { background: var(--mg-green-tint); border-color: var(--mg-green-border); color: var(--mg-green); }

/* Badges: DT .mg-badge, 10px/700 uppercase, .5px tracking, 3px radius. */
.badge, .build-pill {
  display: inline-flex; align-items: center; padding: 1px 5px; border: 1px solid transparent; border-radius: 3px;
  font-size: 10px; font-weight: 700; letter-spacing: .5px; line-height: 1.5; text-transform: uppercase; white-space: nowrap;
}
.badge--actual, .build-pill--ok { color: var(--mg-green); background: var(--mg-green-tint); border-color: var(--mg-green-border); }
.badge--estimated, .build-pill--partial { color: var(--mg-amber-text); background: var(--mg-amber-tint); border-color: var(--mg-amber-border); }
.badge--mixed { color: #4A5350; background: #ECEEED; border-color: #C9CFCC; }

/* Partial-build notice (the Scorecard shell notice). */
.build-note { background: var(--sc-notice-fill); border: 1px solid var(--sc-notice-border); border-radius: var(--radius); color: var(--sc-body); font-size: 12px; }
.build-note > summary { cursor: pointer; padding: 7px 12px; list-style: none; }
.build-note > summary::-webkit-details-marker { display: none; }
.build-note-head { font-weight: 700; color: var(--sc-notice); }
.build-note-more { color: var(--sc-link); text-decoration: underline; white-space: nowrap; }
.build-note[open] .build-note-more { display: none; }
.build-note ul { margin: 0; padding: 0 12px 10px 30px; }
.build-note li + li { margin-top: 2px; }

/* ================================================================ cards (Scorecard sc-card) */
.card { background: var(--sc-card); border: 1px solid var(--sc-rule-card); border-radius: 6px; min-width: 0; overflow: hidden; }
/* Card head (sc-rhead title / DT .card-head h2): 14px/700 ink, title case. */
.card-caption {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 10px; padding: 10px 18px 9px;
  border-bottom: 1px solid var(--sc-rule-card); font-size: 14px; font-weight: 700; line-height: 1.3; color: var(--sc-ink);
}
.card-caption .count {
  margin-left: auto; padding: 1px 7px; border-radius: 3px; background: var(--sc-fill); color: var(--sc-label);
  font-size: 11px; font-weight: 700; line-height: 1.5;
}
.caption-extra { margin-left: auto; font-size: 12px; font-weight: 400; color: var(--sc-sec); text-align: right; }
.card-empty { padding: 14px 18px; color: var(--sc-sec); }
.card-foot { padding: 8px 18px; font-size: 11px; color: var(--sc-label); border-top: 1px solid var(--sc-rule-row); }

/* Empty state (sc-empty). */
.empty-state { padding: 36px 18px; text-align: center; }
.empty-mark { font-size: 22px; line-height: 1; color: var(--sc-foot); margin-bottom: 8px; }
.empty-title { font-size: 15px; font-weight: 700; color: var(--sc-ink); }
.empty-text { margin: 4px auto 0; max-width: 52ch; font-size: 12px; color: var(--sc-sec); }

/* Shop list (overview before the first build): report-card rows. */
.shop-list { list-style: none; margin: 0; padding: 0; }
.shop-list li + li { border-top: 1px solid var(--sc-rule-row); }
.shop-list a {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 12px; min-height: 40px; padding: 9px 18px;
  color: var(--sc-body); text-decoration: none;
}
.shop-list a:hover { background: var(--sc-hover); text-decoration: none; }
.shop-name { font-weight: 600; color: var(--sc-link); }
.shop-meta { font-size: 12px; color: var(--sc-label); }

/* Section label above a group of cards (sc-section). */
.section-title { margin-top: 8px; font-size: 11px; font-weight: 700; line-height: 1.4; letter-spacing: 1px; text-transform: uppercase; color: var(--sc-label); }
.page-note { font-size: 12px; color: var(--sc-sec); }
.stack { display: flex; flex-direction: column; gap: 14px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: 14px; align-items: start; }
.grid-2 > * { min-width: 0; display: flex; flex-direction: column; gap: 14px; }

/* ================================================================ KPI cards
 * Fuel Tracker's compact Scorecard cards (d01e2c8, Jeremy 2026-10-14): ONE auto-fill grid,
 * as many columns as fit, no fixed height. Question 13/600 ink, figure 26/700 -.5px, context
 * lines 12px secondary. A status word replaces the figure: grey, weight 400 (sc-word). */
.tiles { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); }
.tile {
  display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 10px 14px;
  background: var(--sc-card); border: 1px solid var(--sc-rule-card); border-radius: 6px;
}
.tile-label { font-size: 13px; font-weight: 600; line-height: 1.3; color: var(--sc-ink); }
.tile-value-row { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin-top: 2px; }
.tile-value { font-size: 26px; font-weight: 700; letter-spacing: -.5px; line-height: 1.1; color: var(--sc-ink); font-variant-numeric: tabular-nums; }
.tile-value--status { font-size: 20px; font-weight: 400; letter-spacing: 0; color: var(--sc-label); }
.tile-delta, .tile-sub, .tile-line { font-size: 12px; line-height: 1.35; color: var(--sc-sec); }
.tile-delta, .tile-sub { margin-top: 2px; }
.delta-label { color: var(--sc-label); }
.tile-line.delta--bad { color: var(--sc-red); font-weight: 600; }
.tile-value.st--blocked, .tile-value.delta--bad { color: var(--sc-red); }
.tile-value.st--blocked { font-weight: 600; }
.zero, .tile-value.zero { color: #C7CCCA; }
.missing { color: var(--sc-foot); }
.delta--good { color: var(--sc-green); }
.delta--bad { color: var(--sc-red); }
.delta--even { color: #4A5350; }

/* KPI cards inside a card (shop page CCC blocks): Scorecard stat chips, filled, no border. */
.card--group .tiles--inset { padding: 12px 18px; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); }
.tiles--inset > .tile { background: var(--sc-head); border-color: transparent; border-radius: 4px; }
.tiles--inset .tile-value { font-size: 22px; letter-spacing: -.4px; }
.tiles--inset .tile-value--status { font-size: 16px; }
.card--group > .notes { margin-top: -6px; padding: 0 18px 10px; }

/* ================================================================ data tables
 * Real <table>s. Header row = Scorecard (title case, 11px/700 secondary; numeric headers
 * right over right-aligned numbers). Body = the house palette: header #F1F3F2 / base #FFF /
 * stripe #F7F8F8, three distinct values; backgrounds painted per cell (base set explicitly,
 * stripe on even body rows, hover) so the sticky identity column carries every row state
 * (mobile guide §7 Treatment 2). The group row is DT's r-group_total: head fill, bold, a
 * #C9CFCC rule above, no stripe. */
.table-wrap { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.data-table th, .data-table td {
  padding: 7px 12px; text-align: left; vertical-align: middle; white-space: nowrap;
  border-bottom: 1px solid var(--sc-rule-row); background: var(--sc-card);
}
.data-table thead th {
  padding-top: 8px; padding-bottom: 8px; background: var(--mg-table-head); border-bottom: 1px solid var(--sc-rule-card);
  font-size: 11px; font-weight: 700; line-height: 1.2; color: var(--sc-sec);
}
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table tbody th { font-weight: 600; color: var(--sc-ink); }
.data-table tbody tr:nth-child(even) > * { background: var(--mg-zebra); }
.data-table tbody tr:hover > * { background: var(--sc-hover); }
.data-table tfoot .row-total > * {
  background: var(--mg-table-head); font-weight: 700; color: var(--sc-ink);
  border-top: 1px solid var(--sc-rule-ctl); border-bottom: 0;
}
.data-table tbody tr:last-child > * { border-bottom: 0; }
.data-table a { color: var(--sc-link); text-decoration: none; }
.data-table a:hover { color: var(--sc-link-hover); text-decoration: underline; }
.data-table td.zero { color: #C7CCCA; }
.data-table td.delta--good { color: var(--sc-green); }
.data-table td.delta--bad { color: var(--sc-red); }
.data-table th.th--wrap { white-space: normal; min-width: 6.5em; max-width: 9em; }
.s-abbr { display: none; }
.data-table--sticky .ident { position: sticky; left: 0; z-index: 1; box-shadow: 1px 0 0 var(--sc-rule-card); }
.data-table--sticky thead .ident { z-index: 2; }

/* The block header row of a comparison table: an uppercase group label over its columns
   (sc-section type), on the card white, centred. */
.data-table--kpi thead .block-row th {
  background: var(--sc-card); text-align: center; font-size: 10px; letter-spacing: 1px; text-transform: uppercase;
  color: var(--sc-label); border-bottom: 1px solid var(--sc-rule-row);
}
.data-table--kpi thead .block-row th.ident {
  text-align: left; vertical-align: bottom; background: var(--mg-table-head); font-size: 11px; letter-spacing: 0;
  text-transform: none; color: var(--sc-sec); border-bottom-color: var(--sc-rule-card);
}
.data-table--kpi thead .block-row th.block--pending { font-weight: 400; }
.data-table--kpi .block-start { border-left: 1px solid var(--sc-rule-card); }
.data-table--kpi th, .data-table--kpi td { padding-left: 10px; padding-right: 10px; }
.row-mtd > th { color: var(--sc-ink); }

/* Status-aware cells (views.Cell): a status word replaces the number and is quieter than
   one (the Scorecard state word: grey, weight 400); blocked is the one red status word (an
   action: the AR tie-out failed). Red on a number only where the mart carries the target. */
.data-table td.kc { line-height: 1.25; }
.data-table td.st--pending, .data-table td.st--no_data, .data-table td.st--not_separable,
.data-table td.st--no_target { color: var(--sc-label); font-size: 12px; font-weight: 400; }
.data-table td.st--blocked { color: var(--sc-red); font-size: 12px; font-weight: 600; }
.kc-row { display: inline-flex; align-items: baseline; gap: 3px; }
.kc-sub { display: block; margin-top: 1px; font-size: 10px; color: var(--sc-amber); }
.flag {
  display: inline-flex; align-items: center; justify-content: center; width: 13px; height: 13px; flex: none;
  border-radius: 50%; background: var(--mg-amber-tint); border: 1px solid var(--mg-amber-border);
  color: var(--mg-amber-text); font-size: 9px; font-weight: 700; line-height: 1; vertical-align: 1px;
}
.st--pending, .card-empty.st--pending, .card-empty.st--no_data { color: var(--sc-label); }
.card-empty.st--blocked { color: var(--sc-red); }
.tie { font-size: 12px; font-weight: 600; }
.tie--good { color: var(--sc-green); }
.tie--bad { color: var(--sc-red); }

/* Per-store state lines under a list. */
.state-lines { list-style: none; margin: 0; padding: 10px 18px; display: grid; gap: 4px; color: var(--sc-sec); font-size: 12px; }
.state-lines li { overflow-wrap: anywhere; }
.state-lines b { color: var(--sc-body); font-weight: 700; }
.state-lines .st--blocked { color: var(--sc-red); }

/* Notes under a table (sc-foot). */
.notes { margin-top: -6px; padding: 6px 4px; font-size: 12px; color: var(--sc-sec); }
.notes-head { display: flex; align-items: center; gap: 6px; font-weight: 700; color: var(--sc-notice); }
.notes ul { margin: 4px 0 0; padding-left: 19px; }

/* Chart (inline SVG, viewBox only; CSS sizes it). */
.chart-wrap { padding: 12px 18px 4px; }
.chart { display: block; width: 100%; height: auto; max-width: 560px; margin: 0 auto; font-family: var(--font-sans); }
.chart-bar { fill: var(--sc-teal); }
.chart-bar--current { fill: var(--sc-link); }
.chart-bar--missing { fill: none; stroke: var(--sc-rule-ctl); stroke-dasharray: 3 3; }
.chart-axis { stroke: var(--sc-rule-ctl); stroke-width: 1; }
.chart-val { font-size: 10px; fill: var(--sc-sec); font-variant-numeric: tabular-nums; }
.chart-lab { font-size: 10px; fill: var(--sc-label); }
.chart-lab--current { fill: var(--sc-ink); font-weight: 700; }
.chart-facts { display: flex; flex-wrap: wrap; gap: 6px 24px; margin: 0; padding: 8px 18px 12px; font-size: 12px; }
.chart-facts div { display: flex; gap: 6px; align-items: baseline; }
.chart-facts dt { color: var(--sc-label); }
.chart-facts dd { margin: 0; font-weight: 700; color: var(--sc-ink); }

/* Shop filter (GET links, no JS): DT's filter strip holding pager-style buttons; the
   current shop is the teal-filled one. */
.chips {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 12px;
  background: var(--mg-strip); border: 1px solid var(--mg-border); border-radius: var(--radius);
}
.chips-label { margin-right: 4px; font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--sc-label); }
.chip {
  display: inline-flex; align-items: center; min-height: 30px; padding: 0 10px; border: 1px solid var(--sc-rule-ctl);
  border-radius: var(--radius); background: #fff; color: var(--sc-link); font-size: 12px; text-decoration: none; white-space: nowrap;
  transition: var(--transition-hover);
}
.chip:hover { background: var(--sc-hover); color: var(--sc-link-hover); border-color: var(--sc-teal); text-decoration: none; }
.chip--on, .chip--on:hover { background: var(--sc-teal); border-color: var(--sc-teal); color: #fff; font-weight: 700; }
.chip .s-abbr { display: none; }

/* ================================================================ anonymous pages
 * DT's centred card (login / error / not provisioned): logo + app caption over the page's
 * own content; the page's .auth-card flattens into it. */
.center-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { width: 100%; max-width: 420px; padding: 24px; background: #fff; border: 1px solid var(--mg-border); border-radius: var(--radius-md); }
.login-card .brand { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 18px; }
.login-card .brand img { display: block; height: 32px; width: auto; }
.login-card .brand .app { font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: var(--mg-text-2); font-weight: 600; }
.auth-card { display: flex; flex-direction: column; gap: 12px; }
.content .auth-card { max-width: 420px; width: 100%; margin: 24px auto; padding: 24px; border-radius: var(--radius-md); }
.login-card .auth-card { border: 0; border-radius: 0; padding: 0; overflow: visible; }
.auth-card h2 { font-size: 16px; font-weight: 600; color: var(--sc-ink); }
.auth-alt { text-align: center; font-size: 12px; }
.auth-foot { font-size: 12px; }
.auth-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

/* ================================================================ <= 900px
 * The dark rail leaves the edge: a light sticky top band, nav links as a wrapping row of
 * bordered chips (active = the 3px teal left edge). Every rail color flips here, hovers
 * included. The identity foot leaves (the user menu carries identity at every width). */
@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .sidebar {
    width: auto; flex: none; height: auto; position: sticky; top: 0; z-index: 30;
    background: #fff; color: var(--sc-body); border-bottom: 1px solid var(--mg-border);
  }
  .sidebar, .nav { color-scheme: light; }
  .logo-plate { padding: 10px 16px; }
  .nav { flex-direction: row; flex-wrap: wrap; gap: 6px; padding: 10px 16px; overflow: visible; }
  .nav-group { display: contents; }
  .nav-group + .nav-group { margin-top: 0; }
  .nav-label { display: none; }
  .nav a {
    padding: 5px 12px 5px 10px; border: 1px solid var(--mg-border); border-left: 3px solid var(--mg-border);
    border-radius: var(--radius); color: var(--sc-body); background: #fff; font-size: 12px;
  }
  .nav a:hover { background: var(--sc-hover); color: var(--sc-body); }
  .nav a.active { background: var(--mg-teal-tint); border-left-color: var(--mg-teal); color: var(--sc-ink); }
  .glyph { display: none; }
  /* The dots move into the sticky logo band (.switcher--band, a direct child of
     .brand-row: the logo plate's flex:1 pushes it to the right end, immediately left of
     the hamburger at <=840). The foot keeps the identity only, flipped dark-on-light, in
     the band at 841-900 and inside the open menu at <=840. */
  .switcher--foot { display: none; }
  .switcher--band { display: inline-flex; flex: none; margin-right: 12px; }
  /* 44px tap target WITHOUT changing the canonical 6px box (29px drawn): the ::after
     insets from the 27px PADDING box, so 8.5px a side = 44px; that reaches 7.5px past the
     border, clear of the hamburger 8px to its right. */
  .switcher--band > .switcher-btn { position: relative; }
  .switcher--band > .switcher-btn::after { content: ""; position: absolute; inset: -8.5px; }
  .sidebar-foot { padding: 6px 16px 8px; border-top: 1px solid var(--mg-border); color: var(--sc-sec); }
  .sidebar-user { color: var(--sc-body); }
  .sidebar-email { color: var(--sc-sec); }
  .topbar { position: static; padding: 0 16px; }
  .ctx-strip { padding: 5px 16px; }
  .content { padding: 16px 16px 32px; }
}

/* ================================================================ <= 840px
 * The nav collapses behind the hamburger (scoped under html.js-nav: with JS off the chip
 * row stays). nav.js un-collapses at matchMedia("(min-width: 841px)"): 840 and 841 move
 * together. The open menu expands IN PLACE (pushes content down): no overlay, no scrim. */
@media (max-width: 840px) {
  html.js-nav .hamburger {
    display: inline-flex; align-items: center; justify-content: center; flex: none;
    width: 44px; height: 40px; margin-right: 10px; padding: 0; border: 1px solid var(--mg-border-control);
    border-radius: var(--radius); background: #fff; cursor: pointer;
  }
  .hamburger-bar, .hamburger-bar::before, .hamburger-bar::after {
    display: block; width: 20px; height: 2px; background: var(--mg-ink); position: relative;
  }
  .hamburger-bar::before, .hamburger-bar::after { content: ""; position: absolute; left: 0; }
  .hamburger-bar::before { top: -6px; }
  .hamburger-bar::after { top: 6px; }
  .hamburger:focus-visible { outline: 2px solid var(--mg-teal); outline-offset: 1px; box-shadow: none; }
  /* 8px to the hamburger (its own 10px margin holds the right edge). */
  html.js-nav .switcher--band { margin-right: 8px; }
  html.js-nav .nav-panel { display: none; }
  /* Height budget: brand row ~55px; the open list scrolls inside what is left. */
  html.js-nav .sidebar.is-nav-open .nav-panel { display: flex; max-height: calc(100vh - 56px); overflow-y: auto; }
  /* The open list is the ONE scroller (.nav-panel above). The band itself must not clip:
     the switcher panel hangs from .brand-row and runs past a short open menu (switcher
     canonical §3: never inside an overflow box that clips it). */
  html.js-nav .sidebar.is-nav-open { max-height: 100vh; overflow: visible; }
  html.js-nav .sidebar.is-nav-open .nav { flex-direction: column; flex-wrap: nowrap; gap: 0; padding: 4px 0 8px; }
  html.js-nav .sidebar.is-nav-open .nav-label { display: block; padding: 10px 16px 4px; color: var(--sc-label); }
  html.js-nav .sidebar.is-nav-open .nav a {
    min-height: 44px; padding: 8px 16px 8px 13px; border: 0; border-left: 3px solid transparent;
    border-radius: 0; font-size: 14px; background: #fff;
  }
  html.js-nav .sidebar.is-nav-open .nav a:hover { background: var(--sc-hover); }
  html.js-nav .sidebar.is-nav-open .nav a.active { background: var(--mg-teal-tint); border-left-color: var(--mg-teal); }
  html.js-nav .sidebar.is-nav-open .glyph { display: inline-block; color: var(--sc-label); }
  html.js-nav .sidebar.is-nav-open .nav a.active .glyph { color: var(--mg-teal-deep); }
}

/* ================================================================ <= 640px
 * Phone content pass: title bar wraps instead of truncating, the context strip stacks,
 * KPI cards 2-up (multi-value cards a full row), 44px targets / 16px control fonts,
 * identity columns swap to short codes (dual-span). Dense table rows keep their height on
 * purpose (dashboard-mobile-design.md §6). */
@media (max-width: 640px) {
  :root { --gutter: 12px; }
  .logo-plate { padding: 8px 12px; gap: 8px; }
  .logo-plate img { height: 22px; }
  .app-name { font-size: 9px; letter-spacing: 1.5px; }
  .topbar { min-height: 48px; padding: 6px 12px; gap: 10px; }
  /* A heading is never truncated (DT A19): it wraps. */
  .topbar h1 { font-size: 15px; line-height: 1.25; white-space: normal; overflow: visible; text-overflow: clip; padding-right: 0; }
  .ctx-strip { flex-direction: column; align-items: flex-start; gap: 6px; padding: 6px 12px; }
  .ctx-stamp { margin-left: 0; }
  .scope-chip-label { font-size: 11px; }
  .scope-chip-clear { min-height: 32px; }
  .content { padding: 12px 12px 32px; gap: 12px; }
  /* 2-up as a wrapping flex row, not the grid: a lone single-value card between two
     full-row cards stretches to the row instead of leaving half of it empty, and the
     reading order is untouched (no dense packing). */
  .tiles { display: flex; flex-wrap: wrap; gap: 8px; }
  .tiles > .tile { flex: 1 1 calc(50% - 4px); }
  .tiles > .tile.tile--multi { flex-basis: 100%; }
  .tile { padding: 10px 12px; }
  .tile-label { font-size: 12px; }
  .tile-value { font-size: 22px; letter-spacing: -.4px; }
  .tile-value--status { font-size: 16px; }
  .card--group .tiles--inset { padding: 10px 12px; }
  .btn { min-height: 44px; font-size: 16px; }
  .data-table th, .data-table td { padding: 7px 10px; }
  .data-table .s-full { display: none; }
  .data-table .s-abbr { display: inline; }
  .card-caption { padding: 10px 12px 9px; }
  .caption-extra { margin-left: 0; text-align: left; flex-basis: 100%; }
  .card-empty, .state-lines { padding-left: 12px; padding-right: 12px; }
  .card-foot { padding: 8px 12px; }
  .chart-wrap { padding: 10px 12px 4px; }
  .chart-facts { padding: 8px 12px 12px; }
  .empty-state { padding: 24px 14px; }
  .center-page { padding: 12px; align-items: flex-start; }
  .login-card { padding: 18px; }
  .content .auth-card { margin: 8px auto; padding: 18px; }
  .shop-list a { min-height: 44px; padding: 9px 12px; }
  .chips { padding: 8px; }
  .chips-label { flex-basis: 100%; font-size: 11px; }
  .chip { min-height: 44px; padding: 0 14px; font-size: 14px; }
  .chip .s-full { display: none; }
  .chip .s-abbr { display: inline; }
  .badge, .build-pill { font-size: 11px; }
  .build-note > summary { padding: 10px 12px; }
}

/* ================================================================ Open Work + job details
 * (open_work.html, job.html, _open_work_macros.html). Additive: new classes only; the
 * tables, tiles, cards and chips are the shared ones above. Kept after the media blocks, so
 * this section carries its own 640 pass. */
.alert-warn { background: var(--mg-amber-tint); border-color: var(--mg-amber-border); color: var(--mg-amber-text); }
.badge--overdue { color: var(--sc-red); background: var(--sc-red-fill); border-color: var(--sc-red-border); }
.cell-sub { display: block; margin-top: 1px; font-size: 11px; color: var(--sc-label); }
.sort-link { color: inherit; }
.sort-link::after { content: " \2195"; color: var(--sc-foot); font-weight: 400; }
.sort-link.is-on { color: var(--sc-ink); }
.sort-link.is-on::after { content: " \25BC"; color: var(--sc-teal); }
/* Label/value grid (a definition list, not a table): wraps to as many columns as fit. */
.kv { margin: 0; padding: 12px 18px 14px; display: grid; gap: 10px 18px; grid-template-columns: repeat(auto-fill, minmax(min(170px, 100%), 1fr)); }
.kv-item { min-width: 0; }
.kv dt { font-size: 11px; font-weight: 700; color: var(--sc-label); }
.kv dd { margin: 1px 0 0; color: var(--sc-ink); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.kv dd.missing, .kv dd .missing { color: var(--sc-foot); }
.kv dd.zero { color: #C7CCCA; }
.job-head { padding: 12px 0 0; }
.job-title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; padding: 0 18px; }
.job-title { font-size: 18px; font-weight: 700; color: var(--sc-ink); }
.kv--head { grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); }
/* Job charts (bodyshop/web/job_charts.py). */
.chart--wide { max-width: 720px; }
.chart-grid { stroke: var(--sc-rule-row); stroke-width: 1; }
.chart-line { fill: none; stroke: var(--sc-teal); stroke-width: 2; }
.chart-line--alt { stroke: var(--sc-ink); stroke-dasharray: 4 3; }
.chart-dot { fill: var(--sc-teal); }
.chart-dot--alt { fill: var(--sc-ink); }
.chart-bar--target { fill: var(--sc-head); stroke: var(--sc-rule-ctl); stroke-width: 1; }
.chart-bar--open { fill: var(--sc-link); opacity: .55; }
.chart-key { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 0 18px 8px; font-size: 11px; color: var(--sc-sec); }
.key { display: inline-block; width: 14px; height: 8px; border-radius: 2px; }
.key + .key, .chart-key .key:not(:first-child) { margin-left: 8px; }
.key--target { background: var(--sc-head); border: 1px solid var(--sc-rule-ctl); }
.key--actual { background: var(--sc-teal); }
.key--open { background: var(--sc-link); opacity: .55; }
/* Parts (CCC Parts Dashboard lists, migration 0011). */
.ow-parts { min-width: 150px; }
.ow-parts-late { color: var(--sc-red); font-weight: 600; }
.ow-held { margin-top: 14px; }
.job-choose { font-size: 14px; }
/* Job photo thumbnails (served by /jobs/<id>/thumbs/<photo>); a grey box when not landed. */
.ow-ident { display: inline-flex; align-items: center; gap: 8px; }
.ow-thumb { display: inline-block; flex: none; width: 36px; height: 27px; border-radius: 3px; object-fit: cover; background: #ECEEED; border: 1px solid #C9CFCC; }
.ow-thumb--none { background: repeating-linear-gradient(135deg, #ECEEED 0 4px, #F5F6F6 4px 8px); }
.ow-strip { display: flex; gap: 8px; overflow-x: auto; padding: 12px 18px 4px; }
.ow-strip-item { margin: 0; flex: none; width: 120px; }
.ow-photo { display: block; width: 120px; height: 90px; border-radius: 4px; object-fit: cover; background: #ECEEED; border: 1px solid #C9CFCC; }
.ow-photo--none { background: repeating-linear-gradient(135deg, #ECEEED 0 6px, #F5F6F6 6px 12px); }
.ow-strip-item figcaption { font-size: 11px; color: var(--sc-label); margin-top: 2px; overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .kv { padding: 10px 12px 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
  .kv--head { grid-template-columns: minmax(0, 1fr); }
  .job-title-row { padding: 0 12px; }
  .chart-key { padding: 0 12px 8px; }
  .ow-thumb { width: 28px; height: 21px; }
  .ow-ident { gap: 6px; }
  .ow-strip { padding: 10px 12px 4px; }
  .ow-strip-item, .ow-photo { width: 96px; }
  .ow-photo { height: 72px; }
}

/* redteam: job */
/* Job page photo grid (red-team A9): a responsive grid of the first 12, the rest behind a
   <details> "Show all N photos" toggle; each thumbnail in a 16:9 box with object-fit: contain
   (CCC thumbnails are 16:9: never squashed or cropped); identifier photo first and badged. */
.ow-photos { padding: 12px 18px 4px; }
.ow-photo-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ow-photo-item { position: relative; margin: 0; min-width: 0; }
.ow-photo-link { display: block; border-radius: 4px; }
.ow-photo-link:hover .ow-photo { border-color: var(--sc-link); }
.ow-photo-link:focus-visible { outline: 2px solid var(--sc-teal); outline-offset: 2px; }
.ow-photos .ow-photo { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: contain; }
.ow-photo-item--id .ow-photo { border-color: var(--sc-teal); box-shadow: 0 0 0 1px var(--sc-teal); }
.ow-photo-badge { position: absolute; top: 4px; left: 4px; padding: 1px 6px; border-radius: 3px; background: var(--sc-teal); color: #fff; font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; line-height: 16px; pointer-events: none; }
.ow-photo-cap { display: block; margin-top: 2px; font-size: 11px; color: var(--sc-label); overflow-wrap: anywhere; }
.ow-photos-more { margin-top: 10px; }
.ow-photos-more > summary { display: inline-flex; align-items: center; min-height: 32px; padding: 4px 12px; border: 1px solid var(--sc-rule-ctl); border-radius: 4px; background: var(--sc-card); color: var(--sc-link); font-size: 13px; font-weight: 600; cursor: pointer; list-style: none; }
.ow-photos-more > summary::-webkit-details-marker { display: none; }
.ow-photos-more > summary:hover { border-color: var(--sc-link); }
.ow-photos-more > summary:focus-visible { outline: 2px solid var(--sc-teal); outline-offset: 2px; }
.ow-photos-more[open] > summary { margin-bottom: 10px; }
.ow-more-open, .ow-photos-more[open] .ow-more-closed { display: none; }
.ow-photos-more[open] .ow-more-open { display: inline; }
/* Photo lightbox (photos.js): a modal <dialog>, the same thumbnail file shown larger. */
.lightbox { border: 0; border-radius: 6px; padding: 0; max-width: calc(100vw - 24px); max-height: calc(100vh - 24px); background: var(--sc-card); color: var(--sc-body); box-shadow: 0 12px 40px rgba(0, 0, 0, .35); }
.lightbox::backdrop { background: rgba(20, 24, 23, .72); }
.lightbox-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px 8px 16px; border-bottom: 1px solid var(--sc-rule-card); }
.lightbox-cap { margin: 0; min-width: 0; font-size: 14px; font-weight: 600; color: var(--sc-ink); overflow-wrap: anywhere; }
.lightbox-stage { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; }
.lightbox-img { display: block; width: min(576px, calc(100vw - 150px)); height: auto; max-height: calc(100vh - 170px); object-fit: contain; background: var(--sc-fill); border-radius: 4px; }
.lightbox-btn { flex: none; min-width: 44px; min-height: 40px; padding: 0 12px; border: 1px solid var(--sc-rule-ctl); border-radius: 4px; background: var(--sc-card); color: var(--sc-ink); font: inherit; font-size: 14px; cursor: pointer; }
.lightbox-btn:hover { border-color: var(--sc-link); color: var(--sc-link); }
.lightbox-btn:focus-visible { outline: 2px solid var(--sc-teal); outline-offset: 2px; }
.lightbox-nav { font-size: 28px; line-height: 1; padding: 0 8px 4px; }
.lightbox-note { margin: 0; padding: 0 16px 12px; font-size: 12px; color: var(--sc-label); text-align: center; }
@media (max-width: 640px) {
  .ow-photos { padding: 10px 12px 4px; }
  .ow-photo-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
  .ow-photos-more > summary { min-height: 44px; font-size: 16px; }
  .lightbox-stage { flex-wrap: wrap; padding: 10px; }
  .lightbox-img { order: -1; flex: 1 0 100%; width: 100%; max-height: calc(100vh - 230px); }
  .lightbox-nav { min-width: 72px; min-height: 44px; }
  .lightbox-btn { min-height: 44px; font-size: 16px; }
}

/* redteam: lists */
/* Shop chips read as store names at every width (A10). The short code sits beside the name
   in the chip's own flex row with a gap (text-clipping rule 3) and drops out on phones.
   Nothing here clips text: no overflow hidden; a long name wraps inside its chip on a phone
   rather than widening the page. */
.chip { gap: 6px; }
.chip .chip-code { font-size: 10px; font-weight: 600; letter-spacing: .5px; color: var(--sc-label); }
.chip--on .chip-code, .chip--on:hover .chip-code { color: rgba(255, 255, 255, .85); }
@media (max-width: 640px) {
  .chip .chip-code { display: none; }
  .chip { white-space: normal; max-width: 100%; line-height: 1.25; padding-top: 4px; padding-bottom: 4px; }
}

/* redteam: pages ===============================================================
 * Hover / tap help (A8), per-source header stamp (A4), status legend (A17), shop section
 * nav (A15), muted value tags (A13, A16) and the tile source line (A14). Additive only. */
.tip { cursor: help; text-decoration: underline dotted var(--sc-foot); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.tip:focus { outline: none; }
.tip:focus-visible { outline: 2px solid var(--mg-teal); outline-offset: 1px; border-radius: 2px; }
.tip.flag, .tip.badge, .tip.build-pill { text-decoration: none; }
.tip.flag { cursor: pointer; }
.tip-body { display: none; }
/* The definition shows as a fixed toast at the bottom of the viewport: no card, table
   scroller or sticky column can clip it, and it never adds sideways scroll. */
.tip.is-open > .tip-body {
  display: block; position: fixed; left: 12px; right: 12px; bottom: 16px; z-index: 60;
  max-width: 460px; margin: 0 auto; padding: 9px 13px; border-radius: 6px;
  background: var(--mg-ink); color: #fff; box-shadow: var(--shadow-float);
  font-size: 13px; font-weight: 400; line-height: 1.45; letter-spacing: 0; text-align: left;
  text-transform: none; white-space: normal; overflow-wrap: anywhere; cursor: default;
}
.data-table th .tip { white-space: inherit; }

/* Per-source as-of stamp (A4). */
.as-of .src { white-space: nowrap; }
.as-of .src + .src::before { content: "\B7"; margin-right: 8px; color: var(--sc-foot); }
.as-of .src-name { color: var(--sc-label); }
.as-of .src--late b { color: var(--mg-amber-text); }

/* Muted words beside a value (CSI "from N", paint basis) and the tile source line. */
.kc-tag { display: block; margin-top: 1px; font-size: 10px; font-weight: 400; color: var(--sc-label); white-space: nowrap; }
.tile-foot { margin-top: 6px; font-size: 11px; line-height: 1.35; color: var(--sc-label); }

/* Status-word legend (A17): collapsed by default. */
.legend { font-size: 12px; color: var(--sc-sec); }
.legend > summary { cursor: pointer; display: inline-block; color: var(--sc-link); text-decoration: underline; }
.legend dl { margin: 8px 0 0; padding: 10px 14px; display: grid; gap: 4px 14px; grid-template-columns: max-content minmax(0, 1fr);
  background: var(--sc-card); border: 1px solid var(--sc-rule-card); border-radius: 6px; }
.legend dl > div { display: contents; }
.legend dt { font-weight: 700; color: var(--sc-body); }
.legend dd { margin: 0; min-width: 0; }

/* Shop page section nav (A15): sticky under the title bar on desktop. */
.section-nav {
  position: sticky; top: var(--topbar-h); z-index: 4; display: flex; flex-wrap: wrap; gap: 6px;
  margin: -6px calc(-1 * var(--gutter)) 0; padding: 8px var(--gutter);
  background: var(--sc-page); border-bottom: 1px solid var(--sc-rule-card);
}
.section-nav a {
  display: inline-flex; align-items: center; padding: 3px 10px; border: 1px solid var(--sc-rule-ctl, #C9CFCC);
  border-radius: 999px; background: #fff; font-size: 12px; color: var(--sc-body); white-space: nowrap;
}
.section-nav a:hover { border-color: var(--sc-teal); background: var(--sc-hover); text-decoration: none; }
/* T7 2026-10-29: the sticky nav wraps to 2 lines below ~1460px wide and to 3 near 900px
   (75px / 107px tall), so a 52px margin left the section title under it. 116px clears three
   lines; the <=900px block below (static nav) keeps its own value. */
.sec-anchor { scroll-margin-top: calc(var(--topbar-h) + 116px); }
span.sec-anchor { display: block; height: 0; }
@media (max-width: 900px) {
  /* The title bar is static here: the nav is a one-line horizontal scroller, not sticky. */
  .section-nav { position: static; flex-wrap: nowrap; overflow-x: auto; margin: 0; padding: 4px 0 6px;
    border-bottom: 0; background: transparent; scrollbar-width: thin; }
  .sec-anchor { scroll-margin-top: 72px; }
}
@media (max-width: 640px) {
  .section-nav a { min-height: 36px; padding: 0 12px; font-size: 13px; }
  .legend dl { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .legend dd { margin-bottom: 6px; }
  .as-of .src { white-space: normal; }
  .as-of { gap: 2px 12px; }
  .as-of .src + .src::before { content: none; }
}

/* ================================================================ T4 2026-10-29
 * Gross tile bridge (views.gross_bridge, rt-gross-lag): a closed disclosure under the tile's
 * lines; each step is label + figure on one row, a muted note under it. Wraps, never clips. */
.tile-bridge { margin-top: 6px; border-top: 1px solid var(--sc-rule-row); padding-top: 4px; font-size: 12px; }
.tile-bridge > summary { cursor: pointer; color: var(--sc-link); line-height: 1.6; min-height: 24px; }
.bridge-steps { margin: 4px 0 0; display: grid; gap: 4px; }
.bridge-step { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 8px; }
.bridge-step dt { margin: 0; color: var(--sc-body); overflow-wrap: anywhere; }
.bridge-step dd { margin: 0; }
.bridge-step dd.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--sc-ink); font-weight: 600; }
.bridge-step dd.num.st--pending, .bridge-step dd.num.st--no_data, .bridge-step dd.num.st--blocked { font-weight: 400; color: var(--sc-label); }
.bridge-note { grid-column: 1 / -1; color: var(--sc-label); font-size: 11px; line-height: 1.35; overflow-wrap: anywhere; }
.bridge-foot { margin: 6px 0 0; color: var(--sc-label); font-size: 11px; line-height: 1.35; }
@media (max-width: 640px) { .tile-bridge > summary { min-height: 32px; } }

/* Open Work: Incoming "RO open, no drop date" (2026-10-29): a closed disclosure under the dated
 * Incoming tables; opens to a note and one card per shop. */
.ow-nodate { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; min-width: 0; }
.ow-nodate > summary { cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-height: 32px; padding: 6px 12px;
  border: 1px solid var(--sc-rule-card); border-radius: 6px; background: var(--sc-card); color: var(--sc-body); font-size: 13px; list-style: none; }
.ow-nodate > summary::-webkit-details-marker { display: none; }
.ow-nodate > summary:hover { border-color: var(--sc-link); }
.ow-nodate > summary:focus-visible { outline: 2px solid var(--sc-teal); outline-offset: 2px; }
.ow-nodate-title { font-weight: 600; color: var(--sc-ink); overflow-wrap: anywhere; }
.ow-nodate-more { color: var(--sc-link); text-decoration: underline; white-space: nowrap; }
.ow-nodate[open] .ow-nodate-more { display: none; }
.ow-nodate > .page-note { margin: 0; }
@media (max-width: 640px) { .ow-nodate > summary { min-height: 44px; font-size: 14px; } }
/* Insurer wait (T5c): on phones a long insurer name wraps inside the pinned identity column
   instead of pushing every figure off-screen (dashboard-mobile-design.md section 7). */
@media (max-width: 640px) {
  .data-table th.ident--wrap-narrow { white-space: normal; min-width: 7em; max-width: 11em; overflow-wrap: anywhere; }
}
/* T7b: a header scrolled into view inside a sideways-scrolled table lands clear of the
   sticky Shop column, not under it. On phones the shop column shows the store abbreviation
   (s-abbr; DCDJR is the widest), about 65px wide at 390px; the padding clears it. Keyboard focus (which Chromium does not
   scroll for a partly visible header) is corrected by the focusin handler in base.html. */
@media (max-width: 640px) {
  .table-wrap:has(> .data-table--sticky .s-abbr) { scroll-padding-inline-start: 4.5rem; }
}

/* Switcher §3: under 380px the band panel narrows so it stays on screen (2 columns). */
@media (max-width: 379px) {
  .switcher--band .switcher-panel { width: 208px; }
  .switcher--band .switcher-grid { grid-template-columns: repeat(2, 1fr); }
}
/* Chrome never prints (switcher-canonical §6). */
@media print {
  .switcher, .no-print { display: none; }
}
