:root {
  color-scheme: light dark;
  --bg: #0f1419;
  --panel: #1a2332;
  --text: #e8ecf1;
  --muted: #9aa7b2;
  --accent: #3d9a5c;
  --water: #1e3a5f;
  --safe: rgba(61, 154, 92, 0.45);
  --outline: rgba(120, 170, 220, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.map-shell {
  position: relative;
  height: calc(100% - 12rem);
  min-height: calc(260px * 1.1);
  width: 100%;
  --map-ring-width: 12px;
  --map-ring-color: rgba(255, 255, 255, 0.18);
}

.map-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 500;
  pointer-events: none;
  box-shadow: inset 0 0 0 var(--map-ring-width) var(--map-ring-color);
}

.map-shell--safe {
  --map-ring-color: rgba(34, 197, 94, 0.85);
}

.map-shell--not-safe {
  --map-ring-color: rgba(239, 68, 68, 0.8);
}

.map-shell--unknown,
.map-shell--locating {
  --map-ring-color: rgba(156, 163, 175, 0.75);
}

.map-location-banner {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 700;
  padding: 0.85rem 0.95rem;
  text-align: center;
  font-weight: 600;
  font-size: 1.25rem;
  line-height: 1.35;
  pointer-events: none;
}

.map-shell--safe .map-location-banner {
  background: rgba(34, 197, 94, 0.92);
  color: #052e0b;
}

.map-shell--not-safe .map-location-banner {
  background: rgba(239, 68, 68, 0.92);
  color: #450a0a;
}

.map-shell--unknown .map-location-banner {
  background: rgba(107, 114, 128, 0.92);
  color: #111827;
}

.map-shell--locating .map-location-banner {
  background: rgba(107, 114, 128, 0.88);
  color: #111827;
}

#map {
  height: 100%;
  width: 100%;
}

/* Intro: nearly full-screen on small viewports */
.intro-modal {
  position: fixed;
  inset: 0;
  z-index: 2500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
}

.intro-modal[hidden] {
  display: none !important;
}

.intro-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.intro-modal__panel {
  position: relative;
  width: 100%;
  max-width: 26rem;
  max-height: 90vh;
  overflow: auto;
  background: var(--panel);
  color: var(--text);
  border-radius: 12px;
  padding: 1.35rem 1.25rem 1.5rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.intro-modal__title {
  margin: 0 0 1rem;
  font-size: 1.15rem;
  font-weight: 600;
}

.intro-modal__lead {
  margin: 0 0 0.85rem;
  font-size: 1rem;
  line-height: 1.45;
}

.intro-modal__body {
  margin: 0 0 1.35rem;
  font-size: 0.98rem;
  line-height: 1.5;
  color: var(--muted);
}

.compass-icon-inline {
  display: inline-flex;
  vertical-align: middle;
  margin: 0 0.15rem;
  color: #e8ecf1;
}

.intro-modal__btn {
  display: block;
  width: 100%;
  padding: 0.65rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  color: #0f1419;
  background: #3d9a5c;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.intro-modal__btn:hover {
  filter: brightness(1.06);
}

.intro-modal__btn:focus-visible {
  outline: 2px solid #7ec8ff;
  outline-offset: 2px;
}

.app-header {
  padding: 0.65rem 1rem 0.75rem;
  background: var(--panel);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.app-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  width: 100%;
}

.map-legend {
  margin: 0;
  width: 100%;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--muted);
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.map-legend-detail {
  margin: 0;
  width: 100%;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--muted);
}

.map-legend strong {
  color: var(--text);
  font-weight: 600;
}

.map-legend-swatch {
  flex-shrink: 0;
  width: 1.35rem;
  height: 1.35rem;
  margin-top: 0.12rem;
  border-radius: 4px;
  background: var(--safe);
  border: 1px solid rgba(61, 154, 92, 0.85);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
}

.status-line {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.4;
}

footer.site-footer {
  padding: 0.75rem 1rem 1rem;
  background: var(--panel);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.82rem;
  line-height: 1.45;
}

footer.site-footer h2 {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

footer.site-footer section {
  margin-bottom: 0.75rem;
}

footer.site-footer section:last-child {
  margin-bottom: 0;
}

footer.site-footer a {
  color: #7ec8ff;
}

footer.site-footer a:hover {
  text-decoration: underline;
}

.disclaimer {
  color: var(--muted);
}

.leaflet-container {
  /* Matches CARTO Positron light tiles while tiles load */
  background: #ececec;
  font-family: inherit;
}

/* Locate control: match dark UI, sit under zoom (+/-) in top-left */
.leaflet-top.leaflet-left .leaflet-control-locate {
  margin-top: 0.5rem;
}

.leaflet-control-locate .leaflet-bar-part {
  background: #fff !important;
  border: 1px solid rgba(0, 0, 0, 0.2) !important;
  color: #1a1a1a;
}

.leaflet-control-locate .leaflet-bar-part:hover {
  background: #f3f4f6 !important;
}

.leaflet-control-locate a.leaflet-bar-part {
  line-height: 30px;
}

.leaflet-control-locate .leaflet-control-locate-location-arrow,
.leaflet-control-locate .leaflet-control-locate-spinner {
  filter: none;
  opacity: 1;
}

/* User location dot: no throb; constant size (see L.Control.Locate.min.css animation) */
.leaflet-control-locate-location circle {
  animation: none;
  transform: none;
  stroke-width: 2;
}

/* On-map warning when a lake has no computed safe zone */
.no-safe-zone-marker {
  background: transparent !important;
  border: none !important;
}

.no-safe-zone-badge {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.35rem;
  padding: 4px 6px;
  box-sizing: border-box;
  cursor: pointer;
  background: rgba(234, 179, 8, 0.95);
  color: #1c1917;
  font-weight: 600;
  line-height: 1.25;
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(161, 98, 7, 0.5);
  overflow: hidden;
  min-width: 0;
  min-height: 0;
}

.no-safe-zone-badge span {
  flex: 1 1 auto;
  min-width: 0;
  hyphens: auto;
}

.no-safe-zone-badge svg {
  flex-shrink: 0;
  display: block;
}

.no-safe-zone-badge--compact {
  justify-content: center;
  align-items: center;
  padding: 4px;
  width: 40px;
  height: 40px;
  box-sizing: border-box;
}

.no-safe-zone-badge--expanded {
  white-space: nowrap;
  overflow: hidden;
  font-size: 0.875rem;
}

.no-safe-zone-badge--expanded span {
  flex: 0 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
