html, body {
  margin: 0; padding: 0;
  width: 100%; height: 100%;
  background: #0b1220;
  font-family: -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
  color: #f3f4f6;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

#map { position: absolute; inset: 0; }

/* Geocoder + Directions: legible on the Tesla 17" landscape */
.mapboxgl-ctrl-geocoder {
  font-size: 17px;
  min-width: 360px;
  max-width: 480px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.35);
}
.mapboxgl-ctrl-geocoder--input { height: 52px; padding-left: 44px; }
.mapboxgl-ctrl-geocoder--icon-search { top: 16px; left: 12px; }

.mapboxgl-ctrl-directions { font-size: 16px; max-width: 380px; }
.directions-control-instructions { max-height: 50vh; }
.mapbox-directions-instructions ol li { padding: 12px 14px; font-size: 16px; }
.mapbox-directions-route-summary { padding: 12px 14px; }

/* HUD */
#hud {
  position: absolute; right: 12px; bottom: 12px;
  display: flex; gap: 8px; align-items: center;
  z-index: 5;
  pointer-events: none;
}
#hud > * { pointer-events: auto; }

.hud-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  font-size: 14px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
#hud-status .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: #fbbf24;
}
#hud-status .dot.ok { background: #34d399; }
#hud-status .dot.err { background: #f87171; }

#speed-pill { font-variant-numeric: tabular-nums; }
#speed-pill #speed-value { font-size: 22px; font-weight: 700; line-height: 1; }
#speed-pill .unit { font-size: 11px; opacity: 0.7; }

.hud-btn {
  appearance: none; -webkit-appearance: none;
  width: 52px; height: 52px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(15, 23, 42, 0.85);
  color: #f3f4f6;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 50%;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background 0.15s, color 0.15s;
}
.hud-btn:active { background: rgba(30, 41, 59, 0.95); }

#compass {
  --bearing: 0deg;
  color: #cbd5e1;
}
#compass svg { transform: rotate(var(--bearing)); transition: transform 0.2s linear; }
#compass.active { color: #38bdf8; }
#compass.north-up { color: #f87171; }

#recenter.active { color: #38bdf8; border-color: rgba(56, 189, 248, 0.5); }

/* Alert popup */
.alert-popup .mapboxgl-popup-content {
  background: rgba(10, 14, 24, 0.95);
  color: #f3f4f6;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.4;
  box-shadow: 0 12px 28px rgba(0,0,0,0.5);
}
.alert-popup .mapboxgl-popup-tip { display: none; }
.alert-popup .title { font-weight: 600; margin-bottom: 4px; }
.alert-popup .meta { opacity: 0.7; font-size: 12px; }
