:root {
  color-scheme: light;
  --ink: #18323b;
  --muted: #61747a;
  --line: #dce5e7;
  --paper: #f4f7f7;
  --card: #ffffff;
  --teal: #176b70;
  --teal-dark: #123b4a;
  --notice: #fff5d9;
  --error-bg: #fde9e7;
  --error-ink: #8d3028;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.5; }
a { color: var(--teal); }
.site-header { background: var(--teal-dark); color: white; }
.header-inner { max-width: 1240px; margin: 0 auto; display: flex; align-items: end; justify-content: space-between; gap: 24px; padding: 34px 24px; }
h1, h2, h3, h4, p { margin-top: 0; }
h1 { margin-bottom: 7px; font-size: clamp(1.8rem, 4vw, 2.7rem); line-height: 1.1; letter-spacing: -.025em; }
.subhead { margin: 0; color: #d4e6e8; }
.eyebrow { margin-bottom: 8px; font-size: .72rem; font-weight: 800; letter-spacing: .12em; color: #4c8589; }
.site-header .eyebrow { color: #a8d5d4; }
.updated-block { display: flex; align-items: center; gap: 8px; white-space: nowrap; color: #e1eeee; font-size: .85rem; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #f1c45a; }
main { max-width: 1240px; margin: 0 auto; padding: 24px 24px 48px; }
.notice { margin-bottom: 30px; padding: 14px 16px; border: 1px solid #eadba7; border-radius: 12px; background: var(--notice); font-size: .92rem; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 30px 0 15px; }
.section-heading h2 { margin-bottom: 0; font-size: 1.5rem; letter-spacing: -.02em; }
.section-intro { max-width: 480px; margin: 0; color: var(--muted); font-size: .88rem; }
.text-link { font-weight: 650; text-decoration: none; }
.text-link:hover, .official-links a:hover { text-decoration: underline; }
.gauges-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.gauge-card, .map-card, .resource-card, .official-links { background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: 0 2px 8px rgb(18 59 74 / 3%); }
.gauge-summary { display: flex; align-items: start; justify-content: space-between; gap: 16px; padding: 20px 20px 16px; min-height: 132px; }
.gauge-identity { min-width: 0; }
.station-kicker { margin-bottom: 5px; font-size: .7rem; font-weight: 800; letter-spacing: .09em; color: var(--teal); }
.gauge-summary h3 { margin-bottom: 4px; font-size: 1.12rem; line-height: 1.25; }
.station-stream { margin-bottom: 0; font-size: .82rem; }
.muted { color: var(--muted); }
.small { font-size: .78rem; }
.reading { min-width: 115px; text-align: right; }
.reading-number { display: flex; justify-content: end; align-items: baseline; gap: 5px; }
.reading-value { font-size: 2.2rem; line-height: 1.1; font-weight: 760; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.reading-unit { color: var(--muted); font-size: .9rem; }
.reading-time { display: block; margin-top: 7px; }
.plot-panel { padding: 16px 20px 18px; border-top: 1px solid var(--line); }
.readings-panel { border-top: 1px solid var(--line); }
.readings-toggle { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 20px; cursor: pointer; list-style: none; }
.readings-toggle::-webkit-details-marker { display: none; }
.readings-toggle::after { content: "+"; color: var(--teal); font-size: 1.25rem; font-weight: 700; line-height: 1; margin-left: auto; }
.readings-panel[open] .readings-toggle::after { content: "−"; }
.readings-toggle h4 { margin: 0; font-size: .96rem; }
.readings-content { padding: 0 20px 18px; }
.plot-panel { background: #fbfdfd; }
.plot-title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.plot-title-row h4 { margin: 0; font-size: .96rem; }
.pill { display: inline-block; max-width: 60%; border-radius: 999px; padding: 4px 8px; background: #eaf2f2; color: #385a60; font-size: .68rem; line-height: 1.35; white-space: normal; text-align: right; }
.pill.error { background: var(--error-bg); color: var(--error-ink); }
.bom-image-link { display: flex; align-items: center; justify-content: center; min-height: 110px; width: 100%; margin: 4px 0 12px; overflow: hidden; border-radius: 6px; background: #fff; }
.bom-plot { display: block; width: 100%; height: auto; object-fit: contain; }
.chart-fallback { margin: 0; padding: 18px; color: var(--muted); font-size: .85rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .84rem; font-variant-numeric: tabular-nums; }
th, td { padding: 8px 6px; text-align: left; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: .69rem; text-transform: uppercase; letter-spacing: .04em; }
td:last-child, th:last-child { text-align: right; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
.source-note { margin: 12px 0 0; }
.loading-card { padding: 24px; color: var(--muted); }
.map-card { padding: 10px; }
#map { width: 100%; height: 430px; border-radius: 10px; background: #e4eded; }
.map-caption { margin: 10px 6px 2px; font-size: .82rem; color: var(--muted); }
.resource-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.resource-card { display: flex; align-items: start; gap: 16px; padding: 20px; }
.resource-card h3 { margin-bottom: 6px; font-size: 1rem; }
.resource-card p { margin-bottom: 10px; color: var(--muted); font-size: .88rem; }
.resource-symbol { display: grid; place-items: center; flex: 0 0 46px; height: 46px; border-radius: 12px; background: #eaf2f2; color: var(--teal); font-size: 1.45rem; }
.official-links { display: flex; flex-wrap: wrap; gap: 12px 24px; padding: 20px; margin-top: 28px; }
.official-links h2 { flex-basis: 100%; margin-bottom: 0; font-size: 1.1rem; }
.official-links a { text-decoration: none; font-size: .9rem; }
footer { padding: 20px 22px; text-align: center; color: var(--muted); font-size: .8rem; border-top: 1px solid var(--line); }
footer p { max-width: 900px; margin: 0 auto; }
@media (max-width: 820px) {
  .gauges-grid { gap: 14px; }
  .gauge-summary { flex-direction: column; min-height: 0; }
  .reading { text-align: left; }
  .reading-number { justify-content: start; }
  .reading-time { margin-top: 4px; }
  .plot-panel { padding: 15px; }
  .readings-toggle { padding: 14px 15px; }
  .readings-content { padding: 0 15px 15px; }
  .resource-card { padding: 16px; }
}
@media (max-width: 620px) {
  .header-inner { align-items: start; flex-direction: column; padding: 26px 18px; gap: 14px; }
  main { padding: 18px 14px 34px; }
  .section-heading { align-items: start; flex-direction: column; gap: 8px; margin-top: 25px; }
  .gauges-grid, .resource-grid { grid-template-columns: 1fr; }
  .gauge-summary { flex-direction: row; align-items: start; padding: 17px; }
  .reading { min-width: 92px; text-align: right; }
  .reading-number { justify-content: end; }
  .reading-value { font-size: 1.9rem; }
  .reading-time { font-size: .7rem; }
  .plot-panel { padding: 15px 17px; }
  .readings-toggle { padding: 14px 17px; }
  .readings-content { padding: 0 17px 15px; }
  #map { height: 360px; }
  .official-links { flex-direction: column; gap: 10px; }
}


/* Linked selection between station chart cards and map markers */
.gauge-card { cursor: pointer; transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease; }
.gauge-card.is-selected {
  border-color: #f28c28;
  box-shadow: 0 0 0 3px rgb(242 140 40 / 24%), 0 4px 14px rgb(18 59 74 / 8%);
}
.gauge-card:focus-visible { outline: 3px solid #4c8589; outline-offset: 3px; }
.custom-map-icon {
  background: transparent;
  border: 0;
}
.map-marker {
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: 40px;
  height: 40px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 1px 5px rgb(0 0 0 / 35%);
  transition: background-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.map-marker svg {
  display: block;
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.map-marker-farm { background: #25834a; color: #ffffff; }
.map-marker-station { background: #1677b8; color: #ffffff; }
.map-marker-station.is-selected {
  background: #f28c28;
  color: #18323b;
  border-color: #ffffff;
  box-shadow: 0 0 0 4px rgb(242 140 40 / 38%), 0 2px 7px rgb(0 0 0 / 40%);
  transform: scale(1.12);
}
