/* Inerte Express — planning platform stylesheet (v3)
   Design system aligned with inerteexpress.com: Inter body, hairline surfaces, paper inputs,
   dark primary buttons, Lucide iconography, subtle layered shadows. Everything in rem so the
   text-size control scales the whole UI. Mobile-first. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/assets/fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/assets/fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Tokens ---------- */
:root {
  --text-scale: 1;

  --bg: #FFFFFF;
  --paper: #F5F5F2;
  --panel: #FFFFFF;
  --panel-2: #F8F8F6;
  --fg: #191919;
  --muted: #70716F;
  --line: #DEDED9;
  --line-strong: #C9C9C2;

  --accent: #C4913F;
  --accent-text: #8A5F1E;
  --accent-soft: #F7EEDC;

  --primary: #191919;
  --primary-fg: #FFFFFF;
  --primary-hover: #383934;
  --focus: #677D49;

  --load: #3F6A94;
  --go: #B8891B;
  --wait: #C23B2A;
  --pour: #277A4E;
  --back: #7F8A90;
  --setup: #6F58A8;
  --bar-text: #FFFFFF;

  --ok-bg: #E6F0E1;
  --ok-fg: #2F5E2A;
  --bad-bg: #FCF0ED;
  --bad-fg: #8C2922;

  --shadow-1: 0 2px 5px rgba(25, 25, 25, 0.03), 0 8px 24px rgba(25, 25, 25, 0.07);
  --shadow-2: 0 4px 12px rgba(25, 25, 25, 0.03), 0 16px 48px rgba(25, 25, 25, 0.12);
  --radius-s: 0.5rem;
  --radius: 0.875rem;
  --radius-l: 1.25rem;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #1F2120;
  --paper: #2A2D2C;
  --panel: #262827;
  --panel-2: #2E3130;
  --fg: #F4F3EF;
  --muted: #A7ABA8;
  --line: #383B3A;
  --line-strong: #4A4E4C;
  --accent: #C4913F;
  --accent-text: #D8A753;
  --accent-soft: #3B3222;
  --primary: #F7F5EF;
  --primary-fg: #191919;
  --primary-hover: #E6E3DA;
  --focus: #9DB97A;
  --load: #6E99C2;
  --go: #D8AC45;
  --wait: #E2654F;
  --pour: #3FAE75;
  --back: #7C878D;
  --setup: #A38BD1;
  --bar-text: #10151A;
  --ok-bg: #1F3A24;
  --ok-fg: #9FD7A6;
  --bad-bg: #3F2320;
  --bad-fg: #F3A094;
  --shadow-1: 0 2px 5px rgba(0, 0, 0, 0.25), 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-2: 0 4px 12px rgba(0, 0, 0, 0.3), 0 16px 48px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1F2120;
    --paper: #2A2D2C;
    --panel: #262827;
    --panel-2: #2E3130;
    --fg: #F4F3EF;
    --muted: #A7ABA8;
    --line: #383B3A;
    --line-strong: #4A4E4C;
    --accent: #C4913F;
    --accent-text: #D8A753;
    --accent-soft: #3B3222;
    --primary: #F7F5EF;
    --primary-fg: #191919;
    --primary-hover: #E6E3DA;
    --focus: #9DB97A;
    --load: #6E99C2;
    --go: #D8AC45;
    --wait: #E2654F;
    --pour: #3FAE75;
    --back: #7C878D;
    --setup: #A38BD1;
    --bar-text: #10151A;
    --ok-bg: #1F3A24;
    --ok-fg: #9FD7A6;
    --bad-bg: #3F2320;
    --bad-fg: #F3A094;
    --shadow-1: 0 2px 5px rgba(0, 0, 0, 0.25), 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-2: 0 4px 12px rgba(0, 0, 0, 0.3), 0 16px 48px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  font-size: calc(100% * var(--text-scale));
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100dvh;
}
h1, h2, h3 { margin: 0; line-height: 1.2; }
p { margin: 0; }
button, input, output, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { display: block; }
img { max-width: 100%; height: auto; }
[hidden] { display: none !important; }
a { color: inherit; }

button, [role="button"], .chip, .seg-btn, .dock button, .menu [role="menuitem"] {
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
input, select, textarea { font-size: max(1rem, 16px); }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
.skip {
  position: fixed;
  left: 1rem;
  top: calc(0.75rem + env(safe-area-inset-top, 0px));
  z-index: 200;
  transform: translateY(calc(-100% - 2rem));
  background: var(--primary);
  color: var(--primary-fg);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-s);
  font-weight: 500;
  text-decoration: none;
}
.skip:focus { transform: none; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Type ---------- */
.eyebrow {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.5;
}
.hero { display: grid; gap: 0.5rem; padding: 0.5rem 0 0.25rem; }
.hero h1 { font-size: clamp(1.625rem, 1.2rem + 1.8vw, 2.125rem); font-weight: 600; letter-spacing: -0.025em; }
.lead { color: var(--muted); font-size: 0.9375rem; max-width: 60ch; line-height: 1.65; }
.muted { color: var(--muted); }
.small { font-size: 0.8125rem; }
.hint { font-size: 0.8125rem; color: var(--muted); line-height: 1.5; }

/* ---------- Layout ---------- */
.page {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1rem max(1rem, env(safe-area-inset-right, 0px)) calc(6.5rem + env(safe-area-inset-bottom, 0px)) max(1rem, env(safe-area-inset-left, 0px));
  display: grid;
  gap: 1rem;
}
@media (min-width: 640px) { .page { padding-top: 1.5rem; gap: 1.25rem; } }
.wrap { max-width: 72rem; margin: 0 auto; padding: 1rem max(1rem, env(safe-area-inset-right, 0px)) 3rem max(1rem, env(safe-area-inset-left, 0px)); display: grid; gap: 1rem; }
main:focus { outline: none; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  padding-top: env(safe-area-inset-top, 0px);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: 0 1px 0 var(--line);
}
@media (prefers-reduced-transparency: reduce) { .topbar { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; } }
.topbar-inner {
  max-width: 72rem;
  margin: 0 auto;
  min-height: 3.75rem;
  padding: 0.5rem max(1rem, env(safe-area-inset-right, 0px)) 0.5rem max(1rem, env(safe-area-inset-left, 0px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.brand-link { display: inline-flex; align-items: center; border-radius: 0.25rem; min-width: 0; }
.brand-link:focus-visible { outline-offset: 4px; }
.logo { height: 1.75rem; width: auto; max-width: min(100%, 14rem); }
@media (min-width: 640px) { .logo { height: 2.125rem; max-width: 18rem; } }
.logo-light { display: block; }
.logo-dark { display: none; }
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-light { display: none; }
  :root:not([data-theme="light"]) .logo-dark { display: block; }
}
.topbar-actions { display: flex; align-items: center; gap: 0.375rem; flex: 0 0 auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  min-height: 3rem;
  padding: 0 1.125rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--panel);
  color: var(--fg);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.3;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 120ms var(--ease-out), background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}
.btn:active { transform: scale(0.97); transition-duration: 0s; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn svg { width: 1.125rem; height: 1.125rem; flex: 0 0 auto; }
.btn-primary, .btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-fg); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-icon, .btn.icon-only { width: 2.75rem; min-width: 2.75rem; height: 2.75rem; min-height: 2.75rem; padding: 0; border-radius: 50%; }
.btn-sm { min-height: 2.5rem; padding: 0 0.875rem; font-size: 0.8125rem; }
.btn.wide, .btn-wide { width: 100%; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: var(--panel-2); border-color: var(--line-strong); }
  .btn-primary:hover, .btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
  .btn-ghost:hover { border-color: transparent; }
}
.btn[aria-pressed="true"], .btn[aria-checked="true"] { background: var(--panel-2); border-color: var(--line-strong); }

.switch .on, .switch .off { display: none; }
.switch[aria-checked="true"] .on { display: inline; }
.switch[aria-checked="false"] .off { display: inline; }
.switch .sun { display: block; }
.switch .moon { display: none; }
.switch[aria-checked="true"] .sun { display: none; }
.switch[aria-checked="true"] .moon { display: block; }

.avatar {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--primary);
  color: var(--primary-fg);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* Segmented control */
.seg {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--panel);
  overflow: hidden;
}
.seg-btn {
  min-width: 2.5rem;
  min-height: 2.75rem;
  padding: 0 0.625rem;
  border: 0;
  background: transparent;
  color: var(--fg);
  font-size: 0.875rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 160ms ease, transform 120ms var(--ease-out);
}
.seg-btn + .seg-btn, .seg output + .seg-btn, .seg-btn + output { border-left: 1px solid var(--line); }
.seg-btn:active { transform: scale(0.95); transition-duration: 0s; }
.seg-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.seg-btn:focus-visible { outline-offset: -3px; }
.seg output { display: none; align-items: center; justify-content: center; min-width: 3.25rem; font-size: 0.75rem; font-weight: 600; color: var(--muted); }
@media (min-width: 640px) { .seg output { display: inline-flex; } }
.seg-btn svg { width: 1.125rem; height: 1.125rem; }
.ts-small { font-size: 0.8125rem; }
.ts-big { font-size: 1.0625rem; }
@media (hover: hover) and (pointer: fine) { .seg-btn:hover { background: var(--panel-2); } }

/* Chips (presets) */
.presets { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  min-height: 2.25rem;
  padding: 0 0.875rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--fg);
  font-size: 0.8125rem;
  font-weight: 500;
  transition: transform 120ms var(--ease-out), background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}
.chip:active { transform: scale(0.96); transition-duration: 0s; }
.chip[aria-pressed="true"] { background: var(--primary); color: var(--primary-fg); border-color: var(--primary); }
@media (hover: hover) and (pointer: fine) { .chip:hover { border-color: var(--line-strong); } .chip[aria-pressed="true"]:hover { background: var(--primary-hover); } }

/* ---------- Cards ---------- */
.card, .panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  min-width: 0;
}
@media (min-width: 640px) { .card, .panel { padding: 1.25rem 1.5rem; } }
.card-head, .panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.625rem 1rem;
  margin-bottom: 1.25rem;
}
.card-head h2, .panel-head h2, .panel-title { font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.01em; }
.panel-title { margin-bottom: 1.25rem; }
.admin-main { display: grid; gap: 2rem; margin: 0.5rem 0; }
.admin-main > .panel { padding-top: 1.5rem; padding-bottom: 1.5rem; }
@media (min-width: 640px) { .admin-main > .panel { padding: 1.75rem 1.75rem 1.75rem; } }
.audit-nav output { min-width: 8.5rem; text-align: center; font-size: 0.8125rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.seg-btn:disabled { opacity: 0.4; }
.card-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }

/* ---------- Forms ---------- */
.fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 0.75rem;
}
@media (min-width: 640px) { .fields { grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: 1.125rem 1rem; } }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 0.75rem; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); } }
.field { display: grid; gap: 0.375rem; min-width: 0; align-content: start; }
.field-wide, .field.wide { grid-column: 1 / -1; }
@media (min-width: 640px) { .field-wide, .field.wide { grid-column: span 2; } }
.field label { font-size: 0.875rem; font-weight: 500; line-height: 1.4; }
.field label .unit, .field label small { color: var(--muted); font-weight: 400; font-size: 0.8125rem; white-space: nowrap; }
.field input, .field select, .field textarea, .input {
  width: 100%;
  min-height: 3.25rem;
  padding: 0.8125rem 0.9375rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--paper);
  color: var(--fg);
  font-size: max(1rem, 16px);
  font-weight: 500;
  line-height: 1.4;
  min-width: 0;
  transition: border-color 160ms ease, background-color 160ms ease;
  -webkit-appearance: none;
  appearance: none;
}
.field select {
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 1.25rem) 50%, calc(100% - 0.875rem) 50%;
  background-size: 0.375rem 0.375rem;
  background-repeat: no-repeat;
  padding-right: 2.5rem;
}
.field input::placeholder { color: var(--muted); font-weight: 400; }
.field input:focus-visible, .field select:focus-visible, .input:focus-visible { border-color: var(--fg); outline-offset: 1px; }
.field input[aria-invalid="true"] { border-color: var(--bad-fg); }
.err { color: var(--bad-fg); font-size: 0.8125rem; font-weight: 500; line-height: 1.4; }
@media (hover: hover) and (pointer: fine) { .field input:hover, .field select:hover { border-color: var(--line-strong); } }

/* Number steppers */
.stepper {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--paper);
  overflow: hidden;
  transition: border-color 160ms ease;
}
.stepper:focus-within { border-color: var(--fg); }
.stepper input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: center;
  padding-left: 0.25rem;
  padding-right: 0.25rem;
  -moz-appearance: textfield;
}
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper input:focus-visible { outline: none; }
.stepper button {
  flex: 0 0 2.75rem;
  border: 0;
  background: transparent;
  color: var(--fg);
  display: grid;
  place-items: center;
  transition: background-color 120ms ease, transform 120ms var(--ease-out);
}
.stepper button svg { width: 1.125rem; height: 1.125rem; }
.stepper button:active { background: var(--line); transition-duration: 0s; }
.stepper button:focus-visible { outline-offset: -3px; }
.stepper .inc { border-left: 1px solid var(--line); }
.stepper .dec { border-right: 1px solid var(--line); }
@media (hover: hover) and (pointer: fine) { .stepper button:hover { background: var(--panel-2); } }

fieldset { border: 0; padding: 0; margin: 1.25rem 0 0; min-width: 0; }
fieldset:first-child { margin-top: 0; }
legend { padding: 0; margin-bottom: 0.75rem; font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.note { color: var(--muted); font-size: 0.8125rem; margin-top: 1rem; line-height: 1.55; }
.form-status, .auth-error {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-s);
  background: var(--bad-bg);
  border: 1px solid color-mix(in srgb, var(--bad-fg) 20%, transparent);
  color: var(--bad-fg);
  font-weight: 500;
  font-size: 0.875rem;
  line-height: 1.5;
}
.form-status { margin-top: 1rem; }

/* Autocomplete */
.ac-wrap { position: relative; }
.ac {
  position: absolute;
  left: 0; right: 0;
  top: calc(100% + 0.375rem);
  z-index: 30;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  box-shadow: var(--shadow-2);
  max-height: 16rem;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 0.25rem;
}
.ac [role="option"] {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  width: 100%;
  min-height: 2.75rem;
  padding: 0.5rem 0.625rem;
  border: 0;
  border-radius: 0.375rem;
  background: transparent;
  color: var(--fg);
  text-align: left;
  font-size: 0.9375rem;
  line-height: 1.35;
}
.ac [role="option"] svg { width: 1rem; height: 1rem; flex: 0 0 auto; color: var(--muted); }
.ac [role="option"][aria-selected="true"], .ac [role="option"]:focus-visible { background: var(--panel-2); outline: none; }
.ac .ac-empty { padding: 0.75rem; color: var(--muted); font-size: 0.875rem; }

/* Route card */
.route-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; margin-top: 1rem; }
.route-actions .hint { flex: 1 1 14rem; }
.route-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.625rem; margin-top: 1rem; }
@media (min-width: 640px) { .route-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 0.75rem 0.875rem; min-width: 0; }
.stat .v { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.01em; margin-top: 0.125rem; }
.stat .s { font-size: 0.75rem; color: var(--muted); margin-top: 0.125rem; }
.map { height: 16rem; margin-top: 1rem; border-radius: var(--radius-s); border: 1px solid var(--line); overflow: hidden; background: var(--paper); isolation: isolate; }
@media (min-width: 640px) { .map { height: 20rem; } }
.map .leaflet-control-attribution { font-size: 0.625rem; }
.route-applied { margin-top: 0.75rem; }

/* ---------- KPIs ---------- */
.sum, .kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.625rem; }
@media (min-width: 640px) { .sum, .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; } }
@media (min-width: 900px) { .sum, .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kpi {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.875rem 1rem;
  min-width: 0;
}
.kpi.main { grid-column: 1 / -1; background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
@media (min-width: 640px) { .kpi.main { grid-column: span 2; } }
.kpi .label { font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.kpi .v { font-size: 1.5rem; font-weight: 600; line-height: 1.15; margin-top: 0.25rem; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.kpi.main .v { font-size: 2.5rem; color: var(--accent-text); letter-spacing: -0.03em; }
.kpi .s { font-size: 0.8125rem; color: var(--muted); margin-top: 0.25rem; }
sup.day { font-size: 0.5em; font-weight: 700; color: var(--accent-text); margin-left: 0.125em; vertical-align: super; }
.chip.ok, .chip.bad {
  display: inline-block;
  margin-top: 0.5rem;
  min-height: 0;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  line-height: 1.4;
  border: 0;
}
.chip.ok { background: var(--ok-bg); color: var(--ok-fg); }
.chip.bad { background: var(--bad-bg); color: var(--bad-fg); }

/* ---------- Legend + Gantt ---------- */
.legend { list-style: none; margin: 0 0 0.875rem; padding: 0; display: flex; flex-wrap: wrap; gap: 0.375rem 1rem; font-size: 0.8125rem; color: var(--muted); }
.legend i { display: inline-block; width: 0.75rem; height: 0.75rem; border-radius: 3px; vertical-align: -1px; margin-right: 0.4rem; }
.sw-setup { background: var(--setup); } .sw-load { background: var(--load); } .sw-go { background: var(--go); }
.sw-wait { background: var(--wait); } .sw-pour { background: var(--pour); } .sw-back { background: var(--back); }

.chart-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--panel);
}
.chart-scroll:focus-visible { outline-offset: 0; }
.gantt { position: relative; display: inline-block; min-width: 100%; --labelw: 7rem; }
.gantt-row { display: flex; height: 2.375rem; }
.gantt-row.axis { height: 1.75rem; }
.gantt-label {
  position: sticky; left: 0; z-index: 2;
  flex: 0 0 var(--labelw); width: var(--labelw);
  display: flex; align-items: center;
  padding: 0 0.625rem;
  font-size: 0.8125rem; font-weight: 500;
  background: var(--paper);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gantt-row:last-child .gantt-label, .gantt-row:last-child .gantt-track { border-bottom: 0; }
.gantt-track {
  position: relative; flex: 0 0 auto;
  border-bottom: 1px solid var(--line);
  background-image: linear-gradient(to right, var(--line-strong) 1px, transparent 1px), linear-gradient(to right, var(--line) 1px, transparent 1px);
  background-repeat: repeat-x;
}
.axis .gantt-track { background-image: none; }
.tick { position: absolute; top: 0.3rem; transform: translateX(-50%); font-size: 0.6875rem; font-weight: 500; color: var(--muted); white-space: nowrap; }
.bar {
  position: absolute; top: 0.4375rem; height: calc(100% - 0.875rem);
  border: 0; border-radius: 4px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.6875rem; font-weight: 700; color: var(--bar-text);
  overflow: hidden; white-space: nowrap;
}
.bar:focus-visible, .bar.selected { outline: 2px solid var(--fg); outline-offset: 1px; z-index: 1; }
.bar-setup { background: var(--setup); } .bar-load { background: var(--load); } .bar-go { background: var(--go); }
.bar-wait { background: var(--wait); } .bar-pour { background: var(--pour); } .bar-back { background: var(--back); }
.vline { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px dashed var(--accent); z-index: 1; pointer-events: none; }
.vline.now { border-left: 2px solid var(--focus); }
.vline span { position: absolute; top: 0.125rem; left: 0.25rem; font-size: 0.625rem; font-weight: 700; padding: 0 0.3rem; border-radius: 3px; background: var(--accent); color: #fff; white-space: nowrap; }
.vline.now span { background: var(--focus); }
.chart-detail { margin-top: 0.75rem; font-size: 0.875rem; min-height: 1.5em; color: var(--muted); }
.chart-detail b { color: var(--fg); font-weight: 600; }
.zoom { display: inline-flex; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: 0.9375rem; }
th, td { padding: 0.625rem 0.75rem; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; vertical-align: top; }
th { font-size: 0.6875rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
td.dep { font-weight: 600; }
td .w { color: var(--wait); font-weight: 600; }
@media (min-width: 640px) and (max-width: 1023px) { th, td { padding: 0.5rem; } table { font-size: 0.875rem; } }
@media (max-width: 639px) {
  table, tbody { display: block; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  tbody { display: grid; gap: 0.625rem; }
  tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.25rem 1rem;
    padding: 0.75rem 0.875rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-s);
    background: var(--paper);
  }
  td { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; padding: 0.125rem 0; border: 0; white-space: normal; }
  td::before { content: attr(data-label); color: var(--muted); font-size: 0.75rem; font-weight: 500; }
  td.head { grid-column: 1 / -1; display: block; font-weight: 600; font-size: 1rem; padding-bottom: 0.375rem; border-bottom: 1px solid var(--line); margin-bottom: 0.25rem; }
  td.head::before { content: attr(data-label) " "; color: inherit; font-size: inherit; font-weight: inherit; }
}

/* ---------- Dock (floating actions) ---------- */
.dock {
  position: fixed;
  left: 50%;
  bottom: calc(0.875rem + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  align-items: stretch;
  max-width: calc(100vw - 1.5rem);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 1.5rem;
  box-shadow: var(--shadow-1);
  overflow: hidden;
}
@media (min-width: 900px) { .dock { left: auto; right: 1.5rem; transform: none; } }
.dock button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0.75rem 1rem;
  border: 0;
  background: transparent;
  color: var(--fg);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  transition: background-color 160ms ease, transform 160ms var(--ease-out);
}
.dock button + button { border-left: 1px solid var(--line); }
.dock button svg { width: 1.125rem; height: 1.125rem; flex: 0 0 auto; }
.dock button:active { transform: scale(0.985); filter: brightness(0.95); transition-duration: 0s; }
.dock button:focus-visible { outline-offset: -4px; }
@media (hover: hover) and (pointer: fine) { .dock button:hover { background: var(--panel-2); } }
@media (max-width: 359px) { .dock button span { display: none; } }

/* ---------- Popover menu ---------- */
.usermenu { position: relative; }
.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  min-width: 15rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-2);
  padding: 0.375rem;
  z-index: 70;
  display: grid;
  transform-origin: top right;
  transition: opacity 150ms var(--ease-out), transform 150ms var(--ease-out);
  @starting-style { opacity: 0; transform: scale(0.97); }
}
.menu-head { padding: 0.625rem 0.75rem 0.75rem; border-bottom: 1px solid var(--line); margin-bottom: 0.25rem; display: grid; }
.menu-head b { font-weight: 600; }
.menu-head span { font-size: 0.8125rem; color: var(--muted); overflow-wrap: anywhere; }
.menu [role="menuitem"] {
  display: flex; align-items: center; gap: 0.625rem;
  width: 100%; text-align: left;
  background: none; border: 0;
  padding: 0.625rem 0.75rem;
  border-radius: 0.5rem;
  font: inherit; font-size: 0.9375rem; font-weight: 500;
  color: inherit; text-decoration: none;
  cursor: pointer; min-height: 2.75rem;
  transition: background-color 120ms ease;
}
.menu [role="menuitem"] svg { width: 1.125rem; height: 1.125rem; color: var(--muted); }
.menu [role="menuitem"]:active { background: var(--line); }
.menu [role="menuitem"]:focus-visible { background: var(--panel-2); outline: none; }
.menu .danger { color: var(--bad-fg); }
.menu .danger svg { color: inherit; }
@media (hover: hover) and (pointer: fine) { .menu [role="menuitem"]:hover { background: var(--panel-2); } }

/* ---------- Dialogs: bottom sheet on phones, centered modal otherwise ---------- */
dialog.sheet, dialog.dlg {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--fg);
  padding: 0;
  margin: 0;
  max-width: none;
  max-height: none;
  width: 100%;
  position: fixed;
  inset: auto 0 0 0;
  border-radius: var(--radius-l) var(--radius-l) 0 0;
  box-shadow: var(--shadow-2);
  overscroll-behavior: contain;
}
dialog.sheet::backdrop, dialog.dlg::backdrop { background: rgba(25, 25, 25, 0.45); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.sheet-inner {
  max-height: 85dvh;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 0.75rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
  display: grid;
  gap: 0.875rem;
}
.sheet-handle { width: 2.25rem; height: 0.3125rem; border-radius: 999px; background: var(--line-strong); margin: 0 auto 0.25rem; }
dialog.sheet h2, dialog.dlg h2 { font-size: 1.125rem; font-weight: 600; letter-spacing: -0.01em; }
dialog.sheet[open], dialog.dlg[open] {
  transform: translateY(0);
  opacity: 1;
  transition: transform 260ms var(--ease-drawer), opacity 200ms var(--ease-out);
  @starting-style { transform: translateY(100%); opacity: 1; }
}
@media (min-width: 640px) {
  dialog.sheet, dialog.dlg {
    inset: 0;
    margin: auto;
    width: min(92vw, 30rem);
    border-radius: var(--radius);
  }
  dialog.sheet[open], dialog.dlg[open] {
    transform: scale(1);
    transition: transform 180ms var(--ease-out), opacity 180ms var(--ease-out);
    @starting-style { transform: scale(0.97); opacity: 0; }
  }
  .sheet-handle { display: none; }
  .sheet-inner { padding: 1.5rem; max-height: 85vh; }
}
@media (prefers-reduced-motion: reduce) {
  dialog.sheet[open], dialog.dlg[open] { transition: opacity 150ms ease; @starting-style { transform: none; opacity: 0; } }
  .menu { transition: opacity 120ms ease; @starting-style { transform: none; } }
}
dialog form { display: grid; gap: 0.875rem; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 0.5rem; flex-wrap: wrap; }
.dlg-actions .btn { flex: 1 1 auto; }
@media (min-width: 640px) { .dlg-actions .btn { flex: 0 0 auto; } }
.option-row { display: flex; align-items: flex-start; gap: 0.75rem; padding: 0.75rem 0.875rem; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--paper); font-size: 0.9375rem; line-height: 1.4; cursor: pointer; }
.option-row input[type="checkbox"] { width: 1.25rem; height: 1.25rem; margin: 0.1rem 0 0; accent-color: var(--primary); flex: 0 0 auto; }
.option-row span small { display: block; color: var(--muted); font-size: 0.8125rem; margin-top: 0.125rem; }
.stack { display: grid; gap: 0.625rem; }
.summary-box { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 0.875rem 1rem; font-size: 0.9375rem; line-height: 1.5; }
.summary-box b { font-weight: 600; }
.qr-box { display: grid; place-items: center; gap: 0.75rem; padding: 1rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-s); }
.qr-box svg { width: min(100%, 14rem); height: auto; }
.link-box { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8125rem; color: var(--muted); overflow-wrap: anywhere; word-break: break-all; }

/* ---------- Toast ---------- */
#toast {
  position: fixed;
  left: 50%;
  bottom: calc(5rem + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: calc(100vw - 2rem);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-s);
  background: var(--primary);
  color: var(--primary-fg);
  font-weight: 500;
  font-size: 0.875rem;
  box-shadow: var(--shadow-2);
  transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out);
  @starting-style { opacity: 0; transform: translateX(-50%) translateY(0.5rem); }
}
#toast .btn { min-height: 2.25rem; padding: 0.25rem 0.75rem; background: transparent; color: inherit; border-color: currentColor; }

/* ---------- Login page ---------- */
.auth-body { display: flex; flex-direction: column; min-height: 100dvh; }
.auth-wrap { margin: auto; width: 100%; max-width: 26rem; padding: max(1.5rem, env(safe-area-inset-top, 0px)) 1rem max(1.5rem, env(safe-area-inset-bottom, 0px)); display: grid; gap: 1rem; }
.auth-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 1.75rem 1.25rem 1.5rem; display: grid; gap: 0.625rem; }
@media (min-width: 640px) { .auth-card { padding: 2.25rem 2rem 1.75rem; box-shadow: var(--shadow-1); } }
.auth-logo { width: min(100%, 13rem); height: auto; margin: 0 auto 0.75rem; }
.auth-title { font-size: 1.25rem; font-weight: 600; text-align: center; letter-spacing: -0.01em; }
.auth-sub { color: var(--muted); text-align: center; font-size: 0.9375rem; }
.auth-card form { display: grid; gap: 0.875rem; margin-top: 0.5rem; }
.pw { position: relative; }
.pw input { padding-right: 3.25rem; }
.pw-toggle { position: absolute; right: 0.25rem; top: 50%; transform: translateY(-50%); width: 2.75rem; height: 2.75rem; min-height: 0; padding: 0; border: 0; background: transparent; color: var(--muted); border-radius: 50%; }
.pw-toggle[aria-pressed="true"] { color: var(--fg); background: transparent; border: 0; }
.auth-note { font-size: 0.9375rem; line-height: 1.55; }
.auth-foot { text-align: center; font-size: 0.8125rem; color: var(--muted); margin-top: 0.75rem; }
.auth-controls { display: flex; justify-content: center; }

/* ---------- Administration ---------- */
.status-pill { display: inline-block; padding: 0.15rem 0.55rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.status-pill.on { background: var(--ok-bg); color: var(--ok-fg); }
.status-pill.off { background: var(--bad-bg); color: var(--bad-fg); }
.row-actions { display: flex; gap: 0.375rem; flex-wrap: wrap; align-items: flex-start; }
.actions-cell { white-space: nowrap; }
.actions-cell .row-actions { flex-wrap: nowrap; }
.actions-cell .cell-select { min-width: 7.5rem; max-width: 8.5rem; }
@media (min-width: 640px) { #usersTable th, #usersTable td { padding-left: 0.5rem; padding-right: 0.5rem; } }
.status-cell { max-width: 12rem; }
.status-note { display: block; font-size: 0.75rem; margin-top: 0.25rem; }
.row-menu { display: inline-block; }
.row-menu summary { list-style: none; cursor: pointer; display: inline-flex; }
.row-menu summary::-webkit-details-marker { display: none; }
.row-menu summary::after { content: ''; width: 0.5rem; height: 0.5rem; margin-left: 0.5rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.row-menu[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.row-menu-list { display: grid; gap: 0.25rem; margin-top: 0.375rem; justify-items: start; }
.row-actions .btn { min-height: 2.25rem; padding: 0 0.75rem; font-size: 0.8125rem; }
td.wrap-ok { white-space: normal; min-width: 10rem; }
.audit-table td { font-size: 0.875rem; }
.gen-row { display: flex; gap: 0.5rem; align-items: stretch; }
.gen-row input { flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.created-note { background: var(--ok-bg); color: var(--ok-fg); padding: 0.75rem 1rem; border-radius: var(--radius-s); font-weight: 500; overflow-wrap: anywhere; margin-top: 0.75rem; }
.created-note code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1rem; background: rgba(0, 0, 0, 0.08); padding: 0.1rem 0.4rem; border-radius: 0.3rem; user-select: all; -webkit-user-select: all; }
#newUserForm .auth-error { margin-top: 0.75rem; }
@media (max-width: 639px) { .row-actions { flex-direction: column; align-items: stretch; } }

/* ---------- Fleet ---------- */
.fleet { display: grid; gap: 0.625rem; margin-top: 1rem; }
.fleet-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.5rem 0.75rem;
  align-items: end;
  padding: 0.75rem 0.875rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--paper);
}
.fleet-row .fleet-name { grid-column: 1 / -1; font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.02em; }
.fleet-row .field input, .fleet-row .field select { background: var(--panel); min-height: 2.75rem; padding: 0.5rem 0.75rem; }
.fleet-row .field label { font-size: 0.75rem; color: var(--muted); }
@media (min-width: 640px) {
  .fleet-row { grid-template-columns: 7rem minmax(0, 1fr) minmax(0, 1fr); align-items: end; }
  .fleet-row .fleet-name { grid-column: auto; padding-bottom: 0.875rem; }
}
input.plate { text-transform: uppercase; letter-spacing: 0.08em; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.badge { display: inline-flex; align-items: center; gap: 0.5rem; width: fit-content; padding: 0.3rem 0.75rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); font-size: 0.8125rem; font-weight: 600; }
.mail-box { display: grid; gap: 0.75rem; padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--paper); }
.mail-box .field input { background: var(--panel); }
.it-search { max-width: 24rem; }
.it-name { font-weight: 600; }
.it-meta { color: var(--muted); font-size: 0.8125rem; }
@media (max-width: 639px) {
  td.it-cell { grid-column: 1 / -1; display: block; }
  td.it-cell::before { display: block; margin-bottom: 0.125rem; }
  td.it-cell br { display: none; }
  td.it-cell .it-meta { display: block; margin-top: 0.125rem; }
}

/* ---------- Live location (coming soon) ---------- */
.live-card { position: relative; overflow: hidden; padding: 0; min-height: 16rem; isolation: isolate; }
.live-card.tall { min-height: 24rem; }
.live-map { position: absolute; inset: 0; background: url("/brand/map-preview.jpg") center / cover no-repeat; filter: blur(5px) saturate(0.85); transform: scale(1.06); }
:root[data-theme="dark"] .live-map { filter: blur(5px) saturate(0.7) brightness(0.55); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .live-map { filter: blur(5px) saturate(0.7) brightness(0.55); } }
.live-overlay {
  position: relative;
  z-index: 1;
  min-height: inherit;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 2rem 1.25rem;
  background: color-mix(in srgb, var(--bg) 42%, transparent);
}
.live-overlay > div { display: grid; gap: 0.5rem; justify-items: center; max-width: 30rem; }
.live-overlay .pill { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.9rem; border-radius: 999px; background: var(--primary); color: var(--primary-fg); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; }
.live-overlay h2 { font-size: 1.375rem; font-weight: 600; letter-spacing: -0.02em; }
.live-overlay p { color: var(--fg); font-size: 0.9375rem; line-height: 1.55; }
.live-overlay .attrib { font-size: 0.6875rem; color: var(--muted); margin-top: 0.5rem; }
.live-plates { display: flex; flex-wrap: wrap; gap: 0.375rem; justify-content: center; margin-top: 0.25rem; }
.live-plates span { background: var(--panel); border: 1px solid var(--line); border-radius: 0.375rem; padding: 0.25rem 0.5rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.8125rem; letter-spacing: 0.06em; }
.sheet-inner .live-card { min-height: 14rem; border-radius: var(--radius-s); border: 1px solid var(--line); }

/* ---------- Editable schedule (editors) ---------- */
td .cell-select, td .cell-time {
  min-height: 2.5rem;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 0.375rem;
  background: var(--paper);
  color: var(--fg);
  font: inherit;
  font-size: max(0.9375rem, 16px);
  font-weight: 500;
  max-width: 100%;
}
td .cell-time { font-weight: 600; width: 8.5rem; }
td .cell-select { max-width: 11rem; }
tr.manual td.dep-cell { box-shadow: inset 3px 0 0 var(--accent); }
.cell-edit { display: inline-flex; align-items: center; gap: 0.25rem; }
.cell-reset { width: 2rem; height: 2rem; border: 0; border-radius: 50%; background: transparent; color: var(--muted); display: inline-grid; place-items: center; }
.cell-reset svg { width: 1rem; height: 1rem; }
.cell-reset:active { background: var(--line); }
.cell-warn { display: block; color: var(--bad-fg); font-size: 0.75rem; font-weight: 500; margin-top: 0.125rem; white-space: normal; }
.edit-note { font-size: 0.8125rem; color: var(--muted); margin-top: 0.75rem; }
.edit-note b { color: var(--accent-text); }
td .cell-num { width: 5.25rem; min-height: 2.5rem; padding: 0 0.5rem; font-size: 1rem; font-weight: 600; text-align: right; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--paper); color: var(--fg); -moz-appearance: textfield; }
td .cell-num::-webkit-inner-spin-button, td .cell-num::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
td .cell-num:focus-visible { outline: 2px solid var(--fg); outline-offset: 1px; }
.cell-actions { white-space: nowrap; }
.cell-actions .cell-reset + .cell-reset { margin-left: 0.125rem; }
.cell-rm:hover, .cell-rm:focus-visible { color: var(--bad-fg); }
.cell-tag { display: block; font-size: 0.6875rem; font-weight: 500; color: var(--accent-text); letter-spacing: 0.02em; }
tr.removed td { color: var(--muted); background: var(--paper); font-size: 0.875rem; }
tr.removed .linklike { color: var(--fg); font-weight: 500; }
@media (max-width: 639px) { .cell-actions { justify-content: flex-start; gap: 0.5rem; } tr.removed .removed-cell { display: block; } }
@media (max-width: 639px) { td .cell-select { max-width: 9.5rem; } }

/* ---------- Settings sheet ---------- */
.set-list { display: grid; gap: 0.375rem; }
.set-row { display: flex; align-items: center; gap: 0.625rem; padding: 0.5rem 0.625rem; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--paper); }
.set-row input[type="checkbox"] { width: 1.125rem; height: 1.125rem; accent-color: var(--primary); flex: 0 0 auto; }
.set-row span { flex: 1 1 auto; font-size: 0.9375rem; }
.set-row .mv { width: 2rem; height: 2rem; border: 1px solid var(--line); border-radius: 0.375rem; background: var(--panel); display: inline-grid; place-items: center; color: var(--fg); }
.set-row .mv svg { width: 0.875rem; height: 0.875rem; }
.set-row .mv:disabled { opacity: 0.3; }
.set-group { display: grid; gap: 0.625rem; }
.set-group h3 { font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.sum-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.625rem; }
.sum-head .eyebrow { margin: 0; }

/* ---------- Presence (check-in / check-out) ---------- */
.presence { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; padding: 0.75rem 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.presence-main { display: grid; gap: 0.125rem; min-width: 0; }
.presence-main b { font-weight: 600; font-size: 0.9375rem; }
.presence-main span { font-size: 0.8125rem; color: var(--muted); }
.presence .btn { min-width: 8rem; }

/* ---------- Plan B ---------- */
.field textarea { resize: vertical; min-height: 6rem; line-height: 1.5; font-weight: 400; }

/* ---------- Chat ---------- */
.chat-fab {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right, 0px));
  bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
  z-index: 55;
  width: 3.25rem; height: 3.25rem;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--fg);
  display: grid; place-items: center;
  box-shadow: var(--shadow-1);
  transition: transform 120ms var(--ease-out), background-color 160ms ease;
}
.chat-fab svg { width: 1.375rem; height: 1.375rem; }
.chat-fab:active { transform: scale(0.95); transition-duration: 0s; }
.chat-fab[aria-expanded="true"] { background: var(--panel-2); border-color: var(--line-strong); }
@media (hover: hover) and (pointer: fine) { .chat-fab:hover { background: var(--panel-2); } }
@media (min-width: 900px) { .chat-fab { bottom: calc(5.25rem + env(safe-area-inset-bottom, 0px)); right: 1.5rem; } }
.chat-badge, .chat-count { display: inline-grid; place-items: center; min-width: 1.25rem; height: 1.25rem; padding: 0 0.3rem; border-radius: 999px; background: var(--wait); color: #fff; font-size: 0.6875rem; font-weight: 700; line-height: 1; }
.chat-badge { position: absolute; top: -0.25rem; right: -0.25rem; box-shadow: 0 0 0 2px var(--panel); }
.chat-panel {
  position: fixed;
  right: 1.5rem;
  bottom: calc(9rem + env(safe-area-inset-bottom, 0px));
  z-index: 56;
  width: min(26rem, calc(100vw - 3rem));
  height: min(40rem, calc(100dvh - 11rem));
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform-origin: bottom right;
  transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out);
  @starting-style { opacity: 0; transform: scale(0.97) translateY(0.5rem); }
}
.chat-sheet .sheet-inner { display: none; }
dialog.chat-sheet { height: 92dvh; max-height: 92dvh; display: flex; flex-direction: column; padding: 0; }
dialog.chat-sheet:not([open]) { display: none; }
.chat { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; height: 100%; }
.chat.page { height: min(44rem, calc(100dvh - 15rem)); min-height: 28rem; }
.chat-head { display: flex; align-items: center; gap: 0.5rem; padding: 0.625rem 0.75rem; border-bottom: 1px solid var(--line); background: var(--panel-2); flex: 0 0 auto; }
.chat-headtext { flex: 1 1 auto; min-width: 0; display: grid; }
.chat-title { font-size: 0.9375rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-sub { font-size: 0.75rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-list, .chat-newwrap { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 0.5rem; }
.chat-toolbar { display: flex; gap: 0.5rem; flex-wrap: wrap; padding: 0.25rem 0.25rem 0.625rem; }
.chat-items { display: grid; gap: 0.125rem; }
.chat-item { display: flex; align-items: center; gap: 0.625rem; width: 100%; padding: 0.5rem 0.5rem; border: 0; border-radius: var(--radius-s); background: transparent; color: var(--fg); text-align: left; min-height: 3.25rem; transition: background-color 120ms ease; }
.chat-item:active { background: var(--line); transition-duration: 0s; }
@media (hover: hover) and (pointer: fine) { .chat-item:hover { background: var(--panel-2); } }
.chat-avatar { flex: 0 0 2.5rem; width: 2.5rem; height: 2.5rem; border-radius: 50%; background: var(--primary); color: var(--primary-fg); display: grid; place-items: center; font-size: 0.8125rem; font-weight: 600; }
.chat-avatar.group { background: var(--accent-soft); color: var(--accent-text); }
.chat-avatar svg { width: 1.125rem; height: 1.125rem; }
.chat-item-main { flex: 1 1 auto; min-width: 0; display: grid; gap: 0.125rem; }
.chat-item-title { font-size: 0.9375rem; font-weight: 600; display: flex; align-items: center; gap: 0.375rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-tag { font-size: 0.625rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-text); background: var(--accent-soft); padding: 0.1rem 0.4rem; border-radius: 999px; }
.chat-item-sub { font-size: 0.8125rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item.unread .chat-item-sub { color: var(--fg); font-weight: 500; }
.chat-item-side { display: grid; justify-items: end; gap: 0.25rem; flex: 0 0 auto; }
.chat-item-time { font-size: 0.6875rem; color: var(--muted); }
.chat-empty { padding: 1.5rem 0.75rem; color: var(--muted); font-size: 0.9375rem; text-align: center; }
.chat-new { display: grid; gap: 0.75rem; padding: 0.25rem; }
.user-pick { display: grid; gap: 0.375rem; max-height: 18rem; overflow: auto; }
.chat-thread { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.chat-status:empty { display: none; }
.chat-monitor { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.75rem; background: var(--accent-soft); color: var(--accent-text); font-size: 0.8125rem; font-weight: 500; }
.chat-monitor svg { width: 1rem; height: 1rem; flex: 0 0 auto; }
.chat-monitor .btn { margin-left: auto; }
.msgs { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 0.75rem; display: flex; flex-direction: column; gap: 0.375rem; }
.msg-day { align-self: center; font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding: 0.5rem 0 0.25rem; }
.msg { display: grid; gap: 0.125rem; max-width: 85%; }
.msg.me { align-self: flex-end; justify-items: end; }
.msg.other { align-self: flex-start; }
.msg-name { font-size: 0.6875rem; font-weight: 600; color: var(--muted); padding-left: 0.25rem; }
.msg-bubble { padding: 0.5rem 0.75rem; border-radius: 1rem; background: var(--paper); border: 1px solid var(--line); font-size: 0.9375rem; line-height: 1.45; overflow-wrap: anywhere; white-space: normal; }
.msg.me .msg-bubble { background: var(--primary); color: var(--primary-fg); border-color: var(--primary); border-bottom-right-radius: 0.3rem; }
.msg.other .msg-bubble { border-bottom-left-radius: 0.3rem; }
.msg.deleted .msg-bubble { background: transparent; color: var(--muted); border-style: dashed; }
.msg-meta { display: flex; align-items: center; gap: 0.25rem; font-size: 0.6875rem; color: var(--muted); padding: 0 0.25rem; }
.msg-del { width: 1.5rem; height: 1.5rem; border: 0; background: transparent; color: var(--muted); display: inline-grid; place-items: center; border-radius: 50%; opacity: 0.7; }
.msg-del svg { width: 0.875rem; height: 0.875rem; }
.composer { display: flex; align-items: flex-end; gap: 0.5rem; padding: 0.625rem 0.75rem calc(0.625rem + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); background: var(--panel); flex: 0 0 auto; }
.composer textarea { flex: 1 1 auto; min-width: 0; min-height: 2.75rem; max-height: 8.75rem; padding: 0.625rem 0.875rem; border: 1px solid var(--line); border-radius: 1.375rem; background: var(--paper); color: var(--fg); font: inherit; font-size: max(1rem, 16px); line-height: 1.4; resize: none; }
.composer textarea:focus-visible { border-color: var(--fg); outline-offset: 1px; }
.chat-send { flex: 0 0 auto; }
.chat-card { padding: 0; overflow: hidden; }
.chat-page .chat-card { border-radius: var(--radius-l); }
@media (max-width: 639px) { .chat.page { height: calc(100dvh - 13rem); } }

/* ---------- Attendance (admin) ---------- */
.att-filters { display: flex; flex-wrap: wrap; gap: 0.5rem 0.75rem; align-items: end; margin-bottom: 0.75rem; }
.att-filters .field { min-width: 9rem; }

/* ---------- Fleet sections in the planner ---------- */
.fleet-section { margin-top: 1rem; }
.fleet-section:first-of-type { margin-top: 0; }
.fleet-sechead { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.5rem; }
.fleet-sechead h3 { font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.fleet-row.pump { grid-template-columns: minmax(0, 1fr) auto; }
.fleet-row .rm { width: 2.5rem; height: 2.5rem; border: 1px solid var(--line); border-radius: 50%; background: var(--panel); color: var(--muted); display: inline-grid; place-items: center; align-self: end; margin-bottom: 0.125rem; }
.fleet-row .rm svg { width: 1rem; height: 1rem; }
.fleet-row .rm:active { background: var(--line); }
.fleet-row .fleet-meta { grid-column: 1 / -1; font-size: 0.75rem; color: var(--muted); }
.fleet-row .field { position: relative; }
.fleet-row .ac { font-size: 0.875rem; }
@media (min-width: 640px) {
  .fleet-row { grid-template-columns: 7rem minmax(0, 1fr) minmax(0, 1fr) auto; }
  .fleet-row.pump { grid-template-columns: 7rem minmax(0, 1fr) auto; }
}
.plate-chip { display: inline-block; padding: 0.15rem 0.5rem; border: 1px solid var(--line-strong); border-radius: 0.3rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.8125rem; letter-spacing: 0.06em; background: var(--paper); }
td.vin { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.75rem; letter-spacing: 0.02em; }
.exp-warn { color: var(--bad-fg); font-weight: 600; }
tr.inactive-row td { opacity: 0.55; }

/* ---------- Simple pages ---------- */
.error-page { margin-top: 2rem; display: grid; gap: 0.75rem; justify-items: start; }
.error-page h1 { font-size: 1.5rem; font-weight: 600; }
.foot { color: var(--muted); font-size: 0.8125rem; text-align: center; padding: 0.5rem 0 0; }
.print-meta { display: none; }
noscript .card { border-color: var(--bad-fg); }

/* Legacy header used by admin/login pages */
.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1rem; }
.brand { display: grid; gap: 0.5rem; min-width: 0; }
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }

/* ---------- Departure order strip, sequence marks, live execution ---------- */
.order-strip { list-style: none; margin: 0 0 0.75rem; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem; }
.order-head { font-size: 0.8125rem; color: var(--muted); margin-right: 0.25rem; }
.order-more .linklike { font-size: 0.8125rem; color: var(--fg); font-weight: 500; padding: 0.25rem 0.25rem; }
.order-chip { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.2rem 0.625rem 0.2rem 0.25rem; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); font-size: 0.8125rem; line-height: 1.2; }
.order-chip .n { width: 1.375rem; height: 1.375rem; border-radius: 50%; background: var(--fg); color: var(--bg); font-weight: 700; font-size: 0.75rem; display: grid; place-items: center; flex: 0 0 auto; }
.order-chip .t { font-weight: 600; font-variant-numeric: tabular-nums; }
.order-chip .drv { color: var(--muted); }
.order-chip.st-ok { border-color: var(--ok-fg); } .order-chip.st-ok .n { background: var(--ok-fg); color: #fff; }
.order-chip.st-late { border-color: var(--bad-fg); } .order-chip.st-late .n { background: var(--bad-fg); color: #fff; }
.order-chip.st-overdue .n { background: var(--bad-fg); color: #fff; }
.seq-mark { position: absolute; top: 0.0625rem; transform: translateX(-50%); z-index: 2; width: 1.125rem; height: 1.125rem; border-radius: 50%; background: var(--fg); color: var(--bg); font-size: 0.625rem; font-weight: 700; display: grid; place-items: center; pointer-events: none; box-shadow: 0 0 0 2px var(--panel); }
.live-dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--muted); flex: 0 0 auto; }
.live-on { border-color: var(--bad-fg); color: var(--bad-fg); }
.live-on .live-dot { background: var(--bad-fg); animation: live-pulse 1.6s ease-in-out infinite; }
@keyframes live-pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--bad-fg) 45%, transparent); } 50% { box-shadow: 0 0 0 5px transparent; } }
@media (prefers-reduced-motion: reduce) { .live-on .live-dot { animation: none; } }
.st-chip { display: inline-block; padding: 0.15rem 0.55rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; white-space: nowrap; }
.st-chip.st-pending { background: var(--paper); color: var(--muted); border: 1px solid var(--line); }
.st-chip.st-active { background: var(--accent-soft); color: var(--accent-text); }
.st-chip.st-overdue { background: var(--bad-bg); color: var(--bad-fg); border: 1px dashed var(--bad-fg); }
.st-chip.st-ok { background: var(--ok-bg); color: var(--ok-fg); }
.st-chip.st-late { background: var(--bad-bg); color: var(--bad-fg); }
.st-cell { display: grid; gap: 0.25rem; justify-items: start; }
.st-by { font-size: 0.75rem; color: var(--muted); }
.btn-xs { min-height: 2rem; padding: 0 0.625rem; font-size: 0.75rem; }
tbody tr.st-ok { background: color-mix(in srgb, var(--ok-bg) 55%, transparent); }
tbody tr.st-late { background: color-mix(in srgb, var(--bad-bg) 60%, transparent); }
tbody tr.st-ok td.head { box-shadow: inset 3px 0 0 var(--ok-fg); }
tbody tr.st-late td.head { box-shadow: inset 3px 0 0 var(--bad-fg); }
.bar-pour.st-ok { background: var(--ok-fg); }
.bar-pour.st-late { background: var(--bad-fg); }
.bar-pour.st-overdue { outline: 2px dashed var(--bad-fg); outline-offset: -2px; }
@media (max-width: 639px) { .st-cell { display: flex; flex-wrap: wrap; gap: 0.375rem 0.5rem; align-items: center; } }

/* ---------- Driver view, execution steps, account tags ---------- */
.st-chip.st-arrived { background: var(--accent-soft); color: var(--accent-text); border: 1px solid var(--accent-text); }
.st-steps { display: flex; flex-wrap: wrap; gap: 0.125rem 0.625rem; font-size: 0.75rem; color: var(--muted); font-style: normal; }
.st-steps .step { font-style: normal; white-space: nowrap; }
.st-steps .step-ok { color: var(--ok-fg); font-weight: 600; }
.st-steps .step-late { color: var(--bad-fg); font-weight: 600; }
.kind-tag { display: inline-block; font-size: 0.6875rem; font-weight: 600; padding: 0.05rem 0.45rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); margin-left: 0.375rem; vertical-align: middle; }
.drv-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.75rem; }
.drv-vehicle { display: grid; gap: 0.125rem; min-width: 0; }
.drv-vehicle b { font-size: 1.125rem; font-weight: 600; letter-spacing: 0.02em; }
.drv-vehicle span { font-size: 0.875rem; color: var(--muted); }
.daynav output { min-width: 9rem; text-align: center; font-size: 0.875rem; font-weight: 600; }
.drv-list { display: grid; gap: 1rem; }
.drv-it { display: grid; gap: 0.75rem; }
.drv-it-head { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; flex-wrap: wrap; font-size: 0.9375rem; }
.drv-load { border: 1px solid var(--line); border-radius: var(--radius); padding: 0.875rem 1rem; display: grid; gap: 0.75rem; background: var(--paper); }
.drv-load.st-ok { border-color: var(--ok-fg); background: color-mix(in srgb, var(--ok-bg) 70%, var(--panel)); }
.drv-load.st-late { border-color: var(--bad-fg); background: color-mix(in srgb, var(--bad-bg) 70%, var(--panel)); }
.drv-load.st-overdue { border: 1px dashed var(--bad-fg); }
.drv-load.st-active, .drv-load.st-arrived { border-color: var(--accent-text); }
.drv-load-top { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.drv-load-top b { font-size: 1.0625rem; font-weight: 600; }
.drv-plan { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.5rem; font-size: 0.9375rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.drv-plan span { display: block; color: var(--muted); font-size: 0.6875rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.125rem; }
.drv-btns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; }
.drv-btns.one { grid-template-columns: 1fr; }
.drv-btn { min-height: 3.5rem; display: grid; gap: 0.1rem; place-items: center; line-height: 1.2; font-size: 1rem; padding: 0.375rem 0.5rem; }
.drv-btn small { font-size: 0.75rem; font-weight: 500; opacity: 0.8; }
.drv-btn.done-ok { background: var(--ok-bg); color: var(--ok-fg); border-color: var(--ok-fg); opacity: 1; }
.drv-btn.done-late { background: var(--bad-bg); color: var(--bad-fg); border-color: var(--bad-fg); opacity: 1; }
.drv-status { margin-top: 0.25rem; }
@media (max-width: 480px) { .drv-plan { grid-template-columns: repeat(3, minmax(0, 1fr)); } .drv-btns { grid-template-columns: 1fr; } .drv-btn { grid-template-columns: auto auto; justify-content: space-between; min-height: 3.25rem; } }

/* ---------- Footer links, legal page, cookie consent ---------- */
.foot-links { margin-top: 0.25rem; line-height: 1.8; }
.foot-links a, .linklike { color: var(--muted); text-decoration: underline; text-underline-offset: 0.18em; text-decoration-color: var(--line-strong); }
.foot-links a:hover, .linklike:hover, .foot-links a:focus-visible, .linklike:focus-visible { color: var(--fg); text-decoration-color: currentColor; }
.linklike { display: inline; background: none; border: 0; padding: 0; margin: 0; font: inherit; cursor: pointer; min-height: 0; -webkit-tap-highlight-color: transparent; border-radius: 2px; }
.auth-legal { text-align: center; font-size: 0.8125rem; color: var(--muted); margin: -0.25rem 0 0; }
.stack-tight { display: grid; gap: 0.125rem; font-size: 0.8125rem; line-height: 1.45; }
.stack-tight a { color: var(--fg); }

.legal .hero { padding-bottom: 0; }
.legal-toc { display: grid; gap: 0.25rem; font-size: 0.9375rem; }
.legal-toc a { color: var(--fg); text-decoration: none; padding: 0.375rem 0; border-bottom: 1px solid var(--line); min-height: 2.75rem; display: flex; align-items: center; }
.legal-toc a:last-child { border-bottom: 0; }
.legal-toc a:hover, .legal-toc a:focus-visible { color: var(--accent-text); }
.legal-body { display: grid; gap: 0.75rem; font-size: 0.9375rem; line-height: 1.65; }
.legal-body h2 { font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.01em; margin-top: 1rem; scroll-margin-top: 5rem; }
.legal-body h2:first-child { margin-top: 0; }
.legal-body ul { padding-left: 1.25rem; display: grid; gap: 0.5rem; }
.legal-body a { color: var(--fg); text-decoration: underline; text-underline-offset: 0.18em; }
@media (min-width: 640px) {
  .legal-toc { grid-template-columns: 1fr 1fr; column-gap: 1.5rem; }
  .legal-toc a:nth-last-child(2) { border-bottom: 0; }
}

.cookie-banner {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 70;
  margin: 0 auto;
  width: 100%;
  max-width: 44rem;
  padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
  background: var(--panel);
  color: var(--fg);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: var(--radius-l) var(--radius-l) 0 0;
  box-shadow: var(--shadow-2);
  display: grid;
  gap: 0.75rem;
  font-size: 0.875rem;
  line-height: 1.5;
  transition: transform 300ms var(--ease-drawer), opacity 200ms var(--ease-out);
  @starting-style { transform: translateY(100%); opacity: 0; }
}
.cookie-text b { display: block; font-weight: 600; margin-bottom: 0.125rem; }
.cookie-text a { color: var(--fg); text-decoration: underline; text-underline-offset: 0.18em; }
.cookie-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.cookie-actions .btn { flex: 1 1 auto; }
@media (min-width: 640px) {
  .cookie-banner { bottom: 1rem; left: 1rem; right: 1rem; border-bottom: 1px solid var(--line); border-radius: var(--radius-l); padding-bottom: 1rem; grid-template-columns: 1fr auto; align-items: center; gap: 1rem; }
  .cookie-actions { justify-content: flex-end; }
  .cookie-actions .btn { flex: 0 0 auto; }
}
@media (prefers-reduced-motion: reduce) { .cookie-banner { transition: opacity 150ms ease; @starting-style { transform: none; } } }
.option-row.muted { opacity: 0.65; cursor: default; }
@media print { .cookie-banner, .foot-links { display: none !important; } }

/* ---------- Print ---------- */
@media print {
  :root, :root[data-theme="dark"] {
    --bg: #fff; --panel: #fff; --panel-2: #f3f3f3; --paper: #fff; --fg: #000; --muted: #333;
    --line: #999; --line-strong: #666; --accent-text: #6B4A16; --accent-soft: #fff;
    --load: #3F6A94; --go: #B8891B; --wait: #C23B2A; --pour: #277A4E; --back: #7F8A90; --setup: #6F58A8; --bar-text: #fff;
    --ok-bg: #e4f3ea; --ok-fg: #1E6B43; --bad-bg: #fae3df; --bad-fg: #A1301F;
    color-scheme: light;
  }
  html { font-size: 11pt; }
  body { background: #fff; }
  .topbar, .dock, #toast, .skip, .presets, .card-actions, .zoom, .note, .chart-detail, .form-status, .route-actions, .ac, .hero .lead { display: none !important; }
  .page { max-width: none; padding: 0; gap: 0.75rem; }
  .card, .kpi { box-shadow: none; break-inside: avoid; }
  .kpi.main .v { font-size: 1.75rem; }
  .sum, .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .fields { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .field input { border-color: #999; min-height: 2rem; }
  .stepper button { display: none; }
  .chart-scroll { overflow: visible; border: 0; }
  .gantt { display: block; }
  .bar, .legend i, .chip, .vline span, .kpi.main { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  table { font-size: 10pt; }
  tbody tr { break-inside: avoid; }
  .print-meta { display: block; color: var(--muted); font-size: 9pt; }
  .map { display: none; }
  a[href]::after { content: none; }
}
