/* ============================================================
   LumeRide — shared premium design system
   Identical in rider + driver apps. Brand: black / white / gold.
   ============================================================ */

:root {
  --gold: #e5c894;
  --gold-deep: #c9a45c;
  --gold-soft: rgba(229, 200, 148, .08);
  --gold-line: rgba(229, 200, 148, .35);
  --ink: #101418;
  --coal: #0b0e11;
  --panel: #151a20;
  --panel-2: #1c222a;
  --line: rgba(255, 255, 255, .08);
  --text: #f5f2ea;
  --muted: #9aa3ad;
  --radius: 18px;
  --danger: #e5534b;
  --ok: #3fb68b;
  --sheet-radius: 22px;
  --shadow-sheet: 0 -12px 40px rgba(0, 0, 0, .55);
  --shadow-card: 0 8px 28px rgba(0, 0, 0, .45);
  --shadow-gold: 0 6px 20px rgba(229, 200, 148, .28);
  /* Spacing tokens — 4px base scale. */
  --space-xs: 6px;
  --space-sm: 10px;
  --space-md: 14px;
  --space-lg: 20px;
  --space-xl: 28px;
  /* Type scale — display / title / body / caption hierarchy. */
  --text-display: 28px;
  --text-title: 20px;
  --text-body: 16px;
  --text-caption: 13px;
  --text-micro: 12px;
  --leading-tight: 1.2;
  --leading-body: 1.45;
  /* Motion. */
  --ease-sheet: cubic-bezier(.32, .72, .24, 1);
  --dur-sheet: .38s;
  --dur-press: .12s;
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', Inter, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  background: var(--coal);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', Inter, 'Segoe UI', Roboto, sans-serif;
  font-size: var(--text-body);
  line-height: var(--leading-body);
  overscroll-behavior: none;
}

body { position: relative; overflow: hidden; }

h1, h2, h3, p { margin: 0; }
button { font: inherit; color: inherit; }
button:focus-visible, input:focus-visible, a:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ── Type scale utilities ──────────────────────────────────────
   Display / title / body / caption hierarchy for sheet copy.
   .display for hero numbers + phase headlines, .title for sheet
   headings, .caption for muted supporting copy. */
.display { font-size: var(--text-display); font-weight: 800; letter-spacing: -.02em; line-height: var(--leading-tight); }
.title { font-size: var(--text-title); font-weight: 700; letter-spacing: -.01em; line-height: var(--leading-tight); }
.caption { font-size: var(--text-caption); color: var(--muted); line-height: 1.4; }
.text-gold { color: var(--gold); }

/* ── Map ─────────────────────────────────────────────────── */
#map {
  position: absolute;
  inset: 0;
  background: var(--coal);
  z-index: 0;
}

/* ── Map loading + error states ──────────────────────────────
   NOTE (shared-layer decision): the overlay styles themselves live
   in the app CSS — rider.css (.map-loading/.map-error full-screen
   coal + gold radial) and driver.css (.map-overlay scrim + blurred
   card) — because the two apps lay them out differently. design.css
   deliberately does NOT redeclare .map-loading/.map-error here: a
   shared rule would fight the app rules that load after it (e.g. a
   shared transform would break their flex centring). What design.css
   supplies is the shared foundation they build on: the --gold /
   --panel / --shadow-card tokens and the reusable `shimmer` keyframe
   (see Skeleton section below), which .skeleton and any loading
   state can reuse. The apps toggle the overlays with the `hidden`
   attribute and the map handle's onReady/onError (map-provider.js). */

/* ── Top bar / brand ─────────────────────────────────────── */
.topbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px;
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.topbar .topbar-spacer { pointer-events: none; }

.brand-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px 7px 7px;
  background: rgba(11, 14, 17, .82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-card);
  font-weight: 700;
  letter-spacing: .02em;
}
.lr-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  flex: 0 0 34px;
  background: var(--ink);
  border: 1.5px solid var(--gold);
  border-radius: 10px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .04em;
}

/* ── Bottom sheet ────────────────────────────────────────── */
.sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 600;
  background: var(--panel);
  border-top: 1px solid var(--line);
  border-radius: var(--sheet-radius) var(--sheet-radius) 0 0;
  padding: 10px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  box-shadow: var(--shadow-sheet);
  transition: transform var(--dur-sheet) var(--ease-sheet);
  will-change: transform;
  max-height: 82vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.sheet-handle {
  width: 40px; height: 5px;
  margin: 2px auto 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .22);
}
.sheet[data-state="hidden"] { transform: translateY(calc(100% + 8px)); }
.sheet[data-state="peek"] { transform: translateY(calc(100% - 148px)); }
.sheet[data-state="full"] { transform: translateY(0); }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--panel-2);
  color: var(--text);
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  user-select: none;
  transition: transform var(--dur-press) ease, opacity .15s ease, background .15s ease, box-shadow .15s ease;
}
.btn:active { transform: scale(.97); }
@media (hover: hover) {
  .btn:hover { filter: brightness(1.07); }
  .btn:active { filter: brightness(.97); }
}
.btn:disabled { opacity: .45; cursor: default; }
.btn:disabled:active { transform: none; }
.btn-wide, .btn.wide { width: 100%; }
.btn-gold { background: var(--gold); color: var(--ink); box-shadow: var(--shadow-gold); }
.btn-gold:active { background: var(--gold-deep); }
.btn-light { background: #fff; color: var(--ink); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: 14px; border-radius: 11px; }

/* ── Fields / search ─────────────────────────────────────── */
.field { display: block; margin-bottom: 14px; }
.field label, .field > span.field-label {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .02em;
}
.field input, .field select, .field textarea,
input.search-input {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  font-size: 16px; /* 16px prevents iOS focus zoom */
  appearance: none;
  -webkit-appearance: none;
}
.field input::placeholder, input.search-input::placeholder { color: var(--muted); }
.field input:focus, .field select:focus, .field textarea:focus,
input.search-input:focus { border-color: var(--gold); outline: none; }

/* ── Suggestion list ─────────────────────────────────────── */
.suggest-list { list-style: none; margin: 0; padding: 0; }
.suggest-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
  width: 100%;
  padding: 13px 4px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--line);
  text-align: left;
  cursor: pointer;
  color: var(--text);
  transition: background .15s ease;
}
.suggest-item:last-child { border-bottom: none; }
.suggest-item:active { background: rgba(255, 255, 255, .04); }
.suggest-item .suggest-name { font-size: 16px; font-weight: 600; }
.suggest-item .suggest-sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Tier cards ──────────────────────────────────────────── */
.tier-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  margin-bottom: 10px;
  background: var(--panel-2);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  text-align: left;
  cursor: pointer;
  color: var(--text);
  transition: border-color .15s ease, background .15s ease, transform var(--dur-press) ease, box-shadow .15s ease;
}
.tier-card:active { transform: scale(.98); box-shadow: 0 2px 10px rgba(0, 0, 0, .35); }
.tier-card.selected {
  border-color: var(--gold);
  background: var(--gold-soft);
  box-shadow: var(--shadow-gold);
}
@media (hover: hover) {
  .tier-card:hover { border-color: rgba(229, 200, 148, .45); }
  .tier-card.selected:hover { border-color: var(--gold); }
}
.tier-card .tier-info { flex: 1 1 auto; min-width: 0; }
.tier-card .tier-name { font-size: 16px; font-weight: 700; }
.tier-card .tier-eta { font-size: 13px; color: var(--muted); }
.tier-card .tier-price { font-size: 16px; font-weight: 700; text-align: right; white-space: nowrap; }
/* Vehicle glyph: layered-gradient car abstraction (no SVG/emoji). */
.car-art {
  position: relative;
  flex: 0 0 54px;
  width: 54px; height: 38px;
  border-radius: 10px;
  background:
    radial-gradient(circle at 16px 30px, #0b0e11 0 5px, #9aa3ad 6px 8px, transparent 9px),
    radial-gradient(circle at 40px 30px, #0b0e11 0 5px, #9aa3ad 6px 8px, transparent 9px),
    linear-gradient(180deg, rgba(229, 200, 148, .0) 0 55%, rgba(0, 0, 0, .28) 56% 100%),
    linear-gradient(180deg, #3a434e 0%, #232a33 60%, #1a2028 100%);
  box-shadow: inset 0 0 0 1px var(--line);
}
.car-art::before {
  content: "";
  position: absolute;
  left: 12px; right: 12px; top: 6px; height: 11px;
  border-radius: 7px 7px 3px 3px;
  background: linear-gradient(180deg, #59636f, #39414c);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
}
.tier-card.selected .car-art { box-shadow: inset 0 0 0 1px var(--gold); }

/* ── Driver card ─────────────────────────────────────────── */
.driver-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color .15s ease, transform var(--dur-press) ease, box-shadow .15s ease;
}
.driver-card:active { transform: scale(.99); box-shadow: 0 2px 10px rgba(0, 0, 0, .35); }
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px; height: 52px;
  flex: 0 0 52px;
  border-radius: 50%;
  background: var(--ink);
  border: 1.5px solid var(--gold);
  color: var(--gold);
  font-size: 17px;
  font-weight: 800;
}
.driver-card .driver-info { flex: 1 1 auto; min-width: 0; }
.driver-card .driver-name { font-size: 16px; font-weight: 700; }
.driver-card .driver-rating { font-size: 13px; color: var(--muted); }
.driver-card .driver-rating .star { color: var(--gold); }
.driver-card .driver-car { text-align: right; font-size: 14px; font-weight: 600; }
.driver-card .driver-plate {
  display: inline-block;
  margin-top: 3px;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--muted);
}

/* ── Status / trip phase ─────────────────────────────────── */
.status-line { font-size: var(--text-caption); color: var(--muted); line-height: 1.4; }
.trip-phase {
  font-size: var(--text-display);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: var(--leading-tight);
}

/* ── Progress (countdowns) ──────────────────────────────── */
.progress-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .1);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: var(--gold);
  transition: width .3s linear;
}

/* ── Skeleton / spinner ────────────────────────────────────
   `shimmer` is the shared loading sweep: .skeleton, .map-loading
   and any future loading state reuse this one keyframe. */
@keyframes shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.skeleton {
  border-radius: 12px;
  background: linear-gradient(90deg, var(--panel-2) 25%, #262e38 50%, var(--panel-2) 75%);
  background-size: 800px 100%;
  animation: shimmer 1.4s infinite linear;
}
.skeleton-line { height: 14px; margin-bottom: 10px; }
.skeleton-line:last-child { margin-bottom: 0; }

@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  display: inline-block;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 3px solid rgba(229, 200, 148, .25);
  border-top-color: var(--gold);
  animation: spin .8s linear infinite;
  vertical-align: middle;
}

/* ── Toast ───────────────────────────────────────────────── */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%) translateY(16px);
  z-index: 900;
  max-width: calc(100vw - 40px);
  padding: 12px 18px;
  background: rgba(11, 14, 17, .94);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-card);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Notifications (js/notify.js) ────────────────────────────
   Banner stack sits above the sheet but below the auth gate;
   the center overlay sits above banners. Colors come from the
   theme tokens, so both themes work from one rule set. */
.notify-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(11, 14, 17, .82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  color: var(--text);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  pointer-events: auto;
  transition: transform .18s ease, border-color .18s ease;
}
.notify-bell:hover { border-color: var(--gold-line); }
.notify-bell:active { transform: scale(.93); }
/* The map carries no brand overlay — the bell is the top bar's
   only permanent chrome and hugs the right edge. */
.topbar .notify-bell { margin-left: auto; }
.notify-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--ink);
  border: 2px solid var(--coal);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.notify-badge[hidden] { display: none; }

.notify-banners {
  position: fixed;
  top: calc(10px + env(safe-area-inset-top, 0px));
  left: 12px;
  right: 12px;
  z-index: 950;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.notify-banner {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 13px 14px;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--gold-line);
  color: var(--text);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  text-align: left;
  animation: notify-in .28s var(--ease-sheet);
  transition: opacity .18s ease, transform .18s ease;
}
.notify-banner.urgent { border-color: var(--gold); box-shadow: var(--shadow-gold); }
.notify-banner.leaving { opacity: 0; transform: translateY(-10px); }
@keyframes notify-in {
  from { opacity: 0; transform: translateY(-14px); }
  to { opacity: 1; transform: translateY(0); }
}
.notify-icon {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--gold-soft);
  color: var(--gold);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.notify-banner-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.notify-banner-text strong { font-size: 15px; font-weight: 700; }
.notify-banner-text span { font-size: 13px; color: var(--muted); }

.notify-center {
  position: fixed;
  inset: 0;
  z-index: 980;
  background: rgba(5, 6, 8, .55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.notify-center[hidden] { display: none; }
.notify-panel {
  width: 100%;
  max-width: 560px;
  max-height: 86vh;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px 22px 0 0;
  padding: 16px 18px calc(18px + env(safe-area-inset-bottom, 0px));
  box-shadow: var(--shadow-sheet);
  animation: notify-in .25s var(--ease-sheet);
}
@media (min-width: 720px) {
  .notify-center { align-items: center; padding: 24px; }
  .notify-panel { border-radius: 22px; }
}
.notify-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.notify-head h2 { font-size: var(--text-title); font-weight: 800; }
.notify-head-actions { display: flex; align-items: center; gap: 8px; }
.notify-close {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.notify-settings {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.notify-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.notify-row[hidden] { display: none; }
.notify-row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.notify-row-text strong { font-size: 15px; font-weight: 700; }
.notify-row-text span { font-size: 13px; color: var(--muted); }
.notify-note {
  flex: 1;
  font-size: 13px;
  line-height: var(--leading-body);
  color: var(--muted);
  background: var(--gold-soft);
  border: 1px solid var(--gold-line);
  border-radius: 12px;
  padding: 10px 12px;
}
.switch.notify-switch { width: 54px; height: 32px; flex-basis: 54px; }
.switch.notify-switch .switch-track::after { width: 24px; height: 24px; top: 3px; left: 3px; }
.switch.notify-switch input:checked + .switch-track::after { transform: translateX(22px); }

.notify-list { display: flex; flex-direction: column; }
.notify-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 13px 2px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}
.notify-item:last-child { border-bottom: none; }
.notify-item.urgent .notify-icon { background: var(--gold); color: var(--ink); }
.notify-item-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.notify-item-text strong { font-size: 15px; font-weight: 700; }
.notify-item-text span { font-size: 13px; color: var(--muted); }
.notify-item-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex: 0 0 auto; }
.notify-time { font-size: 12px; color: var(--muted); white-space: nowrap; }
.notify-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--gold); }
.notify-empty { padding: 22px 6px; text-align: center; color: var(--muted); font-size: 14px; }
.notify-empty[hidden] { display: none; }

/* ── FAB (locate) ────────────────────────────────────────── */
.fab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px; height: 48px;
  border: none;
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  font-size: 21px;
  line-height: 1;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: transform var(--dur-press) ease, box-shadow .15s ease;
}
.fab:active { transform: scale(.94); }
@media (hover: hover) {
  .fab:hover { transform: translateY(-1px); box-shadow: 0 12px 32px rgba(0, 0, 0, .5); }
}

/* ── Center pin ──────────────────────────────────────────── */
@keyframes pin-bounce {
  0%, 100% { transform: translate(-50%, -100%); }
  50% { transform: translate(-50%, calc(-100% - 6px)); }
}
.center-pin {
  position: absolute;
  left: 50%; top: 50%;
  z-index: 400;
  transform: translate(-50%, -100%);
  pointer-events: none;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .5));
  transition: transform .18s ease;
}
.center-pin::before {
  content: "";
  display: block;
  width: 18px; height: 18px;
  margin: 0 auto;
  border-radius: 50%;
  background: var(--gold);
  border: 3px solid var(--ink);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .35);
}
.center-pin::after {
  content: "";
  display: block;
  width: 0; height: 0;
  margin: -3px auto 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 12px solid var(--gold);
}
.center-pin.lifted { animation: pin-bounce .5s ease; }

/* ── Segmented control ───────────────────────────────────── */
.seg {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.seg button {
  flex: 1 1 0;
  min-height: 40px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, transform var(--dur-press) ease;
}
.seg button:active { transform: scale(.98); }
.seg button.active { background: var(--gold); color: var(--ink); }

/* ── Switch (online / offline) ───────────────────────────── */
.switch {
  position: relative;
  display: inline-block;
  width: 76px; height: 44px;
  flex: 0 0 76px;
  cursor: pointer;
}
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .switch-track {
  position: absolute; inset: 0;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  transition: background .2s ease, border-color .2s ease;
}
.switch .switch-track::after {
  content: "";
  position: absolute;
  top: 4px; left: 4px;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .4);
  transition: transform .2s ease;
}
.switch input:checked + .switch-track { background: var(--gold); border-color: var(--gold); }
.switch input:checked + .switch-track::after { transform: translateX(32px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ── Stats (earnings) ────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.stat {
  padding: 14px 10px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: center;
  transition: border-color .15s ease, transform var(--dur-press) ease;
}
.stat:active { transform: scale(.98); }
.stat .stat-value { font-size: 21px; font-weight: 800; color: var(--gold); }
.stat .stat-label { margin-top: 2px; font-size: 12px; color: var(--muted); letter-spacing: .03em; }

/* ── List rows (history) ─────────────────────────────────── */
.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--line);
  transition: background .15s ease;
}
.list-row:active { background: rgba(255, 255, 255, .03); }
.list-row:last-child { border-bottom: none; }
.list-row .list-main { flex: 1 1 auto; min-width: 0; }
.list-row .list-title { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row .list-sub { font-size: 13px; color: var(--muted); }
.list-row .list-value { font-size: 15px; font-weight: 700; white-space: nowrap; }

/* ── Star rating ─────────────────────────────────────────── */
.stars { display: inline-flex; gap: 6px; }
.stars button {
  padding: 4px;
  border: none;
  background: none;
  font-size: 30px;
  line-height: 1;
  color: rgba(255, 255, 255, .22);
  cursor: pointer;
}
.stars button:active { transform: scale(.92); }
.stars button.active { color: var(--gold); }

/* ── Notice ──────────────────────────────────────────────── */
.notice {
  padding: 12px 14px;
  margin-bottom: 14px;
  background: var(--gold-soft);
  border: 1px solid var(--gold-line);
  border-radius: 12px;
  color: var(--text);
  font-size: 14px;
}
.notice.warn {
  background: rgba(229, 83, 75, .1);
  border-color: rgba(229, 83, 75, .4);
}

/* ── Utilities ───────────────────────────────────────────── */
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }
.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stack > * + * { margin-top: 14px; }

/* ── Leaflet overrides ───────────────────────────────────── */
.leaflet-container {
  font: inherit;
  background: #0b0e11;
  color: var(--text);
}
.leaflet-control-attribution {
  background: rgba(11, 14, 17, .65) !important;
  color: rgba(255, 255, 255, .38) !important;
  font-size: 9px !important;
  line-height: 1.4 !important;
  padding: 1px 5px;
}
.leaflet-control-attribution a { color: rgba(255, 255, 255, .45) !important; }
/* Apps disable the zoom control; keep any stray control unobtrusive. */
.leaflet-control-zoom { display: none; }
.leaflet-div-icon { background: transparent; border: none; }

/* ── Map markers (divIcons) ──────────────────────────────── */
.mk { background: transparent; border: none; }
.mk .mk-core, .mk .mk-dot { display: block; }

@keyframes mk-pulse {
  0% { box-shadow: 0 0 0 0 rgba(229, 200, 148, .55); }
  70% { box-shadow: 0 0 0 16px rgba(229, 200, 148, 0); }
  100% { box-shadow: 0 0 0 0 rgba(229, 200, 148, 0); }
}
.mk-self { display: flex; align-items: center; justify-content: center; }
.mk-self .mk-core {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 3.5px solid var(--gold);
  animation: mk-pulse 2s ease-out infinite;
}

.mk-driver {
  display: flex; align-items: center; justify-content: center;
  background: var(--ink);
  border: 1.5px solid var(--gold);
  border-radius: 9px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .5);
}
.mk-driver .mk-dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; }

.mk-pickup, .mk-dropoff {
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .5);
}
.mk-pickup { background: var(--gold); }
.mk-dropoff { background: #fff; }
.mk-pickup .mk-dot, .mk-dropoff .mk-dot {
  position: absolute;
  left: 50%; top: 50%;
  width: 9px; height: 9px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.mk-pickup .mk-dot { background: var(--ink); }
.mk-dropoff .mk-dot { background: var(--ink); }

/* ── Desktop preview: sheet becomes a centered card ──────── */
@media (min-width: 720px) {
  .sheet {
    left: 50%;
    right: auto;
    bottom: 24px;
    width: 430px;
    max-width: 430px;
    transform: translateX(-50%);
    border: 1px solid var(--line);
    border-radius: var(--sheet-radius);
    max-height: calc(100vh - 120px);
  }
  .sheet[data-state="hidden"] { transform: translateX(-50%) translateY(calc(100% + 32px)); }
  .sheet[data-state="peek"] { transform: translateX(-50%) translateY(calc(100% - 148px)); }
  .sheet[data-state="full"] { transform: translateX(-50%) translateY(0); }
}

/* ── Reduced motion ────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ══════════════════════════════════════════════════════════════
   THEME SYSTEM (Build 7) — day/night theming.
   js/theme.js resolves AUTO (sunrise/sunset from the last GPS fix,
   clock fallback) / LIGHT / DARK and sets <html data-theme>. The
   :root tokens above ARE the dark theme; everything below restyles
   the app for light: warm-cream surfaces from the brand board,
   charcoal text, bronze-gold accents dark enough to read on cream.
   ══════════════════════════════════════════════════════════════ */
[data-theme="light"] {
  color-scheme: light;
  --gold: #a87f24;
  --gold-deep: #8a641c;
  --gold-soft: rgba(168, 127, 36, .10);
  --gold-line: rgba(168, 127, 36, .48);
  --coal: #faf8f4;
  --panel: #ffffff;
  --panel-2: #f3efe6;
  --line: rgba(35, 37, 42, .13);
  --text: #23252a;
  --muted: #6f6a5e;
  --danger: #c0362c;
  --ok: #1e7d5a;
  --shadow-sheet: 0 -12px 40px rgba(84, 66, 20, .20);
  --shadow-card: 0 8px 28px rgba(84, 66, 20, .16);
  --shadow-gold: 0 6px 20px rgba(168, 127, 36, .28);
}

/* Brand mark: the picked board lockup (gold arc + LUMERIDE
   wordmark), swapped per theme — white wordmark on dark UI,
   charcoal wordmark on light UI. Same asset pair the platform
   header uses (assets/logo-lockup-for-*.svg). */
.brand-mark {
  display: block;
  flex: 0 0 auto;
  background: url('../assets/logo-lockup-for-dark-bg.svg') center / contain no-repeat;
}
[data-theme="light"] .brand-mark {
  background-image: url('../assets/logo-lockup-for-light-bg.svg');
}
.brand-mark-chip { width: 104px; height: 29px; }
.brand-mark-auth { width: 172px; height: 48px; margin: 0 auto 18px; }
.brand-mark-lg { width: 188px; height: 52px; }
.brand-mark-md { width: 152px; height: 42px; }

/* Theme toggle: cycles Auto → Light → Dark (js/theme.js renders the
   icon + mode label and wires every [data-theme-toggle] button). */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 13px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .02em;
  cursor: pointer;
  transition: transform var(--dur-press) ease, border-color .15s ease;
}
.theme-toggle:active { transform: scale(.95); }
.theme-toggle svg { display: block; }
.theme-toggle-gate { margin: 0 auto 20px; background: rgba(255, 255, 255, .06); }
[data-theme="light"] .theme-toggle-gate { background: rgba(35, 37, 42, .05); }

/* ── Light-theme component adjustments ─────────────────────── */
[data-theme="light"] .brand-chip {
  background: rgba(255, 255, 255, .86);
}
[data-theme="light"] .notify-bell { background: rgba(255, 255, 255, .86); }
[data-theme="light"] .notify-badge { border-color: #fff; }
[data-theme="light"] .notify-center { background: rgba(74, 62, 32, .32); }
[data-theme="light"] .sheet-handle { background: rgba(35, 37, 42, .20); }
[data-theme="light"] .toast {
  background: rgba(255, 255, 255, .96);
}
[data-theme="light"] .skeleton {
  background: linear-gradient(90deg, var(--panel-2) 25%, #e6dfcf 50%, var(--panel-2) 75%);
  background-size: 800px 100%;
}
[data-theme="light"] .progress-track { background: rgba(35, 37, 42, .10); }
[data-theme="light"] .suggest-item:active { background: rgba(35, 37, 42, .045); }
[data-theme="light"] .list-row:active { background: rgba(35, 37, 42, .035); }
[data-theme="light"] .stars button { color: rgba(35, 37, 42, .22); }
[data-theme="light"] .stars button.active { color: var(--gold); }
[data-theme="light"] .spinner { border-color: rgba(168, 127, 36, .25); border-top-color: var(--gold); }
/* Gold buttons carry white text on the deeper light-theme bronze. */
[data-theme="light"] .btn-gold { color: #fff; }
[data-theme="light"] .seg button.active { color: #fff; }
[data-theme="light"] .btn-gold:active { background: var(--gold-deep); }
/* Leaflet chrome on the light basemap. */
[data-theme="light"] .leaflet-container { background: #e9e5da; }
[data-theme="light"] .leaflet-control-attribution {
  background: rgba(255, 255, 255, .65) !important;
  color: rgba(35, 37, 42, .45) !important;
}
[data-theme="light"] .leaflet-control-attribution a { color: rgba(35, 37, 42, .55) !important; }
/* Dropoff pin flips to charcoal so it stays visible on light maps. */
[data-theme="light"] .mk-dropoff { background: var(--text); }
[data-theme="light"] .mk-dropoff .mk-dot { background: #fff; }
[data-theme="light"] .mk-driver { box-shadow: 0 4px 12px rgba(84, 66, 20, .28); }
