/* ==========================================================================
   State overlay — the empty / loading / error card over the map area,
   plus the shared spinner.
   ========================================================================== */

.overlay-state {
  position: absolute;
  inset: 0;
  z-index: var(--z-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: color-mix(in srgb, var(--background) 72%, transparent);
  backdrop-filter: blur(3px);
  /* The dim is visual only: map-area controls under it (basemap picker,
     zoom, pan) must stay clickable in the empty/error states. */
  pointer-events: none;
}

.overlay-state .state-card { pointer-events: auto; }

/* No track, no map chrome: while the state overlay is up the map area shows
   only the state card. Leaflet's control container would otherwise stack
   above the overlay (corner z-index 1000 > overlay 900), and #map-fit would
   show through the frost. Attribution is not in this list on purpose — it
   follows tile presence, not overlay state: tiles and the attribution
   control both start with the first track (mapView.js startTiles), so an
   empty map owes no credit, and once tiles render the credit stays even
   under later loading/error frosts. */
#map-pane:has(#overlay-state:not([hidden])) #map-fit,
#map-pane:has(#overlay-state:not([hidden])) .leaflet-control-zoom,
#map-pane:has(#overlay-state:not([hidden])) .leaflet-control-scale {
  display: none;
}

.state-card {
  max-width: 420px;
  padding: 28px 26px;
  text-align: center;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.state-brand {
  display: inline-flex;
}
.state-brand img { width: 56px; height: 56px; display: block; }

.state-error-icon {
  display: inline-flex;
  color: var(--danger);
}
.state-error-icon .icon { width: 28px; height: 28px; }

.state-title { font-size: 17px; }

.state-text {
  font-size: 13.5px;
  color: var(--foreground-muted);
}

.state-privacy {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-block-start: 6px;
  font-size: 12px;
  color: var(--foreground-faint);
  text-align: start;
}

.state-privacy .icon { width: 14px; height: 14px; margin-block-start: 2px; color: var(--success); }

.spinner {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 3px solid var(--border-strong);
  border-block-start-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }
