/* TayuGO — base.css
 * Source-of-truth: vltrndataroom/TAYUGO/02_FRAMEWORKS/UX_DOCTRINE.md
 * Light-mode default (sun glare > screen contrast). Dark mode opt-in.
 */

:root {
  --bg: #FFFFFF;
  --bg-raised: #FFFFFF;
  --surface: #E2E8FA;
  --border: #DCE2F2;
  --border-strong: #AEBCDE;
  --text: #1A1A1A;
  --text-muted: #5A6378;
  --text-inverse: #FFFFFF;

  --brand: #F77201;
  --brand-hover: #D45F00;
  --brand-light: #FEEFDF;

  --ocean: #082F92;
  --sand: #C9D4F4;
  --sea: #3D5BC4;

  --ok: #1F6B3F;
  --warn: #C77A0E;
  --err: #B5302D;
  --info: #082F92;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-pill: 999px;

  --tap-min: 44px;
  --tap-primary: 52px;
  --tap-driver: 56px;        /* driver-while-moving minimum */
  --tap-driver-primary: 64px;/* driver primary action */

  /* Driver / late-night surface tokens */
  --surface-late-night: #0F1B2E;
  --surface-late-night-raised: #1A2842;
  --surface-late-night-border: #2C3F66;
  --text-on-night: #E2E8FA;
  --text-on-night-muted: #B8C5DD;
  --status-online: #1F6B3F;
  --status-online-glow: rgba(31, 107, 63, 0.35);
  --status-offline: #5A6378;
  --status-on-trip: #082F92;
  --status-break: #C77A0E;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.12);
  --shadow-raised: 0 8px 32px rgba(232, 72, 59, 0.10);

  --motion-fast: 120ms cubic-bezier(0.2, 0.9, 0.3, 1);
  --motion-base: 220ms cubic-bezier(0.2, 0.9, 0.3, 1);

  --font-body: "Plus Jakarta Sans", "Helvetica Neue", system-ui, sans-serif;

  --maxw: 1200px;

  /* 4-pt spacing scale — never use arbitrary px values inline.
   * One rhythm across all surfaces. */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;

  /* Type ramp — body 16 min, never below.
   * 13/14 sizes only for genuinely-secondary metadata. */
  --fs-xs: 13px;     /* helper / footnote */
  --fs-sm: 14px;     /* metadata, dense rows */
  --fs-base: 16px;   /* body min — iOS no-zoom requires ≥16px */
  --fs-md: 18px;
  --fs-lg: 22px;
  --fs-xl: 28px;
  --fs-2xl: 36px;
  --fs-3xl: 48px;

  /* Sticky-CTA bar reserve — pages with bottom action bars must
   * pad their main content by this so nothing hides beneath it. */
  --sticky-cta-h: 88px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;          /* UX_DOCTRINE rule 4: body 16pt min */
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-hover); }
a:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* WCAG AA tap targets — 44px primary minimum */
button, .btn {
  min-height: var(--tap-min);
  font: inherit;
  cursor: pointer;
  border: 0;
  border-radius: var(--radius-md);
  padding: 0 20px;
  background: transparent;
  color: var(--text);
  font-weight: 600;
  transition: background var(--motion-fast), transform var(--motion-fast);
}
button:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--brand);
  color: var(--text-inverse);
  height: var(--tap-primary);
  padding: 0 24px;
  box-shadow: var(--shadow-raised);
}
.btn-primary:hover { background: var(--brand-hover); }
.btn-primary:active { transform: translateY(1px); }

.btn-ghost {
  background: var(--bg-raised);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--surface); }

.btn-night {
  background: #0F1B2E;
  color: #E2E8FA;
  height: var(--tap-primary);
}

input, select, textarea {
  font: inherit;
  font-size: 16px;          /* iOS no-zoom requires ≥16px */
  padding: 12px 14px;
  min-height: var(--tap-min);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-raised);
  color: var(--text);
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
  font-size: 14px;
  letter-spacing: 0.01em;
}

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

/* App chrome — compact, stays out of the way */
.appbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
  height: 64px;
  display: flex;
  align-items: center;
}
.appbar .logo {
  font-weight: 700;
  font-size: 22px;
  color: var(--ocean);  /* TayuGO cobalt; .accent carries the GO orange */
  letter-spacing: -0.01em;
}
.appbar .logo .accent { color: var(--brand); }

.appbar nav {
  margin-left: auto;
  display: flex;
  gap: 20px;
  align-items: center;
}

/* Cards */
.card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--motion-base), box-shadow var(--motion-base);
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.card-img { aspect-ratio: 16 / 10; width: 100%; object-fit: cover; background: var(--surface); }
.card-body { padding: 16px; }
.card-title { font-size: 18px; font-weight: 600; margin: 0 0 6px; }
.card-meta { font-size: 14px; color: var(--text-muted); }

/* Pills / badges */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
}
.pill.late-night { background: #0F1B2E; color: #E2E8FA; }
.pill.taxi-partner { background: var(--ocean); color: white; }
.pill.ok { background: #DDF2E2; color: var(--ok); }
.pill.warn { background: #FBE9C9; color: var(--warn); }
.pill.err { background: #F8DDD9; color: var(--err); }

/* Layouts */
.grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.row { display: flex; gap: 12px; align-items: center; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack.tight { gap: 8px; }
.stack.loose { gap: 24px; }

/* Hero */
.hero {
  background:
    radial-gradient(at 70% 20%, rgba(61, 91, 196, 0.16), transparent 50%),
    radial-gradient(at 10% 110%, rgba(232, 72, 59, 0.10), transparent 50%),
    var(--bg);
  padding: 56px 0 40px;
}
.hero h1 {
  font-size: clamp(32px, 5vw, 56px);
  margin: 0 0 12px;
  letter-spacing: -0.02em;
  font-weight: 700;
  line-height: 1.05;
}
.hero p { font-size: 18px; color: var(--text-muted); max-width: 560px; margin: 0 0 24px; }

/* Search bar — primary action */
.search-bar {
  display: flex;
  gap: 8px;
  background: var(--bg-raised);
  padding: 8px;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-md);
  max-width: 640px;
}
.search-bar input { border: 0; min-height: 44px; flex: 1; }
.search-bar input:focus { outline: 0; }

/* Footer */
.footer {
  margin-top: 80px;
  padding: 32px 0;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 14px;
  background: var(--surface);
}

/* Cart */
.cart-line {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 14px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.cart-line:last-child { border-bottom: 0; }
.cart-total {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 16px;
  font-size: 15px;
  padding: 12px 0;
}
.cart-total .grand {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  font-size: 18px;
  font-weight: 700;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* Form rows */
.form-row { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.form-row > .full { grid-column: 1 / -1; }

/* Late-night theme — opt-in */
[data-theme="night"] {
  --bg: #0F1B2E;
  --bg-raised: #1A2842;
  --surface: #243456;
  --border: #2C3F66;
  --border-strong: #3D5582;
  --text: #E2E8FA;
  --text-muted: #B8C5DD;
}

/* Accessibility — skip link */
.skip-link {
  position: absolute;
  left: -10000px;
  top: 8px;
  background: var(--brand);
  color: var(--text-inverse);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  z-index: 100;
}
.skip-link:focus { left: 8px; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Role switcher — appears on every surface */
.role-bar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--text);
  color: var(--text-inverse);
  font-size: 13px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.role-bar .container {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.role-bar a {
  color: var(--text-inverse);
  opacity: 0.78;
  text-decoration: none;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-weight: 500;
  transition: background var(--motion-fast), opacity var(--motion-fast);
  font-size: 13px;
}
.role-bar a:hover { opacity: 1; background: rgba(255, 255, 255, 0.10); }
.role-bar a.current {
  background: var(--brand);
  color: white;
  opacity: 1;
}
.role-bar .label {
  opacity: 0.55;
  margin-right: 4px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 11px;
}
.role-bar .api-pill {
  margin-left: auto;
  font-size: 11px;
  opacity: 0.6;
  font-family: ui-monospace, SF Mono, monospace;
}

/* Mobile */
@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .form-row { grid-template-columns: 1fr; }
  .hero { padding: 36px 0 28px; }
  .appbar { height: 56px; }
}

/* ───────────────────────────────────────────────────────────
 * Driver-grade tap target (56px) — for in-vehicle, gloved-thumb,
 * sun-glare contexts. Always paired label, never icon-only.
 * ─────────────────────────────────────────────────────────── */
.btn-driver {
  min-height: var(--tap-driver);
  font-size: 17px;
  font-weight: 700;
  padding: 0 22px;
  border-radius: var(--radius-lg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.btn-driver-primary {
  min-height: var(--tap-driver-primary);
  font-size: 19px;
  font-weight: 700;
  padding: 0 26px;
  border-radius: var(--radius-lg);
  background: var(--brand);
  color: var(--text-inverse);
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: var(--shadow-raised);
}
.btn-driver-primary:hover { background: var(--brand-hover); }
.btn-driver-primary:active { transform: translateY(1px); }

/* ───────────────────────────────────────────────────────────
 * KPI tile — admin & driver dashboards. Use .kpi-tile.primary
 * for the top-left "most-important" cell.
 * ─────────────────────────────────────────────────────────── */
.kpi-tile {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 108px;
}
.kpi-tile .kpi-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.kpi-tile .kpi-value {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.kpi-tile .kpi-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: auto;
}
.kpi-tile.primary {
  background: var(--text);
  color: var(--text-inverse);
  border-color: var(--text);
}
.kpi-tile.primary .kpi-label { color: rgba(226, 232, 250, 0.65); }
.kpi-tile.primary .kpi-value { color: var(--text-inverse); }
.kpi-tile.primary .kpi-sub   { color: rgba(226, 232, 250, 0.70); }
.kpi-tile.warn  .kpi-value { color: var(--warn); }
.kpi-tile.err   .kpi-value { color: var(--err); }
.kpi-tile.ok    .kpi-value { color: var(--ok); }

/* admin KPI grid: 1-up mobile, 2-up tablet, 4-up desktop with
 * the primary spanning two columns at desktop. */
.kpi-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}
@media (min-width: 560px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
}
@media (min-width: 1024px) {
  .kpi-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
  .kpi-grid > .kpi-tile.primary { grid-column: span 2; }
}

/* ───────────────────────────────────────────────────────────
 * Status hero — driver online/offline state at 3-ft glance.
 * Dominates viewport when offline; shrinks when a job is active.
 * ─────────────────────────────────────────────────────────── */
.status-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 36px 20px;
  border-radius: var(--radius-xl);
  background: var(--bg-raised);
  border: 2px solid var(--border);
  text-align: center;
  min-height: 280px;
}
.status-hero[data-state="online"] {
  background: var(--status-online);
  border-color: var(--status-online);
  color: white;
  box-shadow: 0 0 0 6px var(--status-online-glow);
}
.status-hero[data-state="on-trip"] {
  background: var(--status-on-trip);
  border-color: var(--status-on-trip);
  color: white;
}
.status-hero[data-state="break"] {
  background: var(--status-break);
  border-color: var(--status-break);
  color: white;
}
.status-hero .status-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.75;
}
.status-hero .status-title {
  font-size: clamp(36px, 9vw, 56px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1;
}
.status-hero .status-sub {
  font-size: 16px;
  opacity: 0.85;
  margin: 0;
  max-width: 36ch;
}
.status-hero .status-toggle {
  margin-top: 8px;
  min-height: var(--tap-driver-primary);
  font-size: 18px;
  font-weight: 700;
  padding: 0 32px;
  border-radius: var(--radius-pill);
  background: var(--ocean);
  color: #FFFFFF;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}
.status-hero[data-state="online"] .status-toggle,
.status-hero[data-state="on-trip"] .status-toggle,
.status-hero[data-state="break"] .status-toggle {
  background: #FFFFFF;
}
.status-hero[data-state="online"] .status-toggle { color: var(--status-online); }
.status-hero[data-state="on-trip"] .status-toggle { color: var(--status-on-trip); }

/* Status dot — pulses when online */
.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}
.status-dot.live {
  box-shadow: 0 0 0 0 currentColor;
  animation: status-pulse 1.6s ease-in-out infinite;
}
@keyframes status-pulse {
  0%   { box-shadow: 0 0 0 0 currentColor; }
  70%  { box-shadow: 0 0 0 10px rgba(255,255,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); }
}

/* ───────────────────────────────────────────────────────────
 * Late-night chrome — a visual signal operators / riders know:
 * "we are in the 22:00–04:00 window".
 * Apply via [data-window="late-night"] on body.
 * ─────────────────────────────────────────────────────────── */
.late-night-stripe {
  display: none;
  background: var(--surface-late-night);
  color: var(--text-on-night);
  padding: 8px 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--surface-late-night-border);
}
[data-window="late-night"] .late-night-stripe { display: block; }
.late-night-stripe .container {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ───────────────────────────────────────────────────────────
 * Empty / zero-state guidance card — admin needs to distinguish
 * "waiting on something" from "nothing happening".
 * ─────────────────────────────────────────────────────────── */
.empty-state {
  padding: 28px 24px;
  text-align: center;
  color: var(--text-muted);
  background: var(--bg-raised);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
}
.empty-state .empty-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 4px;
}
.empty-state .empty-hint { font-size: 14px; margin: 0; }

/* ───────────────────────────────────────────────────────────
 * Section header — used on admin pages, drives scan rhythm.
 * ─────────────────────────────────────────────────────────── */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 32px 0 14px;
}
.section-head h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.01em;
}
.section-head .section-meta {
  font-size: 13px;
  color: var(--text-muted);
}

/* ───────────────────────────────────────────────────────────
 * Form section — onboarding flows. Wraps a related field group
 * with a numbered step indicator.
 * ─────────────────────────────────────────────────────────── */
.form-section {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.form-section + .form-section { margin-top: 16px; }
.form-section h2 {
  margin: 0 0 4px;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.form-section h2 .step-num {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 50%;
  background: var(--brand);
  color: white;
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.form-section .section-sub {
  margin: 0 0 14px;
  color: var(--text-muted);
  font-size: 14px;
}

/* Checkbox / radio rows — bigger tap target, label-wraps-input
 * pattern so the whole row is clickable. */
.choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  background: var(--bg-raised);
  transition: border-color var(--motion-fast), background var(--motion-fast);
  min-height: var(--tap-min);
  font-size: 15px;
}
.choice:hover { border-color: var(--border-strong); background: var(--surface); }
.choice input[type="checkbox"],
.choice input[type="radio"] {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  flex: 0 0 20px;
  accent-color: var(--brand);
}
.choice .choice-text { flex: 1; }
.choice .choice-sub {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ───────────────────────────────────────────────────────────
 * Consumer-web shared primitives — used by index/vendor/cart/help.
 * These exist so individual pages stop reinventing inline padding,
 * inline font-size, and inline margins.
 * ─────────────────────────────────────────────────────────── */

/* Narrow content column — 720px reads like a column, not a wall. */
.container-narrow {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 var(--space-5);
}

/* Page section — vertical rhythm above/below the container. */
.page-section { padding: var(--space-8) 0; }
.page-section--lg { padding: var(--space-10) 0 var(--space-8); }
.page-section--tight { padding: var(--space-6) 0; }

/* H1/H2 default ramps so individual pages don't override sizes inline. */
h1 {
  font-size: var(--fs-2xl);
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-weight: 700;
  margin: 0 0 var(--space-3);
}
h2 {
  font-size: var(--fs-lg);
  letter-spacing: -0.01em;
  line-height: 1.2;
  font-weight: 700;
  margin: 0 0 var(--space-3);
}
h3 {
  font-size: var(--fs-md);
  font-weight: 600;
  margin: 0 0 var(--space-2);
}

/* Full-width primary CTA — used on cart/order/ride forms. */
.btn-block {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
}

/* Helper note — small print under primary actions. Stays ≥14px. */
.helper-note {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  margin: var(--space-3) 0 0;
  line-height: 1.45;
}
.helper-note--center { text-align: center; }

/* ───────────────────────────────────────────────────────────
 * Mode tabs (Ride / Food) — index.html primary mode switch.
 * Lives BELOW the headline as a form-control, not above it.
 * ─────────────────────────────────────────────────────────── */
.mode-tabs {
  display: inline-flex;
  gap: var(--space-1);
  background: var(--surface);
  padding: var(--space-1);
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
}
.mode-tabs button {
  min-height: var(--tap-min);
  padding: 0 22px;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
  font-size: var(--fs-base);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  transition: background var(--motion-fast), color var(--motion-fast);
}
.mode-tabs button[aria-pressed="true"] {
  background: var(--bg-raised);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.mode-tabs button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ───────────────────────────────────────────────────────────
 * Ride pickup/dropoff field group — connected pin track.
 * Pickup pin · vertical line · destination pin all share an
 * absolutely-positioned 24px gutter so the track is unbroken.
 * ─────────────────────────────────────────────────────────── */
.ride-form {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  box-shadow: var(--shadow-md);
}
.pin-track {
  position: relative;
  display: grid;
  grid-template-columns: 24px 1fr;
  column-gap: var(--space-4);
  row-gap: var(--space-3);
  align-items: center;
}
.pin-track::before {
  /* the connecting line between pickup + drop pins */
  content: '';
  position: absolute;
  left: 11px;
  top: 28px;
  bottom: 28px;
  width: 2px;
  background: var(--border-strong);
  border-radius: 2px;
}
.pin {
  position: relative;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text);
  margin: 0 auto;
  z-index: 1;
}
.pin.dest { background: var(--brand); }
.pin-track .field-label {
  display: block;
  grid-column: 2;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 -2px;
}
.pin-track .pin-input {
  position: relative;
  grid-column: 2;
}
.pin-track .pin-input input {
  padding-right: 52px; /* room for geo button */
}
.pin-track .geo-btn {
  position: absolute;
  right: var(--space-1);
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  min-height: 40px;
  border-radius: 50%;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  padding: 0;
}
.pin-track .geo-btn:hover { background: var(--brand-light); }

/* Quick-pick destination chips — must hit 44px to be safe to tap. */
.quick-pick {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-top: var(--space-4);
}
.quick-pick button {
  min-height: var(--tap-min);
  padding: 0 var(--space-4);
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text);
}
.quick-pick button:hover {
  background: var(--brand-light);
  border-color: var(--brand-light);
}

/* Fare panel — lives inside the ride form once a quote exists. */
.fare-panel {
  margin-top: var(--space-4);
  padding: var(--space-4);
  background: var(--brand-light);
  border-radius: var(--radius-lg);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-2) var(--space-4);
  align-items: center;
}
.fare-panel .fare-meta {
  color: var(--text-muted);
  font-size: var(--fs-sm);
}
.fare-panel .fare-price {
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

/* ───────────────────────────────────────────────────────────
 * Late-night soft cue — visible evening signal.
 * Use on hero or as a sticky strip; copy is operator-set.
 * ─────────────────────────────────────────────────────────── */
.late-night-cue {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 12px 6px 8px;
  background: var(--surface-late-night);
  color: var(--text-on-night);
  border-radius: var(--radius-pill);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-decoration: none;
}
.late-night-cue:hover { color: var(--text-on-night); opacity: 0.92; }
.late-night-cue .moon { font-size: 16px; line-height: 1; }
.late-night-cue .surcharge {
  background: rgba(255, 255, 255, 0.16);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-xs);
  font-weight: 600;
}

/* ───────────────────────────────────────────────────────────
 * Filter row — used on browse + admin lists. Pills get full
 * 44px tap target while still reading as "filter chip".
 * ─────────────────────────────────────────────────────────── */
.filter-row {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  align-items: center;
}
.filter-row .pill {
  min-height: var(--tap-min);
  padding: 0 var(--space-4);
  font-size: var(--fs-sm);
  font-weight: 600;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  cursor: pointer;
}
.filter-row .pill[aria-pressed="true"] {
  background: var(--text);
  color: var(--text-inverse);
  border-color: var(--text);
}

/* ───────────────────────────────────────────────────────────
 * Vendor card refinements — image gradient must not steal the
 * card-title's prominence. Pills wrap, never overflow.
 * ─────────────────────────────────────────────────────────── */
.vendor-card { display: block; }
.vendor-card .card-title {
  font-size: var(--fs-md);
  line-height: 1.25;
}
.vendor-card .vendor-meta {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  margin: 0 0 var(--space-2);
}
.vendor-card .stars {
  color: var(--brand);
  letter-spacing: 1px;
  font-size: var(--fs-sm);
}
.vendor-card .pill-row {
  display: flex;
  gap: var(--space-1);
  flex-wrap: wrap;
  margin-top: var(--space-3);
}

/* ───────────────────────────────────────────────────────────
 * Vendor detail — hero + sticky cart-bar.
 * ─────────────────────────────────────────────────────────── */
.vendor-hero {
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
  padding: var(--space-6) 0 var(--space-5);
}
.vendor-hero h1 { margin: 0 0 var(--space-2); font-size: var(--fs-xl); }
.vendor-hero .vendor-meta { margin: 0 0 var(--space-3); }

.menu-section { margin-top: var(--space-8); }
.menu-section h2 {
  margin: 0 0 var(--space-3);
  font-size: var(--fs-lg);
}
.menu-section .menu-list { display: flex; flex-direction: column; gap: var(--space-3); }

.product-row {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-4);
  align-items: center;
}
.product-row .product-name { margin: 0; font-size: var(--fs-base); font-weight: 600; }
.product-row .product-desc {
  margin: var(--space-1) 0 0;
  font-size: var(--fs-sm);
  color: var(--text-muted);
  line-height: 1.4;
}
.product-row .product-price {
  font-weight: 700;
  font-size: var(--fs-base);
  font-variant-numeric: tabular-nums;
  display: block;
  margin-bottom: var(--space-2);
  text-align: right;
}
/* Add-to-cart is a SECONDARY action on a product list — every
 * row would scream if styled brand-red. The page CTA wins. */
.btn-add {
  min-height: 40px;
  padding: 0 var(--space-4);
  border-radius: var(--radius-md);
  background: var(--bg-raised);
  border: 1.5px solid var(--text);
  color: var(--text);
  font-weight: 700;
  font-size: var(--fs-sm);
  letter-spacing: 0.02em;
  transition: background var(--motion-fast), color var(--motion-fast);
}
.btn-add:hover { background: var(--text); color: var(--text-inverse); }
.btn-add[data-state="added"] {
  background: var(--ok);
  border-color: var(--ok);
  color: white;
}

/* Sticky cart bar — page reserves --sticky-cta-h via padding-bottom. */
.sticky-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  background: var(--bg-raised);
  border-top: 1px solid var(--border);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.08);
  padding: var(--space-3) 0 max(var(--space-3), env(safe-area-inset-bottom));
}
.sticky-cta .container,
.sticky-cta .container-narrow {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  justify-content: space-between;
}
.sticky-cta .cta-summary { display: flex; flex-direction: column; gap: 2px; }
.sticky-cta .cta-summary strong { font-size: var(--fs-base); }
.sticky-cta .cta-summary small { font-size: var(--fs-sm); color: var(--text-muted); }

/* Pages with sticky-cta must add this to <main> so content
 * doesn't sit underneath the bar. */
.has-sticky-cta { padding-bottom: var(--sticky-cta-h); }

/* ───────────────────────────────────────────────────────────
 * Cart page primitives — replace inline style="margin:..." spam.
 * ─────────────────────────────────────────────────────────── */
.cart-vendor-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}
.cart-vendor-card strong { font-size: var(--fs-md); }
.cart-vendor-card .cart-vendor-meta {
  margin: var(--space-1) 0 0;
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.cart-stack { display: flex; flex-direction: column; gap: var(--space-4); }

.tip-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}
.tip-card h3 { margin: 0 0 var(--space-1); }
.tip-card .tip-sub {
  margin: 0 0 var(--space-3);
  font-size: var(--fs-sm);
  color: var(--text-muted);
}
.tip-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-2);
}
.tip-row button {
  min-height: var(--tap-min);
  padding: 0;
  border-radius: var(--radius-md);
  background: var(--bg-raised);
  border: 1.5px solid var(--border);
  font-weight: 600;
  font-size: var(--fs-sm);
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.tip-row button:hover { border-color: var(--text); }
.tip-row button[aria-pressed="true"] {
  background: var(--ocean);
  color: #FFFFFF;
  border-color: var(--ocean);
}
@media (max-width: 480px) {
  .tip-row { grid-template-columns: repeat(2, 1fr); }
}

.qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg-raised);
  overflow: hidden;
}
.qty-stepper button {
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--text);
}
.qty-stepper button:hover { background: var(--surface); }
.qty-stepper .qty-num {
  min-width: 36px;
  text-align: center;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ───────────────────────────────────────────────────────────
 * Help / FAQ — readable column with explicit rhythm.
 * ─────────────────────────────────────────────────────────── */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  margin-top: var(--space-6);
}
.faq-list h2 {
  font-size: var(--fs-md);
  margin: 0 0 var(--space-2);
}
.faq-list p {
  margin: 0;
  font-size: var(--fs-base);
  line-height: 1.55;
  color: var(--text);
}

/* ───────────────────────────────────────────────────────────
 * Cart badge — compact red dot on nav.
 * ─────────────────────────────────────────────────────────── */
.cart-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: var(--brand);
  color: var(--text-inverse);
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  margin-left: 6px;
  font-variant-numeric: tabular-nums;
}

/* ───────────────────────────────────────────────────────────
 * Vendor surface — order-inbox columns, sticky bottom nav, the
 * 24hr badge, the new-order flash, and the hold-to-confirm primary.
 * Used by apps/vendor/.
 * ─────────────────────────────────────────────────────────── */
:root {
  --surface-vendor-primary: #1F6B3F;
  --surface-vendor-primary-hover: #195733;
  --surface-vendor-flash: rgba(31, 107, 63, 0.18);
}

.vendor-page {
  /* Pages with the bottom-nav must reserve room beneath. */
  padding-bottom: calc(var(--sticky-cta-h) + var(--space-3));
  min-height: 100vh;
}

/* The sticky bottom nav — Orders / Menu / Status. */
.bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 60;
  background: var(--bg-raised);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 6px 0 max(6px, env(safe-area-inset-bottom));
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.06);
}
.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 56px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.02em;
}
.bottom-nav a .bn-icon {
  font-size: 22px;
  line-height: 1;
}
.bottom-nav a[aria-current="page"] {
  color: var(--brand);
}
.bottom-nav a[aria-current="page"]::after {
  content: '';
  position: absolute;
  bottom: 4px;
  width: 24px;
  height: 3px;
  border-radius: 2px;
  background: var(--brand);
}
.bottom-nav a:focus-visible { outline: 2px solid var(--brand); outline-offset: -4px; }

/* Order inbox — three columns on tablet+, stacked on mobile. */
.order-inbox {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: 1fr;
}
@media (min-width: 900px) {
  .order-inbox { grid-template-columns: repeat(3, 1fr); }
}
.inbox-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
}
.inbox-col-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
  padding: 0 var(--space-1);
}
.inbox-col-head h3 {
  margin: 0;
  font-size: var(--fs-md);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.inbox-col-head .col-count {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* Order card */
.order-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  transition: box-shadow var(--motion-base), border-color var(--motion-base);
}
.order-card.is-new {
  border-color: var(--ok);
  box-shadow: 0 0 0 4px var(--surface-vendor-flash);
}
@keyframes order-flash {
  0%, 100% { box-shadow: 0 0 0 0 var(--surface-vendor-flash); }
  50%      { box-shadow: 0 0 0 10px var(--surface-vendor-flash); }
}
.order-card.flash { animation: order-flash 0.6s ease-in-out 3; }

.order-card .oc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}
.order-card .oc-id {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  font-family: ui-monospace, SF Mono, monospace;
  letter-spacing: 0.04em;
}
.order-card .oc-total {
  font-size: var(--fs-md);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.order-card .oc-sub {
  font-size: var(--fs-sm);
  color: var(--text-muted);
}
.order-card .oc-customer {
  font-size: var(--fs-base);
  font-weight: 600;
}
.order-card .oc-items-summary {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  margin: 0;
}
.order-card .oc-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: none;
  border-top: 1px dashed var(--border);
  padding-top: var(--space-2);
  margin-top: var(--space-1);
}
.order-card.expanded .oc-items { display: block; }
.order-card .oc-items li {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  padding: 4px 0;
  font-size: var(--fs-sm);
}
.order-card .oc-items .oi-qty { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.order-card .oc-toggle {
  align-self: flex-start;
  font-size: var(--fs-xs);
  color: var(--text-muted);
  background: transparent;
  border: 0;
  padding: 4px 0;
  text-decoration: underline;
  cursor: pointer;
  min-height: 28px;
}
.order-card .oc-notes {
  font-size: var(--fs-sm);
  color: var(--text);
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  margin: 0;
}
.order-card .oc-clock {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.order-card .oc-clock.warn { color: var(--warn); }
.order-card .oc-clock.err  { color: var(--err); }

.order-card .oc-actions {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-2);
}
.order-card .oc-actions.split {
  grid-template-columns: 1fr 2fr;
}

/* Big tap targets — the Accept/Ready primary */
.btn-vendor-primary {
  min-height: var(--tap-driver-primary);
  font-size: 18px;
  font-weight: 800;
  border-radius: var(--radius-lg);
  background: var(--surface-vendor-primary);
  color: white;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
  width: 100%;
  letter-spacing: 0.01em;
  box-shadow: 0 6px 16px rgba(31, 107, 63, 0.20);
}
.btn-vendor-primary:hover { background: var(--surface-vendor-primary-hover); }
.btn-vendor-primary:active { transform: translateY(1px); }
.btn-vendor-primary[disabled] { opacity: 0.6; cursor: not-allowed; }

/* The hold-to-confirm fill — runs left→right over 1s while held */
.btn-vendor-primary .hold-fill {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.22);
  width: 0;
  pointer-events: none;
  transition: width 1s linear;
}
.btn-vendor-primary[data-holding="true"] .hold-fill { width: 100%; }

.btn-vendor-secondary {
  min-height: var(--tap-driver);
  font-size: 16px;
  font-weight: 700;
  border-radius: var(--radius-lg);
  background: var(--bg-raised);
  border: 1.5px solid var(--text);
  color: var(--text);
  cursor: pointer;
  width: 100%;
}
.btn-vendor-secondary:hover { background: var(--surface); }

/* 24hr badge */
.badge-24hr {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-late-night);
  color: var(--text-on-night);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.badge-24hr::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sand);
}

/* Reject / status modal */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 100;
  display: none;
  align-items: flex-end;
  justify-content: center;
}
.sheet-backdrop.open { display: flex; }
.sheet {
  background: var(--bg-raised);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  width: 100%;
  max-width: 520px;
  padding: var(--space-5) var(--space-5) max(var(--space-5), env(safe-area-inset-bottom));
  box-shadow: 0 -12px 32px rgba(0, 0, 0, 0.18);
  animation: sheet-up 0.22s ease-out;
}
@keyframes sheet-up {
  from { transform: translateY(20%); opacity: 0; }
  to   { transform: translateY(0);   opacity: 1; }
}
.sheet h3 { margin: 0 0 var(--space-3); font-size: var(--fs-lg); }
.sheet .sheet-actions {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

@media (prefers-reduced-motion: reduce) {
  .order-card.flash, .sheet { animation: none !important; }
  .btn-vendor-primary .hold-fill { transition: none; }
}

/* ───────────────────────────────────────────────────────────
 * Polish — appbar pills get a real tap target; header doesn't
 * crush against itself on narrow screens.
 * ─────────────────────────────────────────────────────────── */
.appbar nav .pill {
  min-height: 36px;
  padding: 6px 12px;
}
.appbar nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
@media (max-width: 480px) {
  .appbar nav { gap: 12px; }
  .appbar nav a:not(.pill):not(.late-night-cue) { font-size: var(--fs-sm); }
}

/* ───────────────────────────────────────────────────────────
 * Mode toggle — driver picks Rides / Deliveries / Both
 * Sits below the status hero. Segmented control pattern.
 * ─────────────────────────────────────────────────────────── */
.mode-toggle {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  margin: 12px 0 0;
}
body[data-theme="night"] .mode-toggle {
  background: var(--surface-late-night);
  border-color: var(--surface-late-night-border);
}
.mode-toggle button {
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  background: transparent;
  border: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  transition: background var(--motion-fast), color var(--motion-fast);
}
body[data-theme="night"] .mode-toggle button { color: var(--text-on-night-muted); }
.mode-toggle button[aria-pressed="true"] {
  background: var(--bg-raised);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
body[data-theme="night"] .mode-toggle button[aria-pressed="true"] {
  background: var(--surface-late-night-raised);
  color: var(--text-on-night);
}

/* Order-specific offer / active extensions — share .offer-card / .leg-row */
.offer-card.offer-order {
  background: var(--ocean);
}
.offer-card.offer-order .accept { color: var(--ocean); }
.offer-vendor-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  margin-top: 6px;
  opacity: 0.95;
}
.offer-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.18);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.offer-badge.preparing { background: var(--sand); color: var(--text); }

/* Active job — leg gating (leg-2 disabled until vendor ready / leg-1 done) */
.leg-row.disabled { opacity: 0.45; }
.leg-row.disabled .leg-nav { pointer-events: none; opacity: 0.5; }

/* ───────────────────────────────────────────────────────────
 * Customer order tracking — public token-based page.
 * Mobile-first 375×812; no chrome that costs vertical real estate.
 * ─────────────────────────────────────────────────────────── */
.track-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-radius: var(--radius-pill);
  background: var(--brand);
  color: white;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  box-shadow: var(--shadow-md);
  transition: background var(--motion-base);
}
.track-status-pill[data-state="placed"]      { background: var(--text-muted); }
.track-status-pill[data-state="accepted"]    { background: var(--ocean); }
.track-status-pill[data-state="preparing"]   { background: var(--warn); }
.track-status-pill[data-state="ready"]       { background: var(--sea); }
.track-status-pill[data-state="picked_up"],
.track-status-pill[data-state="in_transit"]  { background: var(--brand); }
.track-status-pill[data-state="delivered"]   { background: var(--ok); }
.track-status-pill[data-state="cancelled"]   { background: var(--err); }
.track-status-pill .pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: white;
  animation: status-pulse 1.6s ease-in-out infinite;
}
.track-status-pill[data-state="delivered"] .pulse,
.track-status-pill[data-state="cancelled"] .pulse { animation: none; }

.track-progress {
  display: flex;
  gap: 4px;
  margin-top: 14px;
}
.track-progress .seg {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  transition: background var(--motion-base);
}
.track-progress .seg.done { background: var(--ok); }
.track-progress .seg.active {
  background: var(--brand);
  animation: track-active 1.4s ease-in-out infinite;
}
@keyframes track-active {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

.track-driver {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 16px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-top: 16px;
}
.track-driver .avatar {
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, var(--sea), var(--ocean));
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 22px;
}
.track-driver .who { display: flex; flex-direction: column; gap: 2px; }
.track-driver .who .name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.track-driver .who .vehicle {
  font-size: 13px;
  color: var(--text-muted);
}
.track-driver .call {
  min-height: var(--tap-primary);
  padding: 0 18px;
  border-radius: var(--radius-pill);
  background: var(--ok);
  color: white;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

#track-map {
  height: 240px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  margin-top: 16px;
}
body[data-theme="night"] #track-map { border-color: var(--surface-late-night-border); }

.track-summary {
  margin-top: 16px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
body[data-theme="night"] .track-summary {
  background: var(--surface-late-night-raised);
  border-color: var(--surface-late-night-border);
}
.track-summary summary {
  list-style: none;
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.track-summary summary::-webkit-details-marker { display: none; }
.track-summary summary::after {
  content: '+';
  font-size: 22px;
  font-weight: 400;
  color: var(--text-muted);
}
.track-summary[open] summary::after { content: '−'; }
.track-summary .body {
  padding: 0 16px 16px;
  border-top: 1px solid var(--border);
}
body[data-theme="night"] .track-summary .body { border-top-color: var(--surface-late-night-border); }
.track-summary .row-line {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  padding: 6px 0;
}
.track-summary .row-line.total {
  font-weight: 700;
  font-size: 16px;
  border-top: 1px solid var(--border);
  margin-top: 6px;
  padding-top: 10px;
}
body[data-theme="night"] .track-summary .row-line.total { border-top-color: var(--surface-late-night-border); }

.track-help {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap-primary);
  margin-top: 20px;
  padding: 0 18px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
body[data-theme="night"] .track-help {
  background: var(--surface-late-night-raised);
  color: var(--text-on-night);
  border-color: var(--surface-late-night-border);
}

.track-empty {
  padding: 60px 20px;
  text-align: center;
}
.track-empty .icon {
  font-size: 44px;
  margin-bottom: 12px;
}
.track-empty .title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 6px;
}
.track-empty .hint {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
}
