:root {
  --lake-blue: #0B5FA5;
  --evergreen: #2F6B3D;
  --slate: #4A5568;
  --warm-sand: #E9DFC8;
  --accent-orange: #F59E0B;
  --white: #FFFFFF;
  --ink: #1F2933;
  --radius: 10px;
  --shadow: 0 2px 10px rgba(11, 95, 165, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--warm-sand);
}

a { color: var(--lake-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Nav ---------- */
.site-header {
  background: var(--lake-blue);
  color: var(--white);
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1000;
}
.site-header .brand { font-weight: 700; font-size: 1.2rem; color: var(--white); display: inline-flex; align-items: center; gap: 0.55rem; }
.site-header .brand:hover { opacity: 0.85; text-decoration: none; }
.site-header .brand-logo { width: 36px; height: 36px; display: block; flex-shrink: 0; }
.site-header nav a { color: var(--white); margin-left: 1.2rem; opacity: 0.9; }
.site-header nav a:hover { opacity: 1; text-decoration: underline; }

/* Mobile nav: the desktop layout (single row, margin-left spacing) has no
   room for six links + the brand on a narrow screen, so the links wrap
   mid-flow -- an <a> like "How to Use" can break onto two lines with its
   left margin still applied to the wrapped word, which is what reads as a
   stray extra "link" and a misaligned word. Below the breakpoint, stack
   the brand above the nav and let the nav wrap as a proper flex row using
   `gap` instead of per-link margin, so wrapped links land on a clean new
   line instead of a semi-random break. Desktop (above the breakpoint) is
   completely untouched. */
@media (max-width: 760px) {
  .site-header { flex-direction: column; align-items: flex-start; gap: 0.6rem; padding: 0.8rem 1rem; }
  .site-header nav { display: flex; flex-wrap: wrap; row-gap: 0.5rem; column-gap: 1rem; width: 100%; }
  .site-header nav a { margin-left: 0; font-size: 0.88rem; }
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(180deg, rgba(11,95,165,0.85), rgba(47,107,61,0.85)),
              center/cover no-repeat;
  color: var(--white);
  padding: 4rem 1.5rem;
  text-align: center;
}
.hero h1 { font-size: 2.4rem; margin: 0 0 0.4rem; }
.hero p { font-size: 1.1rem; margin: 0 0 1.6rem; opacity: 0.95; }
.hero-buttons a {
  display: inline-block;
  background: var(--accent-orange);
  color: var(--ink);
  font-weight: 600;
  padding: 0.7rem 1.3rem;
  border-radius: var(--radius);
  margin: 0 0.4rem;
}
.hero-buttons a:hover { text-decoration: none; filter: brightness(1.05); }

/* ---------- Stats strip ---------- */
.stats-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2.5rem;
  background: var(--white);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.stats-strip .stat { text-align: center; }
.stats-strip .stat .value { font-size: 1.8rem; font-weight: 700; color: var(--lake-blue); }
.stats-strip .stat .label { font-size: 0.85rem; color: var(--slate); }

/* ---------- Layout ---------- */
.container { max-width: 1200px; margin: 0 auto; padding: 1.5rem; }
.grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } }

/* Waterbody detail page: two equal-width tiles (map, past-year snapshot) */
.grid-two-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: stretch; }
@media (max-width: 860px) { .grid-two-tiles { grid-template-columns: 1fr; } }

#wb-map { aspect-ratio: 1 / 1; width: 100%; border-radius: var(--radius); border: 1px solid #e9dfc8; }

.species-filter-pills { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.8rem 0; }
.species-pill {
  --pill-color: var(--slate);
  background: var(--white);
  border: 2px solid var(--pill-color);
  color: var(--pill-color);
  border-radius: 20px;
  padding: 0.35rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.species-pill.active { background: var(--pill-color); color: var(--white); }
.species-pill:not(.active) { opacity: 0.55; }

.stock-type-legend {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--slate);
  margin-bottom: 1rem;
}
.legend-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  margin-left: 0.6rem;
}
.legend-swatch:first-child { margin-left: 0; }
.legend-swatch.legend-regular { background: var(--slate); }
.legend-swatch.legend-brood { background: #1F2933; }

.chart-wrapper { position: relative; height: 420px; width: 100%; }

/* Legend row shown below each chart's own canvas (species-color swatches
   for the line chart; Regular/Brood swatches for the bar chart use the
   existing .stock-type-legend instead). */
.chart-legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; font-size: 0.85rem; color: var(--slate); margin-top: 0.8rem; }
.chart-legend-item { display: inline-flex; align-items: center; gap: 0.4rem; }
.chart-legend-swatch { display: inline-block; width: 0.85rem; height: 0.85rem; border-radius: 3px; flex-shrink: 0; }
.chart-legend-item.is-hidden { opacity: 0.4; }

.stats-strip-compact { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; box-shadow: none; padding: 0; }
.stats-strip-compact .stat { text-align: left; }
.stats-strip-compact .value { font-size: 1.3rem; }

/* Snapshot's three stacked stat rows (see js/waterbody.js renderStats()):
   the four headline numbers (Stocking Events/Total Fish/Species/Avg. Size)
   condensed onto one row via .stats-strip-primary's 4 columns; First/Last
   Stocked below that via .stats-strip-halves, each spanning 2 of those 4
   columns so the pair fills the row; and Largest Single Event / Most
   Stocked Species below that, in a second .stats-strip-halves row laid
   out the same way. All three rows are plain block-level siblings inside
   .stats-snapshot-wrap, so they stack vertically without needing a
   grid/flex container of their own. */
.stats-snapshot-wrap .stats-strip-primary,
.stats-snapshot-wrap .stats-strip-halves { grid-template-columns: repeat(4, 1fr); margin-bottom: 1rem; }
@media (max-width: 760px) {
  .stats-snapshot-wrap .stats-strip-primary,
  .stats-snapshot-wrap .stats-strip-halves { grid-template-columns: 1fr 1fr; }
}
/* Each headline stat (row 1) and each stat in the two halves rows (rows
   2 and 3) gets its own bordered "compartment" rather than sitting as
   plain left-aligned text in the shared grid -- text centered within
   each box. Halves-row stats each span 2 of the 4 grid columns
   (auto-placed: the first stat lands in columns 1-2, the second in
   columns 3-4) so together they fill the same width as row 1's four
   single-column boxes. */
.stats-strip-primary .stat,
.stats-strip-halves .stat {
  text-align: center;
  background: rgba(233, 223, 200, 0.35);
  border: 1px solid #e9dfc8;
  border-radius: var(--radius);
  padding: 0.7rem 0.4rem;
}
.stats-strip-halves .stat { grid-column: span 2; }

.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.2rem;
  margin-bottom: 1.5rem;
}
.card h2, .card h3 { margin-top: 0; color: var(--evergreen); }
#wb-name { margin: 0; }
.wb-location { margin: 0.2rem 0 0; font-size: 1rem; font-weight: 500; color: var(--slate); }

/* A normal button sitting within the Snapshot card's own padding -- not
   edge-to-edge like a first attempt at this was (looked like it was just
   glued to the card's boundary rather than a real button). */
.snapshot-bait-shop-btn {
  display: block;
  width: 50%;
  min-width: 220px;
  margin: 0.8rem auto 0;
  padding: 0.7rem 1rem;
  background: var(--lake-blue);
  color: var(--white);
  text-align: center;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  border-radius: 8px;
}
.snapshot-bait-shop-btn:hover { filter: brightness(1.08); }

#map { position: relative; height: 560px; width: 100%; border-radius: var(--radius); border: 1px solid #e9dfc8; }

.map-zoom-hint {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(31, 41, 51, 0.82);
  color: var(--white);
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-size: 0.95rem;
  z-index: 1000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.map-zoom-hint.is-visible { opacity: 1; }
.map-zoom-hint kbd {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 4px;
  padding: 0.05rem 0.4rem;
  font-family: inherit;
}
/* Applied via each circleMarker's `className` option (js/app.js) -- Leaflet
   renders these as SVG <path> elements, so a CSS box-shadow won't apply;
   drop-shadow works on SVG and gives the same subtle-shadow effect. */
.wb-marker { filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35)); }

/* Leaflet's default attribution text (Leaflet | OpenStreetMap | OpenTopoMap
   credits) wraps to a second line on narrower maps like #wb-map -- a
   slightly smaller size keeps it on one line without touching Leaflet's
   own CSS file. */
.leaflet-control-attribution {
  font-size: 9px;
  line-height: 1.3;
}

.filters label { display: block; margin: 0.5rem 0 0.2rem; font-size: 0.85rem; color: var(--slate); }
.filters select, .filters input {
  width: 100%; padding: 0.4rem; border-radius: 6px; border: 1px solid #cbd5e0;
}
.search-separator { border: none; border-top: 1px solid #e9dfc8; margin: 1rem 0 0.8rem; }
.search-results-heading { margin: 0 0 0.5rem; color: var(--evergreen); }
.search-box-input { width: 100%; padding: 0.4rem; border-radius: 6px; border: 1px solid #cbd5e0; }

.list-item {
  padding: 0.6rem 0;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
}
.list-item:last-child { border-bottom: none; }

/* Today in Stocking History: stacked two-line entries (species + waterbody
   on top, year + quantity smaller/muted below) instead of a single flex
   row -- avoids the awkward mid-row wrap a long waterbody name caused
   when squeezed into the narrower right-hand column next to Filters. */
.today-history-item { padding: 0.55rem 0; border-bottom: 1px solid #eee; }
.today-history-item:last-child { border-bottom: none; }
.today-history-main { font-weight: 700; color: var(--ink); font-size: 0.92rem; }
.today-history-meta { font-size: 0.78rem; color: var(--slate); margin-top: 0.15rem; }

.whats-new-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  column-gap: 0.8rem;
}
.whats-new-date {
  grid-row: 1 / 3;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--lake-blue);
  white-space: nowrap;
}
.whats-new-main { grid-row: 1 / 3; display: flex; flex-direction: column; gap: 0.2rem; text-align: right; min-width: 0; }
.whats-new-row1 { font-weight: 600; color: var(--ink); }
.whats-new-row2 { font-size: 0.8rem; color: var(--slate); }
.whats-new-qty { grid-row: 1 / 3; font-weight: 600; color: var(--ink); white-space: nowrap; min-width: 4.5rem; text-align: right; }

.badge {
  display: inline-block;
  background: var(--evergreen);
  color: var(--white);
  font-size: 0.7rem;
  padding: 0.1rem 0.5rem;
  border-radius: 12px;
  margin-left: 0.4rem;
}
.badge.preliminary { background: var(--accent-orange); color: var(--ink); }

table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 0.5rem; border-bottom: 1px solid #eee; }
th { color: var(--slate); font-weight: 600; }

.approx-note { font-size: 0.75rem; color: var(--slate); font-style: italic; }

/* ---------- Shared small buttons (Report a Problem, admin actions, etc.) ---------- */
.btn-small {
  padding: 0.45rem 0.9rem;
  border-radius: 6px;
  border: none;
  background: var(--lake-blue);
  color: var(--white);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}
.btn-small:hover { filter: brightness(1.1); }
.btn-small.secondary { background: var(--slate); }

/* ---------- Report a Problem (waterbody.html) ---------- */
.wb-header-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.8rem; }
.wb-header-row h1, .wb-header-row h3 { margin: 0; }
.wb-header-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 0.5rem; }
.wb-header-actions-row { display: flex; gap: 0.7rem; }

.btn-share { display: inline-flex; align-items: center; gap: 0.4rem; }
.btn-share-icon { flex-shrink: 0; }

.location-header-actions { display: flex; align-items: center; gap: 0.6rem; }
.google-maps-link { display: inline-flex; align-items: center; line-height: 0; opacity: 0.85; transition: opacity 0.15s; }
.google-maps-link:hover { opacity: 1; }
/* Matches .btn-small's rendered height (0.45rem padding top+bottom + its
   font-size/line-height) so it sits flush with the Notes button next to it.
   width: auto keeps the icon's proportions intact. */
.google-maps-link img { height: 1.9rem; width: auto; display: block; }

.notes-modal-overlay {
  position: fixed; inset: 0; background: rgba(31, 41, 51, 0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 1rem;
}
.notes-modal-overlay[hidden] { display: none; }
.notes-modal {
  background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow);
  max-width: 480px; width: 100%; max-height: 80vh; overflow-y: auto; padding: 1.2rem 1.4rem;
}
.notes-modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.6rem; }
.notes-modal-header h4 { margin: 0; color: var(--evergreen); }
.notes-modal-close {
  background: none; border: none; font-size: 1.6rem; line-height: 1; cursor: pointer;
  color: var(--slate); padding: 0 0.2rem;
}
.notes-modal-close:hover { color: var(--ink); }
.notes-modal-body { font-size: 0.95rem; line-height: 1.5; word-wrap: break-word; }

.share-url-row { display: flex; gap: 0.5rem; }
.share-url-row input[type=text] {
  flex: 1 1 auto; padding: 0.5rem 0.6rem; border-radius: 6px; border: 1px solid #cbd5e0;
  font-size: 0.85rem; color: var(--ink); background: #f7f9fb;
}
.share-url-row .btn-small { flex-shrink: 0; white-space: nowrap; }
.share-url-row .btn-small.is-copied { background: var(--evergreen); color: var(--white); border-color: var(--evergreen); }
.share-modal-actions { margin-top: 1rem; text-align: right; }

.report-problem-panel { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid #eee; }
.report-problem-panel label { display: block; font-size: 0.85rem; color: var(--slate); font-weight: 600; margin-bottom: 0.3rem; }
.report-problem-panel textarea {
  width: 100%; padding: 0.6rem; border-radius: 6px; border: 1px solid #cbd5e0;
  font-family: inherit; font-size: 0.9rem; resize: vertical;
}
.report-problem-actions { display: flex; align-items: center; gap: 0.7rem; margin-top: 0.6rem; flex-wrap: wrap; }
.report-problem-status { font-size: 0.85rem; color: var(--slate); }

/* ---------- Admin: Usage Statistics ---------- */
.stats-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 800px) { .stats-two-col { grid-template-columns: 1fr; } }
.stats-two-col h4 { margin: 0 0 0.5rem; color: var(--evergreen); }
.stats-table-wrap { max-height: 420px; overflow-y: auto; }

/* ---------- Snapshot header + tabs (waterbody snapshot panel) ---------- */
.grid-two-tiles .card { display: flex; flex-direction: column; }
.grid-two-tiles .card #wb-map { flex: 1; min-height: 320px; }

.snapshot-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  border-bottom: 2px solid var(--warm-sand);
  padding-bottom: 0.6rem;
  margin-bottom: 1rem;
}
.snapshot-header h3 { margin: 0; }

.snapshot-subheader {
  border-bottom: 1px solid var(--warm-sand);
  padding-bottom: 0.7rem;
  margin-top: 1rem;
  margin-bottom: 1rem;
  min-height: 2.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.snapshot-subheader .approx-note { margin: 0; text-align: center; }

.snapshot-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--warm-sand);
}

/* Merged Data Info modal -- wider than the plain notes modal to fit a table */
.merged-info-modal { max-width: 640px; width: 90vw; }
.merged-info-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; margin-top: 0.8rem; }
.merged-info-table th, .merged-info-table td { text-align: left; padding: 0.4rem 0.6rem; border-bottom: 1px solid #eee; }
.merged-info-table th { color: var(--slate); font-weight: 600; border-bottom: 2px solid var(--warm-sand); }
.merged-info-table tbody tr:hover { background: #f7f9fb; }
.merged-info-table tr.merged-source-row { background: #fdf3e4; }
.merged-info-table tr.merged-source-row:hover { background: #fbe9cf; }
.merged-info-legend { display: flex; align-items: center; gap: 0.4rem; margin: 0 0 0.4rem; }
.merged-info-legend-swatch { display: inline-block; width: 0.9rem; height: 0.9rem; border-radius: 3px; background: #fdf3e4; border: 1px solid #eee; }

.tabs { display: flex; gap: 0.4rem; }
.tab-btn {
  background: none;
  border: 1px solid #cbd5e0;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--slate);
  padding: 0.35rem 0.8rem;
}
.tab-btn:hover { border-color: var(--lake-blue); color: var(--lake-blue); }
.tab-btn.active { background: var(--lake-blue); border-color: var(--lake-blue); color: var(--white); }
.tab-panel[hidden] { display: none; }

/* Full History's date picker sits at the very bottom of the tab panel
   (below the species list) so the stats strip + species list line up in
   the same position regardless of which Snapshot tab is active. */
.date-range-picker {
  background: var(--warm-sand);
  border-radius: var(--radius);
  padding: 0.9rem 1rem 0.8rem;
  margin-top: 1.2rem;
}

/* Dual-thumb month range slider: two overlapping <input type="range">
   elements share one visual track. Each input's own track is invisible
   and ignores clicks (pointer-events: none) except right at its thumb,
   so dragging either handle doesn't get blocked by the other slider
   sitting on top of it. */
.month-range-slider {
  position: relative;
  height: 32px;
  margin: 0.3rem 0 0.4rem;
}
.month-range-track {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 6px;
  transform: translateY(-50%);
  background: #cbd5e0;
  border-radius: 3px;
}
.month-range-track-highlight {
  position: absolute;
  top: 50%;
  height: 6px;
  transform: translateY(-50%);
  background: var(--lake-blue);
  border-radius: 3px;
}
.month-range-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 32px;
  margin: 0;
  background: none;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
}
.month-range-input::-webkit-slider-runnable-track { background: transparent; height: 32px; }
.month-range-input::-moz-range-track { background: transparent; height: 32px; border: none; }
.month-range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  pointer-events: auto;
  width: 18px;
  height: 18px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--lake-blue);
  border: 3px solid var(--white);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}
.month-range-input::-moz-range-thumb {
  pointer-events: auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--lake-blue);
  border: 3px solid var(--white);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}
.month-range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--evergreen);
  margin-bottom: 0.7rem;
}


.site-footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--slate);
  font-size: 0.85rem;
}

/* ---------- Statewide summary page ---------- */
.filters-card { margin-bottom: 1.5rem; }
.filters-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}
.filters-card-header h3 { margin: 0; }
.filters-toggle-btn {
  background: none;
  border: 1px solid #cbd5e0;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--slate);
  padding: 0.3rem 0.75rem;
}
.filters-toggle-btn:hover { border-color: var(--lake-blue); color: var(--lake-blue); }

/* Row 1: Stock Type pills, a vertical separator, then Species pills, all
   on one line (wraps on narrow screens). Row 2: the date-range timeline
   spanning most of the width, with Apply/Reset pinned to the right --
   see .statewide-range-row below. */
.statewide-pills-row {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.1rem;
}
.filter-pill-group { display: flex; flex-direction: column; gap: 0.45rem; }
.filter-pill-group-label { font-size: 0.85rem; color: var(--slate); font-weight: 600; }
/* .species-filter-pills normally carries its own top/bottom margin for its
   standalone usage on waterbody.php -- zero it out here so its pills sit
   flush under the label, lining up with the Stock Type pills next to it
   instead of sitting lower. */
.filter-pill-group .species-filter-pills { margin: 0; }
.filter-pill-separator {
  align-self: stretch;
  width: 1px;
  background: var(--warm-sand);
  min-height: 2.4rem;
}
@media (max-width: 700px) {
  .filter-pill-separator { display: none; }
}

.stock-type-filter-pills { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.stock-type-pill {
  --pill-color: var(--lake-blue);
  background: var(--white);
  border: 2px solid var(--pill-color);
  color: var(--pill-color);
  border-radius: 20px;
  padding: 0.35rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.stock-type-pill.active { background: var(--pill-color); color: var(--white); }
.stock-type-pill:not(.active) { opacity: 0.55; }

.statewide-range-row {
  display: flex;
  align-items: flex-start;
  gap: 1.2rem;
}
.statewide-range-wrap { flex: 1 1 auto; min-width: 0; }
.statewide-range-actions { display: flex; align-items: center; gap: 0.6rem; flex-shrink: 0; }
.statewide-range-actions button {
  background: var(--lake-blue);
  color: var(--white);
  border: none;
  border-radius: 6px;
  padding: 0.45rem 1rem;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.85rem;
}
.statewide-range-actions button:hover { filter: brightness(1.08); }
.filter-reset-btn {
  background: none !important;
  color: var(--slate) !important;
  border: 1px solid #cbd5e0 !important;
}
.filter-reset-btn:hover { border-color: var(--lake-blue) !important; color: var(--lake-blue) !important; filter: none !important; }
.filter-reset-btn:disabled {
  opacity: 0.4;
  filter: grayscale(1) !important;
  cursor: default;
  pointer-events: none;
}

.stats-strip-statewide {
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}

/* Lets js/near-me.js scroll straight to this element after a search
   (scrollIntoView) without it landing underneath the sticky header --
   taller value on mobile since .site-header stacks into two rows there
   (see the nav media query above). */
#near-me-stats { scroll-margin-top: 80px; }
@media (max-width: 760px) {
  #near-me-stats { scroll-margin-top: 150px; }
}

.chart-wrapper-pie { height: 340px; }

.top10-item { align-items: center; }
.top10-rank {
  display: inline-block;
  width: 1.6rem;
  font-weight: 700;
  color: var(--lake-blue);
}

/* ---------- Near Me page ---------- */
/* Two columns at desktop widths: address entry + action buttons on the
   left, both sliders stacked on the right -- replaces an earlier fully-
   stacked layout (address row, then a full-width radius row, then a
   full-width date row) that took roughly twice the vertical space for
   the same controls. */
.near-me-search-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 2rem; align-items: start; }
@media (max-width: 760px) { .near-me-search-grid { grid-template-columns: 1fr; gap: 1rem; } }

.near-me-search-col label { font-size: 0.85rem; color: var(--slate); font-weight: 600; display: block; margin-bottom: 0.3rem; }
.near-me-search-col input[type=text] {
  width: 100%; padding: 0.55rem; border-radius: 6px; border: 1px solid #cbd5e0;
  font-size: 0.95rem; box-sizing: border-box; margin-bottom: 0.6rem;
}
.near-me-form-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.near-me-geo-btn {
  background: none; border: 1px solid #cbd5e0; color: var(--slate);
  border-radius: 6px; padding: 0.55rem 0.9rem; font-size: 0.85rem; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.near-me-geo-btn:hover { border-color: var(--lake-blue); color: var(--lake-blue); }
.near-me-status { font-size: 0.82rem; color: var(--slate); margin: 0.5rem 0 0; min-height: 1.2em; }
.near-me-status.is-error { color: #D7263D; }

.radius-row { margin: 0 0 0.9rem; }
.radius-row:last-child { margin-bottom: 0; }
.radius-row label { font-size: 0.85rem; color: var(--slate); font-weight: 600; display: block; margin-bottom: 0.2rem; }
.radius-slider { position: relative; height: 32px; }
.radius-track { position: absolute; top: 50%; left: 0; right: 0; height: 6px; transform: translateY(-50%); background: #cbd5e0; border-radius: 3px; }
.radius-track-fill { position: absolute; top: 50%; left: 0; height: 6px; transform: translateY(-50%); background: var(--evergreen); border-radius: 3px; }
.radius-input {
  position: absolute; top: 0; left: 0; width: 100%; height: 32px; margin: 0; background: none;
  -webkit-appearance: none; appearance: none;
}
.radius-input::-webkit-slider-runnable-track { background: transparent; height: 32px; }
.radius-input::-moz-range-track { background: transparent; height: 32px; border: none; }
.radius-input::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; margin-top: 7px; border-radius: 50%;
  background: var(--evergreen); border: 3px solid var(--white); box-shadow: 0 1px 4px rgba(0,0,0,0.35); cursor: pointer;
}
.radius-input::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%; background: var(--evergreen); border: 3px solid var(--white);
  box-shadow: 0 1px 4px rgba(0,0,0,0.35); cursor: pointer;
}
.radius-value { font-size: 0.85rem; font-weight: 700; color: var(--evergreen); margin-top: 0.4rem; }

#near-me-map { height: 420px; width: 100%; border-radius: var(--radius); border: 1px solid #e9dfc8; }

.distance-pill {
  display: inline-block; background: #eef6ff; color: var(--lake-blue);
  font-size: 0.72rem; font-weight: 600; padding: 0.1rem 0.5rem; border-radius: 10px; margin-left: 0.4rem;
}

.near-me-report-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.near-me-report-table th, .near-me-report-table td { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid #eee; }
.near-me-report-table th { color: var(--slate); font-weight: 600; font-size: 0.8rem; }
/* Distance, Species, Total Stocked, Avg Size columns -- centered
   (including their headings); Waterbody and County stay left-aligned. */
.near-me-report-table th:nth-child(3), .near-me-report-table td:nth-child(3),
.near-me-report-table th:nth-child(4), .near-me-report-table td:nth-child(4),
.near-me-report-table th:nth-child(5), .near-me-report-table td:nth-child(5),
.near-me-report-table th:nth-child(6), .near-me-report-table td:nth-child(6) {
  text-align: center;
}
.near-me-report-table tbody tr:hover { background: #f7f9fb; }
.near-me-table-wrap { max-height: 420px; overflow-y: auto; }
.near-me-empty-state { text-align: center; padding: 2rem 1rem; color: var(--slate); }

/* Waterbodies in Range now spans the full card width (see near-me.html) --
   a grid instead of one long vertical list makes actual use of that width
   instead of leaving most of each row empty. */
.near-me-waterbody-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0 1.5rem;
}
@media (max-width: 760px) {
  .near-me-waterbody-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .near-me-waterbody-grid { grid-template-columns: 1fr; }
}
.near-me-waterbody-grid .list-item { border-bottom: 1px solid #eee; }

/* Collapsible cards (Waterbodies in Range / Stocking Report by Waterbody
   on Near Me) -- a header row with a Hide/Show toggle, and a content
   block that's just hidden via the `hidden` attribute when collapsed.
   Collapsed-by-default-on-mobile is decided in JS (js/near-me.js), not
   here; this only styles whatever state JS puts it in. */
.collapsible-header { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.collapsible-header h3 { margin: 0; }
.collapse-toggle-btn {
  display: inline-flex; align-items: center; gap: 0.35rem; flex-shrink: 0;
  background: none; border: 1px solid #cbd5e0; border-radius: 20px;
  padding: 0.3rem 0.8rem; font-size: 0.8rem; font-weight: 600; color: var(--lake-blue);
  cursor: pointer;
}
.collapse-toggle-btn:hover { background: #eef6ff; }
.collapse-chevron { transition: transform 0.15s; }
.collapse-toggle-btn[aria-expanded="false"] .collapse-chevron { transform: rotate(-90deg); }
.collapsible-content { margin-top: 0.7rem; }

/* Species Totals: one block per species, color-coded to match the same
   SPECIES_COLORS palette used on the Statewide Summary charts (js/near-me.js),
   each with its own top-3-waterbodies sub-list. The header is clickable
   (toggles a species filter on the Waterbodies in Range list below --
   see toggleSpeciesFilter() in js/near-me.js), so it gets its own
   hover/focus/selected treatment separate from the block's padding. */
.species-total-block { padding: 0.7rem 0; border-bottom: 1px solid #eee; transition: opacity 0.15s; }
.species-total-block:last-child { border-bottom: none; }
.species-total-block.is-dimmed { opacity: 0.4; }
.species-total-header {
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
  cursor: pointer; border-radius: 6px; padding: 0.2rem 0.3rem; margin: -0.2rem -0.3rem;
  transition: background-color 0.15s;
}
.species-total-header:hover { background: #f7f9fb; }
.species-total-header:focus-visible { outline: 2px solid var(--lake-blue); outline-offset: 2px; }
.species-total-block.is-selected .species-total-header { background: #eef6ff; }
.species-color-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.species-total-name { font-weight: 700; color: var(--ink); flex: 1 1 auto; }
.species-total-qty { font-size: 0.85rem; color: var(--lake-blue); font-weight: 700; white-space: nowrap; }
.species-total-meta { font-size: 0.76rem; color: var(--slate); margin: 0.15rem 0 0.5rem 1.2rem; }
.species-top-waterbodies { margin: 0 0 0 1.2rem; padding-left: 1.1rem; font-size: 0.85rem; }
.species-top-waterbodies li { margin-bottom: 0.3rem; }
.species-top-waterbodies .swb-meta { color: var(--slate); font-size: 0.78rem; }

/* Species Totals card header: title + "By Species"/"By Waterbody" toggle,
   top right (see js/near-me.js renderSpeciesTotals()/renderWaterbodyGrouped()). */
.species-totals-header-row { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; flex-wrap: wrap; }
.species-totals-header-row h3 { margin: 0; }
.species-totals-toggle { display: inline-flex; border: 1px solid #cbd5e0; border-radius: 999px; overflow: hidden; flex-shrink: 0; }
.species-totals-toggle .toggle-btn {
  background: none; border: none; padding: 0.3rem 0.7rem; font-size: 0.78rem; font-weight: 600;
  color: var(--slate); cursor: pointer;
}
.species-totals-toggle .toggle-btn + .toggle-btn { border-left: 1px solid #cbd5e0; }
.species-totals-toggle .toggle-btn.is-active { background: var(--lake-blue); color: var(--white); }

/* By-waterbody grouped view: same block/border rhythm as .species-total-block,
   but each block is a waterbody with a chip per species stocked there. */
.wb-total-block { padding: 0.7rem 0; border-bottom: 1px solid #eee; }
.wb-total-block:last-child { border-bottom: none; }
.wb-total-header { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; }
.wb-total-name { font-weight: 700; }
.wb-total-meta { font-size: 0.76rem; color: var(--slate); }
.wb-species-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.4rem 0 0; }
.wb-species-chip {
  display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.78rem;
  background: #f7f9fb; border-radius: 999px; padding: 0.2rem 0.6rem 0.2rem 0.4rem;
}

.near-me-species-filter-note {
  font-size: 0.8rem; color: var(--lake-blue); font-weight: 600;
  background: #eef6ff; border-radius: 6px; padding: 0.5rem 0.7rem; margin: 0 0 0.8rem;
}
