:root {
  --bg: #f6f7f9; --card: #fff; --raised: #f6f7f9; --ink: #1b2430; --muted: #5b6675; --accent: #0b5cad;
  --on-accent: #fff; --line: #e3e7ec; --ok: #1f7a3d; --warn: #9a5b00; --map: #e9edf1;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11151a; --card: #1a2028; --raised: #212831; --ink: #e8edf2; --muted: #9aa6b2; --accent: #5aa2ef;
    --on-accent: #0b1622; --line: #2a323c; --ok: #5cc884; --warn: #e0a84a; --map: #222a33;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
main { max-width: 480px; margin: 0 auto; padding: 20px 16px 40px; }
.brand { font-weight: 700; letter-spacing: .2px; color: var(--muted); font-size: 14px; text-transform: uppercase; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px; margin-top: 12px; }
h1 { font-size: 22px; line-height: 1.25; margin: 2px 0 8px; }
p { margin: 8px 0; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

/* The arrival time: the one thing a customer glances at the page for. */
.eta { margin: 4px 0 8px; }
.eta-main { display: block; font-size: 26px; line-height: 1.2; font-weight: 800; letter-spacing: -.2px; }
.eta-sub { display: block; color: var(--muted); font-size: 15px; margin-top: 2px; }

/* The driver's card: first name, an initial for a face, and the truck. */
.profile { margin: 14px 0 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--raised); }
.profile-top { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.avatar {
  flex: none; width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center; background: var(--accent); color: var(--on-accent);
  font-size: 21px; font-weight: 700; line-height: 1;
}
.profile-label { color: var(--muted); font-size: 13px; line-height: 1.3; }
.name { font-weight: 700; font-size: 19px; line-height: 1.3; overflow-wrap: anywhere; }
.profile-truck { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line); }
.truck-icon { flex: none; color: var(--muted); }
.avatar .truck-icon { color: inherit; }
.truck { font-size: 15px; }
.truck.none { color: var(--muted); }
.plate {
  display: inline-block; margin-left: 2px; padding: 0 6px; border: 1px solid var(--line);
  border-radius: 5px; font-variant-numeric: tabular-nums; letter-spacing: .5px; color: var(--ink);
}

.mapwrap { position: relative; margin: 14px -20px 0; }
#map { height: 300px; background: var(--map); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.recenter {
  position: absolute; right: 10px; top: 10px; z-index: 500;
  font: inherit; font-size: 14px; font-weight: 600; padding: 8px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); color: var(--accent);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .2);
}

.status { font-size: 14px; color: var(--ok); margin-top: 10px; min-height: 1.5em; }
.status:empty { min-height: 0; margin: 0; } /* arrived, expired: nothing to report */
.status.stale { color: var(--warn); }
.status.quiet { color: var(--muted); }

.actions { display: flex; gap: 10px; margin-top: 14px; }
.btn {
  flex: 1; display: block; text-align: center; text-decoration: none; padding: 12px 10px;
  border-radius: 10px; font-weight: 600; border: 1px solid var(--accent); color: var(--accent);
}
.btn.primary { background: var(--accent); color: var(--on-accent); }

footer { margin-top: 20px; font-size: 13px; color: var(--muted); }
footer a { color: var(--muted); }

/* The truck on the map. Leaflet positions the box; this draws it. */
.truck-marker { background: none; border: none; }
.truck-dot {
  width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: #fff;
  display: grid; place-items: center; border: 3px solid #fff; box-shadow: 0 1px 6px rgba(0, 0, 0, .35);
}
.leaflet-container { font: inherit; }
.leaflet-container .leaflet-control-attribution { font-size: 11px; line-height: 1.4; }
