/* ── Reset & base ────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: #222;
  background: #1a2a38;
}

/* ── Map container ───────────────────────────────────────────── */
#map {
  position: absolute;
  inset: 0;
}

/* ── Legend ──────────────────────────────────────────────────── */
#legend {
  position: absolute;
  bottom: 36px;
  right: 12px;
  background: rgba(255, 255, 255, 0.93);
  border-radius: 6px;
  padding: 12px 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  min-width: 140px;
  z-index: 5;
}

#legend h3 {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #666;
  margin-bottom: 10px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  line-height: 1;
}

.legend-item:last-child {
  margin-bottom: 0;
}

.swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
  opacity: 0.82;
}

/* ── Tooltip ─────────────────────────────────────────────────── */
#tooltip {
  position: absolute;
  display: none;
  background: rgba(20, 20, 20, 0.88);
  color: #fff;
  padding: 7px 11px;
  border-radius: 5px;
  font-size: 13px;
  line-height: 1.5;
  pointer-events: none;
  z-index: 10;
  max-width: 220px;
  white-space: nowrap;
}

/* ── Error banner ────────────────────────────────────────────── */
#load-error {
  display: none;
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: #c0392b;
  color: #fff;
  padding: 10px 18px;
  border-radius: 5px;
  font-size: 13px;
  z-index: 20;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

/* ── MapLibre control overrides ──────────────────────────────── */
.maplibregl-ctrl-group {
  border-radius: 6px !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18) !important;
}
