/* What the pages share: the colors, light and dark, and the pieces more than one page draws. */
:root {
  --bg: #0e1420; --card: #172031; --glass: #172031ee; --line: #243149; --text: #e8edf5; --muted: #8a97ad;
  --accent: #4f8cff; --ok: #3ccf7a; --warn: #f2b33d; --bad: #f2564b;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f2f4f8; --card: #fff; --glass: #ffffffee; --line: #e1e6ee; --text: #131a26; --muted: #66728a;
    --accent: #2563eb; --ok: #15a356; --warn: #c78400; --bad: #d63b30;
    color-scheme: light;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.35 system-ui, -apple-system, sans-serif; }

.lineno {
  flex: none; min-width: 42px; text-align: center; font-weight: 700; padding: 3px 6px; border-radius: 6px;
  background: var(--line);
}
.late1 { color: var(--warn); } .late2 { color: var(--bad); } .early { color: var(--accent); } .ontime { color: var(--ok); }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--warn); }
.dot.live { background: var(--ok); }
.dot.down { background: var(--bad); }

/* The map pages: a full-screen map with a card over its top. */
#map { position: fixed; inset: 0; }
.leaflet-container { font: inherit; background: var(--bg); }
@media (prefers-color-scheme: dark) {
  .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.9) contrast(.85) saturate(.5); }
}
.overlay {
  position: fixed; z-index: 1000; top: calc(10px + env(safe-area-inset-top)); left: 10px; right: 10px;
  max-width: 520px; margin: 0 auto; padding: 12px 14px; border-radius: 14px;
  background: var(--glass); border: 1px solid var(--line); box-shadow: 0 6px 24px #0004; backdrop-filter: blur(8px);
}
.back { color: var(--muted); text-decoration: none; font-size: 26px; line-height: 1; padding: 0 4px 2px 0; }

/* A vehicle marker (common.js' vehicleIcon): centered on its position, turned by --r, sized by --s from its map. */
.vehicle .body {
  position: absolute; left: -12px; top: -32px; width: 24px; height: 64px;
  transform: scale(var(--s, 1)) rotate(var(--r)); transition: transform 1s; filter: drop-shadow(0 2px 3px #0008);
}
.vehicle .body svg { display: block; }
.vehicle .tag {
  position: absolute; left: calc(var(--s, 1) * 12px); top: calc(var(--s, 1) * -24px - 10px);
  padding: 1px 6px; border-radius: 6px; font: 700 13px system-ui, sans-serif; border: 1.5px solid #fff; white-space: nowrap;
}
.vehicle .halo {
  display: none; position: absolute; left: -20px; top: -20px; width: 40px; height: 40px; border-radius: 50%;
  opacity: .35; animation: pulse 2s ease-out infinite;
}
.vehicle.on .halo { display: block; }
@keyframes pulse { from { transform: scale(.6); opacity: .5; } to { transform: scale(1.8); opacity: 0; } }
