:root {
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

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

body {
  background: #d9e3dd;
  color: #10201d;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

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

.map-shell {
  position: relative;
  overflow: hidden;
}

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

.map-panel {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 1;
  display: flex;
  width: min(420px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgb(255 255 255 / 22%);
  border-radius: 8px;
  background: rgb(12 26 30 / 88%);
  box-shadow: 0 16px 44px rgb(0 0 0 / 24%);
  color: #f4fbf8;
  overflow: auto;
  backdrop-filter: blur(14px);
}

.panel-header p {
  margin: 0 0 3px;
  color: #b8cbc6;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.panel-header h1 {
  margin: 0;
  font-size: 1.28rem;
  font-weight: 760;
  line-height: 1.1;
}

.map-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  flex: 0 0 auto;
  gap: 8px;
  margin: 0;
}

.map-stats div {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgb(255 255 255 / 14%);
  border-radius: 6px;
  background: rgb(255 255 255 / 8%);
}

.map-stats dt {
  margin: 0 0 5px;
  color: #b8cbc6;
  font-size: 0.68rem;
  font-weight: 760;
  letter-spacing: 0;
  text-transform: uppercase;
}

.map-stats dd {
  margin: 0;
  overflow: hidden;
  font-variant-numeric: tabular-nums;
  font-size: 1.05rem;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  flex: 0 0 auto;
  gap: 8px;
}

.map-filters label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.map-filters span {
  color: #b8cbc6;
  font-size: 0.68rem;
  font-weight: 760;
  letter-spacing: 0;
  text-transform: uppercase;
}

.map-filters input,
.map-filters select {
  width: 100%;
  min-height: 38px;
  min-width: 0;
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: 6px;
  background: #f4fbf8;
  color: #10201d;
  font-size: 0.88rem;
  font-weight: 650;
}

.map-filters input {
  padding: 0 10px;
}

.map-filters select {
  padding: 0 8px;
}

.category-legend {
  display: flex;
  flex: 0 0 auto;
  max-height: 58px;
  flex-wrap: wrap;
  gap: 6px;
  overflow: auto;
  padding-right: 2px;
}

.legend-item {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  gap: 6px;
  padding: 3px 7px;
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 999px;
  background: rgb(255 255 255 / 8%);
  color: #e7f1ee;
  font-size: 0.72rem;
  font-weight: 650;
  white-space: nowrap;
}

.legend-swatch,
.location-list-color {
  display: block;
  flex: 0 0 auto;
  border-radius: 999px;
}

.legend-swatch {
  width: 9px;
  height: 9px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-heading h2 {
  margin: 0;
  color: #d8e7e2;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.section-heading button,
.section-heading a {
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: 6px;
  background: rgb(255 255 255 / 9%);
  color: #f4fbf8;
  font-size: 0.76rem;
  font-weight: 760;
  text-decoration: none;
}

.section-heading button:hover,
.section-heading button:focus-visible,
.section-heading a:hover,
.section-heading a:focus-visible {
  background: rgb(255 255 255 / 16%);
  outline: none;
}

.section-heading a[aria-disabled="true"] {
  opacity: 0.45;
  pointer-events: none;
}

.title-results,
.metadata-panel {
  display: grid;
  flex: 0 0 auto;
  gap: 8px;
  min-height: 0;
}

.location-list {
  display: grid;
  max-height: min(280px, 28vh);
  gap: 4px;
  overflow: auto;
  padding-right: 2px;
}

.location-list-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 9px;
  width: 100%;
  min-height: 54px;
  align-items: center;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #f4fbf8;
  text-align: left;
}

.location-list-item:hover,
.location-list-item:focus-visible,
.location-list-item[aria-current] {
  border-color: rgb(255 255 255 / 18%);
  background: rgb(255 255 255 / 9%);
  outline: none;
}

.location-list-color {
  width: 10px;
  height: 34px;
}

.location-list-body {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.location-list-body strong,
.location-list-body span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.location-list-body strong {
  font-size: 0.84rem;
  font-weight: 760;
}

.location-list-body span {
  color: #b8cbc6;
  font-size: 0.73rem;
  font-weight: 650;
}

.metadata-panel {
  min-height: 134px;
  padding-top: 2px;
  border-top: 1px solid rgb(255 255 255 / 14%);
}

.metadata-panel h3 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 0.98rem;
  font-weight: 760;
  line-height: 1.2;
}

.selected-location,
.selected-evidence,
.empty-results {
  margin: 0;
  color: #c9dad5;
  font-size: 0.78rem;
  line-height: 1.35;
}

.selected-evidence {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.metadata-list {
  display: grid;
  grid-template-columns: 94px minmax(0, 1fr);
  max-height: min(230px, 24vh);
  gap: 6px 10px;
  margin: 0;
  overflow: auto;
  padding-right: 2px;
  color: #dfece8;
  font-size: 0.74rem;
}

.metadata-list dt {
  color: #9db5af;
  font-weight: 760;
}

.metadata-list dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.maplibregl-ctrl-top-right {
  top: 16px;
  right: 16px;
}

.maplibregl-popup-content {
  border-radius: 8px;
  color: #10201d;
  font: inherit;
}

.point-popup {
  display: grid;
  max-width: 240px;
  gap: 4px;
}

.point-popup strong {
  font-size: 0.86rem;
  line-height: 1.2;
}

.point-popup span {
  color: #43534f;
  font-size: 0.74rem;
}

.fallback {
  display: grid;
  min-height: 100%;
  margin: 0;
  place-items: center;
  padding: 24px;
  background: #10201d;
  color: #f4fbf8;
  font-size: 1rem;
}

@media (max-width: 720px) {
  .map-panel {
    right: 12px;
    left: 12px;
    top: 12px;
    width: auto;
    max-height: 62vh;
    padding: 12px;
  }

  .panel-header h1 {
    font-size: 1.08rem;
  }

  .map-stats div {
    padding: 8px;
  }

  .map-filters {
    grid-template-columns: 1fr;
  }

  .category-legend {
    display: none;
  }

  .location-list {
    min-height: 58px;
    max-height: 120px;
  }

  .metadata-list {
    grid-template-columns: 82px minmax(0, 1fr);
    max-height: 120px;
  }

  .selected-evidence {
    -webkit-line-clamp: 2;
  }

  .maplibregl-ctrl-top-right {
    top: auto;
    right: 12px;
    bottom: 38px;
  }
}
