:root {
  font: 14px/1.45 system-ui, sans-serif;
  color: #202b28;
  background: #f4f5ef;
  --paper: #fbfcf7;
  --green: #365d47;
  --border: #cbd5c9;
  --muted: #526349;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
main { max-width: 1160px; margin: auto; padding: clamp(12px, 3vw, 28px); }
h1 { margin: 0; font-size: clamp(23px, 4vw, 34px); line-height: 1.15; }
p { margin: 0 0 8px; }
a { color: var(--green); }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

.row { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
header { justify-content: space-between; margin-bottom: 14px; }
.hub-nav { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
#study-selection, .map-tools { align-items: end; margin-bottom: 10px; }
label { font-size: 12px; font-weight: 600; }
label > :is(input:not([type=checkbox]), select) { display: block; margin-top: 3px; }
.check { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; }
.check input { margin: 0; }

button, select, input:not([type=range], [type=checkbox], [type=file]) {
  min-height: 32px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--paper);
  color: inherit;
  font: inherit;
  font-size: 13px;
}
button, select, summary { cursor: pointer; }
button:disabled { opacity: .55; cursor: default; }
button:not(:disabled):hover { background: #e6ecdf; }
input[type=number] { width: 7.5em; }
input[type=range] { width: 100%; margin: 0; accent-color: var(--green); }
.zoom { flex: 1 1 180px; }
.zoom output { float: right; color: var(--muted); font-weight: 400; }

.timeline {
  margin-bottom: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--paper);
}
#download-prompt {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 1100;
  width: min(340px, calc(100% - 24px));
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 4px 18px #202b2833;
}
#download-prompt p { margin: 6px 0 10px; }
#download-allow { color: white; background: var(--green); }
#download-allow:hover { background: #244736; }
.timeline time { font-size: 12px; font-variant-numeric: tabular-nums; }
.timeline input { display: block; margin-top: 5px; }
#fire-replay { background: var(--green); color: white; }
#fire-replay:not(:disabled):hover { background: #244736; }
#map-audio-toggle { margin-left: auto; }
#map-audio-toggle[aria-pressed=true] { color: white; background: var(--green); }

#map {
  aspect-ratio: 1.5;
  border-radius: 6px;
  outline: 1px solid var(--border);
  background: #e1e7dd;
}
#map:focus-visible { outline: 3px solid var(--green); outline-offset: -3px; }
.map-updating #map { cursor: progress; }
#map .leaflet-hexagons-pane { opacity: .5; }

.map-layers { margin-top: 5px; }
.map-key, .map-status, details, #selection-state { color: var(--muted); font-size: 12px; }
.map-key { margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.map-status > :empty, details p:empty { display: none; }
.color-matrix { display: grid; grid-template-columns: auto 86px; align-items: center; gap: 2px 6px; }
.color-matrix > :last-child { grid-column: 2; white-space: nowrap; }
#color-swatches { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 8px; gap: 1px; }

details { border-top: 1px solid var(--border); margin-top: 10px; padding-top: 8px; }
summary { width: fit-content; margin-bottom: 8px; font-weight: 600; }
.wind-arrow {
  display: grid;
  place-items: center;
  border: 1px solid #3c5470;
  border-radius: 50%;
  background: white;
  color: #164061;
  font: 700 24px/1 system-ui, sans-serif;
}
.wind-arrow span { display: block; }
.wind-label {
  position: absolute;
  top: calc(100% + 3px);
  left: 50%;
  transform: translateX(-50%);
  padding: 3px 6px;
  border: 1px solid #3c5470;
  border-radius: 4px;
  background: white;
  font: 600 11px/1.25 system-ui, sans-serif;
  white-space: nowrap;
}
.hotspot-brief > div { margin-top: 4px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
