:root {
  color-scheme: light;
  --background: #f8faf9;
  --surface: #ffffff;
  --text: #17211f;
  --muted: #64716d;
  --border: #d8e2de;
  --accent: #0f766e;
  --accent-dark: #0b5d57;
  --accent-light: #eef8f6;
  --table-header: #e1f3f0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--background);
}
* { box-sizing: border-box; }
body { margin: 0; }
.atlas { padding: 20px; }
h1, h2, p { margin: 0; }
h1 { font-size: 1.45rem; line-height: 1.3; }
h2 { font-size: 1.1rem; }
a { color: var(--accent-dark); text-decoration-thickness: 1px; text-underline-offset: 2px; overflow-wrap: anywhere; }
a:hover { color: var(--accent); }
button, input, select { font: inherit; }
button, input, select, .data-link { min-height: 42px; }
button, select { cursor: pointer; }
button { border: 1px solid var(--accent); border-radius: 4px; background: var(--accent); color: #fff; padding: 8px 14px; font-weight: 600; }
button:hover { background: var(--accent-dark); }
input, select { border: 1px solid var(--border); border-radius: 4px; background: var(--surface); color: var(--text); padding: 8px 10px; width: 100%; }
input::placeholder { color: var(--muted); opacity: 1; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
.atlas-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.atlas-heading p { margin-top: 6px; max-width: 78ch; }
.data-link { flex-shrink: 0; display: inline-flex; align-items: center; font-size: .9rem; }
.filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; }
.filter-field label { display: block; font-size: .86rem; font-weight: 650; margin-bottom: 4px; }
.search-field { grid-column: span 2; }
.region-field { grid-column: span 2; }
.reset-button { align-self: end; width: fit-content; }
.reset-button, .quiet-button { color: var(--accent-dark); background: var(--surface); border-color: var(--border); }
.reset-button:hover, .quiet-button:hover { background: var(--accent-light); border-color: var(--accent); }
.results-summary { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 16px; margin: 16px 0 10px; }
#result-count { font-weight: 650; }
.muted { color: var(--muted); font-size: .88rem; }
.warning { background: #fff7e4; color: #614913; padding: 12px; border-left: 3px solid #98752a; margin: 12px 0; }
.map-section { border: 1px solid var(--border); border-radius: 6px; overflow: hidden; background: var(--surface); }
#map { width: 100%; height: 420px; background: #f1f5f3; z-index: 0; }
.map-footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; padding: 10px 14px 0; }
.legend { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: .82rem; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend-title { font-weight: 650; }
.swatch { display: inline-block; width: 15px; height: 15px; border: 1px solid #64716d; }
.count-zero { background: #edf2ef; }
.count-low { background: #bddbd3; }
.count-medium { background: #79bab0; }
.count-high { background: #368f82; }
.count-most { background: #0b5d57; }
.quiet-button { font-size: .83rem; min-height: 36px; padding: 5px 10px; }
.map-note { color: var(--muted); font-size: .82rem; padding: 8px 14px 12px; }
.records-section { margin-top: 20px; }
.records-heading { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; margin-bottom: 10px; }
.table-scroll { overflow: auto; max-height: 560px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); }
table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: .86rem; line-height: 1.5; }
th { text-align: left; background: var(--table-header); padding: 10px 12px; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 1; }
td { padding: 12px; vertical-align: top; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: 0; }
th:nth-child(1) { width: 23%; min-width: 165px; }
th:nth-child(2) { width: 20%; min-width: 145px; }
th:nth-child(3) { width: 17%; min-width: 135px; }
th:nth-child(4) { width: 28%; min-width: 200px; }
th:nth-child(5) { width: 12%; min-width: 115px; }
td .secondary { color: var(--muted); font-size: .82rem; margin-top: 4px; }
.record-id { display: block; color: var(--muted); font-size: .75rem; margin-top: 6px; }
.status-text { font-weight: 650; }
.scope-note { margin-top: 6px; }
details { margin-top: 6px; }
summary { color: var(--accent-dark); cursor: pointer; width: fit-content; }
details p { margin-top: 6px; }
.source-list { display: grid; gap: 6px; }
.source-list a { display: inline-block; }
.empty-state { border: 1px solid var(--border); padding: 20px; background: var(--surface); }
.pagination { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 12px; }
.leaflet-container { font-family: inherit; }
.leaflet-container a { color: var(--accent-dark); }
.leaflet-control-zoom a { background: var(--surface); }
.leaflet-interactive:focus { outline: none; stroke: #17211f; stroke-width: 3px; }
.leaflet-popup-content { line-height: 1.5; }
.leaflet-popup-content strong, .leaflet-popup-content span { display: block; }
.leaflet-popup-content button { margin-top: 8px; }
.country-label { background: transparent; border: none; color: #52625c; font-size: 12px; font-weight: 650; line-height: 1.2; text-align: center; white-space: nowrap; pointer-events: none; text-shadow: 0 1px 2px #fff, 0 -1px 2px #fff, 1px 0 2px #fff, -1px 0 2px #fff; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 850px) {
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .region-field { grid-column: auto; }
  .atlas-heading { flex-direction: column; gap: 4px; }
  #map { height: 370px; }
}
@media (max-width: 470px) {
  .atlas { padding: 12px; }
  .filters { padding: 12px; gap: 10px; }
  .region-field { grid-column: span 2; }
  .reset-button { grid-column: span 2; }
  .records-heading { flex-direction: column; gap: 0; }
  #map { height: 340px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
@media print {
  .filters, .pagination button, .map-footer button, .data-link { display: none; }
  .atlas { padding: 0; }
  .table-scroll { max-height: none; overflow: visible; }
  th { position: static; }
  .map-section { break-inside: avoid; }
}
