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

* {
  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: #d9ddd1;
}

.panel {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 5;
  width: min(380px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgb(43 41 36 / 16%);
  border-radius: 8px;
  background: rgb(255 252 246 / 94%);
  box-shadow: 0 16px 48px rgb(32 33 36 / 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: #65615a;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

.count {
  min-width: 48px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #202124;
  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: #5b5953;
  font-size: 0.82rem;
}

.stats span {
  padding: 5px 8px;
  border: 1px solid rgb(43 41 36 / 12%);
  border-radius: 999px;
  background: rgb(255 255 255 / 62%);
}

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

.incident {
  border-bottom: 1px solid rgb(43 41 36 / 10%);
}

.incident button {
  width: 100%;
  min-height: 64px;
  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: 42px;
  border-radius: 999px;
  background: #52796f;
}

.incident.major button::before {
  background: #b51f1f;
}

.incident.strong button::before {
  background: #e4552f;
}

.incident.moderate button::before {
  background: #d5961f;
}

.incident button:hover,
.incident button:focus-visible {
  background: rgb(215 86 34 / 10%);
  outline: none;
}

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

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

.incident-meta {
  margin-top: 3px;
  color: #5f5c55;
  font-size: 0.78rem;
}

.mapboxgl-popup-content {
  min-width: 190px;
  border-radius: 8px;
  box-shadow: 0 12px 36px rgb(32 33 36 / 20%);
}

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

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

.mapboxgl-popup-content dt {
  color: #65615a;
}

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

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

.quake-marker {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 2px solid white;
  border-radius: 50%;
  background: #52796f;
  color: white;
  box-shadow: 0 8px 20px rgb(32 33 36 / 28%);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.quake-marker.major {
  width: 44px;
  height: 44px;
  background: #b51f1f;
}

.quake-marker.strong {
  width: 40px;
  height: 40px;
  background: #e4552f;
}

.quake-marker.moderate {
  background: #d5961f;
}

.quake-marker:hover,
.quake-marker:focus-visible {
  outline: 3px solid rgb(255 255 255 / 82%);
  outline-offset: 2px;
}

@media (max-width: 720px) {
  .panel {
    top: auto;
    right: 10px;
    bottom: 10px;
    left: 10px;
    width: auto;
    max-height: 42vh;
  }

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

  h1 {
    font-size: 1.08rem;
  }

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

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