:root {
  color-scheme: light;
  --paper: #f7f5ef;
  --panel: #fffefa;
  --ink: #24241e;
  --muted: #635f53;
  --border: #e5e0d4;
  --rust: #a53e22;
  --rust-dark: #842f19;
  --rust-light: #f3e3d9;
  --green: #365547;
  --radius: 9px;
  font-family: "Aptos", "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid #22667f; outline-offset: 3px; }
.site-header {
  height: 66px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 30px; background: var(--panel); border-bottom: 1px solid var(--border);
}
.site-brand { display: flex; align-items: center; gap: 12px; font-weight: 730; font-size: 1.06rem; }
.brand-mark {
  display: grid; grid-template-columns: 5px 5px; grid-template-rows: 5px 5px; gap: 3px; place-content: center;
  width: 30px; height: 30px; background: var(--rust); border-radius: 8px; transform: rotate(-6deg);
}
.brand-mark i { background: #fff5e7; border-radius: 1px; }
.brand-mark i:nth-child(2) { opacity: .52; }
.header-context { font-size: .875rem; color: var(--muted); }
.workspace { display: grid; grid-template-columns: minmax(315px, 360px) minmax(0, 1fr); height: calc(100dvh - 66px); min-height: 470px; }
.sidebar {
  display: flex; flex-direction: column; gap: 24px; overflow: auto; padding: 30px 24px 20px;
  background: var(--paper); border-right: 1px solid var(--border);
}
.intro h1 { font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.8rem, 3vw, 2.36rem); font-weight: 500; letter-spacing: -.052em; margin: 8px 0 12px; line-height: 1; white-space: nowrap; }
.eyebrow { font-size: .75rem; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; color: var(--rust-dark); margin: 0; }
.intro > p:last-child, .empty-state p, .muted { color: var(--muted); margin: 0; line-height: 1.5; }
.dashboard { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); }
.dataset-stat { padding: 13px 11px 14px 14px; }
.dataset-stat + .dataset-stat { border-left: 1px solid var(--border); }
.dataset-stat strong, .dataset-stat span { display: block; }
.dataset-stat strong { font-size: 1.55rem; font-weight: 710; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.dataset-stat span { font-size: .8125rem; margin-top: 3px; color: var(--muted); }
.map-filters { display: grid; gap: 14px; }
.filter { border: 0; margin: 0; padding: 0; min-width: 0; }
.filter legend { margin: 0 0 9px; padding: 0; font-size: .875rem; font-weight: 680; }
.segments { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--border); background: #eeeae0; border-radius: var(--radius); padding: 3px; gap: 3px; }
.vote-segments { grid-template-columns: repeat(3, 1fr); }
.filter-status { color: var(--muted); font-size: .875rem; margin: 7px 0 0; }
.filter-status:empty { display: none; }
.segments label { position: relative; display: grid; text-align: center; cursor: pointer; }
.segments input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.segments span { padding: 8px 4px; border: 1px solid transparent; border-radius: 6px; font-size: .875rem; color: var(--muted); }
.segments input:checked + span { background: var(--panel); color: var(--ink); border-color: #e0dbce; font-weight: 650; }
.segments input:focus-visible + span { outline: 3px solid #22667f; }
.review { border-top: 1px solid var(--border); padding-top: 17px; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-bottom: 10px; }
h2, h3 { margin: 0; }
h2 { font-size: 1.05rem; letter-spacing: -.025em; }
h3 { font-size: .94rem; }
.empty-state { background: var(--panel); border: 1px dashed #dcd5c5; border-radius: var(--radius); text-align: center; padding: 21px 16px; }
.empty-state p { margin-top: 6px; font-size: .875rem; }
.selection-icon { display: grid; place-content: center; margin: 0 auto 10px; width: 36px; height: 36px; background: var(--rust-light); color: var(--rust-dark); border-radius: 50%; font-size: 1.45rem; line-height: 1; }
.sidebar-foot { font-size: .8125rem; line-height: 1.5; color: var(--muted); margin: auto 0 0; }
.icon-button { width: 35px; height: 35px; font-size: 1.3rem; border: 1px solid var(--border); border-radius: 7px; background: var(--panel); }
.icon-button:hover, .reset:hover, .basemap button:hover { background: #eeeae0; }
.detail-location { display: flex; flex-wrap: wrap; gap: 5px 9px; align-items: center; }
.detail-id { border-radius: 4px; padding: 3px 7px; background: var(--rust-light); color: var(--rust-dark); font-weight: 680; font-size: .8125rem; }
.coordinates, .tally { font-size: .875rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.metadata { margin: 10px 0 7px; font-size: .875rem; }
.metadata > div { display: flex; gap: 12px; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); }
.metadata dt { color: var(--muted); }
.metadata dd { margin: 0; text-align: right; font-weight: 600; }
.metadata .source-row { display: block; }
.source-row dd { text-align: left; font-size: .8125rem; overflow-wrap: anywhere; margin-top: 4px; }
.imagery-link { padding: 7px 0; background: none; border: 0; text-decoration: underline; text-underline-offset: 3px; color: var(--rust-dark); font-size: .875rem; font-weight: 650; }
.voting { margin-top: 14px; }
.vote-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 10px; }
.vote-buttons button { background: var(--panel); border: 1px solid #d4cbb9; border-radius: 7px; min-height: 40px; font-size: .9rem; font-weight: 650; }
.vote-buttons button span { margin-right: 3px; }
.vote-buttons button:hover:not(:disabled) { border-color: var(--green); }
.vote-buttons button[aria-pressed="true"] { color: white; border-color: var(--green); background: var(--green); }
.vote-buttons button[data-choice="incorrect"][aria-pressed="true"] { border-color: var(--rust-dark); background: var(--rust-dark); }
.vote-buttons button:disabled { opacity: .65; }
.vote-status { color: var(--muted); font-size: .875rem; margin-top: 9px; }
.vote-status:empty { display: none; }
.vote-status.error { color: var(--rust-dark); }
.tally { margin: 7px 0 0; }
.detection-list { display: grid; gap: 6px; padding: 0; margin: 10px 0 0; list-style: none; max-height: 260px; overflow: auto; }
.detection-list button { width: 100%; background: var(--panel); border: 1px solid var(--border); border-radius: 7px; padding: 8px; text-align: left; font-size: .875rem; }
.detection-list button:hover { border-color: var(--rust); }

.map-area { position: relative; min-width: 0; isolation: isolate; }
#map { position: absolute; inset: 0; background: #e4e9e5; font-family: inherit; }
.street-tiles { filter: saturate(.51) contrast(.91) brightness(1.065); }
.map-toolbar { position: absolute; z-index: 500; top: 16px; inset-inline: 16px; display: flex; gap: 8px; align-items: flex-start; justify-content: space-between; pointer-events: none; }
.map-count, .basemap, .legend, .reset {
  border: 1px solid #d8d4c8; background: var(--panel); border-radius: var(--radius);
  box-shadow: 0 2px 7px #24241e1c;
}
.map-count { padding: 10px 12px; font-size: .875rem; font-weight: 650; display: flex; gap: 8px; align-items: center; }
.status-dot, .legend-dot { display: inline-block; width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; }
.status-dot { background: var(--rust); }
.legend-dot { border: 2px solid var(--rust); }
.basemap { display: flex; gap: 2px; padding: 3px; pointer-events: auto; }
.basemap button { border: 0; background: transparent; border-radius: 6px; padding: 7px 10px; font-size: .875rem; font-weight: 620; }
.basemap button[aria-pressed="true"] { color: white; background: var(--green); }
.leaflet-top.leaflet-right .leaflet-control-zoom { margin: 67px 16px 0 0; border: 1px solid #d8d4c8; border-radius: 8px; overflow: hidden; }
.leaflet-control-zoom a { background: var(--panel); color: var(--ink); }
.reset { position: absolute; z-index: 500; top: 136px; right: 16px; width: 32px; height: 33px; padding: 0; font-size: 1.25rem; line-height: 1; }
.legend { position: absolute; z-index: 500; bottom: 25px; left: 16px; display: flex; align-items: center; gap: 12px; padding: 7px 9px; font-size: .8125rem; }
.legend span { display: flex; align-items: center; gap: 5px; }
.legend-cluster { display: grid; place-items: center; background: var(--rust-light); color: var(--rust-dark); border: 1px solid var(--rust); width: 17px; height: 17px; border-radius: 50%; font-size: .75rem; font-weight: 700; font-style: normal; }
.map-notice { position: absolute; z-index: 500; bottom: 68px; left: 16px; right: 16px; width: fit-content; max-width: calc(100% - 32px); padding: 8px 12px; border-radius: 7px; background: var(--panel); color: var(--muted); border: 1px solid var(--border); font-size: .875rem; }
.leaflet-marker-icon.detection-marker { background: transparent; border: 0; display: grid; place-items: center; }
.marker-ring {
  width: 20px; height: 20px; border: 2px solid var(--rust-dark); border-radius: 50%;
  box-shadow: 0 0 0 1px #fffef9, 0 1px 3px #31130566;
}
.marker-ring.lagoon { border-color: var(--green); }
.marker-ring.active { width: 27px; height: 27px; box-shadow: 0 0 0 2px #fffef9, 0 1px 3px #31130566; }
.marker-cluster {
  display: grid; place-items: center; border-radius: 50%; border: 2px solid #fff8ed; color: #fffefa;
  background: #a43f24ee; box-shadow: 0 1px 5px #54261950, 0 0 0 1px #7f301e80; font-size: 12px;
  font-weight: 720; font-variant-numeric: tabular-nums; width: 100%; height: 100%;
}
.cluster-busy { background: #82351f; }
.cluster-small { background: #b85938; }
.detection-marker:hover > *, .detection-marker:focus-visible > * { filter: brightness(1.12); }
.leaflet-container .leaflet-control-attribution { max-width: 100%; background: #fffefae8; }
@media (max-width: 720px) {
  .site-header { height: 56px; padding: 0 14px; }
  .site-brand { font-size: .96rem; gap: 8px; }
  .header-context { font-size: .75rem; }
  .workspace { display: flex; flex-direction: column; height: auto; min-height: 0; }
  .map-area { order: -1; height: 57svh; min-height: 315px; }
  .sidebar { overflow: visible; border-right: 0; border-top: 1px solid var(--border); padding: 21px 16px; gap: 19px; }
  .review:has(#detail:not([hidden])) { order: -1; border-top: 0; padding-top: 0; }
  .intro h1 { white-space: normal; }
  .map-toolbar { top: 10px; inset-inline: 10px; }
  .leaflet-top.leaflet-right .leaflet-control-zoom { margin-right: 10px; margin-top: 59px; }
  .reset { top: 128px; right: 10px; }
  .legend { left: 10px; }
}
