:root {
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #eef3f0;
  color: #202624;
}

* {
  box-sizing: border-box;
}

html,
body,
.shell,
.map-stage,
#map {
  min-height: 100%;
}

html,
body {
  height: 100%;
  margin: 0;
}

button {
  font: inherit;
}

.shell {
  width: 100%;
}

.map-stage {
  position: relative;
  height: 100vh;
  overflow: hidden;
}

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

.panel {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 5;
  width: min(400px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgb(29 39 37 / 16%);
  border-radius: 8px;
  background: rgb(255 255 252 / 94%);
  box-shadow: 0 16px 48px rgb(29 39 37 / 18%);
  backdrop-filter: blur(10px);
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 18px 10px;
}

.eyebrow {
  margin: 0 0 4px;
  color: #56615d;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 1.28rem;
  line-height: 1.15;
}

.count {
  min-width: 48px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #202624;
  color: white;
  font-size: 1.05rem;
  font-weight: 750;
  text-align: center;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 18px 14px;
  color: #53605b;
  font-size: 0.82rem;
}

.stats span {
  padding: 5px 8px;
  border: 1px solid rgb(29 39 37 / 12%);
  border-radius: 999px;
  background: rgb(255 255 255 / 68%);
}

.incident-list {
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: auto;
  border-top: 1px solid rgb(29 39 37 / 12%);
  list-style: none;
}

.incident {
  border-bottom: 1px solid rgb(29 39 37 / 10%);
}

.incident button {
  width: 100%;
  min-height: 82px;
  display: grid;
  grid-template-columns: 10px 1fr;
  column-gap: 12px;
  align-items: center;
  border: 0;
  padding: 10px 14px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.incident button::before {
  content: "";
  width: 10px;
  height: 56px;
  border-radius: 999px;
  background: #7b5d2a;
}

.incident.tornado button::before {
  background: #9f1d35;
}

.incident.storm button::before {
  background: #6f4cc3;
}

.incident.flood button::before {
  background: #146fa8;
}

.incident.fire button::before {
  background: #c7471d;
}

.incident.winter button::before {
  background: #257f8f;
}

.incident button:hover,
.incident button:focus-visible {
  background: rgb(20 111 168 / 10%);
  outline: none;
}

.incident-name,
.incident-meta,
.incident-scope {
  min-width: 0;
  display: block;
  grid-column: 2;
}

.incident-name {
  font-size: 0.95rem;
  font-weight: 760;
  overflow-wrap: anywhere;
}

.incident-meta {
  margin-top: 3px;
  color: #58625f;
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.incident-scope {
  margin-top: 4px;
  color: #46534f;
  font-size: 0.76rem;
}

.empty-state {
  padding: 18px;
}

.empty-state .incident-name,
.empty-state .incident-meta {
  grid-column: auto;
}

.mapboxgl-popup-content {
  min-width: 230px;
  border-radius: 8px;
  box-shadow: 0 12px 36px rgb(29 39 37 / 20%);
}

.mapboxgl-popup-content strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1rem;
}

.mapboxgl-popup-content p {
  margin: 0 0 10px;
}

.mapboxgl-popup-content dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  margin: 0 0 10px;
}

.mapboxgl-popup-content dt {
  color: #56615d;
}

.mapboxgl-popup-content dd {
  margin: 0;
  font-weight: 650;
}

.mapboxgl-popup-content a {
  color: #146fa8;
  font-weight: 700;
}

.weather-marker {
  min-width: 38px;
  height: 28px;
  border: 2px solid white;
  border-radius: 999px;
  background: #7b5d2a;
  color: white;
  box-shadow: 0 8px 20px rgb(29 39 37 / 28%);
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
}

.weather-marker.tornado {
  background: #9f1d35;
}

.weather-marker.storm {
  background: #6f4cc3;
}

.weather-marker.flood {
  background: #146fa8;
}

.weather-marker.fire {
  background: #c7471d;
}

.weather-marker.winter {
  background: #257f8f;
}

@media (max-width: 720px) {
  .panel {
    top: auto;
    bottom: 12px;
    left: 12px;
    width: calc(100vw - 24px);
    max-height: 42vh;
  }

  .panel-header {
    padding: 14px 14px 8px;
  }

  h1 {
    font-size: 1.08rem;
  }

  .stats {
    padding: 0 14px 10px;
  }

  .incident button {
    min-height: 70px;
    padding: 9px 12px;
  }
}
