/* ==========================================================================
   gps.dallaswx.com - truck GPS log viewer
   static/style.css   (the ONLY stylesheet; templates/index.html links it)

   Design brief, in one line: 66.8% of engine-on time is the truck going
   nowhere, so "stalled time" has to be the loudest thing on the page.

   THREE VISUAL LANGUAGES, never mixed:
     drive : solid accent (blue), the only saturated flat fill
     idle  : amber DIAGONAL STRIPES, engine on and going nowhere
     park  : ghosted, dashed, engine off (no rows exist at all)

   HOOKS THE MARKUP / JS IS EXPECTED TO USE
     .tl-block               one /api/day/blocks entry, a DIRECT child of
                             .timeline (no <li> wrapper: the wrapper would
                             become the flex item and the block height would
                             stop driving the row). Add .is-drive, .is-idle or
                             .is-park. Set the custom property --dur-min
                             (unitless minutes) and the height is computed
                             here. Height is min-height, never height, so
                             content can never be sliced: the .tl-flag
                             "WAITING" badge used to be clipped out of
                             existence on exactly the blocks that set
                             is_wait. Add .is-compact when
                             --dur-min * scale lands under the full-content
                             height (about 92px) to drop the meta row.
     .split-seg              set inline width, or the --pct custom property.
                             Zero-duration segments must be skipped by the JS,
                             not rendered at 0%.
     --speed-1 .. --speed-5  read these from JS for the Leaflet band layers:
                             getComputedStyle(document.documentElement)
                               .getPropertyValue('--speed-3').trim()
                             Bands are 0-15 / 15-35 / 35-50 / 50-65 / 65+ mph,
                             chosen against the measured moving percentiles
                             (p10 8.5, p50 54.2, p75 65.9, p90 69.1, max 71.7)
                             so real driving spreads across bands 2 to 5
                             instead of flooding one colour.

   Theme: dark is the default palette on :root, the complete light palette is
   redefined under prefers-color-scheme: light. Both are also reachable
   explicitly via [data-theme="dark"] / [data-theme="light"] on <html> so a
   toggle can win over the OS setting in either direction.

   OSM tile policy: the attribution control is styled for legibility, never
   hidden, never shrunk out of readability. Only the tile pane is inverted in
   dark mode, so the route, markers and attribution keep their true colours.
   ========================================================================== */

/* ==========================================================================
   1. Tokens
   ========================================================================== */

:root {
  color-scheme: dark;

  /* surfaces */
  --bg:           #0d1219;
  --bg-grad:      radial-gradient(1200px 600px at 15% -10%, #16202c 0%, #0d1219 60%);
  --panel:        #131b25;
  --panel-2:      #18222e;
  --panel-3:      #1e2937;
  --line:         #27343f;
  --line-soft:    #1d2733;
  --overlay:      rgba(6, 10, 15, 0.72);

  /* ink */
  --text:         #e8eef6;
  --text-dim:     #a3b3c6;
  --text-faint:   #7e91a8;   /* 5.4:1 on --panel; #6f8299 measured 4.41:1 */
  --text-invert:  #0d1219;

  /* brand / drive */
  --accent:       #3ea6ff;
  --accent-2:     #6fc2ff;
  --accent-deep:  #1b6fc4;
  --accent-soft:  rgba(62, 166, 255, 0.16);
  --accent-line:  rgba(62, 166, 255, 0.42);

  /* idle: the signature colour of this site */
  --idle:         #f5a524;
  --idle-2:       #ffc25c;
  --idle-deep:    #a9690a;
  --idle-ink:     #ffd79a;
  --idle-bg:      #2a2011;
  --idle-stripe:  rgba(245, 165, 36, 0.30);
  --idle-soft:    rgba(245, 165, 36, 0.14);
  --idle-line:    rgba(245, 165, 36, 0.55);

  /* park: engine off, deliberately quiet */
  --park:         #56697f;
  --park-bg:      #121922;
  --park-line:    #2a3746;
  --park-ink:     #8093a8;

  /* status */
  --good:         #35c98a;
  --warn:         #f5a524;
  --bad:          #ff5d5d;

  /* speed ramp, cool to hot, avoids amber so it never reads as idle */
  --speed-1:      #35b7a4;   /*  0 - 15 mph  crawl / parking lot */
  --speed-2:      #3d9bf0;   /* 15 - 35 mph  surface street */
  --speed-3:      #6f7cf5;   /* 35 - 50 mph  arterial */
  --speed-4:      #a95ff0;   /* 50 - 65 mph  the p50 to p75 band */
  --speed-5:      #f2487f;   /* 65+   mph    freeway, p90 and up */

  /* elevation: a terrain sage, kept off the speed ramp, the accent and amber,
     so the elevation profile never reads as speed, driving or a sit */
  --elev:         #9cc47e;
  --elev-line:    rgba(156, 196, 126, 0.45);

  /* map
     F7. The old filter left saturation at 0.68, which turned inverted land
     brown and every park and airfield into a green blob. Judged side by side
     on #/day/2026-09-15 at the fit zoom (z11, 848 px map, idle pins and speed
     bands showing): this one reads as neutral charcoal and keeps the ocean a
     shade apart from the land. The flatter candidate, grayscale(0.85)
     invert(1) brightness(0.78) contrast(1.15) sepia(0.25) hue-rotate(175deg),
     merged coast and sea into one dark slab and muted the road labels. */
  --tile-filter:  invert(1) hue-rotate(180deg) brightness(0.82) contrast(0.95) saturate(0.22);
  --attr-bg:      rgba(13, 18, 25, 0.86);
  --attr-ink:     #b9c7d8;
  /* Route casing sits under every route, once per route (F8). Dark mode: the
     page background at 55%, so a line reads against the inverted tiles. */
  --route-casing: rgba(13, 18, 25, 0.55);
  /* Direction arrows and the marching-ants overlay on a hovered route: light
     ink on a dark edge reads on all five speed bands and on the single-colour
     overview routes. Never amber: amber means a sit. */
  --arrow-ink:    #ffffff;
  --arrow-edge:   rgba(8, 12, 18, 0.88);
  --route-ants:   rgba(255, 255, 255, 0.92);

  /* places (plan phase 5)
     A manual label is --text, the page's strongest ink, because a name the
     user typed is the best thing known about a stop. A reverse-geocoded
     address is a guess from OpenStreetMap, so it reads one step quieter, and
     bare coordinates quieter still. Never amber, never accent: a place name is
     not a measurement. --scrim dims the page behind the naming dialog. */
  --place-geo:    #9fb2c8;
  --place-coord:  #7e91a8;
  --scrim:        rgba(4, 8, 13, 0.66);

  /* shape and depth */
  --r-sm: 7px;
  --r-md: 11px;
  --r-lg: 16px;
  --r-pill: 999px;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.45);
  --shadow-2: 0 10px 28px rgba(0, 0, 0, 0.45);
  --shadow-3: 0 18px 50px rgba(0, 0, 0, 0.55);
  --ring: 0 0 0 3px rgba(62, 166, 255, 0.38);

  /* timeline geometry
     --tl-scale was 1.25 px/min against a 38px floor, which meant nothing
     under 30.4 minutes left the floor: a 14.9 min idle, a 10.4 min idle and
     a 25.3 min park all measured 38px and were indistinguishable.
     --tl-scale-idle is deliberately higher than --tl-scale so that an
     engine-on sit escapes the floor at 74/8 = 9.3 minutes rather than at
     74/3.2 = 23 minutes. That is the difference between the target case (a
     ~15 minute sit at a job site) reading as "long" or reading as "same as
     every other stop". Idle outranking drive for vertical weight is the
     whole point of the product, not an accident. */
  --tl-scale: 3.2;         /* px per minute, drive blocks */
  --tl-scale-idle: 8;      /* px per minute, engine-on idle */
  --tl-scale-park: 3.0;    /* engine off, but capped hard: see --tl-max-park */
  --tl-min: 74px;          /* floor: full block content fits without clipping */
  /* An engine-off gap can be 13 hours. The cap keeps it below the height of
     the 14.9 minute target idle (119px), so a long park can never out-shout
     a sit, while a 25 minute park still reads taller than a 20 second one. */
  --tl-max-park: 118px;
  --tl-gutter: 68px;

  /* type */
  --font: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", ui-monospace, "Cascadia Mono",
          Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;

    --bg:           #eef2f7;
    --bg-grad:      radial-gradient(1100px 560px at 12% -12%, #ffffff 0%, #eef2f7 62%);
    --panel:        #ffffff;
    --panel-2:      #f7f9fc;
    --panel-3:      #eef2f8;
    --line:         #d8e0ea;
    --line-soft:    #e7edf4;
    --overlay:      rgba(255, 255, 255, 0.78);

    --text:         #0f1720;
    --text-dim:     #4c5c70;
    --text-faint:   #7a8a9d;
    --text-invert:  #ffffff;

    --accent:       #0b6fd4;
    --accent-2:     #2f8ef0;
    --accent-deep:  #08529e;
    --accent-soft:  rgba(11, 111, 212, 0.12);
    --accent-line:  rgba(11, 111, 212, 0.34);

    --idle:         #c9720a;
    --idle-2:       #9a5504;   /* text weight: 5.9:1 on --idle-bg; #e89413 was 2.2:1 */
    --idle-deep:    #8a4f05;
    --idle-ink:     #7a4703;
    --idle-bg:      #fff4e0;
    --idle-stripe:  rgba(201, 114, 10, 0.26);
    --idle-soft:    rgba(201, 114, 10, 0.10);
    --idle-line:    rgba(201, 114, 10, 0.55);

    --park:         #8496a9;
    --park-bg:      #f2f5f9;
    --park-line:    #d6dde6;
    --park-ink:     #66798d;

    --good:         #11875c;
    --warn:         #b26a05;
    --bad:          #c92a2a;

    --speed-1:      #0f8b7b;
    --speed-2:      #1a6fd0;
    --speed-3:      #4a55d6;
    --speed-4:      #8a2fd2;
    --speed-5:      #d11054;
    --elev:         #4a7a2c;
    --elev-line:    rgba(74, 122, 44, 0.45);

    --tile-filter:  none;
    --attr-bg:      rgba(255, 255, 255, 0.90);
    --attr-ink:     #33414f;
    /* Light casing is a white halo, judged on screen over the I-5 / I-8
       interchange at z14: it cuts the blue line cleanly out of OSM's pink and
       orange roads. A dark casing (--bg ink at 55%) separated too, but it
       turned the 0.85-opacity accent line itself muddy navy. */
    --route-casing: rgba(255, 255, 255, 0.90);
    --arrow-ink:    #ffffff;
    --arrow-edge:   rgba(15, 23, 32, 0.90);
    --route-ants:   rgba(255, 255, 255, 0.95);

    --place-geo:    #55667c;   /* 6.0:1 on --panel, one step under --text */
    --place-coord:  #5f6e80;  /* 5.2:1 on --panel: the quietest of the three, still AA */
    --scrim:        rgba(20, 32, 48, 0.42);

    --shadow-1: 0 1px 2px rgba(16, 32, 52, 0.10);
    --shadow-2: 0 10px 26px rgba(16, 32, 52, 0.12);
    --shadow-3: 0 18px 44px rgba(16, 32, 52, 0.16);
    --ring: 0 0 0 3px rgba(11, 111, 212, 0.30);
  }
}

/* Explicit light, wins over a dark OS preference. */
:root[data-theme="light"] {
  color-scheme: light;

  --bg:           #eef2f7;
  --bg-grad:      radial-gradient(1100px 560px at 12% -12%, #ffffff 0%, #eef2f7 62%);
  --panel:        #ffffff;
  --panel-2:      #f7f9fc;
  --panel-3:      #eef2f8;
  --line:         #d8e0ea;
  --line-soft:    #e7edf4;
  --overlay:      rgba(255, 255, 255, 0.78);

  --text:         #0f1720;
  --text-dim:     #4c5c70;
  --text-faint:   #7a8a9d;
  --text-invert:  #ffffff;

  --accent:       #0b6fd4;
  --accent-2:     #2f8ef0;
  --accent-deep:  #08529e;
  --accent-soft:  rgba(11, 111, 212, 0.12);
  --accent-line:  rgba(11, 111, 212, 0.34);

  --idle:         #c9720a;
  --idle-2:       #9a5504;   /* text weight: 5.9:1 on --idle-bg; #e89413 was 2.2:1 */
  --idle-deep:    #8a4f05;
  --idle-ink:     #7a4703;
  --idle-bg:      #fff4e0;
  --idle-stripe:  rgba(201, 114, 10, 0.26);
  --idle-soft:    rgba(201, 114, 10, 0.10);
  --idle-line:    rgba(201, 114, 10, 0.55);

  --park:         #8496a9;
  --park-bg:      #f2f5f9;
  --park-line:    #d6dde6;
  --park-ink:     #66798d;

  --good:         #11875c;
  --warn:         #b26a05;
  --bad:          #c92a2a;

  --speed-1:      #0f8b7b;
  --speed-2:      #1a6fd0;
  --speed-3:      #4a55d6;
  --speed-4:      #8a2fd2;
  --speed-5:      #d11054;
  --elev:         #4a7a2c;
  --elev-line:    rgba(74, 122, 44, 0.45);

  --tile-filter:  none;
  --attr-bg:      rgba(255, 255, 255, 0.90);
  --attr-ink:     #33414f;
  --route-casing: rgba(255, 255, 255, 0.90);
  --arrow-ink:    #ffffff;
  --arrow-edge:   rgba(15, 23, 32, 0.90);
  --route-ants:   rgba(255, 255, 255, 0.95);

  --place-geo:    #55667c;
  --place-coord:  #5f6e80;  /* 5.2:1 on --panel: the quietest of the three, still AA */
  --scrim:        rgba(20, 32, 48, 0.42);

  --shadow-1: 0 1px 2px rgba(16, 32, 52, 0.10);
  --shadow-2: 0 10px 26px rgba(16, 32, 52, 0.12);
  --shadow-3: 0 18px 44px rgba(16, 32, 52, 0.16);
  --ring: 0 0 0 3px rgba(11, 111, 212, 0.30);
}

/* Explicit dark, wins over a light OS preference (tokens already on :root). */
:root[data-theme="dark"] { color-scheme: dark; }

/* ==========================================================================
   2. Base
   ========================================================================== */

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

/* F10. Inter was named in --font but never loaded, so Windows drew Segoe UI
   and the tabular numbers the tables ask for did not line up. Self-hosted
   variable Inter, latin subset (48 KB, SIL OFL, licence in fonts/OFL.txt):
   one origin, no Google Fonts request, works on the LAN with no internet.
   templates/index.html preloads the same URL. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/inter-latin-wght-normal.woff2") format("woff2");
}

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
p { margin: 0 0 8px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* An OUTER box-shadow ring is clipped away by any ancestor with
   overflow:hidden (.panel, .map-panel), so those two get an inset ring
   instead, and forced-colors gets a real outline since box-shadow is
   dropped there. border-radius:inherit stops the ring reshaping pills. */
:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: inherit;
}
.day-card:focus-visible,
.tl-block:focus-visible,
.leaflet-container:focus-visible {
  box-shadow: inset 0 0 0 3px var(--accent-line);
}
/* Leaflet makes a marker's icon element the focus target. A folded pill's
   icon has no size (iconSize null), so the ring above drew a 6 px dot at its
   centre under the pill. Ring the visible pin instead, in accent, never amber:
   amber means a sit. The outline clears a single pin's idle halo too. */
.leaflet-marker-icon:focus-visible { box-shadow: none; }
.leaflet-marker-icon:focus-visible .pin { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (forced-colors: active) {
  :focus-visible { outline: 2px solid Highlight; outline-offset: 2px; }
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 2000;
  padding: 10px 14px; background: var(--panel); border: 1px solid var(--accent);
  border-radius: var(--r-sm); color: var(--text);
}
.skip-link:focus { left: 8px; top: 8px; }

::selection { background: var(--accent-soft); }

.num, .tabular { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); }
.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;
}

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--line);
  border: 3px solid transparent;
  background-clip: content-box;
  border-radius: var(--r-pill);
}
*::-webkit-scrollbar-thumb:hover { background: var(--park); background-clip: content-box; }

/* ==========================================================================
   3. Shell and top bar
   ========================================================================== */

.app {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  max-width: 1680px;
  margin: 0 auto;
  padding: 0 18px 22px;
}

.topbar {
  position: sticky;
  top: 0;
  /* above Leaflet's own .leaflet-top/.leaflet-bottom { z-index: 1000 }, or the
     +/- zoom buttons scroll over the sticky header */
  z-index: 1100;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  row-gap: 8px;
  gap: 14px;
  padding: 12px 2px;
  margin-bottom: 14px;
  background: linear-gradient(to bottom, var(--bg) 62%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
}

.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }

.brand-mark {
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center;
  border-radius: 10px;
  background: linear-gradient(150deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: #fff;
  font-size: 16px; font-weight: 800; letter-spacing: -0.03em;
  box-shadow: var(--shadow-1), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.brand-name {
  font-size: 16px; font-weight: 700; letter-spacing: -0.02em;
  white-space: nowrap;
}
.brand-name b { color: var(--accent); font-weight: 700; }
.brand-sub {
  font-size: 11.5px; color: var(--text-faint);
  white-space: nowrap; letter-spacing: 0.02em;
}

.topbar-spacer { flex: 1 1 auto; }
/* Pill, theme and Upload wrap together. margin-left:auto keeps the group
   right-aligned when it wraps onto a row the spacer is not on (721 to about
   1000 px); on one row the spacer has already taken the free space. */
.topbar-actions {
  display: flex; align-items: center; gap: 14px;
  flex: 0 1 auto; min-width: 0;
  margin-left: auto;
}

.status-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 11px 5px 9px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--panel);
  color: var(--text-dim);
  font-size: 12px;
  white-space: nowrap;
  box-shadow: var(--shadow-1);
}
.status-pill .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 22%, transparent);
}
.status-pill.is-stale .dot { background: var(--warn); box-shadow: 0 0 0 3px var(--idle-soft); }
.status-pill.is-down .dot { background: var(--bad); box-shadow: 0 0 0 3px rgba(255, 93, 93, 0.22); }
.status-pill b { color: var(--text); font-weight: 600; }
/* The long sentence on a desktop, the upload age alone on a phone (F12). */
.status-short { display: none; }

/* Inline SVG icons in buttons: stroke only, in the button's own ink. */
.ico {
  display: block; flex: none;
  width: 16px; height: 16px;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}

/* F11. The icon shows the theme a click switches TO, picked by the same
   selectors that pick the palette, so it is right before app.js runs. */
.theme-toggle .ico-moon { display: none; }
:root[data-theme="light"] .theme-toggle .ico-sun { display: none; }
:root[data-theme="light"] .theme-toggle .ico-moon { display: block; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .theme-toggle .ico-sun { display: none; }
  :root:not([data-theme="dark"]) .theme-toggle .ico-moon { display: block; }
}

/* ==========================================================================
   4. Controls
   ========================================================================== */

.btn {
  appearance: none;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--panel-2);
  color: var(--text);
  font: inherit; font-size: 13px; font-weight: 550;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, transform 80ms ease;
}
.btn:hover { background: var(--panel-3); border-color: var(--accent-line); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  border-color: var(--accent-deep);
  color: #fff;
}
.btn-primary:hover { filter: brightness(1.06); border-color: var(--accent-deep); }

.btn-ghost { background: transparent; border-color: transparent; color: var(--text-dim); }
.btn-ghost:hover { background: var(--panel-2); color: var(--text); }

.btn-icon { padding: 7px; width: 32px; height: 32px; justify-content: center; }

/* Plan 3c. The GPX export control, in a panel head beside the badges. While
   the fetch is in flight it is aria-busy, not disabled: a disabled button
   loses focus mid-download. pointer-events:none stops a second click; the JS
   checks aria-busy as well, for a click driven from script. */
.head-actions { gap: 8px; justify-content: flex-end; }
.gpx-btn { padding: 5px 10px; font-size: 12.5px; }
.gpx-btn .ico { width: 14px; height: 14px; }
.btn.is-busy { opacity: 0.55; cursor: progress; pointer-events: none; }
.btn.is-busy .ico { animation: gpx-busy 0.9s ease-in-out infinite; }
@keyframes gpx-busy { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }

.seg {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--panel);
}
.seg-btn {
  appearance: none; border: 0; background: transparent;
  color: var(--text-dim);
  font: inherit; font-size: 12.5px; font-weight: 550;
  padding: 5px 11px;
  border-radius: 5px;
  cursor: pointer;
  white-space: nowrap;
}
.seg-btn:hover { color: var(--text); background: var(--panel-3); }
.seg-btn.is-active {
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent-line);
}

.field {
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--text-dim); font-size: 12.5px;
}
input[type="date"], input[type="number"], input[type="text"], select {
  font: inherit; font-size: 13px;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 6px 9px;
}
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(var(--cal-invert, 1)); opacity: 0.6; cursor: pointer; }
:root[data-theme="light"] input[type="date"]::-webkit-calendar-picker-indicator { --cal-invert: 0; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) input[type="date"]::-webkit-calendar-picker-indicator { --cal-invert: 0; }
}

.toolbar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  margin-bottom: 14px;
}
/* F12. From, To and Apply. Inline on a desktop, where the disclosure button
   is not needed; behind "Custom range" under 720 px (section 14). */
.range-toggle { display: none; }
.range-toggle .ico { width: 12px; height: 12px; transition: transform 120ms ease; }
.range-toggle[aria-expanded="true"] .ico { transform: rotate(180deg); }
.range-custom { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 10px; }

/* ==========================================================================
   5. Layout and panels
   ========================================================================== */

.layout {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: minmax(360px, 30%) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.col-left { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.col-right { display: flex; flex-direction: column; gap: 16px; min-width: 0; position: sticky; top: 74px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line-soft);
}
.panel-title {
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--text-faint);
}
.panel-head .spacer { flex: 1 1 auto; }
.panel-body { padding: 14px 16px 16px; }
.panel-body.flush { padding: 0; }
.panel-note { color: var(--text-faint); font-size: 12px; margin-top: 8px; }

/* ==========================================================================
   6. Stats
   ========================================================================== */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 10px;
}

.stat {
  padding: 11px 12px 12px;
  background: var(--panel-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  min-width: 0;
}
.stat-label {
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-faint);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.stat-value {
  margin-top: 4px;
  font-size: 24px; font-weight: 700; letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  color: var(--text);
}
.stat-unit { font-size: 12.5px; font-weight: 600; color: var(--text-faint); margin-left: 3px; }
.stat-sub { margin-top: 3px; font-size: 11.5px; color: var(--text-faint); }

.stat.is-drive { border-color: var(--accent-line); }
.stat.is-drive .stat-value { color: var(--accent); }
.stat.is-elev { border-color: var(--elev-line); }
.stat.is-elev .stat-value { color: var(--elev); }

/* the headline number of this whole product: engine on, going nowhere */
.stat.is-idle {
  border-color: var(--idle-line);
  background:
    repeating-linear-gradient(135deg,
      transparent 0 9px,
      var(--idle-soft) 9px 18px),
    var(--panel-2);
}
.stat.is-idle .stat-value { color: var(--idle-2); }
.stat.is-idle .stat-label { color: var(--idle-ink); }

.stat.is-park .stat-value { color: var(--park-ink); }

/* ==========================================================================
   7. Driving vs idle split bar
   ========================================================================== */

.split-wrap { margin: 4px 0 2px; }

.split-bar {
  display: flex;
  width: 100%;
  height: 16px;
  border-radius: var(--r-pill);
  overflow: hidden;
  background: var(--line-soft);
  box-shadow: inset 0 0 0 1px var(--line);
}

/* min-width:0, not 3px. A 3px floor drew an amber stripe on a pure-driving
   day, a false positive on this site's headline metric, and the floors also
   pushed the row past 100% so the last segment was clipped. The JS skips
   zero-duration segments entirely. */
.split-seg {
  flex: 0 0 auto;
  width: var(--pct, 0%);
  min-width: 0;
  height: 100%;
  transition: width 320ms cubic-bezier(0.22, 0.61, 0.36, 1);
}
.split-seg.is-drive {
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
}
.split-seg.is-idle {
  background:
    repeating-linear-gradient(135deg,
      var(--idle) 0 6px,
      var(--idle-deep) 6px 12px);
}
.split-seg.is-off {
  background: var(--park-bg);
  box-shadow: inset 0 0 0 1px var(--park-line);
}

.split-legend {
  display: flex; flex-wrap: wrap; gap: 14px;
  margin-top: 9px;
  font-size: 12px; color: var(--text-dim);
}
.split-key { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.split-key b { color: var(--text); font-weight: 650; font-variant-numeric: tabular-nums; }
.key-swatch {
  width: 12px; height: 12px; border-radius: 3px; flex: none;
  background: var(--accent);
}
.key-swatch.is-idle {
  background: repeating-linear-gradient(135deg, var(--idle) 0 4px, var(--idle-deep) 4px 8px);
}
.key-swatch.is-off { background: var(--park-bg); box-shadow: inset 0 0 0 1px var(--park-line); }
/* Power on with the truck parked: slate, solid, so it reads as time that
   happened (the board was on) without ever reading as amber idling. */
.split-seg.is-power, .key-swatch.is-power { background: var(--park); }

/* ==========================================================================
   8. The timeline (signature element)
   ========================================================================== */

.timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 14px 16px 16px 16px;
}

/* If a caller ever wraps blocks in <li>, the <li> becomes the flex item and
   the block height stops driving the row. display:contents hands the layout
   box straight back to .tl-block. */
.timeline > li { display: contents; }

/* continuous rail behind the blocks, so the day reads as one strip */
.timeline::before {
  content: "";
  position: absolute;
  left: calc(16px + var(--tl-gutter) + 1px);
  top: 10px; bottom: 12px;
  width: 2px;
  background: linear-gradient(to bottom, transparent, var(--line) 12%, var(--line) 88%, transparent);
  pointer-events: none;
}

.tl-block {
  position: relative;
  display: grid;
  grid-template-columns: var(--tl-gutter) minmax(0, 1fr);
  align-items: stretch;
  /* Proportional to duration, floored so a 2 minute block stays clickable.
     min-height, NEVER height: a hard height plus overflow:hidden sliced the
     time column and clipped the .tl-flag "WAITING" badge out of existence on
     exactly the blocks that set is_wait. With min-height the duration drives
     long blocks and content sets the floor for short ones, so nothing clips. */
  height: auto;
  min-height: max(var(--tl-min), calc(var(--dur-min, 4) * var(--tl-scale) * 1px));
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--panel-2);
  color: inherit;
  text-align: left;
  font: inherit;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  transition: transform 110ms ease, box-shadow 140ms ease, border-color 140ms ease;
}
/* a drive leg with a resolved trip_id is an <a>, so kill the link underline */
a.tl-block, a.tl-block:hover { text-decoration: none; color: inherit; }
.tl-block:hover { transform: translateX(2px); box-shadow: var(--shadow-2); }
.tl-block:focus-visible { box-shadow: var(--ring); }
.tl-block.is-selected { border-color: var(--accent); box-shadow: var(--ring); }
/* the drive legs of the trip whose route is lit on the map (plan 1c). Accent,
   never amber, and never the full selection ring, so hover and selection stay
   distinguishable when both apply. */
.tl-block.is-hover,
.tl-block.is-drive.is-hover {     /* .is-drive below sets border-color at equal specificity */
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent), var(--shadow-2);
  transform: translateX(2px);
}
/* Focusing a drive leg lights its whole trip, so every leg of it gets
   .is-hover at once. The rule above outranks .tl-block:focus-visible, which
   left a keyboard user unable to tell which leg holds focus: keep the ring. */
.tl-block.is-hover:focus-visible,
.tl-block.is-drive.is-hover:focus-visible {
  box-shadow: var(--ring), var(--shadow-2);
}

.tl-time {
  display: flex; flex-direction: column; gap: 2px;
  padding: 8px 12px 8px 2px;
  align-items: flex-end;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: var(--text-dim);
  border-right: 1px solid var(--line-soft);
  white-space: nowrap;
}
.tl-start { font-weight: 650; color: var(--text); letter-spacing: -0.01em; }
.tl-end { font-size: 11px; color: var(--text-faint); }
.tl-dur {
  margin-top: auto;
  font-size: 11px; font-weight: 650;
  color: var(--text-faint);
}

.tl-body {
  position: relative;
  display: flex; flex-direction: column; gap: 4px;
  padding: 8px 12px 8px 13px;
  min-width: 0;
  overflow: hidden;
}
/* the kind bar: 4px of colour that identifies the block at a glance */
.tl-body::before {
  content: "";
  position: absolute; left: 0; top: 6px; bottom: 6px;
  width: 4px; border-radius: var(--r-pill);
  background: var(--park-line);
}

.tl-kind {
  font-size: 10.5px; font-weight: 750;
  letter-spacing: 0.11em; text-transform: uppercase;
  color: var(--text-faint);
}
.tl-headline {
  font-size: 14px; font-weight: 650; letter-spacing: -0.015em;
  color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tl-headline .unit { font-size: 12px; font-weight: 600; color: var(--text-faint); margin-left: 2px; }
.tl-meta {
  display: flex; flex-wrap: wrap; gap: 6px;
  font-size: 11.5px; color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.tl-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--panel-3);
  border: 1px solid var(--line-soft);
  color: var(--text-dim);
  white-space: nowrap;
}
.tl-chip .sw { width: 8px; height: 8px; border-radius: 2px; flex: none; }

/* headline and the WAITING flag share a row, so a compact idle block keeps
   both without growing. The flag is NEVER hidden by .is-compact. */
.tl-head-row {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 8px; min-width: 0;
}
.tl-head-row .tl-headline { flex: 0 1 auto; }

/* short blocks: drop the meta row so the headline never collides */
.tl-block.is-compact .tl-meta,
.tl-block.is-compact .tl-end,
.tl-block.is-compact .tl-kind { display: none; }
.tl-block.is-compact .tl-body { justify-content: center; gap: 0; }
.tl-block.is-compact .tl-time { justify-content: center; }
.tl-block.is-compact .tl-dur { margin-top: 0; }

/* ---- drive: solid accent, the only flat saturated fill ------------------- */
.tl-block.is-drive {
  background:
    linear-gradient(100deg, var(--accent-soft) 0%, transparent 62%),
    var(--panel-2);
  border-color: var(--accent-line);
}
.tl-block.is-drive .tl-body::before {
  background: linear-gradient(to bottom, var(--accent-2), var(--accent));
}
.tl-block.is-drive .tl-kind { color: var(--accent); }
.tl-block.is-drive:hover { border-color: var(--accent); }

/* ---- idle: amber, striped, impossible to scroll past --------------------- */
.tl-block.is-idle {
  /* the loudest thing on the page, and the fastest-growing: see
     --tl-scale-idle in section 1 */
  min-height: max(var(--tl-min), calc(var(--dur-min, 4) * var(--tl-scale-idle) * 1px));
  background:
    repeating-linear-gradient(135deg,
      var(--idle-stripe) 0 8px,
      transparent 8px 18px),
    var(--idle-bg);
  border-color: var(--idle-line);
  background-position: 0 0;
}
.tl-block.is-idle .tl-body::before {
  background: linear-gradient(to bottom, var(--idle-2), var(--idle));
  width: 5px;
  box-shadow: 0 0 10px var(--idle-soft);
}
.tl-block.is-idle .tl-kind { color: var(--idle-2); letter-spacing: 0.13em; }
.tl-block.is-idle .tl-headline { color: var(--idle-ink); }
.tl-block.is-idle .tl-time { color: var(--idle-ink); border-right-color: var(--idle-line); }
.tl-block.is-idle .tl-start { color: var(--idle-2); }
.tl-block.is-idle .tl-chip {
  background: var(--idle-soft);
  border-color: var(--idle-line);
  color: var(--idle-ink);
}
.tl-block.is-idle:hover {
  border-color: var(--idle-2);
  animation: tl-stripe-drift 2.4s linear infinite;
}
@keyframes tl-stripe-drift { to { background-position: 51px 0; } }

/* a long sit (is_wait from the API) gets a loud label of its own */
.tl-flag {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 9px;
  border-radius: var(--r-pill);
  background: var(--idle);
  color: #1a1204;
  font-size: 10.5px; font-weight: 800;
  letter-spacing: 0.08em; text-transform: uppercase;
  box-shadow: 0 0 0 1px var(--idle-deep), 0 2px 8px rgba(0, 0, 0, 0.28);
}
.tl-flag::before {
  content: "";
  width: 7px; height: 7px; border-radius: 50%;
  background: #1a1204;
  animation: flag-pulse 1.8s ease-in-out infinite;
}
@keyframes flag-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

/* An amber chip has to read as idle ANYWHERE, not only as a descendant of
   .tl-block.is-idle: a drive block carrying "8m sitting" needs it too. */
.tl-chip.is-idle {
  background:
    repeating-linear-gradient(135deg, var(--idle-soft) 0 5px, transparent 5px 10px),
    var(--idle-bg);
  border-color: var(--idle-line);
  color: var(--idle-2);
  font-weight: 650;
}
.tl-chip.is-idle .sw {
  background: repeating-linear-gradient(135deg, var(--idle) 0 3px, var(--idle-deep) 3px 6px);
}

/* How much of a TRIP was stationary with the engine running, drawn once on the
   trip's lead leg. Never per leg: every leg repeats the trip-level idle_s. */
.tl-idle-share {
  position: absolute; left: 13px; right: 12px; bottom: 5px;
  height: 4px; border-radius: var(--r-pill);
  background: var(--line-soft);
  overflow: hidden;
}
/* reserve the strip's own row so it can never sit under the content above */
.tl-block:not(.is-compact) .tl-body:has(> .tl-idle-share) { padding-bottom: 14px; }
/* A compact block hides .tl-meta, which is where the bar's label lives. An
   unlabelled amber bar under a distance is a quantity with no name, so the bar
   goes with it; the block still links through to the trip page. */
.tl-block.is-compact .tl-idle-share { display: none; }
.tl-idle-share i {
  display: block; height: 100%;
  width: var(--pct, 0%);
  background: repeating-linear-gradient(135deg, var(--idle) 0 4px, var(--idle-deep) 4px 8px);
}

/* ---- park: engine off, ghosted --------------------------------------- */
.tl-block.is-park {
  /* engine-off gaps can be 13 hours; they compress so idle stays the
     loudest thing on the strip, while still scaling with duration.
     The max-height cap is safe because park content is always compact
     (kind + headline, about 44px) and so never reaches 150px. */
  min-height: max(var(--tl-min), calc(var(--dur-min, 4) * var(--tl-scale-park) * 1px));
  max-height: var(--tl-max-park);
  background:
    repeating-linear-gradient(135deg,
      transparent 0 10px,
      rgba(128, 147, 168, 0.06) 10px 20px),
    var(--park-bg);
  border-style: dashed;
  border-color: var(--park-line);
  color: var(--park-ink);
}
.tl-block.is-park .tl-body::before { background: var(--park-line); width: 3px; }
.tl-block.is-park .tl-kind,
.tl-block.is-park .tl-time,
.tl-block.is-park .tl-start { color: var(--park-ink); }
.tl-block.is-park .tl-headline { color: var(--park-ink); font-weight: 600; }
.tl-block.is-park:hover { border-color: var(--park); }

/* ---- the day ribbon (plan 4b) ------------------------------------------
   The same day as the timeline, projected on the clock instead of on
   duration. Same three visual languages, same tokens. It scrolls inside its
   own box (--rib-min is about 26 px an hour, set by the JS) so that a 16 hour
   day never gives the PAGE a horizontal scrollbar at 375 px. */
.day-ribbon {
  position: relative;
  padding: 12px 16px 10px;
  border-bottom: 1px solid var(--line-soft);
}
.ribbon-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  padding-bottom: 2px;
}
.ribbon-track {
  position: relative;
  height: 40px;
  min-width: max(100%, calc(var(--rib-min, 200) * 1px));
}
.ribbon-hour {
  position: absolute;
  top: 0; left: var(--at, 0%);
  transform: translateX(-50%);
  font-size: 10px; color: var(--text-faint);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ribbon-tick {
  position: absolute;
  top: 14px; bottom: 0; left: var(--at, 0%);
  width: 1px;
  background: var(--line-soft);
}
/* The track itself answers the pointer (the JS picks the nearest segment, so
   a 1 px block is still reachable), and the decoration must never swallow a
   click meant for it. */
.ribbon-tick, .ribbon-hour { pointer-events: none; }
.ribbon-seg {
  position: absolute;
  top: 16px; height: 24px;
  left: var(--at, 0%);
  width: var(--w, 0%);
  min-width: 1px;                 /* a 7 s drive in a 16 h day is 0.07 px */
  padding: 0; border: 0;
  border-radius: 2px;
  background: var(--accent);
  cursor: pointer;
}
.ribbon-seg.is-drive { background: linear-gradient(180deg, var(--accent-2), var(--accent)); }
.ribbon-seg.is-idle {
  background: repeating-linear-gradient(135deg, var(--idle) 0 4px, var(--idle-deep) 4px 8px);
}
.ribbon-seg.is-park {
  background: var(--park-bg);
  box-shadow: inset 0 0 0 1px var(--park-line);
}
/* is-hot is the nearest segment to the pointer, set by the track's own
   mousemove: at 26 px an hour most blocks are a pixel wide, and without it
   nothing says which one a click would take. */
.ribbon-seg:hover, .ribbon-seg.is-hot { filter: brightness(1.15); }
.ribbon-seg.is-hot { box-shadow: 0 0 0 1px var(--accent-line); }
.ribbon-seg.is-selected { box-shadow: 0 0 0 2px var(--accent), 0 0 0 4px var(--accent-soft); }
/* The strip is one tab stop with a roving tabindex, so the focused segment
   needs a ring of its own. Drawn outside the 1 px segment, never inside it. */
.ribbon-seg:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  z-index: 2;
}
/* The hover bubble lives OUTSIDE the scrolling box, or it would be clipped by
   its own overflow at both ends of the day. */
.ribbon-tip {
  position: absolute;
  left: var(--at, 50%); top: calc(100% - 6px);
  transform: translateX(-50%);
  z-index: 3;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--overlay);
  backdrop-filter: blur(6px);
  box-shadow: var(--shadow-2);
  font-size: 11.5px; color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  pointer-events: none;
}

/* ---- clusters: a run of short blocks, folded (plan 4a, F14) -------------
   The fold is VISUAL ONLY. Every total, table, marker and percentage on the
   page is built from the same blocks and does not know this exists.
   --cl-px is set by the JS to the height the members would have had, each at
   its own kind's scale, so an idle-heavy group can never read shorter than
   the sits inside it. */
.tl-block.is-cluster {
  min-height: max(var(--tl-min), calc(var(--cl-px, 60) * 1px));
  background:
    repeating-linear-gradient(135deg, transparent 0 12px, var(--line-soft) 12px 13px),
    var(--panel-2);
  border-style: dashed;
  border-color: var(--line);
}
/* Open, it is only a header over its own members, so it stops claiming their
   height and the members carry the duration again. */
.tl-block.is-cluster.is-open { min-height: 0; }
.tl-block.is-cluster .tl-body::before {
  background: linear-gradient(to bottom, var(--park-line), var(--line));
}
.tl-block.is-cluster .tl-kind { color: var(--text-faint); }
.tl-cluster-sum {
  font-size: 12px; color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
/* The members in miniature, in the same three visual languages as the strip
   itself, at true duration proportion. */
.tl-cluster-strip {
  display: flex; gap: 1px;
  height: 6px; margin: 2px 0 1px;
  border-radius: var(--r-pill);
  overflow: hidden;
  background: var(--line-soft);
}
.tl-cluster-strip i { display: block; height: 100%; width: var(--pct, 0%); min-width: 1px; }
.tl-cluster-strip i.is-drive { background: var(--accent); }
.tl-cluster-strip i.is-idle {
  background: repeating-linear-gradient(135deg, var(--idle) 0 3px, var(--idle-deep) 3px 6px);
}
.tl-cluster-strip i.is-park { background: var(--park-line); }
/* Minutes the log does not cover, inside a cluster's clock span: empty track,
   so the amber keeps its true share of the row's headline period. */
.tl-cluster-strip i.is-gap { background: transparent; }
.tl-cluster-toggle { color: var(--text); border-color: var(--line); font-weight: 600; }
.tl-block.is-cluster:hover { border-color: var(--accent-line); }
.tl-block.is-cluster[aria-expanded="true"] .tl-cluster-toggle { border-color: var(--accent-line); }
/* An expanded member: a quiet accent notch on the rail side, so it reads as
   belonging to the cluster above without moving out of the block column (an
   indent would leave the timeline rail behind). */
.tl-block.is-member { box-shadow: inset 3px 0 0 var(--accent-line); }

.timeline-empty {
  padding: 26px 16px;
  text-align: center;
  color: var(--text-faint);
  font-size: 13px;
}

/* day scale hint next to the timeline head */
.tl-scale-note {
  font-size: 11px; color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   9. Day list (overview)
   ========================================================================== */

.day-list { display: flex; flex-direction: column; }

/* Plan 4c, F16. One header per Monday-to-Sunday week, so the list reads the
   way the timesheet is filled in. Its figures are the sums of the cards under
   it, nothing else, and the sitting share keeps the idle ink. */
.week-head {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px;
  padding: 9px 16px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--line-soft);
  border-top: 1px solid var(--line-soft);
  font-size: 12px;
}
.day-list > .week-head:first-child { border-top: 0; }
.week-when b { font-weight: 700; color: var(--text); }
.week-stats {
  display: flex; flex-wrap: wrap; gap: 4px 12px;
  margin-left: auto;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.week-stats .idle-hit { color: var(--idle-2); font-weight: 650; }

.day-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 12px 16px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 120ms ease;
}
.day-card:last-child { border-bottom: 0; }
.day-card:hover { background: var(--panel-2); }
.day-card.is-active {
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}
/* focus lights the card too; without this the left bar replaced the focus ring */
.day-card.is-active:focus-visible {
  box-shadow: inset 3px 0 0 var(--accent), inset 0 0 0 3px var(--accent-line);
}
.day-date { font-size: 13.5px; font-weight: 650; letter-spacing: -0.01em; }
.day-when { font-size: 11.5px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.day-stats {
  display: flex; flex-wrap: wrap; gap: 4px 12px;
  margin-top: 5px;
  font-size: 12px; color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.day-stats .idle-hit { color: var(--idle-2); font-weight: 650; }
.day-preview {
  width: 96px; height: 52px;
  border-radius: var(--r-sm);
  background: var(--panel-2);
  border: 1px solid var(--line-soft);
  overflow: hidden;
}
.day-preview svg { display: block; width: 100%; height: 100%; }
/* a day with no mappable preview must not read as a loading skeleton */
.day-preview.is-empty {
  display: grid; place-items: center;
  font-size: 10px; color: var(--text-faint);
  background: transparent; border-style: dashed;
}
.day-preview .track { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.day-preview .track-shadow { fill: none; stroke: var(--line); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }

/* the day list doubles as a mini split bar per day */
.day-mini {
  display: flex; height: 5px; border-radius: var(--r-pill);
  overflow: hidden; margin-top: 7px; background: var(--line-soft);
}
.day-mini i { display: block; height: 100%; width: var(--pct, 0%); }
.day-mini i.is-drive { background: var(--accent); }
.day-mini i.is-idle { background: repeating-linear-gradient(135deg, var(--idle) 0 3px, var(--idle-deep) 3px 6px); }
.day-mini i.is-off { background: var(--park-line); }

/* ==========================================================================
   10. Map
   ========================================================================== */

.map-panel {
  position: relative;
  padding: 0;
  overflow: hidden;
  border-radius: var(--r-lg);
}

#map, .map {
  width: 100%;
  height: calc(100vh - 210px);
  min-height: 460px;
  background: var(--panel-2);
}

.leaflet-container {
  background: var(--panel-2);
  font-family: var(--font);
  font-size: 12.5px;
}

/* Dark mode inverts ONLY the tile pane. Route polylines, markers, popups and
   the attribution live in other panes and keep their true colours. */
.leaflet-tile-pane { filter: var(--tile-filter); }

/* OSM tile usage policy: attribution stays visible and legible. Do not hide. */
.leaflet-control-attribution {
  background: var(--attr-bg) !important;
  color: var(--attr-ink) !important;
  font-size: 11px !important;
  line-height: 1.5;
  padding: 2px 8px !important;
  border-radius: var(--r-sm) 0 0 0;
  backdrop-filter: blur(4px);
}
.leaflet-control-attribution a {
  color: var(--accent) !important;
  text-decoration: underline;
}

.leaflet-bar {
  border: 1px solid var(--line) !important;
  box-shadow: var(--shadow-2) !important;
  border-radius: var(--r-sm) !important;
  overflow: hidden;
}
.leaflet-bar a,
.leaflet-bar a:hover {
  background: var(--panel) !important;
  color: var(--text) !important;
  border-bottom-color: var(--line-soft) !important;
  width: 30px; height: 30px; line-height: 30px;
}
.leaflet-bar a:hover { background: var(--panel-3) !important; }
.leaflet-bar a.leaflet-disabled { background: var(--panel-2) !important; color: var(--text-faint) !important; }

.leaflet-popup-content-wrapper {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-3);
}
.leaflet-popup-content { margin: 11px 13px; font-size: 12.5px; line-height: 1.5; }
.leaflet-popup-tip { background: var(--panel); border: 1px solid var(--line); box-shadow: none; }
.leaflet-popup-close-button { color: var(--text-faint) !important; }
.leaflet-popup-close-button:hover { color: var(--text) !important; }

.leaflet-tooltip {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-1);
  font-size: 12px;
}
.leaflet-tooltip-top::before { border-top-color: var(--line); }
.leaflet-tooltip-bottom::before { border-bottom-color: var(--line); }
.leaflet-tooltip-left::before { border-left-color: var(--line); }
.leaflet-tooltip-right::before { border-right-color: var(--line); }

/* popup content grid */
.pop-title { font-weight: 700; font-size: 13px; margin-bottom: 6px; letter-spacing: -0.01em; }
.pop-title.is-idle { color: var(--idle-2); }
.pop-title.is-drive { color: var(--accent); }
.pop-title.is-park { color: var(--park-ink); }
.pop-row { display: flex; justify-content: space-between; gap: 16px; }
.pop-k { color: var(--text-faint); }
.pop-v { font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---- divIcon markers (JS renders <div class="pin pin-idle">) ------------
   Leaflet 1.9.4 ships `.leaflet-div-icon { background:#fff; border:1px solid #666 }`
   and L.DivIcon defaults to iconSize [12,12]. Without this reset every pin is a
   white bordered square. The JS also passes className:'' and an explicit
   iconSize. .pin needs position:relative for the .pin-idle::after halo. */
.leaflet-div-icon { background: transparent; border: 0; }

.pin {
  position: relative;
  display: grid; place-items: center;
  width: 100%; height: 100%;
  border-radius: 50%;
  font-size: 10px; font-weight: 800;
  color: var(--text-invert);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}
.pin-start { background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 28%, transparent); }
.pin-end   { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.pin-park  {
  background: var(--park-bg);
  border: 2px dashed var(--park);
  color: var(--park-ink);
}
.pin-idle {
  background: var(--idle);
  color: #1a1204;
  border: 2px solid var(--idle-deep);
  box-shadow: 0 0 0 4px var(--idle-soft), 0 2px 10px rgba(0, 0, 0, 0.4);
}
/* F19. The newest fix in the index, on the overview map and repeated in the
   card beside the hero. Accent with a hollow ring, so it cannot be mistaken
   for an A/B endpoint pin and never borrows amber, which means a sit. */
.pin-last-seen {
  background: var(--panel);
  border: 3px solid var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft), 0 2px 10px rgba(0, 0, 0, 0.35);
}
.pin-last-seen::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--accent);
}

/* an engine-on sit gets a halo so it is findable at any zoom */
.pin-idle::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid var(--idle-line);
  animation: pin-ring 2.2s ease-out infinite;
}
@keyframes pin-ring {
  0%   { transform: scale(0.72); opacity: 0.9; }
  70%  { transform: scale(1.25); opacity: 0; }
  100% { transform: scale(1.25); opacity: 0; }
}

/* F9. Below z13, idle pins closer than 24 px fold into one pill, "3 sits, 9m".
   The icon element has no size (the label width varies), so the anchor child
   centres the pill on the point, and .pin inside it stays free to scale for
   the pulse: Leaflet owns the icon element's transform, the anchor owns the
   translate, the pin owns the scale. Still amber, because every member is an
   engine-on sit. */
.pin-fold-anchor {
  position: absolute; left: 0; top: 0;
  transform: translate(-50%, -50%);
}
.pin.pin-fold {
  width: auto; height: 26px;
  padding: 0 10px;
  border-radius: var(--r-pill);
  font-size: 10.5px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.pin.pin-fold::after { border-radius: var(--r-pill); }

/* A folded pin's popup lists its members; each row zooms to that sit. */
/* The list scrolls and the "Zoom in to all" action stays outside it. A 7-sit
   popup needed about 351 px above its point, more than the 340 px phone map,
   and .map-panel's overflow:hidden cut off the lower rows and the action.
   204 px holds seven 26.75 px rows and their gaps without a scrollbar; the
   phone cap in section 14 holds five. */
.pop-list {
  display: flex; flex-direction: column; gap: 2px; margin: 2px -6px 0;
  max-height: 204px; overflow-y: auto; overscroll-behavior: contain;
}
.pop-item {
  appearance: none;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  width: 100%;
  padding: 4px 6px;
  border: 0; border-radius: 5px;
  background: transparent;
  color: var(--text);
  font: inherit; font-variant-numeric: tabular-nums;
  text-align: left;
  cursor: pointer;
}
.pop-item:hover { background: var(--panel-3); }
.pop-item .pop-v { color: var(--idle-2); }
.pop-actions { margin-top: 8px; padding-top: 7px; border-top: 1px solid var(--line-soft); }
.pop-actions .btn { width: 100%; justify-content: center; padding: 5px 10px; font-size: 12px; }

/* Hovering an idle block on the day timeline pulses its pin. The class sits on
   Leaflet's marker icon element; only the inner .pin scales, because Leaflet
   owns the icon element's own transform (its translate3d position). */
.leaflet-marker-icon.is-pulse .pin {
  animation: pin-pulse 0.9s ease-in-out infinite;
}
@keyframes pin-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.35); }
}

/* ---- route interaction (plan phase 1) -----------------------------------
   Direction arrows on the lit route. Never interactive: an arrow that took
   the pointer would fire mouseout on the route beneath it, clear itself, and
   loop. The rotation is on .dir-arrow because Leaflet owns the transform of
   the icon element. */
.dir-arrow-icon { pointer-events: none !important; }
.dir-arrow {
  width: 14px; height: 14px;
  pointer-events: none;
  transform-origin: 50% 50%;
}
.dir-arrow.is-fresh { animation: dir-arrow-in 120ms ease-out both; }
@keyframes dir-arrow-in { from { opacity: 0; } to { opacity: 1; } }
.dir-arrow svg { display: block; width: 14px; height: 14px; overflow: visible; }
.dir-arrow svg path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.dir-arrow .dir-arrow-edge { stroke: var(--arrow-edge); stroke-width: 4.5; }
.dir-arrow .dir-arrow-ink { stroke: var(--arrow-ink); stroke-width: 2; }
/* single-colour overview routes (plan 1a): accent ink, same dark edge */
.dir-arrow.is-mono .dir-arrow-ink { stroke: var(--accent-2); }

/* Marching ants on the lit route: its own SVG renderer in its own pane, so CSS
   can animate the dash without redrawing the canvas. The pane must never take
   the pointer, or the canvas under it loses the hover. */
.leaflet-pane.gps-ants-pane { z-index: 450; pointer-events: none; }
.gps-ants-pane svg, .gps-ants-pane path { pointer-events: none !important; }
.route-ants {
  stroke: var(--route-ants);
  animation: route-ants-march 0.9s linear infinite;
}
/* one dash period is 4 + 10 = 14; a negative offset marches the dashes the
   way the line was drawn, which is the direction of travel */
@keyframes route-ants-march { to { stroke-dashoffset: -28; } }

/* Trip page: the speed-profile cursor, placed on the route. Neutral ink. */
.pos-marker-icon { pointer-events: none !important; }
.pos-marker {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--arrow-ink);
  border: 3px solid var(--arrow-edge);
  box-shadow: 0 0 0 3px var(--accent-soft), 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* F1. Shown for two seconds when the wheel is used over a map that has not
   been clicked. Neutral tokens: this is advice, not a state of the truck. */
.map-hint {
  position: absolute;
  left: 50%; top: 12px;
  transform: translateX(-50%);
  z-index: 900;
  max-width: calc(100% - 120px);
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--overlay);
  color: var(--text);
  box-shadow: var(--shadow-2);
  backdrop-filter: blur(6px);
  font-size: 12.5px; font-weight: 600;
  text-align: center;
  pointer-events: none;
  animation: map-hint-in 160ms ease-out both;
}
@keyframes map-hint-in { from { opacity: 0; } to { opacity: 1; } }

/* Touch: one finger scrolls the page until the map is tapped. The caption
   says so, and lets the tap straight through to the map. Top centre, not the
   middle: every fit centres the route, so a centred caption sat on the line.
   Clear of the zoom control (top left) and the legend (bottom left). */
.map-touch-cap {
  position: absolute;
  left: 50%; top: 10px;
  transform: translateX(-50%);
  z-index: 900;
  padding: 7px 14px;
  border-radius: var(--r-pill);
  background: var(--overlay);
  color: var(--text);
  border: 1px solid var(--line);
  font-size: 12.5px; font-weight: 600;
  white-space: nowrap;
  opacity: 0.88;
  pointer-events: none;
}

/* ---- map legend --------------------------------------------------------- */
.map-legend {
  position: absolute;
  left: 12px; bottom: 12px;
  z-index: 500;
  padding: 10px 12px;
  background: var(--overlay);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-2);
  backdrop-filter: blur(6px);
  font-size: 11.5px;
  color: var(--text-dim);
  max-width: 62vw;
}
.legend-title {
  font-size: 10px; font-weight: 750; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-faint);
  margin-bottom: 7px;
}
/* "6 trips, 1 short hop" on the day map (plan 2f). Plain ink: a count, not a state. */
.legend-count {
  margin-bottom: 7px;
  font-size: 11.5px; font-weight: 650; color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.legend-row { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.legend-row + .legend-row { margin-top: 4px; }
.legend-ramp { display: flex; gap: 3px; margin-bottom: 6px; }
.legend-ramp i {
  flex: 1 1 0; height: 7px; border-radius: 2px; min-width: 18px;
}
.legend-swatch { width: 14px; height: 5px; border-radius: 2px; flex: none; }

.sw-1, .legend-ramp i.s1, .legend-swatch.s1 { background: var(--speed-1); }
.sw-2, .legend-ramp i.s2, .legend-swatch.s2 { background: var(--speed-2); }
.sw-3, .legend-ramp i.s3, .legend-swatch.s3 { background: var(--speed-3); }
.sw-4, .legend-ramp i.s4, .legend-swatch.s4 { background: var(--speed-4); }
.sw-5, .legend-ramp i.s5, .legend-swatch.s5 { background: var(--speed-5); }

.legend-scale {
  display: flex; justify-content: space-between;
  font-variant-numeric: tabular-nums;
  font-size: 10.5px; color: var(--text-faint);
}
.legend-kinds { margin-top: 9px; padding-top: 8px; border-top: 1px solid var(--line-soft); }
.legend-kinds .key-swatch { width: 11px; height: 11px; }

/* floating map controls (fit bounds, toggle idles, etc.) */
.map-tools {
  position: absolute;
  right: 12px; top: 12px;
  z-index: 500;
  display: flex; flex-direction: column; gap: 6px;
}
.map-tools .btn {
  background: var(--overlay);
  backdrop-filter: blur(6px);
  box-shadow: var(--shadow-2);
}

/* ==========================================================================
   11. Tables and lists (idles report, upload results)
   ========================================================================== */

.table-wrap { overflow-x: auto; }

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
table.data th {
  text-align: left;
  font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-faint);
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.data td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--text-dim);
}
table.data td.strong { color: var(--text); font-weight: 600; }
table.data tr:hover td { background: var(--panel-2); }
table.data tr.is-wait td { background: var(--idle-soft); }
table.data tr.is-wait td.strong { color: var(--idle-2); }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  font-size: 11px; font-weight: 650;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text-dim);
  white-space: nowrap;
}
.badge.is-drive { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.badge.is-idle {
  background: repeating-linear-gradient(135deg, var(--idle-soft) 0 5px, transparent 5px 10px), var(--idle-bg);
  border-color: var(--idle-line);
  color: var(--idle-2);
}
.badge.is-park { background: var(--park-bg); border-color: var(--park-line); color: var(--park-ink); }
/* F17. A trip whose median HDOP is over 2.5. Neutral on purpose: it describes
   the receiver, not the truck, so it must never borrow amber (idle) or red. */
.badge.is-weak-fix {
  background: transparent;
  border-style: dashed;
  border-color: var(--text-faint);
  color: var(--text-dim);
  cursor: help;
}

/* ==========================================================================
   12. Upload
   ========================================================================== */

.dropzone {
  display: grid; place-items: center; gap: 6px;
  padding: 22px 16px;
  border: 2px dashed var(--line);
  border-radius: var(--r-md);
  background: var(--panel-2);
  color: var(--text-dim);
  text-align: center;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}
.dropzone:hover { border-color: var(--accent-line); }
.dropzone.is-over { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.dropzone strong { color: var(--text); font-weight: 650; }
.dropzone small { color: var(--text-faint); }

.upload-result { margin-top: 10px; font-size: 12.5px; }
.upload-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line-soft);
  font-variant-numeric: tabular-nums;
}
.upload-row .file { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: 11.5px; }
.upload-row .added { color: var(--good); font-weight: 650; }
.upload-row .dup { color: var(--text-faint); }

/* ==========================================================================
   13. States
   ========================================================================== */

.empty {
  padding: 34px 20px;
  text-align: center;
  color: var(--text-faint);
}
.empty strong { display: block; color: var(--text-dim); font-size: 14px; margin-bottom: 4px; }

.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--panel-2);
  border-radius: var(--r-md);
  min-height: 14px;
}
.skeleton::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, var(--panel-3), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.3s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }

.spinner {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  position: fixed;
  left: 50%; bottom: 20px;
  transform: translateX(-50%);
  z-index: 1200;
  /* auto width shrink-to-fits against 50vw, so a long error (the upload 503
     string is 95 characters) becomes a narrow tall sliver */
  width: max-content;
  max-width: calc(100vw - 24px);
  padding: 10px 16px;
  border-radius: var(--r-pill);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-3);
  font-size: 13px;
}
.toast.is-error { border-color: var(--bad); color: var(--bad); }
.toast.is-ok { border-color: var(--good); }

.error-note {
  padding: 10px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--bad);
  background: rgba(255, 93, 93, 0.10);
  color: var(--bad);
  font-size: 12.5px;
}

/* ==========================================================================
   14. Responsive
   ========================================================================== */

@media (max-width: 1080px) {
  .layout { grid-template-columns: minmax(320px, 38%) minmax(0, 1fr); }
  #map, .map { height: calc(100vh - 240px); min-height: 400px; }
}

/* The legend leaves the map and sits under it, inside the panel. Over a
   340 px phone map it was 148 px tall and hid 57 of the 81 px of the day's
   "5 sits, 10m" pill on 2026-09-16; a fit that padded around it would have
   left the route under half the map. The two-column layout below 940 px is
   just as narrow: at 768 px the map was 386 px wide and the 164 by 150 px
   legend covered all of 2026-09-16's "7 sits, 18m" pill, at 800 px half of
   it; from 900 px up nothing was hidden. The map keeps its height: the
   sticky right column is then 74 px + (100vh - 240 px) + a 148 px legend,
   which still ends inside the viewport. Taking the legend's height out of
   the map instead dropped the 768 px tablet fit from z11 to z10. */
@media (max-width: 940px) {
  .map-legend {
    position: static;
    max-width: none;
    border: 0; border-top: 1px solid var(--line-soft);
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
    background: var(--panel);
    font-size: 11px;
  }
}

@media (max-width: 720px) {
  .app { padding: 0 12px 18px; }

  /* timeline and map stack, map takes a fixed height instead of viewport math */
  .layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .col-right { position: static; top: auto; }

  #map, .map { height: 340px; min-height: 0; }

  /* F12. The review found brand, status pill and Upload wrapping into three
     rows at phone width. Now row one is brand, pill (dot plus age), theme and upload icons;
     the crumbs take row two on their own. */
  .topbar { gap: 8px; row-gap: 6px; padding: 10px 0; margin-bottom: 10px; }
  .topbar-actions { gap: 8px; }
  .brand { gap: 9px; }
  .brand-mark { width: 30px; height: 30px; font-size: 14px; border-radius: 9px; }
  .brand-sub { display: none; }
  .crumbs { order: 10; flex: 1 1 100%; }
  .status-pill { font-size: 11px; padding: 4px 9px; min-width: 0; }
  .status-long { display: none; }
  .status-short { display: inline; }
  .btn-upload { width: 32px; height: 32px; padding: 0; justify-content: center; }
  .btn-upload .btn-label { display: none; }

  .toolbar { gap: 8px; }
  /* 5px 8px, not 9px: measured at 375 px the segment was 226 px and the
     disclosure 135 px, 369 px against 351 available, so the disclosure
     wrapped onto a row of its own. */
  .seg-btn { padding: 5px 8px; }
  /* Plan 4c added "This week" and "Last week", five quick ranges in the row.
     "Last " is dropped from the two rolling windows and the segment is allowed
     to wrap inside itself, so the PAGE never gains a horizontal scrollbar. */
  .seg { flex-wrap: wrap; max-width: 100%; }
  .seg-long { display: none; }
  /* the quick-range segment stands alone; From, To and Apply wait behind the
     disclosure and take a row of their own when opened */
  .range-toggle { display: inline-flex; gap: 5px; padding: 7px 10px; font-size: 12.5px; }
  .range-custom { display: none; }
  .range-custom.is-open { display: flex; flex: 1 1 100%; gap: 8px; }
  .range-now { flex: 1 1 100%; }
  /* the day and trip nav go to one row in section 16, after their base rules */

  .stat-grid { grid-template-columns: repeat(auto-fit, minmax(114px, 1fr)); gap: 8px; }
  .stat-value { font-size: 21px; }

  /* 62 px and a 10 px right pad, not 58 and 12: in Inter a "58m 54s" .tl-dur
     is 47.5 px against 44 px of room, and align-items:flex-end pushed its
     first digit 1.5 px past the block's clipped left edge. Now 50 px. */
  :root {
    --tl-gutter: 62px; --tl-scale: 2.4; --tl-scale-idle: 7;
    --tl-scale-park: 2.2; --tl-max-park: 100px;
  }
  .tl-time { padding-right: 10px; }
  .timeline { padding: 12px 12px 14px; }
  .timeline::before { left: calc(12px + var(--tl-gutter) + 1px); }
  .tl-headline { font-size: 13px; }

  .pop-list { max-height: 146px; }
  .day-card { grid-template-columns: minmax(0, 1fr) 76px; padding: 11px 12px; }
  .day-preview { width: 76px; height: 44px; }
  .panel-body { padding: 12px; }
}

@media (max-width: 480px) {
  /* .brand has min-width:0 so it shrinks below its content, and .brand-name is
     nowrap: without these the wordmark overflows its own box and lands on top
     of the status pill without ever producing a horizontal scrollbar. */
  .brand-name, .brand-sub, .status-pill {
    overflow: hidden; text-overflow: ellipsis; max-width: 100%;
  }
  .status-pill { min-width: 0; }
  .topbar { gap: 8px; }
  .toolbar { gap: 7px; }
  .stat-value { font-size: 19px; }
}

@media (max-width: 400px) {
  .day-preview { display: none; }
  .day-card { grid-template-columns: minmax(0, 1fr); }
}

/* ==========================================================================
   15. Motion, print
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .tl-block:hover, .tl-block.is-hover, .tl-block.is-drive.is-hover { transform: none; }
  /* no fade, no march, no pulse: the arrows and the lit route still show */
  .dir-arrow.is-fresh, .route-ants, .map-hint,
  .leaflet-marker-icon.is-pulse .pin { animation: none !important; }
  /* the hovered sit still has to be findable, so it holds the enlarged size */
  .leaflet-marker-icon.is-pulse .pin { transform: scale(1.3); }
  /* the hero's route is drawn at once and its pin shows at once, ring still */
  .hero-pin, .hero-start, .hero-pin::after { animation: none !important; }
  .hero-pin::after { opacity: 0; }
}

@media print {
  /* Browsers drop background colours when printing, so the dark tokens had to
     go or the page printed white ink on white paper and the amber idle stripes
     vanished, erasing the whole drive/idle/park distinction. */
  :root {
    --bg: #fff; --bg-grad: none;
    --panel: #fff; --panel-2: #fff; --panel-3: #f4f4f4;
    --line: #bbb; --line-soft: #ddd;
    --text: #000; --text-dim: #333; --text-faint: #555;
    --idle: #8a4f05; --idle-2: #8a4f05; --idle-deep: #5c3403;
    --idle-ink: #5c3403; --idle-bg: #fff6e8;
    --idle-stripe: rgba(138, 79, 5, 0.30); --idle-soft: rgba(138, 79, 5, 0.12);
    --idle-line: rgba(138, 79, 5, 0.60);
    --accent: #08529e; --accent-2: #1a6fd0; --accent-soft: rgba(8, 82, 158, 0.12);
    --accent-line: rgba(8, 82, 158, 0.40);
    --park: #666; --park-bg: #f6f6f6; --park-line: #ccc; --park-ink: #555;
    --elev: #3d6a22; --elev-line: rgba(61, 106, 34, 0.45);
    /* A place name carries meaning on paper too: a label the user typed has to
       stay readable against a geocoded guess. --scrim never prints, the dialog
       is not on the page when it does. */
    --place-geo: #444; --place-coord: #666;
    --tile-filter: none;
    --shadow-1: none; --shadow-2: none; --shadow-3: none;
  }
  body { background: #fff; color: #000; }
  .topbar, .toolbar, .map-tools, .dropzone, .btn, .tray, .toast,
  .drop-overlay, .crumbs { display: none !important; }
  .panel { border-color: #bbb; box-shadow: none; break-inside: avoid; }
  .layout { grid-template-columns: 1fr; }
  #map, .map { height: 320px; }
  .tl-block { break-inside: avoid; }
  .tl-body::before, .tl-block.is-idle, .tl-flag, .split-seg, .tl-idle-share i,
  .sit-bar i, .key-swatch,
  /* the clock strip and a cluster's miniature carry the same drive / idle /
     park meaning as the blocks, so they have to keep their fills on paper */
  .ribbon-seg, .tl-cluster-strip i {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* ==========================================================================
   16. Shell pieces the app builds (crumbs, hero, day nav, profile, upload
       tray, overlays). Same token set, same three visual languages.
   ========================================================================== */

.main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.main:focus { outline: none; }

.site-foot {
  margin-top: 20px; padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  color: var(--text-faint); font-size: 11.5px;
}

.crumbs {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 6px; min-width: 0;
  font-size: 12.5px; color: var(--text-dim);
}
.crumbs .sep { color: var(--text-faint); }
.crumbs .cur { color: var(--text); font-weight: 600; }
/* The hero carries the overview's title on a phone, so the lone crumb row
   would only push it down the screen. */
@media (max-width: 720px) { .crumbs.is-root { display: none; } }

.stack { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.row-wrap { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ---- the hero: the latest day as a picture (2026-10-19) ------------------ */
/* The first thing a phone shows. OSM tiles placed by app.js heroCard() with
   the same --tile-filter as the Leaflet maps, an SVG route on top, and the
   day's numbers over a fade into the panel colour. The whole card is a link
   to the day. Accent ink only: amber means idling, and this is a drive. */
.hero-day {
  position: relative; display: block; overflow: hidden; isolation: isolate;
  height: clamp(320px, 52vh, 420px);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--park-bg);
  color: var(--text);
  box-shadow: var(--shadow-2);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.hero-day:hover, .hero-day:focus-visible { border-color: var(--accent-line); }
.hero-day:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hero-stage { position: absolute; inset: 0; z-index: 0; }
.hero-tiles { position: absolute; inset: 0; filter: var(--tile-filter); }
.hero-tiles img {
  position: absolute; width: 256px; height: 256px; max-width: none;
  user-select: none; -webkit-user-drag: none; pointer-events: none;
}
.hero-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero-glow, .hero-casing, .hero-route {
  fill: none; stroke-linecap: round; stroke-linejoin: round;
}
.hero-glow { stroke: var(--accent); stroke-width: 14; opacity: 0.45; filter: url(#hero-blur); }
.hero-casing { stroke: var(--route-casing); stroke-width: 7.5; }
.hero-route { stroke: var(--accent-2); stroke-width: 4; }
.hero-start { fill: var(--panel); stroke: var(--accent-2); stroke-width: 2.5; }
/* The route draws itself once per page load. --len is the path length,
   measured in app.js; reduced motion cuts the animation to nothing. */
.hero-svg.is-drawing .hero-glow,
.hero-svg.is-drawing .hero-casing,
.hero-svg.is-drawing .hero-route {
  stroke-dasharray: var(--len) var(--len);
  stroke-dashoffset: var(--len);
  animation: hero-draw 2.2s cubic-bezier(0.45, 0.05, 0.25, 1) 0.15s forwards;
}
.hero-svg.is-drawing .hero-start { animation: hero-fade 0.4s ease-out 0.1s both; }
.hero-day:has(.hero-svg.is-drawing) .hero-pin { animation: hero-pop 0.5s ease-out 2.2s both; }
@keyframes hero-draw { to { stroke-dashoffset: 0; } }
@keyframes hero-fade { from { opacity: 0; } }
@keyframes hero-pop { from { opacity: 0; transform: translate(-50%, -50%) scale(0.4); } }

/* Where the truck was last heard from: a solid dot with a ring that breathes. */
.hero-pin {
  position: absolute; z-index: 1;
  width: 16px; height: 16px; border-radius: 50%;
  transform: translate(-50%, -50%);
  background: var(--accent);
  border: 3px solid var(--panel);
  box-shadow: 0 0 0 1px var(--accent-line), 0 2px 8px rgba(0, 0, 0, 0.45);
}
.hero-pin::after {
  content: ''; position: absolute; inset: -9px; border-radius: 50%;
  border: 2px solid var(--accent);
  animation: hero-ring 2.4s ease-out infinite;
}
@keyframes hero-ring {
  0% { transform: scale(0.45); opacity: 0.9; }
  100% { transform: scale(1.9); opacity: 0; }
}

.hero-shade {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(to bottom,
      color-mix(in srgb, var(--panel) 55%, transparent) 0,
      transparent 70px),
    linear-gradient(to bottom,
      transparent 40%,
      color-mix(in srgb, var(--panel) 86%, transparent) 62%,
      var(--panel) 90%);
}
.hero-top {
  position: absolute; z-index: 2; top: 12px; left: 12px; right: 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.hero-chip {
  display: inline-flex; align-items: center; gap: 7px; min-width: 0;
  padding: 5px 11px;
  border: 1px solid var(--line); border-radius: 999px;
  background: color-mix(in srgb, var(--panel) 84%, transparent);
  backdrop-filter: blur(6px);
  font-size: 12px; font-weight: 650; color: var(--text);
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.hero-where {
  overflow: hidden; text-overflow: ellipsis; display: block;
  color: var(--text-dim); font-weight: 600;
}
.hero-dot {
  width: 8px; height: 8px; border-radius: 50%; flex: none;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.hero-foot {
  position: absolute; z-index: 2; left: 0; right: 0; bottom: 0;
  display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px 24px;
  padding: 16px 18px 16px;
}
.hero-main { flex: 1 1 220px; min-width: 0; }
.hero-kicker {
  font-size: 11px; font-weight: 750; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--accent-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hero-big {
  margin-top: 2px;
  font-size: clamp(48px, 15vw, 68px); font-weight: 800; line-height: 1;
  letter-spacing: -0.04em; font-variant-numeric: tabular-nums;
  color: var(--text);
}
.hero-big small {
  margin-left: 6px;
  font-size: 0.36em; font-weight: 700; letter-spacing: 0;
  color: var(--text-dim);
}
.hero-line {
  margin-top: 6px;
  font-size: 13.5px; color: var(--text-dim); font-variant-numeric: tabular-nums;
}
.hero-line b { color: var(--text); font-weight: 700; }
.hero-spark { flex: 0 1 220px; min-width: 150px; }
.hero-bars {
  display: flex; align-items: flex-end; gap: 3px;
  height: 34px;
}
.hero-bars i {
  flex: 1 1 0; height: var(--h); min-height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--accent-line);
}
.hero-bars i.is-none { background: var(--line); }
.hero-bars i.is-last { background: var(--accent); }
.hero-spark-label {
  margin-top: 5px;
  font-size: 11px; color: var(--text-faint); font-variant-numeric: tabular-nums;
  text-align: right;
}
.hero-credit {
  position: absolute; z-index: 3; right: 8px; top: 48px;
  font-size: 9px; color: var(--text-faint);
  opacity: 0.8;
}
@media (max-width: 480px) {
  .hero-spark { flex: 1 1 100%; }
  .hero-spark-label { text-align: left; }
}

/* ---- day / trip navigation header --------------------------------------- */
.navbar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  padding: 12px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
}
.navbar-title { flex: 1 1 200px; min-width: 0; text-align: center; }
.navbar-date { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; }
.navbar-sub { font-size: 12px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
/* Previous / Next / Back. The arrow is the whole button on a phone, where the
   word is dropped and aria-label carries the name (section 14). */
.nav-step { justify-content: center; }
/* The day title in two lengths; the short one is for the phone row. */
.navbar-date .date-short { display: none; }
.nav-arrow { line-height: 1; }
/* Balances the trip page's Back button. 1 px on a desktop, as before. */
.nav-spacer { flex: 0 0 auto; width: 1px; }

/* F12, phone: one row, arrow, date, arrow (the trip page: arrow, title,
   spacer). This media block has to come AFTER the base .navbar rules above,
   not in section 14: at equal specificity the later base rules win, which
   would put the flex row and the 1 px spacer back. */
@media (max-width: 720px) {
  .navbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
    padding: 10px;
  }
  .nav-step { width: 38px; height: 38px; padding: 0; font-size: 17px; }
  .nav-step-label { display: none; }
  .nav-spacer { width: 38px; height: 38px; }
  .navbar-date, .navbar-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .navbar-date { font-size: 16px; }
  /* "Wednesday, Sep 16, 2026" ellipsized at 375 px; "Wed Sep 16, 2026" fits */
  .navbar-date .date-long { display: none; }
  .navbar-date .date-short { display: inline; }
}

/* ---- sit bars (a duration against the longest sit in view) -------------- */
.sit-bar {
  flex: 1 1 110px; min-width: 60px; height: 9px;
  border-radius: var(--r-pill);
  background: var(--line-soft);
  overflow: hidden;
}
.sit-bar i {
  display: block; height: 100%;
  background: repeating-linear-gradient(135deg, var(--idle) 0 5px, var(--idle-deep) 5px 10px);
}

/* ---- speed profile ------------------------------------------------------ */
.profile { display: flex; flex-direction: column; gap: 7px; }
.profile svg {
  display: block; width: 100%; height: 172px;
  background: var(--panel-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
}
.profile .axis-label { fill: var(--text-faint); font-size: 11px; }
.profile-readout { font-size: 12.5px; color: var(--text-dim); min-height: 18px; }

/* Plan 3b. The clock ticks under the profile are HTML, not <text> inside the
   SVG: the chart is preserveAspectRatio="none", so a label drawn in user units
   is squeezed to about a third of its width on a 340 px phone map. --at is the
   tick's own x as a percentage of the SVG width, so the two stay lined up at
   every width without measuring anything. */
.profile-axis {
  position: relative;
  height: 14px;
  font-size: 10.5px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}
.profile-tick {
  position: absolute;
  left: var(--at, 0%);
  transform: translateX(-50%);
  white-space: nowrap;
}
/* The hover cursor: neutral ink, never amber. Amber on this page is a sit. */
.profile-cursor { transition: opacity 120ms ease; }

/* Axis labels for both profiles are HTML laid over the SVG, each sitting just
   above its own gridline: --at is the line's y as a percentage of the SVG
   height. Inside the SVG they were squeezed to a third of their width on a
   phone, because the chart is preserveAspectRatio="none". */
.profile-plot { position: relative; }
.profile-ylab {
  position: absolute;
  left: 8px;
  top: var(--at, 0%);
  transform: translateY(-100%);
  padding-bottom: 1px;
  padding: 0 4px;
  border-radius: 4px;
  /* a backing chip, so a label stays readable where the profile crosses it */
  background: color-mix(in srgb, var(--panel-2) 82%, transparent);
  font-size: 10.5px;
  line-height: 1.35;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  white-space: nowrap;
}

/* ---- elevation profile ---------------------------------------------------
   Plotted by distance, so a sit takes no width. */
.elev-profile .stat-grid { margin-bottom: 4px; }

/* ---- upload overlay and result tray ------------------------------------- */
.drop-overlay {
  position: fixed; inset: 0; z-index: 1400;
  display: none; align-items: center; justify-content: center;
  background: var(--overlay);
  backdrop-filter: blur(4px);
  pointer-events: none;
}
.drop-overlay.is-on { display: flex; }
.drop-inner {
  padding: 34px 44px;
  border: 3px dashed var(--accent);
  border-radius: var(--r-lg);
  background: var(--panel);
  font-size: 17px; font-weight: 700; color: var(--text);
  text-align: center;
}

.tray {
  position: fixed; right: 16px; bottom: 16px; z-index: 1300;
  width: min(380px, calc(100vw - 32px));
  max-height: 60vh; overflow: auto;
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-3);
}
.tray[hidden] { display: none !important; }
.tray-head {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; margin-bottom: 4px;
}
.tray-head .spacer { flex: 1 1 auto; }
.upload-row .err { color: var(--bad); font-weight: 650; }

/* ---- places: names, the pencil, and the naming dialog (plan phase 5) ----- */

/* Precedence made visible. A label the user typed is the page's strongest ink;
   an address guessed from OpenStreetMap is one step quieter; bare coordinates
   are quieter still and tabular, because they are a measurement and a name is
   not. Every one of them keeps the coordinates in its title attribute, so the
   exact figure is one hover away wherever a name has replaced it. */
/* break-word, never `anywhere`. Measured at 375 px on the overview Stops
   table: `anywhere` let the column's min-content fall to one character and
   "Shell, Escondido" was drawn down the page a letter at a time. break-word
   keeps whole words together, so the column's minimum is its longest word and
   the table scrolls inside .table-wrap instead, which is what that box is for. */
.place-name { min-width: 0; overflow-wrap: break-word; }
.place-name.is-label { color: var(--text); font-weight: 650; }
.place-name.is-geo { color: var(--place-geo); font-weight: 500; }
.place-name.is-coords {
  color: var(--place-coord);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.place-name.is-none { color: var(--text-faint); }

/* The name and its pencil. inline-flex so the pencil sits on the name's line
   in a table cell, a popup row and the last-seen card alike. */
.place-cell {
  display: inline-flex; align-items: center; gap: 6px;
  min-width: 0; max-width: 100%;
}

/* Smaller than a .btn-icon in the top bar: this one lives inside a 12.5px
   table row and a 13px popup, where a 32px square would set the row height. */
.btn.place-edit {
  width: 24px; height: 24px;
  padding: 3px;
  flex: none;
  border-color: transparent;
  color: var(--text-faint);
}
.btn.place-edit .ico { width: 14px; height: 14px; }
.btn.place-edit:hover { color: var(--accent); border-color: var(--line); }

/* The trip page's Where cell: still the button that jumps the map to the sit,
   now labelled with the place's name instead of its coordinates. */
.btn.place-show {
  max-width: 100%;
  padding: 4px 9px;
  font-weight: 500;
  text-align: left;
}
.btn.place-show .place-name { color: inherit; }

/* A geocoded address can run to 40 characters, and a chip is nowrap, so it is
   clipped rather than allowed to push the timeline block wide. The full text
   stays in the title, with the coordinates. */
.tl-chip.is-place { max-width: 100%; overflow: hidden; }
.tl-chip.is-place .place-name {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* The A and B pin tooltips on a trip: the word, then where it was. */
.ep-tip { display: inline; }
.ep-tip .ep-sep { color: var(--text-faint); }

/* ---- the naming dialog -------------------------------------------------- */

/* A real modal: the page behind it cannot be scrolled, clicked or tabbed into.
   z-index sits above the tray (1300) and the drop overlay (1400) so a dialog
   opened while either is showing is still the thing in front. */
.place-modal {
  position: fixed; inset: 0; z-index: 1500;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  background: var(--scrim);
  backdrop-filter: blur(3px);
}
:root.has-modal, :root.has-modal body { overflow: hidden; }

.place-dialog {
  width: min(360px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 16px 18px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-3);
  display: flex; flex-direction: column; gap: 12px;
}
.pd-title { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.pd-where {
  font-size: 11.5px; color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}
.pd-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.pd-field > label {
  font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-faint);
}
/* Full width, so 375px needs no horizontal scroll and nothing sits side by
   side that could be squeezed. 16px on the input is deliberate: iOS zooms the
   page in on a focused field under 16px, which on a modal reads as a bug. */
.pd-input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--panel-2);
  color: var(--text);
  font: inherit; font-size: 16px;
}
.pd-input:focus-visible { outline: none; box-shadow: var(--ring); border-color: var(--accent); }
.pd-hint { font-size: 11.5px; color: var(--text-faint); }

.pd-msg {
  padding: 8px 10px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text-dim);
  font-size: 12.5px;
}
.pd-msg.is-error { border-color: var(--bad); background: rgba(255, 93, 93, 0.10); color: var(--bad); }
.pd-msg.is-ok { border-color: var(--good); color: var(--good); }

/* The edit key appears only after the server has answered 401, so it is ruled
   off from the two fields that are always there. It is a password input: the
   key is never written into the page, a log line or a URL. */
.pd-key {
  padding-top: 11px;
  border-top: 1px solid var(--line-soft);
}

/* Wraps on a narrow screen rather than shrinking the buttons below a tap
   target. The spacer pushes Cancel and Save right of Delete. */
.pd-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pd-actions .spacer { flex: 1 1 auto; }
.btn.pd-delete { border-color: var(--bad); color: var(--bad); }
.btn.pd-delete:hover { background: rgba(255, 93, 93, 0.12); }

.pd-forget {
  appearance: none;
  align-self: flex-start;
  padding: 0;
  border: 0; background: none;
  color: var(--text-faint);
  font: inherit; font-size: 11.5px;
  text-decoration: underline;
  cursor: pointer;
}
.pd-forget:hover { color: var(--text-dim); }

/* Plan 5b. Shown only while /api/status says geocoding is on: with it off, no
   address on this page came from Nominatim and the credit would be a claim
   about data that is not here. */
.foot-geo { display: inline; }

/* ---- misc --------------------------------------------------------------- */
.loading {
  display: flex; align-items: center; gap: 10px;
  padding: 26px 16px;
  color: var(--text-dim);
}
.dim { color: var(--text-faint); font-size: 12px; }
.note {
  padding: 10px 12px;
  border: 1px solid var(--idle-line);
  border-radius: var(--r-md);
  background: var(--idle-soft);
  color: var(--text-dim);
  font-size: 12.5px;
}
.note b { color: var(--idle-2); }
[hidden] { display: none !important; }
