/* Tank Monitoring, SMP edition (design/v3/SPEC.md; the functional rules of design/v2/SPEC.md):
   five pages, each on one screen.

   Sections:
     1. THEME LAYER (SMP). The only part of this file with literal colours, fonts, font
        weights, radii and shadows. A Benzinum edition replaces this section and nothing else.
        The values and their measured contrast are in design/v3/SPEC.md 2.2-2.5.
     2. Structural tokens: type sizes, spacing, layout sizes, control heights, motion, focus.
     3. Base.
     4. The shell: top bar (brand, station block, page links on a laptop, refresh, sign out),
        bottom tabs (phone, tablet), the banner.
     5. The pages: Tanks (and the toolbar row), Sales, a tank's page, Deliveries, Alerts,
        Settings.
     6. The Tanks page's tile grid and pager; the tank tile and the tank card: one component.
     7. Level chart.  8. Settings.  9. Lists that page instead of scrolling.
     10. Station switcher.  11. Sales.

   How each page fits one screen: body is exactly 100dvh tall (100vh where dvh is unknown) and
   a grid of [top bar, banner, page, bottom tabs]. The page is a grid whose flexible rows are
   minmax(0, 1fr), so whatever can give way takes what is left and never pushes the screen
   longer: the chart draws its SVG at the size of its box, and the Deliveries and Alerts lists
   show the rows that fit with previous / next.
   Only the station list scrolls, inside itself; and a phone too short for a page's least
   height (its fixed parts and what the flexible ones keep at least, section 5) scrolls the
   page between the top bar and the tabs, rather than clip (also below 360 px wide, WCAG reflow).
   Nothing outside section 1 may set a colour, font, radius or shadow (transparent and
   currentColor excepted); hover styles only inside @media (hover: hover). */

/* =========================================================================================
   1. THEME LAYER (SMP)
   ========================================================================================= */

:root {
  color-scheme: light;
  /* the brand: the stripe under the top bar and the logo mark (SMP's two blades, no letters) */
  --brand-stripe: linear-gradient(90deg, #FA8C14 0%, #4CAD3C 100%);
  --brand-logo: url("/brand-mark.png");
  /* type: each device's own UI font, nothing downloaded */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", Roboto,
               "Helvetica Neue", Arial, "Liberation Sans", sans-serif;
  --fw-regular: 400; --fw-semibold: 600; --fw-wordmark: 700;
  /* radii and elevation */
  --radius-xs: 4px; --radius-sm: 6px; --radius-md: 8px; --radius-lg: 12px; --radius-pill: 999px;
  --radius-mark: 2px;
  --shadow-card: 0 0 0 1px rgba(0,0,0,.05), 0 1px 2px rgba(0,0,0,.05);
  --shadow-overlay: 0 0 0 1px rgba(0,0,0,.06), 0 8px 28px rgba(0,0,0,.16);
  /* rings and edges drawn as shadows (their colours are the tokens below):
     the segment thumb's outline, a tile's hover ring, the line over the bottom tabs, the cut-out
     around the count on a tab's icon, the second pixel of a refused date's red border */
  --shadow-thumb: inset 0 0 0 1px var(--border-control);
  --shadow-hover: 0 0 0 1px var(--border-strong), var(--shadow-card);
  --shadow-tabbar: 0 -1px 0 var(--chrome-line);
  --shadow-badge: 0 0 0 2px var(--chrome);
  --shadow-invalid: inset 0 0 0 1px var(--critical-solid);
  /* surfaces */
  --bg-page: #F4F4F4; --bg-surface: #FFFFFF; --bg-subtle: #F7F7F7; --bg-muted: #EFEFEF;
  --bg-raised: #FFFFFF; --seg-track: #E8E8E8; --bg-scrim: rgba(13,13,13,.56);
  --chrome: #1A1A1A; --chrome-hover: #2A2A2A; --chrome-line: #333333;
  --chrome-divider: rgba(255,255,255,.24);
  /* text */
  --text-strong: #222222; --text-secondary: #555555; --text-muted: #666666;
  --on-chrome: #FFFFFF; --on-chrome-2: #CFD3D8; --on-chrome-muted: #9AA0A8;
  --on-chrome-warning: #F2B705; --on-chrome-offline: #A7B8CB;
  /* lines */
  --border-subtle: #E6E6E6; --border-strong: #C4C4C4; --border-control: #767676;
  /* brand, rationed: the frame, the active page, focus, links */
  --primary: #FA8C14; --primary-ink: #A85400; --primary-subtle: #FFF3E6; --on-primary: #1A1A1A;
  --accent: #4CAD3C; --focus-ring: #C46200; --chrome-focus: #FA8C14;
  /* status: ink (text), solid (icon, edge), tint (background) */
  --ok: #2F7D27; --ok-solid: #2F7D27; --ok-bg: #EAF6E7;
  --warning: #8A5A00; --warning-solid: #B07800; --warning-bg: #FFF6D6;
  --critical: #C62828; --critical-solid: #C62828; --critical-bg: #FDECEC;
  --offline: #3E5266; --offline-solid: #5A6E83; --offline-bg: #E5EBF1;
  --critical-banner-bg: #C62828; --on-critical-banner: #FFFFFF;
  /* products: one colour per grade at every station (regular, premium, mid, diesel, E85, DEF) */
  --series-1: #2F6FD0; --series-2: #C3457F; --series-3: #4A3AA7;
  --series-4: #D87511; --series-5: #0A8F70; --series-6: #767676; --series-other: #767676;
  /* charts and the tank picture */
  --grid: #EBEBEB; --axis: #C4C4C4; --limit-line: #767676; --crosshair: #8A8A8A;
  --tank-shell: #8A8A8A; --fuel-fill: #3A3A3A; --fuel-fill-offline: #5A6E83;
  --band-opacity: .16;
}

/* Print: the top bar loses its charcoal (paper has no background), so its words go dark. */
@media print {
  :root { --chrome: transparent; --on-chrome: #222222; --on-chrome-2: #555555; --on-chrome-muted: #666666;
          --on-chrome-offline: #3E5266; }
}

/* =========================================================================================
   2. Structural tokens (the same for every brand)
   ========================================================================================= */

:root {
  /* six type sizes, the same on every device (SPEC 2.3) */
  --fs-micro: 12px;   --lh-micro: 16px;
  --fs-small: 13px;   --lh-small: 18px;
  --fs-body: 15px;    --lh-body: 22px;
  --fs-title: 18px;   --lh-title: 24px;
  --fs-hero: 28px;    --lh-hero: 32px;
  --fs-display: 40px; --lh-display: 44px;
  --track-caps: .06em; --track-title: -.01em; --track-display: -.02em;
  /* one spacing scale: no other values for padding, margin or gap */
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 20px; --space-6: 24px; --space-8: 32px;
  /* layout, phone first (SPEC 2.4) */
  --gutter: 16px;          /* page sides */
  --page-pad: 12px;        /* page top and bottom */
  --gap: 12px;             /* between cards */
  --card-pad: 16px;
  --topbar-h: 56px; --stripe-h: 3px; --tabbar-h: 56px;
  --banner-h: 36px;        /* one line; the Try again button makes it 44 on touch */
  --toolbar-h: 44px;       /* the first row of each page */
  --control-h: 44px;       /* every button, tab, segment, input, select and pager button */
  /* the least a page's flexible parts keep on a phone before the page scrolls (section 5): a
     tank tile on the Tanks page as tall as a phone's compact tile; a chart a plot that still
     reads (44 px of bars under its 22 px margins: the card about 200 px); a list its tallest
     page (paginate) */
  --tile-min: 212px;
  --plot-min: 88px;
  /* motion: only state changes move; data never animates */
  --dur-fast: 120ms; --dur-base: 200ms;
  --ease: cubic-bezier(.2, 0, 0, 1); --ease-exit: cubic-bezier(.3, 0, 1, 1);
  /* focus */
  --focus-width: 2px; --focus-offset: 2px;
  --z-topbar: 30; --z-dropdown: 40; --z-skip: 100;
}
@media (min-width: 768px) {
  :root { --gutter: 20px; --page-pad: 20px; --gap: 16px; --topbar-h: 64px; }
}
@media (min-width: 1024px) {
  :root { --gutter: 24px; --page-pad: 24px; --gap: 20px; --card-pad: 20px;
          --toolbar-h: 40px; --control-h: 36px; }
}
/* a touch laptop or an iPad in landscape: 44 px controls, and a row they fit in */
@media (min-width: 1024px) and (pointer: coarse) {
  :root { --toolbar-h: 44px; --control-h: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  :root { --dur-fast: .01ms; --dur-base: .01ms; }
}

/* =========================================================================================
   3. Base
   ========================================================================================= */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; height: 100%; }
body {
  margin: 0; background: var(--bg-page); color: var(--text-strong);
  font-family: var(--font-sans); font-size: var(--fs-body); line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
h1, h2, h3 { color: var(--text-strong); font-weight: var(--fw-semibold); font-size: inherit; line-height: inherit; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--primary-ink); }
svg { display: block; overflow: visible; }
[hidden] { display: none !important; }
:focus { outline: none; }
:focus-visible { outline: var(--focus-width) solid var(--focus-ring); outline-offset: var(--focus-offset); }
/* Programmatic focus targets (the page heading after navigation, the skip link's target) are
   not controls: no ring. Scoped on purpose: the chart's roving buckets use tabindex -1 too. */
h1[tabindex="-1"]:focus, main[tabindex="-1"]:focus { outline: none; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; left: var(--space-3); top: -100px; z-index: var(--z-skip);
  padding: var(--space-3) var(--space-4); background: var(--bg-raised); color: var(--text-strong);
  border-radius: var(--radius-md); box-shadow: var(--shadow-overlay); font-weight: var(--fw-semibold);
  text-decoration: none;
}
.skip-link:focus { top: var(--space-3); }
.icon { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor;
  stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.icon--sm { width: 16px; height: 16px; }
.nowrap { white-space: nowrap; }
.key { display: inline-block; width: 12px; height: 3px; border-radius: var(--radius-mark); background: var(--ser);
  flex: 0 0 auto; vertical-align: middle; }
/* One colour per grade (SPEC 2.2): a class sets --ser, lines and keys read it. */
.ser-0 { --ser: var(--series-other); } .ser-1 { --ser: var(--series-1); }
.ser-2 { --ser: var(--series-2); } .ser-3 { --ser: var(--series-3); }
.ser-4 { --ser: var(--series-4); } .ser-5 { --ser: var(--series-5); }
.ser-6 { --ser: var(--series-6); }

.card {
  background: var(--bg-surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-card);
  padding: var(--card-pad); min-width: 0; min-height: 0;
}
.card__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2);
  flex-wrap: wrap; }
.card__title { font-size: var(--fs-body); line-height: var(--lh-body); font-weight: var(--fw-semibold); }
.link-btn {
  display: inline-block; line-height: var(--control-h); padding: 0 var(--space-1); white-space: nowrap;
  color: var(--primary-ink); font-weight: var(--fw-semibold); font-size: var(--fs-body);
  text-decoration: underline; text-underline-offset: 2px; border-radius: var(--radius-xs);
}
button.link-btn { border: 0; background: transparent; }
/* a link button with an icon after its words ("All deliveries >") */
.link-btn--icon { display: inline-flex; align-items: center; gap: var(--space-1); min-height: var(--control-h); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: var(--control-h); padding: 0 var(--space-3); border-radius: var(--radius-sm);
  border: 1px solid var(--border-control); background: transparent; color: var(--text-strong);
  font-size: var(--fs-body); line-height: var(--lh-body); font-weight: var(--fw-semibold);
  white-space: nowrap; transition: background-color var(--dur-fast) var(--ease);
}
a.btn { text-decoration: none; }
.btn[disabled] { color: var(--text-muted); border-color: var(--border-subtle); cursor: default;
  background: transparent; }
.btn--icon { width: var(--control-h); padding: 0; }
.btn--ghost { border-color: transparent; }
@media (hover: hover) {
  .link-btn:hover { text-decoration-thickness: 2px; }
  .btn:hover { background: var(--bg-subtle); }
  .btn[disabled]:hover { background: transparent; }
}
/* The segmented control (SPEC 5.10): the Sales periods, the tank tabs. Equal segments, as wide
   as the widest (full width on a phone), each --control-h tall; its 2 px transparent border
   insets the thumb, so the track needs no padding and the whole segment is the target. The
   choice shows at once (no sliding thumb: the page is drawn again for it). */
.seg { display: inline-grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); width: max-content; max-width: 100%;
  min-width: 0; border-radius: var(--radius-md); background: var(--seg-track); }
.seg > li { display: flex; min-width: 0; }
.seg__btn {
  display: flex; flex: 1 1 auto; align-items: center; justify-content: center; gap: var(--space-2); min-width: 0;
  min-height: var(--control-h); padding: 0 var(--space-3); border: 2px solid transparent; border-radius: var(--radius-md);
  background-color: transparent; background-clip: padding-box; color: var(--text-secondary); font-size: var(--fs-body); line-height: var(--lh-body);
  font-weight: var(--fw-regular); text-decoration: none; white-space: nowrap;
}
.seg__btn:focus-visible { outline-offset: -2px; }
.seg__btn[aria-current="page"], .seg__btn[aria-pressed="true"] { background-color: var(--bg-raised); color: var(--text-strong);
  font-weight: var(--fw-semibold); box-shadow: var(--shadow-thumb); }
@media (hover: hover) { .seg__btn:hover { color: var(--text-strong); } }
@media (max-width: 767.98px) {
  .seg { display: grid; width: 100%; }
  .seg__btn { padding: 0 var(--space-1); }
}
.loading { color: var(--text-muted); font-size: var(--fs-body); }
.empty { color: var(--text-secondary); font-size: var(--fs-body); }
/* Loading states (SPEC 5.14). "wait": invisible until the loads running have taken 300 ms (app.js
   then sets is-slow on the root), so a fast load never flashes "Loading...". A cover hides a
   card's old content (kept while the new loads) once the load is slow. */
.wait { visibility: hidden; }
.is-slow .wait { visibility: visible; }
.cover { position: absolute; inset: 0; z-index: 1; display: flex; align-items: center; justify-content: center;
  border-radius: inherit; background: var(--bg-surface); color: var(--text-muted); font-size: var(--fs-body); }
.card--middle { display: flex; align-items: center; justify-content: center; }
/* the first load's skeleton: outlines and bars in --bg-muted, no shimmer; each part about as
   tall as what takes its place (a phone's compact tile, 212 px; the Tanks card; the Sales totals
   of two products), so the page hardly moves when the data comes */
.skel { display: block; border-radius: var(--radius-xs); background: var(--bg-muted); }
.tile.tile--skel { min-height: 212px; }
.tank-body > .tile.tile--skel { min-height: 148px; height: 148px; overflow: hidden; }
.card.card--skel { min-height: 182px; }
@media (min-width: 768px) {
  .tile.tile--skel { min-height: 174px; }
  .tank-body > .tile.tile--skel { min-height: 170px; height: auto; }
  .card.card--skel { min-height: 280px; }
}
@media (min-width: 1280px) { .card.card--skel { min-height: 192px; } }
.skel--eyebrow { width: 40%; height: 12px; }
.skel--pic { width: 56px; height: 56px; border-radius: 50%; }
.skel--line { width: 60%; height: 12px; }
.skel--short { width: 40%; }
.skel-rows { display: flex; flex-direction: column; gap: var(--space-8); padding: var(--space-4) 0; }
.skel-rows .skel { height: 12px; width: 72%; }
.skel-rows .skel:nth-child(odd) { width: 56%; }
.noscript { padding: var(--space-4); }

/* =========================================================================================
   4. The shell: top bar, banner, page, bottom tabs. body is exactly one screen tall.
   ========================================================================================= */

body {
  height: 100vh; height: 100dvh; overflow-x: hidden;
  display: grid; grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}
/* Each part has its own row: the banner is often hidden, and main must keep the flexible row. */
.topbar { grid-row: 1; }
.banner { grid-row: 2; }
.main { grid-row: 3; }
.tabbar { grid-row: 4; }

/* The top bar (SPEC 3.1): charcoal, 56 px (64 from 768), the stripe its only edge (no shadow).
   Left to right: the brand, the station block, the page links (from 1024 px), Refresh now, Sign
   out. */
.topbar {
  position: relative; z-index: var(--z-topbar); background: var(--chrome); color: var(--on-chrome);
  height: calc(var(--topbar-h) + var(--stripe-h));
}
.topbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: var(--stripe-h);
  background: var(--brand-stripe);
}
.topbar :focus-visible { outline-color: var(--chrome-focus); }
.topbar__inner {
  height: var(--topbar-h); display: flex; align-items: center; gap: var(--space-1);
  padding: 0 max(var(--space-2), env(safe-area-inset-right, 0px)) 0 max(var(--space-3), env(safe-area-inset-left, 0px));
}
.topbar__spacer { flex: 1 1 auto; min-width: 0; }
@media (min-width: 768px) {
  .topbar__inner { gap: var(--space-2); padding-left: max(var(--space-5), env(safe-area-inset-left, 0px));
    padding-right: max(var(--space-3), env(safe-area-inset-right, 0px)); }
}

/* The brand: SMP's mark (the logo file, a theme token), "SMP" from 480 px, and "| Tank
   Monitoring" from 1440 px. The wordmark is a logo, not text: its own 21 px lettering. */
.brand { display: inline-flex; align-items: center; gap: var(--space-2); flex: 0 0 auto; height: 44px; }
.brand__mark { width: 26px; height: 26px; flex: 0 0 auto; background-image: var(--brand-logo);
  background-position: center; background-size: contain; background-repeat: no-repeat; }
.brand__smp { font-size: 21px; line-height: 22px; font-weight: var(--fw-wordmark); letter-spacing: .04em;
  color: var(--on-chrome); }
.brand__divider { width: 1px; height: 24px; background: var(--chrome-divider); margin: 0 var(--space-1); }
.brand__product { font-size: var(--fs-title); line-height: var(--lh-title); font-weight: var(--fw-semibold);
  color: var(--on-chrome); white-space: nowrap; }
.brand__divider, .brand__product { display: none; }
@media (max-width: 479.98px) { .brand__smp { display: none; } }
@media (min-width: 1440px) { .brand__divider, .brand__product { display: block; } }

/* Top-bar buttons stay 44 px at every size (SPEC 3.1, 3.5, 3.6): the bar has the room, and they
   match the page links' height. */
.chrome-btn {
  position: relative; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  gap: var(--space-2); height: 44px; min-width: 44px; padding: 0 var(--space-2); border: 0;
  border-radius: var(--radius-sm); background: transparent; color: var(--on-chrome-2);
  font-size: var(--fs-body); font-weight: var(--fw-semibold); white-space: nowrap; text-decoration: none;
  transition: background-color var(--dur-fast) var(--ease);
}
.chrome-btn[aria-expanded="true"] { background: var(--chrome-hover); color: var(--on-chrome); }
.chrome-btn[aria-busy="true"] .icon { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .chrome-btn[aria-busy="true"] .icon { animation: none; } }
@media (hover: hover) {
  .chrome-btn:hover { background: var(--chrome-hover); color: var(--on-chrome); }
}

/* Refresh now: the icon below 1280 px (its words stay for screen readers), words too from 1280.
   While busy the icon turns; with reduced motion the words say "Updating..." instead. */
.refresh__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0);
  clip-path: inset(50%); white-space: nowrap; }
@media (min-width: 1280px) {
  .refresh { padding: 0 var(--space-3); }
  .refresh__label { position: static; width: auto; height: auto; overflow: visible; clip: auto; clip-path: none; }
}

/* The station block (SPEC 3.2, 3.3): the station's name and, under it, how fresh its numbers
   are; with two or more stations, the button that opens the switcher. On a phone it takes all
   the free width (only the name gives way, with "..."); at most 280 px from 1024 (320 from
   1440). */
.switcher { position: relative; display: flex; flex: 1 1 auto; min-width: 0; margin-left: var(--space-1); }
@media (min-width: 480px) { .switcher { flex: 0 1 auto; } }
@media (min-width: 768px) { .switcher { margin-left: var(--space-3); } }
@media (min-width: 1024px) { .switcher { max-width: 280px; } }
@media (min-width: 1440px) { .switcher { max-width: 320px; } }
.station { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; min-width: 0;
  max-width: 100%; padding: 0 var(--space-2); text-align: left; }
.station.chrome-btn { flex: 0 1 auto; flex-direction: column; align-items: flex-start; gap: 0; color: var(--on-chrome-2); }
.station__line { display: flex; align-items: center; gap: var(--space-1); min-width: 0; max-width: 100%; }
.station__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--on-chrome);
  font-size: var(--fs-body); line-height: var(--lh-body); font-weight: var(--fw-semibold); }
.station__fresh { display: flex; align-items: center; gap: var(--space-1); min-width: 0; max-width: 100%;
  font-size: var(--fs-small); line-height: var(--lh-small); font-weight: var(--fw-regular); color: var(--on-chrome-muted);
  white-space: nowrap; }
.station__fresh > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.station__fresh--offline { color: var(--on-chrome-offline); }

/* The pages (SPEC 3.5): the same five everywhere, as links in the top bar from 1024 px and as
   bottom tabs below; the Alerts count on both. */
.topnav { display: none; }
@media (min-width: 1024px) {
  .topnav { display: flex; align-items: center; gap: 0; margin-left: var(--space-2); }
  .tabbar { display: none !important; }
}
.topnav__link {
  position: relative; display: inline-flex; align-items: center; gap: var(--space-2); height: 44px;
  padding: 0 var(--space-3); border-radius: var(--radius-sm); color: var(--on-chrome-2); font-size: var(--fs-body);
  font-weight: var(--fw-semibold); text-decoration: none; white-space: nowrap;
}
.topnav__link[aria-current="page"] { color: var(--on-chrome); }
.topnav__link[aria-current="page"]::after {
  content: ""; position: absolute; left: var(--space-2); right: var(--space-2); bottom: 2px; height: 3px;
  border-radius: var(--radius-mark); background: var(--primary);
}
@media (hover: hover) {
  .topnav__link:hover { background: var(--chrome-hover); color: var(--on-chrome); }
}

/* The Alerts count: open warnings and alarms only; amber, red while an alarm is open. */
.badge {
  display: inline-block; min-width: 18px; height: 18px; padding: 0 var(--space-1); border-radius: var(--radius-pill);
  font-size: var(--fs-micro); line-height: 18px; font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums;
  text-align: center;
}
.badge--warning { background: var(--on-chrome-warning); color: var(--on-primary); }
.badge--critical { background: var(--critical-banner-bg); color: var(--on-critical-banner); }

.tabbar {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); background: var(--chrome);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
  box-shadow: var(--shadow-tabbar);
}
.tabbar__tab {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; height: var(--tabbar-h); min-width: 0; padding: 0 2px; color: var(--on-chrome-2);
  font-size: var(--fs-micro); line-height: var(--lh-micro); font-weight: var(--fw-semibold); text-decoration: none;
}
.tabbar__tab .icon { width: 22px; height: 22px; color: var(--on-chrome-muted); }
.tabbar__tab:focus-visible { outline: var(--focus-width) solid var(--chrome-focus); outline-offset: -2px; }
.tabbar__tab[aria-current="page"] { color: var(--on-chrome); }
.tabbar__tab[aria-current="page"] .icon { color: var(--primary); }
.tabbar__tab[aria-current="page"]::before {
  content: ""; position: absolute; left: 14%; right: 14%; top: 0; height: 3px;
  border-radius: 0 0 var(--radius-mark) var(--radius-mark); background: var(--primary);
}
@media (hover: hover) {
  .tabbar__tab:hover { background: var(--chrome-hover); color: var(--on-chrome); }
}
.tabbar__icon { position: relative; display: inline-flex; }
.tabbar__icon .badge { position: absolute; top: -7px; right: -14px; box-shadow: var(--shadow-badge); }

/* The banner (SPEC 3.4): one full-bleed line under the top bar, only when something is wrong:
   the last refresh failed (warning, with Try again) or the station is not reporting (offline).
   Its row is auto, so at large text sizes it wraps rather than clip. */
.banner {
  display: flex; align-items: center; gap: var(--space-2); min-height: var(--banner-h); padding: 0 var(--gutter);
  border-left: 3px solid var(--warning-solid); background: var(--warning-bg); color: var(--text-strong);
  font-size: var(--fs-small); line-height: var(--lh-small);
}
.banner--offline { background: var(--offline-bg); border-left-color: var(--offline-solid); }
.banner__icon { color: var(--warning-solid); }
.banner--offline .banner__icon { color: var(--offline-solid); }
.banner__text { flex: 0 1 auto; min-width: 0; padding: var(--space-1) 0; }
.banner__short { display: none; }
@media (max-width: 479.98px) {
  .banner__long { display: none; }
  .banner__short { display: inline; }
}
.banner__again { flex: 0 0 auto; font-size: var(--fs-small); }

/* =========================================================================================
   5. The pages. main holds one page (a .view) that fills it; every row that can give way is
      minmax(0, 1fr), so nothing pushes the screen longer: the chart draws at its box's size,
      and the lists page.
   ========================================================================================= */

/* positioned: the visually hidden words in the page belong to it (when it scrolls, they scroll
   with it and never make the whole screen scroll) */
.main {
  position: relative; min-height: 0; min-width: 0; outline: none; display: grid;
  grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr);
  padding: var(--page-pad) var(--gutter);
}
@media (min-width: 1800px) { .main { width: 100%; max-width: 1760px; justify-self: center; } }
.view { min-height: 0; min-width: 0; display: grid; gap: var(--gap); grid-template-columns: minmax(0, 1fr); }

/* Tanks, the start page (the owner, 2026-10-18, in Today's place): the tiles alone (with their
   pager), as tall as the page. */
.view--tanks { grid-template-rows: minmax(0, 1fr); }

/* The first row of a page (SPEC 3.7): its context or main control on the left, its actions on
   the right. */
.toolbar { display: flex; align-items: center; gap: var(--space-2); min-width: 0; min-height: var(--toolbar-h); }
.card__zone { font-size: var(--fs-small); font-weight: var(--fw-regular); color: var(--text-secondary); white-space: nowrap; }

/* A tank's page (SPEC 4.3): "All tanks" and the tank tabs, then the tank's card and its level
   chart: the card a regular one above the chart below 1024 px; from 1024 px a tall one in a
   380 px column beside the chart, both the full height. */
.view--tank { grid-template-rows: auto minmax(0, 1fr); }
/* "All tanks": the arrow alone below 768 px (its name stays for screen readers), words too from 768 */
.backlink { flex: 0 0 auto; min-width: var(--control-h); justify-content: center; padding: 0 var(--space-2); }
.backlink__text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0);
  clip-path: inset(50%); white-space: nowrap; }
@media (min-width: 768px) {
  .backlink { padding: 0 var(--space-3) 0 var(--space-2); }
  .backlink__text { position: static; width: auto; height: auto; overflow: visible; clip: auto; clip-path: none; }
}
.tank-body { display: grid; gap: var(--gap); min-height: 0; grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr); }
@media (min-width: 1024px) {
  /* the grid sets the card's height here: it is a tall card (--tile-fill, read by layoutTiles) */
  .tank-body { grid-template-columns: 380px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); --tile-fill: 1; }
}
/* Deliveries and Alerts (SPEC 4.4, 4.5): the toolbar, then a card with the rows that fit and the
   pager; Deliveries' filter row between them while it is open. The rows fill the card, as wide
   as every page: the toolbar, the card, the rows and the pager share their edges and middle. */
.view--list { grid-template-rows: auto minmax(0, 1fr); }
.view--list.view--filters { grid-template-rows: auto auto minmax(0, 1fr); }
/* A page that is one sentence (nothing could load at all): in its middle. */
.view--message { align-content: center; justify-items: center; text-align: center; }
/* Sales: the period and date, the totals, then the chart takes what is left. */
.view--sales { grid-template-rows: auto auto minmax(0, 1fr); }

/* A phone too short for a page (SPEC 2.4: never clip, scroll instead): the parts that give way
   keep a least height (a tank tile --tile-min, a chart's plot --plot-min, a list its tallest
   page) and the page scrolls between the top bar and the tabs, rather than cut a card
   or leave a chart empty. The page (main) is as tall as the view's least height (min-content:
   the fixed rows' content and those minimums); at the four sizes everything fits, so nothing
   scrolls and nothing changes. */
@media (max-width: 767.98px) {
  .main { overflow-x: hidden; overflow-y: auto; grid-template-rows: minmax(min-content, 1fr); }
  /* the Tanks page's tiles fill the screen on a phone too (the grid sets their height:
     --tile-fill), each at least --tile-min */
  .view--tanks { grid-template-rows: minmax(min-content, 1fr); }
  .view--tanks .tanks { grid-template-rows: minmax(min-content, 1fr); align-content: stretch; }
  .view--tanks .tanks--paged { grid-template-rows: minmax(min-content, 1fr) auto; }
  .view--tanks .tiles { --tile-fill: 1; grid-template-rows: minmax(var(--tile-min), 1fr); align-content: stretch; }
  .view--tanks .tiles[data-rows="2"] { grid-template-rows: repeat(2, minmax(var(--tile-min), 1fr)); }
  /* tanks one above the other (one column): a regular tile keeps at least 160 px */
  .view--tanks .tiles[data-cols="1"] { --tile-min: 160px; }
  .view--tanks .tiles[data-rows="3"] { grid-template-rows: repeat(3, minmax(var(--tile-min), 1fr)); }
  .view--sales { grid-template-rows: auto auto minmax(min-content, 1fr); }
  .view--tank { grid-template-rows: auto minmax(min-content, 1fr); }
  .tank-body { grid-template-rows: auto minmax(min-content, 1fr); }
  .chart > .chart__plot { min-height: var(--plot-min); }
  /* a list keeps its tallest page (a row, or a heading and its row: paginate sets --page-min),
     or room for its one sentence */
  .view--list { grid-template-rows: auto minmax(min-content, 1fr); }
  .view--list.view--filters { grid-template-rows: auto auto minmax(min-content, 1fr); }
  .listcard > .listbox { min-height: var(--page-min, 160px); }
}
/* A short phone: the Tanks card's picture at most 88 px (layoutTile reads --pic-cap), so the
   level chart under it, the page's answer, keeps the room. */
@media (max-width: 767.98px) and (max-height: 740px) {
  .tank-body { --pic-cap: 88px; }
}
/* Below 360 px wide (400% zoom, WCAG 1.4.10): a tile per row (tilePlan), each as tall as its
   content, and the page scrolls (above) rather than squeeze them; never sideways. */
@media (max-width: 359.98px) {
  /* max-content rows: auto ones would shrink the tiles to the screen (they have min-height 0) */
  .view--tanks, .view--tanks .tanks { grid-template-rows: none; grid-auto-rows: max-content; align-content: start; }
  .view--tanks .tiles, .view--tanks .tiles[data-rows="2"] { --tile-fill: 0; grid-template-rows: none; grid-auto-rows: max-content; }
}

/* A window too short for any of this (a phone on its side): the page may scroll. */
@media (max-height: 520px) {
  body { height: auto; min-height: 100vh; min-height: 100dvh; }
  .view { grid-template-rows: auto auto !important; }
  .tank-body { grid-template-rows: auto 280px !important; --tile-fill: 0; }
  .listcard, .view--sales .chart { min-height: 320px; }
}
@media (max-height: 520px) and (min-width: 1024px) {
  .tank-body { grid-template-rows: minmax(320px, auto) !important; }
}

/* =========================================================================================
   6. The tank tile (the Tanks page) and the tank card (a tank's page): one component (SPEC 5.1).
      Top to bottom: eyebrow, picture with the amount, facts (when to order is an alert only,
      the owner 2026-10-18). JS sets data-size
      from the tile's own box: "tall" (the grid sets its height, 320 px or more, and it is at
      least 280 px wide), "compact"
      (narrower than 300 px: a phone's two across) or "regular", and draws the picture to fit.
   ========================================================================================= */

/* The Tanks page's tiles. JS sets the columns (data-cols) and the rows (data-rows) for the tank
   count and the width, and shows a page of tiles at a time when they do not all fit: four from
   five tanks. */
.tanks { display: grid; gap: var(--space-2); min-width: 0; min-height: 0; align-content: start; }
.tanks__empty {
  display: flex; align-items: center; justify-content: center; text-align: center; padding: var(--space-6) var(--card-pad);
  background: var(--bg-surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); color: var(--text-secondary);
}
.tiles { display: grid; gap: var(--gap); min-width: 0; min-height: 0; grid-template-columns: minmax(0, 1fr); align-content: start; }
.tiles[data-cols="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tiles[data-cols="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tile--wide { grid-column: 1 / -1; }             /* a tablet's third tile of three */
.tanks--paged .tiles { touch-action: pan-y; }     /* a sideways swipe turns the page */
@media (min-width: 768px) {
  /* the grid sets the tiles' height (--tile-fill, read by layoutTiles), from a tablet up: the
     tiles are tall ones where they have the room */
  .tanks { grid-template-rows: minmax(0, 1fr); align-content: stretch; }
  .tanks--paged { grid-template-rows: minmax(0, 1fr) auto; }
  .tiles { --tile-fill: 1; grid-template-rows: minmax(0, 1fr); align-content: stretch; }
  .tiles[data-rows="2"] { grid-template-rows: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 768px) and (max-height: 520px) { .tiles { --tile-fill: 0; } }
/* the pager under the tiles: [<]  Tanks 1-2 of 4  [>], grouped in the middle, the
   buttons where they were whatever the words (and never narrower than 44 px: the words give way) */
.pager > .btn { flex: none; }
.pager--tiles .pager__status { flex: 0 1 240px; min-width: 0; display: flex; flex-wrap: wrap; align-items: center;
  justify-content: center; column-gap: var(--space-1); line-height: var(--lh-small); }
.tile {
  position: relative; min-width: 0; min-height: 0; padding: var(--card-pad);
  display: flex; flex-direction: column; gap: var(--space-3);
  background: var(--bg-surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-card);
  transition: box-shadow var(--dur-fast) var(--ease);
}
/* The Tanks page: the product name is the link, stretched over the whole tile; nothing inside the tile is
   separately interactive. Its ::after draws the focus ring around the tile. */
.tile__link { color: inherit; text-decoration: none; }
.tile__link::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius-lg); }
.tile__link:focus-visible { outline: none; }
.tile__link:focus-visible::after { outline: var(--focus-width) solid var(--focus-ring); outline-offset: var(--focus-offset); }
@media (hover: hover) {
  .tile--link:hover { box-shadow: var(--shadow-hover); }
}

/* the eyebrow: key, the console's label, "Tank 1" and the chevron */
.tile__head { display: flex; align-items: center; gap: var(--space-2); min-width: 0; min-height: var(--lh-micro); }
.tile__label { min-width: 0; font-size: var(--fs-micro); line-height: var(--lh-micro); font-weight: var(--fw-semibold);
  letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--text-strong);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile__name--short { display: none; text-transform: none; }
.tile__go { margin-left: auto; display: inline-flex; align-items: center; gap: var(--space-1); flex: 0 0 auto;
  font-size: var(--fs-micro); line-height: var(--lh-micro); color: var(--text-muted); white-space: nowrap; }

/* the picture beside the amount and the facts */
.tile__body { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "pic amount" "pic facts";
  column-gap: var(--space-4); row-gap: var(--space-2); min-width: 0; min-height: 0; }
.tile__pic { grid-area: pic; align-self: center; min-width: 0; }
.tile__amount { grid-area: amount; align-self: end; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline;
  column-gap: var(--space-2); font-size: var(--fs-small); line-height: var(--lh-small); color: var(--text-secondary); }
.tile__num { white-space: nowrap; }
.tile__gal { font-size: var(--fs-display); line-height: var(--lh-display); font-weight: var(--fw-semibold);
  letter-spacing: var(--track-display); color: var(--text-strong); }
.tile__pct { white-space: nowrap; }
/* label | value rows; on a wide tile they stay together rather than drift to the far edges */
.tile__facts { grid-area: facts; align-self: start; display: grid; row-gap: var(--space-1); min-width: 0; max-width: 300px; }
.tile__fact { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; column-gap: var(--space-3); }
.tile__fact dt { font-size: var(--fs-small); line-height: var(--lh-small); color: var(--text-secondary); }
.tile__fact dd { margin-left: auto; text-align: right; font-size: var(--fs-body); line-height: var(--lh-body);
  font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; color: var(--text-strong); }
.tile__fact--warning dd { display: inline-flex; align-items: center; gap: var(--space-1); color: var(--warning); }
.tile__fact--warning .icon { color: var(--warning-solid); }
/* no forecast yet: "not known yet", quieter than a number */
.tile__fact--quiet dd { font-size: var(--fs-small); line-height: var(--lh-small); font-weight: var(--fw-regular);
  color: var(--text-secondary); }
/* not reporting: the numbers are old; quieter, still AA (the banner says why) */
.tile--offline .tile__gal, .tile--offline .tile__fact dd { color: var(--text-secondary); }

/* compact (a phone's two across): no "Tank 1", the amount beside a small picture, the facts
   stacked */
.tile[data-size="compact"] { padding: var(--space-3); gap: var(--space-2); }
.tile[data-size="compact"] .tile__number { display: none; }
.tile--dup[data-size="compact"] .tile__name { display: none; }
.tile--dup[data-size="compact"] .tile__name--short { display: inline; }
.tile[data-size="compact"] .tile__body { grid-template-areas: "pic amount" "facts facts"; column-gap: var(--space-2);
  row-gap: var(--space-2); }
/* on the Tanks page the grid may give a tile more height than its content: the content sits in
   the middle of it, not at the top */
.tiles .tile[data-size="compact"] .tile__body, .tiles .tile[data-size="regular"] .tile__body { flex: 1 1 auto; align-content: center; }
/* the amount starts under the picture's "Max" line, so a long one never runs into it */
.tile[data-size="compact"] .tile__amount { display: block; padding-top: var(--space-4); }
.tile[data-size="compact"] .tile__gal { display: block; font-size: var(--fs-title); line-height: var(--lh-title);
  letter-spacing: var(--track-title); }
.tile[data-size="compact"] .tile__unit, .tile[data-size="compact"] .tile__pct { display: block; }
.tile[data-size="compact"] .tile__facts { row-gap: var(--space-2); }
.tile[data-size="compact"] .tile__fact { display: block; }
.tile[data-size="compact"] .tile__fact dd { margin-left: 0; text-align: left; font-size: var(--fs-small);
  line-height: var(--lh-small); }

/* tall (the grid sets the height): the picture, the amount and the facts one group, centred in
   the height under the eyebrow; the picture is drawn as large as that height allows
   (layoutTile). The amount and the facts keep to a 320 px column under the picture, so each
   label stays near its value (as on a regular tile) whatever the tile's width. */
.tile[data-size="tall"] .tile__body { flex: 1 1 0; grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto auto; align-content: center; grid-template-areas: "pic" "amount" "facts";
  row-gap: var(--space-3); }
.tile[data-size="tall"] .tile__pic { display: flex; justify-content: center; }
.tile[data-size="tall"] .tile__amount { justify-content: space-between; }
.tile[data-size="tall"] .tile__amount, .tile[data-size="tall"] .tile__facts { width: 100%; max-width: 320px; justify-self: center; }

/* the level picture: a horizontal cylinder's end view; the fuel in its product's colour (the
   owner, 2026-10-18: --ser, one colour per grade as in the charts), grey-blue while the station
   is not reporting; the 90% and 8% lines dashed, drawn in the card's colour where they cross
   the fuel */
.pic text { font-family: var(--font-sans); font-size: var(--fs-micro); fill: var(--text-muted); }
.pic .pic__max { fill: var(--text-strong); font-weight: var(--fw-semibold); }
.pic__empty { fill: var(--bg-muted); }
.pic__fuel { fill: var(--ser, var(--fuel-fill)); }
.pic .pic__fuel--offline { fill: var(--fuel-fill-offline); }
.pic__shell { fill: none; stroke: var(--tank-shell); stroke-width: 1.5; }
.pic__line { fill: none; stroke: var(--limit-line); stroke-width: 1; stroke-dasharray: 4 3; }
.pic__line--fuel { stroke: var(--bg-surface); }

/* The tank tabs (SPEC 4.3): the segmented control (section 3) of links, one per tank: its key,
   the product and "Tank 1" from 768 px; the short name ("87") on a phone, "91 . Tank 3" when two
   tanks share it. Where the names do not fit (fitTankTabs): the short names and "Tank 1"
   (seg--short), then the phone's form (seg--bare); a lone name that still does not fit ends in
   "...". More than five tanks on a phone: a select. */
.tanktabs { display: flex; flex: 0 1 auto; min-width: 0; max-width: 100%; }
.tanktab__long, .tanktab__short { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tanktab__num { flex: 0 0 auto; font-weight: var(--fw-regular); color: var(--text-secondary); }
.tanktab__short, .tanksel { display: none; }
.seg--short .tanktab__long, .seg--bare .tanktab__long { display: none; }
.seg--short .tanktab__short, .seg--bare .tanktab__short { display: block; }
.seg--bare .tanktab__num { display: none; }
.seg--bare .tanktab--dup .tanktab__num { display: block; }
.seg--bare .tanktab--dup .tanktab__num::before { content: "\B7"; margin-right: var(--space-2); }
@media (max-width: 767.98px) {
  .tanktabs { flex: 1 1 auto; }
  .tanktab__long, .tanktab__num { display: none; }
  .tanktab__short, .tanktab--dup .tanktab__num { display: block; }
  .tanktab--dup .tanktab__num::before { content: "\B7"; margin-right: var(--space-2); }
  .toolbar--many .tanktabs { display: none; }
  .toolbar--many .tanksel { display: block; flex: 1 1 auto; }
}

/* =========================================================================================
   7. Charts (SPEC 5.4-5.6): the level chart (Tanks) and the sales chart. Each has a head (the
      title, the legend), the readout line, and the plot, drawn at its box's size.
   ========================================================================================= */

.chart { display: flex; flex-direction: column; gap: var(--space-2); }
.chart__head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: var(--space-1) var(--space-3); min-width: 0; }
.chart__head--hours { flex-wrap: nowrap; }
/* below 360 px the back button and the stepper do not fit one line: the stepper goes under it,
   on the right, with its full 44 px arrows (the page scrolls at that width anyway) */
@media (max-width: 359.98px) {
  .chart__head--hours { flex-wrap: wrap; }
  .chart__head--hours .stepper { margin-left: auto; }
}
.chart__hint { font-size: var(--fs-small); line-height: var(--lh-small); color: var(--text-muted); }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--space-3); min-width: 0; font-size: var(--fs-small);
  line-height: var(--lh-small); color: var(--text-secondary); }
.legend__item { display: inline-flex; align-items: center; gap: var(--space-2); white-space: nowrap; }
.legend__mark { flex: 0 0 auto; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: var(--radius-mark); background: var(--ser); flex: 0 0 auto; }
.swatch--ahead { background: var(--bg-muted); border: 1.5px solid var(--border-control); }
/* the readout line (SPEC 5.6): one line, its height always kept; JS drops whole parts from the
   end until it fits, so it never cuts a number */
.readout { min-height: var(--lh-small); font-size: var(--fs-small); line-height: var(--lh-small); color: var(--text-secondary);
  font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chart__plot { position: relative; flex: 1 1 0; min-height: 0; touch-action: pan-y; }
.chart__plot > svg { position: absolute; left: 0; top: 0; }
.chart__msg { position: absolute; inset: 0; display: flex; flex-wrap: wrap; align-items: center; align-content: center;
  justify-content: center; column-gap: var(--space-1); text-align: center; padding: var(--space-4); color: var(--text-secondary);
  font-size: var(--fs-body); }
.plot--press { cursor: pointer; }
.ch-grid { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.ch-axis { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.ch-tick { fill: var(--text-muted); font-size: var(--fs-micro); font-family: var(--font-sans); font-variant-numeric: tabular-nums; }
.ch-tick--now { fill: var(--text-strong); font-weight: var(--fw-semibold); }
/* the 90% and 8% lines: neutral, dashed, always labelled (never red or amber) */
.ch-limit { fill: none; stroke: var(--limit-line); stroke-width: 1; stroke-dasharray: 4 3; }
.ch-limit-lab { fill: var(--text-muted); font-size: var(--fs-micro); font-family: var(--font-sans); font-variant-numeric: tabular-nums; }
/* a day's low-high bar: a wash of the product's colour, outlined in it (the wash alone is too
   faint for a mark); the end-of-day line; the delivery marker ringed in the card's colour */
.ch-band { fill: var(--ser); fill-opacity: var(--band-opacity); stroke: var(--ser); stroke-width: 1.5; }
.ch-line { fill: none; stroke: var(--ser); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ch-dot { fill: var(--ser); stroke: var(--bg-surface); stroke-width: 1.5; }
.ch-mark { fill: var(--ser); stroke: var(--bg-surface); stroke-width: 4; stroke-linejoin: round; paint-order: stroke; }
.ch-cross { stroke: var(--crosshair); stroke-width: 1; shape-rendering: crispEdges; }
/* a bucket's column: the target for the keyboard (one tab stop, arrows) and its focus ring */
.ch-hit { fill: transparent; cursor: pointer; }
.ch-hit--static { cursor: default; }
.ch-hit:focus-visible { outline: none; stroke: var(--focus-ring); stroke-width: 2; }
/* the sales bars: the products in their colours; what is still expected one quiet outline; the
   other bars dim while one is shown in the readout */
.sbar { fill: var(--ser); }
.sbar--ahead { fill: var(--bg-muted); stroke: var(--border-control); stroke-width: 1.5; }
.sbucket { transition: opacity var(--dur-fast) var(--ease); }
.splot--active .sbucket { opacity: .4; }
.splot--active .sbucket.is-active { opacity: 1; }
/* the hour view's head: [<- 14 days], and the date stepper on the right */
.back-btn { padding-left: var(--space-2); }

/* =========================================================================================
   8. Settings (the gear in the top bar): the station's details and its ordering and alert
      settings, label | value rows in cards; on a phone, Sign out under them
   ========================================================================================= */

.view--settings { grid-template-rows: none; grid-auto-rows: max-content; align-content: start; }
@media (min-width: 1024px) {
  .view--settings { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 1080px; }
  .view--settings > .settings__foot { grid-column: 1 / -1; }
}
.settings { display: flex; flex-direction: column; gap: var(--space-2); }
.view--settings.wait > .card { min-height: 238px; }     /* the first load: about as tall as the Station card */
.kv { display: grid; margin: 0; }
.kv__row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; column-gap: var(--space-4);
  padding: var(--space-2) 0; min-width: 0; }
.kv__row + .kv__row { border-top: 1px solid var(--border-subtle); }
.kv__row dt { font-size: var(--fs-small); line-height: var(--lh-small); color: var(--text-secondary); }
.kv__row dd { margin: 0 0 0 auto; text-align: right; min-width: 0; overflow-wrap: anywhere; font-weight: var(--fw-semibold);
  color: var(--text-strong); font-variant-numeric: tabular-nums; }
.kv__phone { display: inline-flex; align-items: center; gap: var(--space-1); min-height: var(--control-h); }
.settings__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); }
.settings__note { margin: 0; font-size: var(--fs-small); line-height: var(--lh-small); color: var(--text-secondary); }
.settings__signout { margin: 0; }
/* API keys: the card takes the whole row; a new key on show in a tinted box until Done */
@media (min-width: 768px) { .view--settings > .keys { grid-column: 1 / -1; } }
.keys__new { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-3);
  border-radius: var(--radius-sm); background: var(--bg-subtle); border-left: 3px solid var(--border-strong); }
.keys__lead { margin: 0; font-weight: var(--fw-semibold); }
.keys__copy, .keys__actions, .keys__test { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.keys__next { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); }
.keys__result { display: inline-flex; align-items: center; gap: var(--space-1); margin: 0; font-size: var(--fs-small);
  line-height: var(--lh-small); font-weight: var(--fw-semibold); }
.keys__result--ok { color: var(--ok); }
.keys__result--bad { color: var(--critical); }
.keys__result .icon { flex: 0 0 auto; }
.keys code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; padding: 1px 4px;
  border-radius: var(--radius-xs); background: var(--bg-muted); color: var(--text-strong); }
/* how to connect a program (three numbered steps) beside the keys; side by side from 1024 px */
.keys__cols { display: flex; flex-direction: column; gap: var(--space-5); margin-top: var(--space-2); }
@media (min-width: 1024px) {
  .keys__cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-8); align-items: start; }
}
.keys__how, .keys__mine { display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; }
.keys__heading { font-size: var(--fs-micro); line-height: var(--lh-micro); font-weight: var(--fw-semibold);
  letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--text-secondary); }
.keys__steps { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--space-4);
  counter-reset: keystep; }
.keys__step { display: flex; gap: var(--space-3); counter-increment: keystep; }
.keys__step::before { content: counter(keystep); flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; font-size: var(--fs-small); font-weight: var(--fw-semibold);
  color: var(--text-strong); background: var(--bg-muted); }
.keys__body { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; padding-top: 2px; }
.keys__body p { margin: 0; font-size: var(--fs-body); line-height: var(--lh-body); color: var(--text-strong); }
.keys__secret { flex: 1 1 280px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: var(--fs-small); }
.keys__row dt { display: flex; flex-direction: column; gap: 2px; }
.keys__name { color: var(--text-strong); font-weight: var(--fw-semibold); font-size: var(--fs-body); overflow-wrap: anywhere; }
.keys__meta { font-variant-numeric: tabular-nums; }
.keys__form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-2); margin: 0; }
.keys__form .field { flex: 1 1 220px; }
.keys__error { margin: 0; font-size: var(--fs-small); line-height: var(--lh-small); color: var(--critical); }
/* from 768 px Sign out is in the top bar */
@media (min-width: 768px) { .settings__signout { display: none; } }

/* =========================================================================================
   9. Lists that page instead of scrolling (Deliveries, Alerts)
   ========================================================================================= */

/* The list card (SPEC 5.8): on a phone, Deliveries' count and total as its first line; the rows
   that fit (the others are not drawn, never cut); the pager. All of them fit: no pager, and the
   card ends under the rows (listcard--one, set by paginate() after measuring the full card). */
.listcard { display: flex; flex-direction: column; min-height: 0; padding-bottom: var(--space-2); }
.listcard__note { padding-bottom: var(--space-2); font-size: var(--fs-small); line-height: var(--lh-small);
  color: var(--text-secondary); font-variant-numeric: tabular-nums; }
@media (min-width: 768px) { .listcard__note { display: none; } }
.listbox { position: relative; flex: 1 1 0; min-height: 0; overflow: hidden; touch-action: pan-y; }
.listcard--one { align-self: start; padding-bottom: calc(var(--card-pad) - var(--space-2)); }    /* + a row's own 8 px */
.listcard--one .listbox { flex: 0 0 auto; }
.listcard--one .pager--list { display: none; }
.listcard--one .visit:last-child { border-bottom: 0; }     /* the card's edge ends the list */
/* the list's one sentence (loading, an error, none in these dates) in the middle of the card */
.listbox > .loading, .listbox > .empty, .list-msg {
  position: absolute; inset: 0; display: flex; flex-wrap: wrap; align-items: center; align-content: center;
  justify-content: center; gap: var(--space-3) var(--space-1); padding: var(--space-4); text-align: center;
}
.list-msg { flex-direction: column; flex-wrap: nowrap; color: var(--text-secondary); }

/* The pager (SPEC 5.8): [<]  1-8 of 14  [>], grouped in the middle under the rows; the count keeps
   its width, so the buttons stay where they are. */
.pager { display: flex; align-items: center; justify-content: center; gap: var(--space-2); }
.pager--list { padding-top: var(--space-2); border-top: 1px solid var(--border-subtle); }
.pager__status { flex: 0 0 auto; min-width: 112px; text-align: center; font-size: var(--fs-small); line-height: var(--lh-small);
  color: var(--text-secondary); font-variant-numeric: tabular-nums; }

/* Deliveries on a phone (SPEC 4.4): a truck visit is its time and total, then a line per
   product: the short name, the gallons, the level before and after. */
.visit { padding: var(--space-2) 0; border-bottom: 1px solid var(--border-subtle); font-variant-numeric: tabular-nums; }
.visit__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); }
.visit__when { min-width: 0; font-weight: var(--fw-semibold); }
.visit__total { flex: 0 0 auto; font-weight: var(--fw-semibold); white-space: nowrap; }
.visit__unit { font-size: var(--fs-small); font-weight: var(--fw-regular); color: var(--text-secondary); }
/* a product line: [key 87] [+7,833 gal] ... [level 821 -> 8,654], one line of 18 px boxes centred on
   each other (the key has no text to give a baseline); a level too wide for what is left (a
   5-digit tank on a narrow phone) goes whole to a line of its own, still on the right: a number
   is never cut */
.visit__line { display: flex; flex-wrap: wrap; align-items: center; column-gap: var(--space-2);
  font-size: var(--fs-small); line-height: var(--lh-small); color: var(--text-secondary); }
.visit__prod { display: flex; flex: 0 0 auto; min-width: 64px; align-items: center; gap: var(--space-2); white-space: nowrap;
  color: var(--text-strong); }
.visit__gal { flex: 0 0 96px; text-align: right; white-space: nowrap; font-weight: var(--fw-semibold); color: var(--text-strong); }
.visit__level { margin-left: auto; text-align: right; white-space: nowrap; }

/* From 768 px a table: a group of rows per visit (its time once). Fixed layout, so a row's height
   never depends on the rows around it (the pages are measured row by row). */
.dtable { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: var(--fs-body); line-height: var(--lh-body);
  font-variant-numeric: tabular-nums; color: var(--text-strong); }
.dtable thead th { padding: 0 var(--space-4) var(--space-2) 0; text-align: left; font-size: var(--fs-small); line-height: var(--lh-small);
  font-weight: var(--fw-semibold); color: var(--text-secondary); border-bottom: 1px solid var(--border-strong); }
.dtable td, .dtable .dtable__when { padding: var(--space-2) var(--space-4) var(--space-2) 0; vertical-align: top; text-align: left;
  font-weight: var(--fw-regular); }
.dtable .visit { padding: 0; border-bottom: 1px solid var(--border-subtle); }
.dtable tr + tr td { padding-top: 0; }
.dtable .r { text-align: right; white-space: nowrap; }
.dtable thead th:last-child, .dtable td:last-child { padding-right: 0; }
.dtable .prod { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dtable .prod .key { margin-right: var(--space-2); position: relative; top: -1px; }
/* a product held in two tanks: the tank after the name, as on the tank tabs; it goes under the
   name (a hanging indent past the key) rather than be cut (768 px) */
.dtable .prod--twin { white-space: normal; padding-left: calc(12px + var(--space-2)); text-indent: calc(-12px - var(--space-2)); }
.visit__tank { white-space: nowrap; color: var(--text-secondary); }
.dtable__gal { font-weight: var(--fw-semibold); }
.dtable col.c-when { width: 36%; }
.dtable col.c-prod { width: 22%; }
.dtable col.c-gal { width: 16%; }
.dtable col.c-level { width: 26%; }

/* Alerts (SPEC 4.5, 5.9): Needs attention (one line when nothing does), Notices, History. A row:
   the icon and word in the status ink and the time on line 1, the message under them; from
   1024 px one grid row: word | message | time. Tinted and edged by its state; notices and closed
   alerts quiet. */
.alerts > li { padding-bottom: var(--space-2); }
.alerts__group { padding: var(--space-1) 0 var(--space-2); font-size: var(--fs-small); line-height: var(--lh-small);
  font-weight: var(--fw-semibold); color: var(--text-secondary); }
.alerts__group > h2 { color: inherit; }     /* a heading for screen readers, the group's quiet name to the eye */
.alerts__ok { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-1) 0; color: var(--text-strong); }
.alerts__ok .icon { color: var(--ok); }
.alerts__none { color: var(--text-secondary); }
.alert { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "sev time" "msg msg";
  column-gap: var(--space-1); align-items: baseline; padding: var(--space-3) var(--space-4); border-radius: var(--radius-md);
  background: var(--bg-subtle); border-left: 3px solid var(--border-strong); }
.alert__sev { grid-area: sev; display: inline-flex; align-items: center; gap: var(--space-2); white-space: nowrap;
  font-size: var(--fs-small); line-height: var(--lh-small); font-weight: var(--fw-semibold); color: var(--text-secondary); }
.alert__sev .icon { align-self: center; color: var(--text-muted); }
.alert__time { grid-area: time; min-width: 0; font-size: var(--fs-small); line-height: var(--lh-small); color: var(--text-secondary);
  font-variant-numeric: tabular-nums; }
.alert__time::before { content: "\B7"; margin-right: var(--space-1); }
.alert__msg { grid-area: msg; min-width: 0; font-size: var(--fs-body); line-height: var(--lh-body); color: var(--text-strong); }
.alert--critical { background: var(--critical-bg); border-left-color: var(--critical-solid); }
.alert--critical .alert__sev { color: var(--critical); }
.alert--critical .alert__sev .icon { color: var(--critical-solid); }
.alert--warning { background: var(--warning-bg); border-left-color: var(--warning-solid); }
.alert--warning .alert__sev { color: var(--warning); }
.alert--warning .alert__sev .icon { color: var(--warning-solid); }
.alert--offline { background: var(--offline-bg); border-left-color: var(--offline-solid); }
.alert--offline .alert__sev { color: var(--offline); }
.alert--offline .alert__sev .icon { color: var(--offline-solid); }
.alert--closed .alert__sev .icon { color: var(--text-secondary); }
@media (min-width: 1024px) {
  .alert { grid-template-columns: 140px minmax(0, 1fr) 260px; grid-template-areas: "sev msg time"; column-gap: var(--space-4); }
  .alert__msg { max-width: 72ch; }
  .alert__time { text-align: right; }
  .alert__time::before { content: none; }
}

/* =========================================================================================
   10. Station switcher (the station block itself is in section 4)
   ========================================================================================= */

/* The switcher (SPEC 3.2): a 400 px popover from 1024 px; below, full width under the top bar, at
   most the height above the tabs. Only its list scrolls. Rows of 48 px: a status icon (unplug,
   octagon or triangle; nothing when fine), the name, the soonest order in words; the station
   shown now tinted, with a tick. Below 480 px, and wider where they would cut the name, the
   order words go under the name (rows of 56). */
.pop {
  position: absolute; top: calc(100% + var(--space-2)); left: 0; z-index: var(--z-dropdown); width: min(400px, calc(100vw - 16px));
  max-height: min(560px, calc(100dvh - var(--topbar-h) - 24px)); display: flex; flex-direction: column;
  background: var(--bg-raised); color: var(--text-strong); border-radius: var(--radius-md); box-shadow: var(--shadow-overlay);
  overflow: hidden;
}
@media (max-width: 1023.98px) {
  .pop { position: fixed; top: calc(var(--topbar-h) + var(--stripe-h) + var(--space-2)); left: var(--space-2); right: var(--space-2); width: auto;
    max-height: calc(100dvh - var(--topbar-h) - var(--stripe-h) - var(--tabbar-h) - var(--space-4)); }
}
.pop__search { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-3); border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary); }
.pop__search input {
  flex: 1 1 auto; min-width: 0; height: 44px; border: 1px solid var(--border-control); border-radius: var(--radius-sm);
  padding: 0 var(--space-3); background: var(--bg-surface); color: var(--text-strong); font-size: 16px;
}
.pop__search input:focus-visible { outline-offset: 0; }
.pop__list { overflow-y: auto; overscroll-behavior: contain; padding: var(--space-1) 0; flex: 1 1 auto; min-height: 0; }
.opt { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-4); cursor: pointer; min-height: 48px; }
.opt[aria-selected="true"] { background: var(--primary-subtle); }
/* the row Enter picks (the arrows move it; the focus stays in the search field): the focus
   ring, inside the row (SPEC 2.7) */
.opt--active { outline: var(--focus-width) solid var(--focus-ring); outline-offset: -2px; }
@media (hover: hover) { .opt:hover { background: var(--bg-subtle); } .opt[aria-selected="true"]:hover { background: var(--primary-subtle); } }
.opt__icon { display: inline-flex; width: 16px; flex: 0 0 auto; }
.opt__icon--unplug { color: var(--offline-solid); }
.opt__icon--critical { color: var(--critical-solid); }
.opt__icon--warning { color: var(--warning-solid); }
.opt__name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: var(--fs-body); font-weight: var(--fw-semibold); color: var(--text-strong); }
.opt__meta { flex: 0 0 auto; font-size: var(--fs-small); line-height: var(--lh-small); color: var(--text-secondary);
  white-space: nowrap; font-variant-numeric: tabular-nums; }
/* opt--wrap (always on a phone; wider, a row whose name the order words would cut): the name
   keeps the whole first line (it is what is picked), the words go under it, in line with it */
.opt--wrap { flex-wrap: wrap; row-gap: 0; }
.opt--wrap .opt__name { flex-basis: 0; }       /* never pushed to a line of its own; "..." only past the row's end */
.opt--wrap .opt__meta { order: 1; flex-basis: 100%; min-width: 0; padding-left: calc(16px + var(--space-3)); overflow: hidden;
  text-overflow: ellipsis; }
.opt__meta--due { color: var(--warning); }
.opt__meta--offline { color: var(--offline); }
.opt__tick { color: var(--primary-ink); }
.pop__foot { padding: var(--space-2) var(--space-4); border-top: 1px solid var(--border-subtle); font-size: var(--fs-small); color: var(--text-secondary); }
.pop__none { padding: var(--space-4); color: var(--text-secondary); font-size: var(--fs-body); }

/* =========================================================================================
   11. Sales (SPEC 4.2, 5.3, 5.5, 5.7; and the controls the Deliveries page shares with it)
   ========================================================================================= */

/* The toolbar: below 1024 px two rows, [periods | CSV] and [<] date [>] Today (on a phone the
   periods alone: no downloads there); from 1024 px one row: the periods, the stepper, Today, and
   the download at the right. */
.toolbar--sales { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "seg dl" "step step";
  align-items: center; gap: var(--space-2); }
.toolbar--sales .seg { grid-area: seg; display: grid; width: auto; }
.toolbar--sales .stepper { grid-area: step; }
.toolbar--sales .dl { grid-area: dl; }
@media (min-width: 1024px) {
  .toolbar--sales { display: flex; }
  .toolbar--sales .seg { display: inline-grid; width: max-content; }
  .toolbar--sales .dl { margin-left: auto; }
}
/* The date stepper (SPEC 5.11; Sales and the Tanks hour view): the label as wide as the
   period's longest one (an invisible copy of it in the same grid cell), so the arrows never
   move; 18 px on Sales from 768 px, 15 px otherwise. The arrows keep their 44 px and the label
   its words: where a row cannot hold them all (a phone below 360 px), "Today" goes to a line of
   its own. */
.stepper { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1); min-width: 0; }
.stepper > .btn { flex: none; }
.stepper__label { display: inline-grid; justify-items: center; align-items: center; min-width: 0; padding: 0 var(--space-1);
  font-size: var(--fs-body); line-height: var(--lh-body); font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums;
  white-space: nowrap; color: var(--text-strong); }
.stepper__label > span { grid-area: 1 / 1; }
.stepper__sizer { visibility: hidden; }
@media (min-width: 768px) {
  .toolbar--sales .stepper__label { font-size: var(--fs-title); line-height: var(--lh-title); letter-spacing: var(--track-title); }
}
.today-btn { margin-left: var(--space-1); color: var(--primary-ink); }
/* Download: "Download" with a chevron (the list of two) or "Download CSV" (one) from 1024 px;
   the icon and "CSV" below. Not on a phone (the owner, 2026-10-18): a spreadsheet is for a
   computer, and the room goes to the controls beside it. */
.dl { position: relative; flex: 0 0 auto; }
@media (max-width: 767.98px) { .dl { display: none; } }
.dl__short { display: none; }
@media (max-width: 1023.98px) {
  .dl__long, .dl__chev { display: none; }
  .dl__short { display: inline; }
}
.menu {
  position: absolute; right: 0; top: calc(100% + var(--space-2)); z-index: var(--z-dropdown); width: max-content;
  min-width: 240px; max-width: calc(100vw - 24px); padding: var(--space-1) 0; background: var(--bg-raised);
  border-radius: var(--radius-md); box-shadow: var(--shadow-overlay);
}
.menu__item { display: flex; align-items: center; min-height: 40px; padding: 0 var(--space-3); color: var(--text-strong);
  font-size: var(--fs-body); line-height: var(--lh-body); font-weight: var(--fw-semibold); text-decoration: none; white-space: nowrap; }
@media (max-width: 1023.98px), (pointer: coarse) { .menu__item { min-height: 44px; } }
a.menu__item:focus-visible { outline-offset: -2px; }
@media (hover: hover) { a.menu__item:hover { background: var(--bg-subtle); } }
/* the download list and the station switcher open with a short fade and a 4 px slide (SPEC
   5.13); with reduced motion --dur-base is .01ms, so they simply appear */
.menu, .pop { animation: pop-in var(--dur-base) var(--ease); }
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px); } }

/* The totals card: the headline, then the table; from 1280 px the headline is a 240 px column
   beside the table. As tall as its content: the chart takes what is left. */
.totals { position: relative; display: flex; flex-direction: column; gap: var(--space-3); }
@media (min-width: 768px) { .totals { gap: var(--space-4); } }
@media (min-width: 1280px) {
  .totals { display: grid; grid-template-columns: 240px auto; justify-content: start; align-items: start; column-gap: var(--space-6); }
}
.kpi { min-width: 0; }
.kpi__label, .kpi__context { font-size: var(--fs-small); line-height: var(--lh-small); color: var(--text-secondary); }
.kpi__value { font-size: var(--fs-hero); line-height: var(--lh-hero); font-weight: var(--fw-semibold); letter-spacing: var(--track-title);
  color: var(--text-strong); }
.kpi__unit { font-size: var(--fs-small); font-weight: var(--fw-regular); letter-spacing: 0; color: var(--text-secondary); }
@media (min-width: 768px) {
  .kpi__value { font-size: var(--fs-display); line-height: var(--lh-display); letter-spacing: var(--track-display); }
}
/* no readings in the period: the sentence takes the number's place */
.kpi--none .kpi__label { font-size: var(--fs-title); line-height: var(--lh-title); font-weight: var(--fw-semibold);
  letter-spacing: var(--track-title); color: var(--text-strong); }

/* The table: fixed column widths with 20 px between them, so they never drift apart (each
   width below is the column plus its 20 px); numbers right-aligned. A phone shows Product,
   Sold and Share; a tablet Average and Expected too; from 1024 px every column. */
.stable { align-self: flex-start; border-collapse: collapse; font-size: var(--fs-body); line-height: var(--lh-body);
  font-variant-numeric: tabular-nums; color: var(--text-strong); }
.stable th, .stable td { height: 40px; padding: 0 0 0 var(--space-5); text-align: right; white-space: nowrap;
  font-weight: var(--fw-regular); border-bottom: 1px solid var(--border-subtle); }
.stable thead th { height: 32px; font-size: var(--fs-small); line-height: var(--lh-small); font-weight: var(--fw-semibold);
  color: var(--text-secondary); border-bottom-color: var(--border-strong); }
.stable .c-prod { width: 160px; padding-left: 0; text-align: left; }
.stable .c-sold { width: 124px; }
.stable .c-share { width: 76px; }
.stable .c-avg { width: 124px; }
.stable .c-busy { width: 132px; text-align: left; }
.stable .c-del { width: 140px; }
.stable .c-exp { width: 148px; }
.stable tbody .c-prod, .stable tfoot th, .stable tfoot td { font-weight: var(--fw-semibold); }
.stable tfoot th, .stable tfoot td, .stable--one tbody tr:last-child > * { border-bottom: 0; }
.stable .key { margin-right: var(--space-2); }
.stable__name { display: inline-block; max-width: 128px; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
.stable__short { display: none; }
@media (max-width: 767.98px) {
  .stable { width: 100%; }
  .stable th, .stable td { height: 32px; }
  .stable thead th { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0);
    clip-path: inset(50%); border: 0; }
  .stable .c-prod { width: auto; }
  .stable .c-sold, .stable .c-share { width: auto; padding-left: var(--space-4); }
  .stable .c-avg, .stable .c-busy, .stable .c-del, .stable .c-exp, .stable tfoot { display: none; }
  .stable tbody tr:last-child > * { border-bottom: 0; }
  .stable__long { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); }
  .stable__short { display: inline; }
}
@media (min-width: 768px) and (max-width: 1023.98px) { .stable .c-busy, .stable .c-del { display: none; } }

/* Deliveries' toolbar (SPEC 4.4, 5.12): the filter's summary button (it opens the filter row),
   the count and total from 768 px (a phone has them as the list card's first line), Download
   CSV at the right ("CSV" with the icon on a phone). */
.toolbar__count { min-width: 0; font-size: var(--fs-small); line-height: var(--lh-small); color: var(--text-secondary);
  font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Alerts' counts may take a second line, broken only between whole parts (two lines fit the row) */
.toolbar__count--wrap { white-space: normal; }
.toolbar--deliv { gap: var(--space-2) var(--space-4); }
.toolbar--deliv .dl { margin-left: auto; }
.filter-btn { flex: 1 1 auto; min-width: 0; justify-content: flex-start; }
.filter-btn__text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.filter-btn__chev { margin-left: auto; transition: transform var(--dur-fast) var(--ease); }
.filter-btn[aria-expanded="true"] .filter-btn__chev { transform: rotate(180deg); }
@media (max-width: 767.98px) { .toolbar--deliv .toolbar__count { display: none; } }
@media (min-width: 768px) {
  .filter-btn { flex: 0 1 auto; max-width: 440px; }
  .toolbar--deliv .dl__long { display: inline; }
  .toolbar--deliv .dl__short { display: none; }
}

/* The filter row: the quick ranges, From and To side by side, the Product under them on a phone;
   from 768 px the three fields in one row under the ranges, from 1024 px all in one row. */
.filters { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "seg seg" "from to" "product product";
  align-items: end; gap: var(--space-2) var(--space-3); min-width: 0; }
.filters .seg { grid-area: seg; }
.field--from { grid-area: from; }
.field--to { grid-area: to; }
.field--product { grid-area: product; }
@media (min-width: 768px) {
  .filters { grid-template-columns: 180px 180px 260px; grid-template-areas: "seg seg seg" "from to product"; justify-content: start; }
  .filters .seg { justify-self: start; }
}
@media (min-width: 1024px) {
  .filters { grid-template-columns: auto 180px 180px 260px; grid-template-areas: "seg from to product"; column-gap: var(--space-4); }
}
.field { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
.field__label { display: flex; flex-wrap: wrap; align-items: center; column-gap: var(--space-1); font-size: var(--fs-small);
  line-height: var(--lh-small); font-weight: var(--fw-semibold); color: var(--text-secondary); }
.field__label > .icon { display: none; }
/* a date the page could not use: the label line says why ("From . before 2000"), in the critical
   ink with the warning icon (the input's red border alone would be colour alone) */
.field--refused .field__label { color: var(--critical); }
.field--refused .field__label > .icon { display: block; color: var(--critical-solid); }
.field__input { height: var(--control-h); padding: 0 var(--space-2); border: 1px solid var(--border-control); border-radius: var(--radius-sm);
  background: var(--bg-surface); color: var(--text-strong); font-size: var(--fs-body); min-width: 0; }
.filters .field__input { width: 100%; }
.field__input:focus-visible { outline-offset: 0; }
/* a date the page could not use (before 2000, half typed): kept as typed, its border says so too */
.field__input[aria-invalid="true"] { border-color: var(--critical-solid); box-shadow: var(--shadow-invalid); }
@media (max-width: 767.98px) {
  .field__input { font-size: 16px; width: 100%; }
}

/* Print (SPEC 7.9): the page as it is on screen, in the light colours (section 1), without the
   controls that only work on a screen: Refresh now, the page links and tabs, the
   pagers, the filter row, the downloads, the steppers' arrows. */
/* =========================================================================================
   12. Sign in (static/login.html) and Sign out (the top bar's last button)
   ========================================================================================= */

.signout { display: flex; flex: 0 0 auto; margin: 0; }
/* a phone's top bar has no room for Sign out: it is on the Settings page there */
@media (max-width: 767.98px) { .signout { display: none; } }
.login-page { min-height: 100vh; min-height: 100dvh; display: flex; }
.login { flex: 1 1 auto; display: flex; align-items: center; justify-content: center;
  padding: var(--space-5) 16px; }
.login__card {
  width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: var(--space-2);
  padding: var(--space-5); background: var(--bg-surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card); border-top: var(--stripe-h) solid var(--primary);
}
.login__brand { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-2); }
.login__title { font-weight: var(--fw-semibold); color: var(--text-secondary); }
.login__heading { font-size: var(--fs-title); line-height: var(--lh-title); margin-bottom: var(--space-1); }
.login__error { padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm);
  background: var(--critical-bg); color: var(--critical); font-weight: var(--fw-semibold); }
.login__label { margin-top: var(--space-2); font-weight: var(--fw-semibold); color: var(--text-secondary); }
.login__input {
  min-height: var(--control-h); padding: 0 var(--space-3); border: 1px solid var(--border-control);
  border-radius: var(--radius-sm); background: var(--bg-surface); color: var(--text-strong);
}
.login__button {
  margin-top: var(--space-4); min-height: var(--control-h); border: 0; border-radius: var(--radius-sm);
  background: var(--primary); color: var(--on-primary); font-weight: var(--fw-semibold);
  transition: filter var(--dur-fast) var(--ease);
}
@media (hover: hover) { .login__button:hover { filter: brightness(1.06); } }

@media print {
  body { background: transparent; }
  .skip-link, .refresh, .signout, .topnav, .tabbar, .pager, .dl, .filters, .filter-btn__chev, .stepper .btn, .today-btn,
  .back-btn, .station .icon { display: none !important; }
  .card, .tile { box-shadow: none; border: 1px solid var(--border-subtle); }
}
