.map-page {
  overflow-x: hidden;
}

.map-dashboard {
  max-width: 100%;
}

.map-disclaimer {
  margin-bottom: 0.75rem;
}

.map-shell {
  padding: 1rem;
}

.map-shell__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.map-shell__status {
  margin: 0;
  align-self: center;
  font-size: 0.875rem;
  color: var(--text-muted, #94a3b8);
}

.map-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 1rem;
  align-items: stretch;
}

.map-controls {
  padding: 1rem;
  max-height: 72vh;
  overflow: auto;
}

.map-controls__group {
  border: 0;
  margin: 0 0 1rem;
  padding: 0;
}

.map-controls__group legend {
  font-family: Oswald, sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.map-controls label {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
}

.map-controls__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem 0.75rem;
}

.map-legend__title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 0.5rem;
  color: var(--text-muted, #94a3b8);
}

.map-legend__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.map-legend__list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}

.swatch {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display: inline-block;
}

.swatch--significant { background: #dc2626; }
.swatch--high { background: #ea580c; }
.swatch--elevated { background: #ca8a04; }
.swatch--moderate { background: #2563eb; }

.map-stage {
  position: relative;
  min-height: 520px;
}

.national-map {
  width: 100%;
  height: min(72vh, 760px);
  min-height: 420px;
  border-radius: 12px;
  overflow: hidden;
  background: #0f172a;
  z-index: 1;
}

.map-detail {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: min(340px, calc(100% - 2rem));
  max-height: calc(100% - 2rem);
  overflow: auto;
  padding: 1rem;
  z-index: 500;
}

.map-detail__close {
  position: absolute;
  top: 0.35rem;
  right: 0.5rem;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 1.5rem;
  cursor: pointer;
}

.map-popup__title {
  font-weight: 700;
  margin: 0 0 0.35rem;
}

.map-popup__meta {
  font-size: 0.85rem;
  margin: 0.15rem 0;
  color: #cbd5e1;
}

.map-popup__btn {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  background: #2563eb;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
}

.event-marker-icon,
.damage-marker-icon {
  background: transparent;
  border: 0;
}

.event-marker {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35);
}

.event-marker__glyph {
  display: block;
  font-size: 1rem;
  line-height: 1;
}

.damage-marker {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  background: #78350f;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
}

.damage-marker__glyph {
  display: block;
  font-size: 0.72rem;
  line-height: 1;
}

.verified-marker-icon,
.survey-marker-icon {
  background: transparent;
  border: 0;
}

.verified-marker {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  background: #14532d;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35);
}

.verified-marker__glyph {
  display: block;
  font-size: 0.78rem;
  line-height: 1;
}

.survey-marker {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  background: #1e3a8a;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35);
}

.survey-marker__glyph {
  display: block;
  font-size: 0.78rem;
  line-height: 1;
}

@media (max-width: 900px) {
  .map-layout {
    grid-template-columns: 1fr;
  }

  .map-controls {
    max-height: none;
  }

  .national-map {
    height: 55vh;
    min-height: 320px;
  }

  .map-detail {
    position: static;
    width: 100%;
    margin-top: 0.75rem;
  }
}

.leaflet-container {
  background: #0b1220;
  font-family: Inter, sans-serif;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: rgba(15, 23, 42, 0.95);
  color: #e2e8f0;
}
