:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --ink: #1d2733;
  --muted: #5b6878;
  --line: #dde2e8;
  --accent: #0b6aa2;
  --accent-ink: #ffffff;
  --hover: #eef4f9;
  --sel: #ffd23f;
  --grid: #eceff3;     /* chart grid lines */
  --insitu: #000000;   /* in-situ markers */
  --header-h: 52px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12161b;
    --surface: #1a2027;
    --ink: #e4e9ef;
    --muted: #97a3b1;
    --line: #2c353f;
    --accent: #4aa8e0;
    --accent-ink: #0b1620;
    --hover: #222b35;
    --grid: #252d36;
    --insitu: #ffffff;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); }
body { display: flex; flex-direction: column; font-size: 14px; line-height: 1.45; }
a { color: var(--accent); }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---------- header ---------- */
.top {
  height: var(--header-h); flex: none; display: flex; align-items: center; gap: 16px;
  padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--line);
}
/* the tagline sits on the baseline of "LakeSense": the row aligns baselines, the brand takes its baseline
   from the word (the logo is centered on its own, and the word gets the logo's height so it stays centered) */
.brand-row { display: flex; align-items: baseline; gap: 16px; min-width: 0; }
.brand { display: flex; align-items: baseline; gap: 8px; text-decoration: none; color: #0f4c6b; font-weight: 700; font-size: 20px; }
.brand span { line-height: 34px; }
@media (prefers-color-scheme: dark) { .brand { color: var(--ink); } }
.brand img { width: 34px; height: 34px; display: block; align-self: center; }
.tagline { color: var(--muted); font-size: 13px; }
.top nav { margin-left: auto; display: flex; gap: 4px; }
.top nav a { text-decoration: none; color: var(--muted); padding: 6px 12px; border-radius: 6px; font-weight: 500; }
.top nav a:hover { background: var(--hover); color: var(--ink); }
.top nav a.on { color: var(--accent); background: var(--hover); }

main { flex: 1; min-height: 0; position: relative; }
.view { position: absolute; inset: 0; }

/* ---------- explore ---------- */
#view-explore { display: grid; grid-template-columns: 460px 1fr; grid-template-rows: 100%; grid-template-areas: "panel map"; }
/* lake selected: time series take most of the screen, map and lake info share a side column */
#view-explore.lake {
  grid-template-columns: clamp(300px, 27vw, 400px) minmax(0, 1fr);
  grid-template-rows: minmax(200px, 40%) minmax(0, 1fr);
  grid-template-areas: "map ts" "panel ts";
}
/* wide screens: a larger lake map (40% width, 55% height) */
@media (min-width: 1200px) {
  #view-explore.lake { grid-template-columns: 40% minmax(0, 1fr); grid-template-rows: 55% minmax(0, 1fr); }
  #view-explore.lake .legend { display: flex; }
  #view-explore.lake .facts { grid-template-columns: fit-content(6.5em) minmax(0, 1fr) fit-content(6.5em) minmax(0, 1fr); }
}
.panel { grid-area: panel; background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto; min-height: 0; }
.ts-pane { grid-area: ts; overflow-y: auto; min-height: 0; padding: 14px 22px 28px; background: var(--bg); }
#list-mode { display: flex; flex-direction: column; height: 100%; }
#detail-mode { padding: 12px 16px 24px; }
.map-wrap { grid-area: map; position: relative; min-height: 0; }
#view-explore.lake .map-wrap { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
#map { position: absolute; inset: 0; }

.search { display: flex; gap: 8px; padding: 12px 16px 6px; }
.search input, .search select {
  height: 36px; border: 1px solid var(--line); border-radius: 6px; padding: 0 10px;
  background: var(--bg); color: var(--ink); font: inherit; min-width: 0;
}
.search input { flex: 1; }
.search select { width: 130px; }
.check { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; padding: 2px 16px; cursor: pointer; }
.list-head { padding: 6px 16px; color: var(--muted); font-size: 12px; border-bottom: 1px solid var(--line); }
.filters-box { margin: 2px 16px 6px; font-size: 13px; }
.filters-box summary { cursor: pointer; color: var(--accent); }
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; margin: 8px 0 4px; }
.filters label { display: flex; flex-direction: column; gap: 2px; color: var(--muted); font-size: 12px; min-width: 0; }
.filters select { width: 100%; }
.filters select { height: 30px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--ink); font: inherit; font-size: 12.5px; min-width: 0; }
.filters .check { flex-direction: row; grid-column: 1 / -1; padding: 0; }
#filt-clear { font-size: 12px; }
.type-line { font-size: 13px; margin: -6px 0 10px; }
.type-line i.dot, .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; border: 1px solid; }
.lake-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.lake-list li {
  padding: 8px 16px; border-bottom: 1px solid var(--line); cursor: pointer;
  display: flex; justify-content: space-between; gap: 8px; align-items: baseline;
}
.lake-list li:hover, .lake-list li:focus { background: var(--hover); outline: none; }
.lake-list .nm { font-weight: 500; }
.lake-list .meta { color: var(--muted); font-size: 12px; white-space: nowrap; }
.lake-list .lid { color: var(--muted); font-weight: 400; font-size: 11px; }
.lake-list li.nodata .nm { font-weight: 400; color: var(--muted); }
.lake-list .more { color: var(--muted); cursor: default; justify-content: center; font-size: 12px; }

.back { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 4px 0; margin-bottom: 4px; }
#d-name { margin: 4px 0 0; font-size: 20px; }
.sub { color: var(--muted); margin-bottom: 10px; }
.facts-box summary { cursor: pointer; color: var(--accent); font-size: 13px; margin-bottom: 6px; }
.facts-box:not([open]) { margin-bottom: 10px; }
.facts { display: grid; grid-template-columns: fit-content(9em) minmax(0, 1fr); gap: 4px 10px; margin: 0 0 12px; font-size: 13px; line-height: 1.3; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.actions button, .btn {
  border: 1px solid var(--line); background: var(--surface); border-radius: 6px; padding: 6px 12px;
  cursor: pointer; text-decoration: none; color: var(--ink); display: inline-block; font-size: 13px;
}
.actions button:hover, .btn:hover { background: var(--hover); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); background: var(--accent); }
.btn:disabled { opacity: .5; cursor: default; }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: var(--surface); padding: 5px 10px; cursor: pointer; font-size: 13px; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--accent); color: var(--accent-ink); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 0 0 12px; }
.stats:empty { display: none; }
.stat { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
.stat b { display: block; font-size: 17px; }
.stat span { color: var(--muted); font-size: 11px; line-height: 1.25; display: block; }

.ts-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.ts-head h2 { margin: 0; font-size: 20px; margin-right: auto; }
.ts-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 10px 0 2px; }
.ts-opts .check { padding: 2px 8px; }
.ts-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.ts-grid .wide { grid-column: 1 / -1; }
.card.chart { margin: 0; padding: 12px 14px 8px; border-radius: 10px; }
.chart-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 4px; }
.chart-h h4 { margin: 0; font-size: 14px; }
.chart-h .hint { margin-right: auto; }
.chart-h select { font: inherit; font-size: 12px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--ink); padding: 2px 4px; }
.trend { font-size: 13px; margin: 2px 0 4px; }
/* indicator tabs: the same space under every legend before the notes (uPlot's legend under the full record) */
.card.chart:not(.prof) .leg, .card.chart:not(.prof) .u-legend { margin-bottom: 12px; }
.card.chart:not(.prof) > p:last-child { margin-bottom: 0; }   /* every card ends at the same distance */
.trend b { font-weight: 600; }

/* profile */
.prof { padding-top: 10px; }
.prof-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 6px; }
.prof-head h3 { margin: 0; font-size: 16px; }
.prof-head .big { color: var(--muted); }
.prof-head .big b { font-size: 22px; color: var(--ink); }
.prof-head .badge { margin: 0; align-self: center; }
.prof-charts { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "r s a"; gap: 6px 14px; }
.prof-charts > .prof-r { grid-area: r; } .prof-charts > :nth-child(2) { grid-area: s; } .prof-charts > :nth-child(3) { grid-area: a; }
.prof h4 { margin: 0 0 2px; font-size: 13px; }
.prof h4 .hint { font-weight: 400; }
svg.annual.rank { display: block; }
svg.annual.rank text.rk { fill: var(--ink); font-weight: 600; }
svg.annual.rank text.rk2 { fill: var(--muted); font-size: 10.5px; }
.prof-r .leg { flex-direction: column; gap: 3px; max-width: 150px; }
.prof-c .leg, .prof-r .leg { margin-top: 2px; }
/* legends centered under the plot box (its left edge is the y-axis at 46 px), not under the whole panel */
.prof-c .leg { padding: 0 9px 0 46px; justify-content: center; }
.prof-r .leg { margin-left: 46px; width: 114px; max-width: none; align-items: center; text-align: center; }
.leg { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 11.5px; color: var(--muted); margin: 6px 0 2px; }
.leg span { display: inline-flex; align-items: center; gap: 4px; }
.leg svg { display: block; overflow: visible; }
.prof-foot { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 6px; }
.prof-foot .trend { font-size: 12.5px; margin: 0 0 4px; }
.prof .what { font-size: 12.5px; color: var(--muted); margin: 0; line-height: 1.4; }
.prof-note { margin: 2px 0 0; font-size: 12.5px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--hover); font-weight: 600; font-size: 12px; }

/* lake description (side panel) and satellite summary (top of the profile) */
.about-lake { font-size: 14px; line-height: 1.5; margin: 0 0 12px; }
.sum { padding: 10px 18px 6px; }
.sum-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; margin-bottom: 2px; }
.sum-h h3 { margin: 0; font-size: 17px; }
.sum-r { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(100px, .7fr) minmax(170px, 1.5fr) minmax(160px, 1.1fr); gap: 2px 16px; align-items: center; padding: 3px 0; border-top: 1px solid var(--line); }
.sum-head { color: var(--muted); font-size: 11.5px; padding: 0 0 2px; border-top: 0; }
.sum-n { font-size: 14px; }
.sum-n span { color: var(--muted); }
.sum-v { font-size: 16px; font-weight: 600; white-space: nowrap; }
.sum-v .hint { font-weight: 400; }
.sum-b { min-width: 0; }
svg.rstrip { display: block; overflow: visible; }
svg.rstrip text { fill: var(--muted); font-size: 10px; }
svg.rstrip text.pc { fill: var(--ink); font-weight: 700; font-size: 11px; }
.sum-t { display: flex; align-items: center; gap: 6px; font-size: 13px; line-height: 1.25; }
.sum-t > span { display: flex; flex-direction: column; }
.sum-t .tarr { flex: none; }
.sum-h .sum-opts { display: flex; flex-wrap: wrap; margin-left: auto; }
.sum-h .sum-opts .check { padding: 0 0 0 12px; }
.sum-bottom { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 18px; margin-top: 4px; }
.sum-bottom > .hint { font-size: 12px; }
.sum-more[open] { flex-basis: 100%; }
a.ind { color: inherit; text-decoration: none; }
a.ind:hover { text-decoration: underline; }
h3 a.ind:hover, .sum-n a.ind:hover b { text-decoration: underline; }
.sum-more { margin: 0; font-size: 12px; }
.sum-more summary { cursor: pointer; color: var(--muted); font-size: 12px; width: max-content; }
.sum-more p { margin: 4px 0 2px; line-height: 1.45; }
.ts-pane > .facts-box { margin: 14px 0 0; padding: 10px 16px 4px; }
.ts-pane > .facts-box summary { font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 8px; }

/* About → Lake types: the nutrient-color plot */
.nc-fig { margin: 12px 0 14px; max-width: 600px; }
svg.ncplot { display: block; width: 100%; height: auto; }
svg.ncplot text { fill: var(--muted); font-size: 11px; }
svg.ncplot text.q { font-weight: 700; font-size: 12px; fill: var(--q); }
@media (prefers-color-scheme: dark) { svg.ncplot text.q { fill: var(--q-dark); } }
svg.ncplot text.ax { fill: var(--ink); font-size: 12px; }
svg.ncplot text.cutl { fill: var(--ink); font-weight: 600; }
svg.ncplot .grid { stroke: var(--grid); }
svg.ncplot .cut { stroke: var(--ink); stroke-width: 1.2; stroke-dasharray: 5 4; }
.nc-leg { flex-direction: column; gap: 3px; font-size: 12.5px; color: var(--ink); margin: 6px 0; }
.nc-leg i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; border: 1px solid; flex: none; }
.nc-fig figcaption { font-size: 12.5px; line-height: 1.45; }
/* the figure scales down on phones: larger text in the figure's own units keeps it readable */
@media (max-width: 480px) {
  svg.ncplot text { font-size: 17px; }
  svg.ncplot text.q, svg.ncplot text.ax { font-size: 18px; }
}

/* the image behind a dot */
.pick-ring { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border: 2px solid var(--ink); border-radius: 50%; pointer-events: none; }
.imgpanel { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 8px; max-width: 980px; }
.imgpanel-h { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.imgpanel-h .imgclose { margin-left: auto; font-size: 15px; }
.imgbox { position: relative; aspect-ratio: 3 / 2; background: var(--bg); border-radius: 6px; overflow: hidden; }
.imgbox img { display: block; width: 100%; height: 100%; }
.imgbox svg.imgov { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
svg.imgov image.mask, svg.imgov image.pm { image-rendering: pixelated; }
.imgmain { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 14px; align-items: start; }
@media (max-width: 899px) { .imgmain { grid-template-columns: minmax(0, 1fr); gap: 8px; } }
.imgside { display: flex; flex-direction: column; gap: 12px; font-size: 12px; color: var(--ink); }
.imgside .leg { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.imgside .leg b { font-weight: 600; margin-top: 2px; }
.imgside .leg .check { padding: 0; font-size: 12px; color: var(--ink); }
.imgside .leg > span { display: flex; align-items: center; gap: 6px; text-align: left; }
.imgside i { flex: none; display: inline-block; width: 11px; height: 11px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.25); }
.imgside i.pm-pass { background: transparent; box-shadow: inset 0 0 0 1px var(--ink); opacity: .6; }
.imgside .sw-samp, .imgside .sw-ol, .imgside .sw-ib { flex: none; display: inline-block; width: 14px; height: 0; }
.imgside .sw-samp { border-top: 2px solid #f0b400; }
.imgside .sw-ol { border-top: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.5); }
.imgside .sw-ib { border-top: 1.5px dashed #868e96; }
.pmsel { display: flex; flex-direction: column; gap: 3px; }
.pmsel select { font: inherit; width: 100%; }
.pmfoot { margin-top: 6px; }
.pmfoot > div + div { margin-top: 3px; }
svg.imgov path, svg.imgov ellipse { fill: none; vector-effect: non-scaling-stroke; }
svg.imgov .ol-casing { stroke: rgba(0,0,0,.55); stroke-width: 3; }
svg.imgov .ol { stroke: #fff; stroke-width: 1.4; }
svg.imgov .ib { stroke: #fff; stroke-width: 1; stroke-dasharray: 4 3; opacity: .85; }
svg.imgov .samp-casing { stroke: rgba(0,0,0,.55); stroke-width: 2.4; }
svg.imgov .samp { stroke: #ffd43b; stroke-width: 1.2; }
svg.imgov .samp-c { fill: #ffd43b; stroke: rgba(0,0,0,.6); stroke-width: 1; vector-effect: non-scaling-stroke; }
.imgmsg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; }
.imgvals { font-size: 13px; margin: 6px 0 2px; }
.imgsrc code { font-size: 11px; word-break: break-all; }

/* month x year heatmap */
.heat { display: grid; gap: 2px; font-size: 11px; }
.heat .c { height: 22px; border-radius: 3px; display: flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
.heat .c.na { background: repeating-linear-gradient(45deg, transparent 0 3px, var(--line) 3px 4px); }
.heat .yl, .heat .ml { color: var(--muted); display: flex; align-items: center; }
.heat .ml { justify-content: center; }
.heat-legend { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); margin-top: 8px; }
.heat-legend i { display: inline-block; width: 160px; height: 10px; border-radius: 3px; }
svg.annual { display: block; width: 100%; overflow: visible; }
svg.annual text { fill: var(--muted); font-size: 11px; }
svg text.yu { font-weight: 600; }   /* y-axis unit */
svg.annual .grid { stroke: var(--grid); }
svg.annual .allmed { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 4 4; }
svg.annual .iqr { stroke-width: 3; stroke-linecap: round; opacity: .35; }
svg.annual .tr { stroke: var(--ink); stroke-width: 2; stroke-dasharray: 6 4; fill: none; }
svg.annual rect.hit { fill: transparent; }
svg.annual path.ins { stroke: var(--insitu); stroke-width: 0.9; stroke-linecap: round; fill: none; }
.ins-mark { display: inline-block; vertical-align: -1px; margin: 0 2px; }
svg.annual rect.hit:hover { fill: var(--hover); }

.chart { margin-top: 14px; }
.ts-grid .chart { margin-top: 0; }
.chart h4 { margin: 0 0 2px; font-size: 13px; }
.chart .empty { color: var(--muted); font-size: 13px; padding: 12px 0; }
.hint { color: var(--muted); font-size: 12px; }
.u-legend { font-size: 12px; }
.u-legend .u-marker { border-radius: 50%; }
.uplot { font-family: inherit; }
.u-axis { color: var(--muted); }

.basemap-switch { position: absolute; top: 10px; left: 10px; display: flex; border-radius: 6px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.basemap-switch button { border: 0; background: #fff; color: #1d2733; padding: 6px 10px; cursor: pointer; font-size: 12px; }
.basemap-switch button.on { background: #1d2733; color: #fff; }
.legend { position: absolute; left: 10px; bottom: 28px; background: rgba(255,255,255,.92); color: #1d2733; border-radius: 6px; padding: 6px 9px; font-size: 11.5px; display: flex; flex-direction: column; gap: 2px; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.legend .hint { color: #5b6878; font-size: 10.5px; }
.legend i, .badge i.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; border: 1px solid rgba(0,0,0,.25); }
.legend small { color: #5b6878; }
#view-explore.lake .legend { display: none; }
.legend .lg-mode { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; margin-bottom: 3px; }
.legend .lg-mode label { display: inline-flex; align-items: center; gap: 3px; cursor: pointer; }
.legend .lg-mode input { margin: 0; }
.nc-key { position: relative; width: 140px; height: 50px; margin: 2px 0 1px 48px; }
.nc-key svg { position: absolute; left: 0; top: 2px; border-radius: 3px; }
.nc-key span { position: absolute; font-size: 10.5px; white-space: nowrap; }
.nc-key .k-g, .nc-key .k-b { right: calc(100% + 4px); }
.nc-key .k-m, .nc-key .k-r { left: 49px; }
.nc-key .k-g, .nc-key .k-m { top: 0; } .nc-key .k-b, .nc-key .k-r { top: 34px; }
.map-msg { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); background: rgba(20,25,30,.85); color: #fff; padding: 6px 12px; border-radius: 6px; font-size: 12px; pointer-events: none; }
.maplibregl-popup-content { padding: 6px 10px; font-size: 12px; color: #1d2733; }

/* ---------- pages ---------- */
.page { overflow-y: auto; }
.page-inner { max-width: 820px; margin: 0 auto; padding: 24px 16px 48px; }
.page h1 { margin-top: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px 20px; margin: 16px 0; }
.card h3 { margin-top: 0; }
.card .search { padding: 0 0 8px; }
.card .search select { width: 100%; max-width: 420px; }
.card .check { padding: 8px 0; }
.dl-pick { position: relative; margin-bottom: 8px; }
.suggest { list-style: none; margin: 0; padding: 0; position: absolute; z-index: 5; left: 0; right: 0; top: 40px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; max-height: 280px; overflow-y: auto; box-shadow: 0 4px 14px rgba(0,0,0,.15); }
.suggest li { padding: 7px 10px; cursor: pointer; }
.suggest li:hover, .suggest li.on { background: var(--hover); }
.basket-head { margin: 14px 0 6px; }
.basket { list-style: none; padding: 0; margin: 0 0 8px; max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: 6px; }
.basket:empty { display: none; }
.basket li { display: flex; justify-content: space-between; padding: 5px 10px; border-bottom: 1px solid var(--line); }
.basket li:last-child { border-bottom: 0; }
.basket button, button.link { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0 4px; }
.progress { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin-top: 10px; }
.progress div { height: 100%; width: 0; background: var(--accent); transition: width .15s; }
.cols { border-collapse: collapse; width: 100%; font-size: 13px; }
.cols td { padding: 5px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.cols td:first-child { font-family: ui-monospace, Menlo, monospace; white-space: nowrap; }
.prose { font-size: 15px; line-height: 1.6; }
.about-logo { float: right; margin: 0 0 10px 20px; }
img.about-logo { width: 120px; height: 120px; }
a.about-logo img { display: block; }
@media (max-width: 480px) { img.about-logo { width: 72px; height: 72px; } a.about-logo img { width: 60px; height: auto; } }
.page-inner.wide-page { max-width: 1100px; }
.methods h2, .methods h3 { margin-top: 32px; }
.preprint .status { display: inline-block; font-size: 11.5px; font-weight: 600; letter-spacing: .02em; padding: 1px 8px; border-radius: 999px; background: #fff3bf; color: #5c4a00; vertical-align: 1px; }
.preprint { background: var(--hover); border-radius: 8px; padding: 10px 14px; }
.methods .eq { font-family: 'Cambria Math', Georgia, serif; font-size: 17px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; overflow-x: auto; }
.methods .toc { font-size: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; }
.methods li { margin-bottom: 6px; }
#examples h2 { margin: 28px 0 2px; font-size: 18px; }
#examples h2 + p { margin: 0 0 10px; color: var(--muted); }
.ex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
a.ex.card { margin: 0; display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--ink); border-top: 4px solid; padding: 12px 14px; transition: box-shadow .15s; }
a.ex.card:hover { box-shadow: 0 3px 12px rgba(0,0,0,.12); }
a.ex .why { font-size: 13px; flex: 1; }
a.ex .go { color: var(--accent); font-size: 13px; font-weight: 600; }

.update-banner { position: fixed; top: 60px; left: 50%; transform: translateX(-50%); z-index: 30; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 8px; font-size: 13px; box-shadow: 0 4px 14px rgba(0,0,0,.2); }
.update-banner button { margin-left: 8px; border: 0; border-radius: 5px; padding: 3px 10px; cursor: pointer; background: var(--accent-ink); color: var(--accent); font-weight: 600; }
.src-tip { position: fixed; z-index: 40; max-width: 320px; pointer-events: none; background: var(--ink); color: var(--bg); font-size: 12px; line-height: 1.35; padding: 5px 8px; border-radius: 6px; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.facts [data-src] { cursor: help; }
.facts dd i.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; border: 1px solid; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #1d2733; color: #fff; padding: 8px 14px; border-radius: 6px; font-size: 13px; z-index: 20; }

/* ---------- small screens ---------- */
@media (max-width: 480px) { .brand span { display: none; } }
@media (max-width: 820px) {
  .tagline { display: none; }
  .top { gap: 8px; padding: 0 10px; }
  .top nav a { padding: 6px 6px; font-size: 13px; }
  .top nav { gap: 0; }
  #view-explore { grid-template-columns: 1fr; grid-template-rows: 42vh minmax(0, 1fr); grid-template-areas: "map" "panel"; }
  .panel { border-right: 0; border-top: 1px solid var(--line); }
  /* lake selected: one scrolling column (map, lake info, charts) */
  #view-explore.lake { display: flex; flex-direction: column; overflow-y: auto; }
  #view-explore.lake > * { flex: none; }
  #view-explore.lake .panel, #view-explore.lake .ts-pane { overflow: visible; border-top: 0; }
  #view-explore.lake .ts-pane { order: 1; }
  #view-explore.lake .map-wrap { order: -1; height: 220px; border-right: 0; border-bottom: 1px solid var(--line); }
  .ts-pane { padding: 12px 12px 20px; }
  #ts-title { display: none; }
  .ts-grid { grid-template-columns: minmax(0, 1fr); }
  .prof-charts { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "s s" "r a"; }
  .sum { padding: 10px 12px 6px; }
  .sum-r { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "n v" "b t"; gap: 2px 10px; padding: 5px 0; }

  .sum-head { display: none; }
  .sum-n { grid-area: n; } .sum-v { grid-area: v; } .sum-b { grid-area: b; } .sum-t { grid-area: t; }
}
