@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=DM+Serif+Display:ital@0;1&display=swap');

:root {
  color-scheme: light;
  --ink: #18372b;
  --muted: #5f756a;
  --paper: #f5f4ec;
  --pale: #e7ebe0;
  --forest: #204d37;
  --border: #c9d4c7;
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
button { font: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid #ca9a52; outline-offset: 3px; }
a { color: #245941; text-underline-offset: 3px; }
.page { max-width: 1820px; margin: auto; }
.masthead { padding: 27px clamp(18px, 3.5vw, 64px) 29px; background: var(--paper); }
.masthead-top { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; }
.eyebrow { font-size: 10px; font-weight: 700; letter-spacing: .19em; text-transform: uppercase; }
.day-label { font: 34px/1 'DM Serif Display', Georgia, serif; color: var(--forest); }
.day-label span { font: 600 11px/1.3 'DM Sans', sans-serif; letter-spacing: .1em; }
h1 { margin: 20px 0 8px; font: normal clamp(36px, 4.4vw, 72px)/1.03 'DM Serif Display', Georgia, serif; letter-spacing: -.025em; }
h1 em { color: #537a55; font-weight: 400; }
.masthead p { color: #526a5e; max-width: 760px; font: 15px/1.5 'DM Sans', sans-serif; margin: 12px 0 0; }
.map-layout { display: grid; grid-template-columns: minmax(288px, 344px) minmax(0, 1fr); border-block: 1px solid #ccdacb; }
.controls { padding: 24px 26px 30px; background: #e9eee6; border-right: 1px solid var(--border); height: 690px; overflow-y: auto; scrollbar-width: thin; }
.panel-kicker { margin: 0 0 11px; color: #60806d; text-transform: uppercase; font-size: 10px; font-weight: 700; letter-spacing: .14em; }
.panel-intro { font: 18px/1.35 'DM Serif Display', Georgia, serif; margin: 0 0 12px; color: #345945; }
.panel-intro strong { font-weight: normal; border-bottom: 1px solid #8aa48e; }
#status { background: #dbe6d7; border-left: 3px solid #598464; padding: 10px 11px; font-size: 12px; line-height: 1.45; color: #264b33; margin: 17px 0 22px; }
.controls section { margin: 20px 0; }
.controls section + section { border-top: 1px solid #cbd6c9; padding-top: 17px; }
h2 { margin: 0 0 11px; font: 700 11px/1.3 'DM Sans', system-ui, sans-serif; text-transform: uppercase; letter-spacing: .1em; color: #4c6756; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.help { font-size: 12px; border: 1px solid #77917d; color: #486753; border-radius: 50%; width: 16px; text-align: center; cursor: help; }
.choices { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { border: 1px solid #a4b8a3; border-radius: 24px; padding: 8px 11px; background: transparent; color: var(--ink); font-size: 12px; line-height: 1.1; }
.chip.selected, .chip[aria-pressed="true"] { background: #214d38; border-color: #214d38; color: #fff; }
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid #adbeac; border-radius: 8px; padding: 3px; gap: 2px; }
.segmented button { border: 0; border-radius: 5px; padding: 9px 5px; font-size: 12px; background: transparent; color: #35533e; }
.segmented button[aria-pressed="true"] { background: #24523b; color: white; }
.hint { color: #597062; font: 11px/1.5 'DM Sans', sans-serif; }
#threshold { margin: 10px 0 0; }
.switch { display: flex; gap: 12px; align-items: center; font-size: 12px; line-height: 1.4; cursor: pointer; }
.switch input { accent-color: #2d6c48; width: 17px; height: 17px; margin: 0; flex-shrink: 0; }
.ranked { display: grid; gap: 5px; }
.rank-item { width: 100%; padding: 8px 7px; border: 0; border-bottom: 1px solid #d2dcd0; display: flex; text-align: left; gap: 9px; background: transparent; color: var(--ink); align-items: center; }
.rank-item:hover { background: #dbe7d9; }
.rank-n { font: 22px/1 'DM Serif Display', Georgia, serif; color: #75907a; width: 25px; }
.rank-copy { flex: 1; font-size: 12px; }
.rank-copy small { color: #607564; display: block; font-size: 11px; }
.inspector { background: #dfe9dc; padding: 15px; border-radius: 5px; }
.controls section.inspector { border: 0; }
.inspector h2 { color: #2d5038; }
#details { color: #2d4b37; font-size: 12px; line-height: 1.55; }
#details .detail-title { font: 23px 'DM Serif Display', Georgia, serif; display: block; margin: 5px 0 7px; }
#details .detail-metric { font-weight: 600; font-size: 13px; }
#details ul { padding-left: 16px; margin: 8px 0; }
#details li { margin: 4px 0; }
#details .detail-note { font-size: 11px; color: #627463; }
.map-frame { position: relative; min-width: 0; height: 690px; background: #d9e1d7; overflow: hidden; }
#map { width: 100%; height: 100%; background: #dce4d8; }
.leaflet-container { font-family: 'DM Sans', system-ui, sans-serif; }
.leaflet-container .leaflet-tile-pane { filter: grayscale(1) sepia(.18) saturate(.52) contrast(.81) brightness(1.07); opacity: .82; }
.leaflet-interactive.cluster-shape { stroke-linejoin: round; transition: fill-opacity .25s ease, stroke-width .15s ease; }
.leaflet-interactive.evidence-cell { cursor: crosshair; }
.leaflet-tooltip.moss-tooltip { border: 1px solid #d3dfce; background: #fbfaf4; color: #244432; font: 12px/1.5 'DM Sans', sans-serif; box-shadow: 0 4px 18px #1b402332; }
.map-note { position: absolute; left: 18px; bottom: 21px; max-width: calc(100% - 140px); z-index: 500; border-radius: 4px; background: #fcfdf4ed; box-shadow: 0 1px 6px #18351b17; padding: 9px 12px; font-size: 11px; line-height: 1.45; color: #415844; pointer-events: none; }
.key-dot { display: inline-block; width: 9px; height: 9px; margin-right: 5px; border-radius: 50%; background: #548362; }
.divider-dot { margin: 0 4px; color: #97aa9a; }
.reset-view { position: absolute; right: 18px; bottom: 21px; z-index: 500; border: 1px solid #b3c4b4; color: #28543a; background: #f6faf2; box-shadow: 0 1px 6px #18351b17; border-radius: 4px; padding: 9px 11px; font-size: 11px; }
.foot { padding: 22px clamp(18px, 3.5vw, 64px) 38px; display: grid; gap: 8px; max-width: 1450px; color: #657567; font-size: 11px; line-height: 1.65; }
.foot strong { color: #354d3a; }
@media (max-width: 800px) {
  .masthead { padding-block: 20px; }
  .masthead h1 { max-width: 660px; }
  .map-layout { display: flex; flex-direction: column; }
  .map-frame { order: 0; height: min(64vh, 620px); min-height: 390px; }
  .controls { order: 1; width: 100%; height: auto; overflow: visible; border-right: none; border-top: 1px solid var(--border); padding: 22px; }
  .map-note { left: 9px; bottom: 14px; padding: 8px; max-width: 67%; font-size: 10px; }
  .reset-view { right: 9px; bottom: 14px; }
  .controls section { max-width: 680px; }
  .inspector { max-width: 680px; }
}
@media (max-width: 480px) {
  .masthead h1 { font-size: 36px; }
  .day-label { font-size: 27px; }
  .map-frame { height: 54vh; min-height: 345px; }
  .map-note .divider-dot { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .leaflet-interactive.cluster-shape { transition: none; }
}

/* Observational overview: categorical leading species or sequential richness. */
.controls section[hidden] { display: none !important; }
.two-option { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.colour-legend { display: grid; grid-template-columns: 1fr; gap: 7px; margin-top: 13px; }
.legend-item { display: flex; gap: 9px; align-items: center; color: #345440; font-size: 11px; line-height: 1.35; }
.legend-swatch { flex: 0 0 15px; width: 15px; height: 15px; border-radius: 3px; border: 1px solid #36544142; }
#colour-explain { margin: 9px 0 0; }
#groups + .hint { margin-top: 10px; }
.map-note { max-width: calc(100% - 180px); }
@media (min-width: 1200px) {
  .colour-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 11px; }
}
@media (max-width: 480px) {
  .colour-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .map-note { max-width: 66%; }
}

/* Distinguish real sightings from the more selective recording clusters. */
.cluster-explainer {
  border: 1px solid #b8cbb7;
  border-left: 3px solid #476a4b;
  background: #edf2e8;
  border-radius: 5px;
  padding: 13px 14px 10px;
  font-size: 11px;
  line-height: 1.55;
  color: #405943;
}
.cluster-explainer[hidden] { display: none; }
.cluster-explainer > strong { display: block; margin-bottom: 9px; color: #244b34; font-size: 12px; }
.cluster-explainer p { margin: 10px 0 0; }
.cluster-key { display: flex; align-items: flex-start; gap: 9px; margin: 7px 0; }
.swatch { display: inline-block; width: 14px; height: 14px; min-width: 14px; border-radius: 3px; border: 1px solid #6b8e7950; margin-top: 1px; }
.swatch-cluster { background: #746c46; }
.swatch-other { background: #d5bb86; }
#evidence-description { margin: 9px 0 0; }
