/* One quiet palette for every page: flat warm greys, near-black ink, one
   copper accent. No glass, no gradients, no shadows on resting surfaces --
   hierarchy comes from type and space. Status colours keep their meaning
   (green moving, amber busy, copper slow, red stopped) and are tuned to read
   on grey. Measurement surfaces (video, canvases) stay dark and neutral. */
@import url("https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600&display=swap");

:root {
  color-scheme: light;
  /* Geist: crisp at text sizes, steady at display sizes, and numerals that
     read at a glance -- the page is mostly minutes, miles and percentages. */
  --font: "Geist", "Inter", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --gut: clamp(16px, 2.2vw, 36px);   /* the only side margin: content uses the full width */

  /* surfaces */
  --bg: #e5e5e5;            /* the page */
  --glass: #f3f3f3;         /* a card resting on it */
  --glass-raised: #fbfbfb;  /* a field, or a card on a card */
  --glass-hover: #ebebeb;
  --panel-dark: #121314;    /* live data and road signs */
  --ink: #161718;           /* primary text and primary buttons */
  --on-ink: #f4f4f2;

  /* text */
  --text: #161718; --ink-2: #47494b; --muted: #5f6164; --faint: #8c8e91;

  /* lines: hairlines only */
  --stroke: rgba(0, 0, 0, .08); --stroke-strong: rgba(0, 0, 0, .18);
  --inner-light: transparent; --blur: none; --shadow: none; --shadow-sm: none;
  --shadow-pop: 0 10px 30px rgba(0, 0, 0, .12), 0 1px 3px rgba(0, 0, 0, .08);

  /* meaning */
  --green: #1e7a4c; --amber: #9a6a00; --copper: #c4561f; --red: #b8321a;
  --blue: #2a78d6; --teal: #1f7f7a; --indigo: #5b5bb0;
  --accent: #b84a16;
  --on-accent: #ffffff;
  --accent-soft: color-mix(in srgb, var(--accent) 10%, var(--glass-raised));
  --accent-edge: color-mix(in srgb, var(--accent) 35%, var(--stroke));
  --accent-hover: color-mix(in srgb, var(--accent) 90%, #000000);

  /* legacy names, kept so every page reads the same palette */
  --wash-1: transparent; --wash-2: transparent; --wash-3: transparent; --wash-4: transparent;
  --topbar-bg: var(--bg); --topbar-line: rgba(0, 0, 0, .07);
  --seg-track: rgba(0, 0, 0, .05); --seg-active: #fbfbfb;
  --scroll-thumb: rgba(0, 0, 0, .2); --scroll-thumb-hover: rgba(0, 0, 0, .35);
  --stage-bg: #121314; --stage-line: #2a2c2e;
  --sign-bg: #121314; --sign-border: #121314; --sign-text: #f4f4f2;
  --sign-cap: #8c8e91; --sign-unit: #8c8e91; --sign-glow: none; --sign-off-border: rgba(0, 0, 0, .08);
  --chart-grid: rgba(0, 0, 0, .07); --chart-baseline: rgba(0, 0, 0, .2); --chart-axis: #5f6164; --chart-ring: #f3f3f3;
  --primary-text: #f4f4f2; --danger-bg: #f4e1d9; --danger-text: #8f2a12;
  --select-arrow: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%235f6164' stroke-width='1.5'/></svg>");
  --r-lg: 16px; --r-md: 12px; --r-sm: 10px; --r-xs: 6px; --r-pill: 999px;
  --line: var(--stroke); --panel: var(--glass); --panel-raised: var(--glass-raised);
}

/* Dark: the same quiet hierarchy, inverted. Surfaces step up in lightness the
   way the light ones step down; status colours are lifted so they keep their
   meaning on near-black. theme.js sets data-theme before the page paints. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #141516; --glass: #1c1d1f; --glass-raised: #242528; --glass-hover: #2a2b2e;
  --panel-dark: #0b0c0d; --ink: #ececea; --on-ink: #141516;
  --text: #ececea; --ink-2: #c2c4c7; --muted: #9b9ea2; --faint: #6f7276;
  --stroke: rgba(255, 255, 255, .09); --stroke-strong: rgba(255, 255, 255, .22);
  --shadow-pop: 0 10px 30px rgba(0, 0, 0, .55), 0 1px 3px rgba(0, 0, 0, .4);
  --green: #3fae74; --amber: #d6a02e; --copper: #e2793f; --red: #ea5a40;
  --blue: #6aa6f2; --teal: #3fb1aa; --indigo: #8f8fe0;
  --accent: #e2793f;
  --on-accent: #141516;
  --accent-hover: color-mix(in srgb, var(--accent) 90%, #ffffff);
  --topbar-bg: var(--bg); --topbar-line: rgba(255, 255, 255, .07);
  --seg-track: rgba(255, 255, 255, .06); --seg-active: #2c2d31;
  --scroll-thumb: rgba(255, 255, 255, .2); --scroll-thumb-hover: rgba(255, 255, 255, .35);
  --stage-bg: #0b0c0d; --stage-line: #2a2c2e;
  --sign-bg: #0b0c0d; --sign-border: #2a2c2e; --sign-off-border: rgba(255, 255, 255, .1);
  --chart-grid: rgba(255, 255, 255, .08); --chart-baseline: rgba(255, 255, 255, .25); --chart-axis: #9b9ea2; --chart-ring: #1c1d1f;
  --primary-text: #141516; --danger-bg: #3b1d15; --danger-text: #f3a68e;
  --select-arrow: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%239b9ea2' stroke-width='1.5'/></svg>");
}
/* A soft fade between the two, never on first paint. */
html.theme-fade, html.theme-fade * { transition: background-color .25s, color .25s, border-color .25s !important; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { font-family: var(--font); -webkit-tap-highlight-color: transparent; }
::selection { background: rgba(42, 120, 214, .22); }

/* Touch screens: fingers, not cursors. Fields at 16 px so iOS Safari does not
   zoom the page when one is tapped, and a visible press state in place of the
   hover a finger cannot produce. */
@media (pointer: coarse) {
  input, select, textarea { font-size: 16px !important; }
  button:active, a:active, summary:active { opacity: .7; }
}
