:root {
  color-scheme: dark;
  --bg-0: #07121d;
  --bg-1: #091b29;
  --bg-2: #102c3c;
  --panel: #0d2232;
  --panel-strong: #0d2a3b;
  --panel-soft: #0b2131;
  --line: #294655;
  --line-strong: #466373;
  --text: #f5fafc;
  --muted: #b6cbd7;
  --muted-strong: #d6e4ec;
  --accent: #6fe4ff;
  --accent-deep: #83e7ff;
  --monitoring: #6fe4ff;
  --normal: #79e4ae;
  --action: #f4d45f;
  --minor: #ffb669;
  --moderate: #ff937e;
  --major: #ff8296;
  --unavailable: #b5c5cf;
  --shadow-lg: 0 18px 48px #00000032;
  --shadow-md: 0 3px 12px #00000022;
  --radius-xl: 22px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg-0); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; color: var(--text); background: var(--bg-0); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; font-variant-numeric: tabular-nums; line-height: 1.5; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; cursor: pointer; }
a { color: inherit; }
svg { display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #e39927; outline-offset: 4px; }
.skip-link { position: fixed; z-index: 1000; top: -100px; left: 12px; padding: 12px 16px; color: #031822; background: var(--accent); border-radius: 8px; font-size: 16px; font-weight: 750; }
.skip-link:focus { top: 12px; }
.app-shell { width: min(1304px, 100%); margin: auto; padding: calc(28px + var(--safe-top)) 40px calc(28px + var(--safe-bottom)); }
.app-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-bottom: 25px; }
.brand { display: flex; gap: 14px; align-items: center; min-width: 0; }
.brand-mark { display: grid; place-items: center; width: 50px; height: 54px; flex-shrink: 0; color: white; background: var(--accent-deep); border-radius: 16px 16px 20px 4px; }
.brand-mark svg { width: 29px; height: 29px; }
.brand-eyebrow { display: block; color: var(--accent-deep); font-size: 12px; line-height: 1.4; font-weight: 750; letter-spacing: .16em; text-transform: uppercase; }
.brand-copy h1 { font-size: clamp(19px, 2.3vw, 27px); letter-spacing: -.055em; line-height: 1.15; margin: 4px 0 0; font-weight: 760; }
.brand-copy p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.icon-button, .text-button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; height: 43px; padding: 0 14px; border: 1px solid var(--line); border-radius: 9px; font-size: 12px; font-weight: 650; color: var(--muted-strong); background: transparent; transition: background .15s, border-color .15s; }
.icon-button { color: white; background: var(--accent-deep); border-color: var(--accent-deep); }
.icon-button svg, .text-button svg { width: 17px; height: 17px; flex-shrink: 0; }
.icon-button:hover { background: #acf0ff; }
.text-button:hover { background: var(--panel); border-color: var(--line-strong); }
.icon-button:disabled { cursor: wait; opacity: .65; }
.icon-button.is-loading svg { animation: spin 1s linear infinite; }
.public-info { display: flex; align-items: center; gap: 10px; padding: 12px 0 15px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.5; }
.public-info-icon { width: 19px; height: 19px; display: grid; place-items: center; flex-shrink: 0; border: 1px solid #4e8098; border-radius: 50%; font: italic 700 13px Georgia, serif; }
.public-info > div:last-child { display: flex; flex-wrap: wrap; gap: 4px 7px; }
.public-info strong { color: var(--muted-strong); font-weight: 700; }
.public-info p { margin: 0; }
.public-info a { color: var(--accent-deep); text-underline-offset: 3px; }
.notice { display: flex; gap: 11px; margin: 0 0 15px; padding: 13px 16px; border: 1px solid #716039; border-radius: 10px; color: #ffe196; background: #30291a; font-size: 13px; }
.notice svg { width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px; }
.notice.is-info { color: #b3ecfc; background: #103444; border-color: #3c7188; }
.notice.is-error { color: #ffb0bd; background: #35212d; border-color: #8a4c60; }
.hero { --severity: var(--unavailable); position: relative; display: grid; grid-template-columns: minmax(0,1fr) minmax(280px,.58fr); gap: 45px; overflow: hidden; border-radius: var(--radius-xl); padding: 36px 40px; color: #fff; background: #0d2a3b; }
.hero::before { content: ""; position: absolute; right: -130px; top: -250px; width: 510px; height: 700px; border: 1px solid #65969426; border-radius: 43% 57% 68% 32%; transform: rotate(30deg); box-shadow: 0 0 0 24px #ffffff03, 0 0 0 52px #ffffff03, 0 0 0 83px #ffffff03, 0 0 0 118px #ffffff03, 0 0 0 158px #ffffff03; pointer-events: none; }
.hero-copy, .hero-reading { position: relative; z-index: 1; }
.hero-copy { padding: 5px 0; }
.hero-kicker { display: flex; gap: 9px; align-items: center; color: #c0d5df; font-size: 12px; text-transform: uppercase; font-weight: 650; letter-spacing: .14em; }
.live-dot { width: 7px; height: 7px; flex-shrink: 0; border-radius: 50%; background: #9dafb0; box-shadow: 0 0 0 4px #ffffff0a; }
.live-dot.is-live { background: #87d2b4; box-shadow: 0 0 0 4px #87d2b418; }
.hero h2 { max-width: 620px; margin: 14px 0; font-size: clamp(28px, 3.3vw, 43px); line-height: 1.1; font-weight: 670; letter-spacing: -.055em; text-wrap: balance; }
.hero-summary { max-width: 640px; margin: 0; color: #d1e0e9; font-size: 13px; line-height: 1.7; }
.hero-note { display: flex; align-items: flex-start; gap: 7px; max-width: 550px; margin-top: 22px; color: #bbd0dd; font-size: 12px; line-height: 1.6; }
.hero-note svg { width: 15px; height: 15px; flex-shrink: 0; margin-top: 1px; }
.hero-reading { align-self: stretch; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding: 3px 0 3px 32px; border-left: 1px solid #ffffff21; }
.hero-reading-label { color: #a9ecff; font-size: 12px; text-transform: uppercase; letter-spacing: .16em; font-weight: 700; }
.hero-reading-place { margin-top: 5px; font-size: 14px; font-weight: 500; color: #edf5f9; }
.hero-reading-value { display: flex; align-items: baseline; gap: 12px; margin-top: 17px; }
.hero-stage { font-size: clamp(63px, 7vw, 91px); line-height: .95; letter-spacing: -.07em; font-weight: 760; }
.hero-unit { color: #c6dae4; font-size: 24px; font-weight: 400; }
.hero-trend { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 650; margin-top: 15px; color: #e0edf4; }
.hero-trend.is-rising { color: #ffd198; }
.hero-trend.is-falling { color: #a3e3cb; }
.hero-trend-icon { font-size: 17px; }
.hero-reading-footnote { margin-top: 10px; font-size: 12px; color: #bbd0dd; }
.hero.severity-action, .hero.severity-minor { box-shadow: inset 0 -4px #f5b859; }
.hero.severity-moderate, .hero.severity-major { box-shadow: inset 0 -4px #f28588; }
.feed-strip { display: grid; grid-template-columns: .8fr 1.25fr 1fr 1fr; border-bottom: 1px solid var(--line); margin: 0; padding: 19px 6px 15px; }
.feed-item { min-width: 0; padding: 0 20px; border-right: 1px solid var(--line); }
.feed-item:first-child { padding-left: 0; }
.feed-item:last-child { border-right: 0; }
.feed-item span { display: block; color: var(--muted); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }
.feed-item strong { display: block; margin-top: 4px; font-size: 12px; font-weight: 700; overflow-wrap: anywhere; }
.feed-item .health-live { color: var(--normal); }
.feed-item .health-delayed, .feed-item .health-saved { color: var(--action); }
.feed-item .health-unavailable { color: var(--major); }
.feed-item .health-checking { color: var(--muted); }
.feed-note { margin: 9px 6px 0; color: var(--muted); font-size: 12px; }
.section-panel { margin: 34px 0 0; }
.history-panel { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin: 36px 0 17px; }
.history-heading { display: flex; align-items: end; gap: 20px; }
.history-heading > p { font-size: 12px; color: var(--muted); margin: 0 0 3px; }
.history-heading span, .route-heading span, .system-map-heading span, .official-heading span, .data-notes-summary span { color: var(--accent); font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: .15em; }
.history-heading h2, .system-map-heading h2, .official-heading h2 { font-size: 26px; letter-spacing: -.05em; line-height: 1.15; font-weight: 650; margin: 4px 0 0; }
.history-note { font-size: 12px; color: var(--muted); margin: 9px 0 0; }
.history-controls { display: inline-grid; grid-template-columns: repeat(3,1fr); padding: 4px; background: #061725; border-radius: 10px; flex-shrink: 0; }
.history-button { min-height: 37px; min-width: 78px; padding: 0 13px; border: 0; border-radius: 7px; color: var(--muted-strong); background: transparent; font-size: 12px; font-weight: 650; }
.history-button:hover { color: var(--accent-deep); background: #214557; }
.history-button.is-active { color: var(--accent-deep); background: var(--panel); box-shadow: 0 2px 5px #173d2a12; }
.gauge-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; scroll-margin-top: 20px; }
.gauge-card { --severity: var(--unavailable); position: relative; display: flex; flex-direction: column; min-width: 0; padding: 23px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--panel); box-shadow: var(--shadow-md); scroll-margin-top: 20px; }
.gauge-card.is-local { border: 1px solid #508eaa; box-shadow: 0 0 0 2px #6fe4ff12; }
.gauge-card::before { content: ""; position: absolute; top: -1px; left: 23px; width: 31px; height: 3px; background: var(--severity); border-radius: 0 0 2px 2px; }
.gauge-card:target, .gauge-card.is-highlighted { box-shadow: 0 0 0 3px #6fe4ff70; }
.severity-monitoring { --severity: var(--monitoring); }
.severity-normal { --severity: var(--normal); }
.severity-action { --severity: var(--action); }
.severity-minor { --severity: var(--minor); }
.severity-moderate { --severity: var(--moderate); }
.severity-major { --severity: var(--major); }
.severity-unavailable { --severity: var(--unavailable); }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 9px; min-height: 99px; }
.card-location { min-width: 0; }
.position-pill { font-size: 12px; line-height: 1.6; text-transform: uppercase; color: var(--accent-deep); font-weight: 750; letter-spacing: .12em; }
.gauge-name { font-size: 17px; line-height: 1.25; letter-spacing: -.03em; margin: 8px 0 0; font-weight: 650; text-wrap: balance; }
.gauge-site { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.status-badge { display: inline-flex; justify-content: center; padding: 5px 7px; margin-top: -2px; max-width: 105px; flex: 0 0 auto; color: var(--severity); background: color-mix(in srgb, var(--severity) 13%, #081b29); border-radius: 5px; font-size: 12px; font-weight: 650; line-height: 1.35; text-align: center; }
.reading-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-top: 20px; }
.reading-row > div:first-child { min-width: 0; }
.reading-label { display: block; color: var(--muted); font-size: 12px; }
.reading-value { display: flex; align-items: baseline; gap: 7px; margin-top: 5px; }
.stage-value { font-size: clamp(43px,4.8vw,62px); font-weight: 760; letter-spacing: -.075em; line-height: 1; }
.stage-unit { color: #bfd2df; font-size: 18px; }
.sensor-label { display: block; margin-top: 8px; color: var(--muted); font-size: 12px; min-height: 14px; }
.observed-value { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.trend-chip { display: inline-flex; align-items: center; gap: 5px; margin-top: 30px; padding: 4px 7px; color: var(--muted-strong); background: #183140; border-radius: 5px; font-size: 12px; font-weight: 650; white-space: nowrap; }
.trend-chip.is-rising { color: #ffd198; background: #392c20; }
.trend-chip.is-falling { color: #9de9c5; background: #163930; }
.trend-icon { font-size: 14px; }
.sparkline-box { position: relative; height: 100px; margin-top: 22px; overflow: hidden; border-bottom: 1px solid var(--line); }
.sparkline { display: block; width: 100%; height: 100%; }
.sparkline-grid { stroke: #375363; stroke-width: 1; fill: none; vector-effect: non-scaling-stroke; stroke-dasharray: 3 4; }
.sparkline-area { fill: color-mix(in srgb, var(--severity) 8%, transparent); }
.sparkline-line { fill: none; stroke: var(--severity); stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.sparkline-dot { fill: var(--severity); stroke: #fff; stroke-width: 2; vector-effect: non-scaling-stroke; }
.sparkline-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.chart-meta { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 3px 8px; margin-top: 7px; min-height: 26px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.chart-range { text-align: right; }
.metrics { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); margin-top: 13px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.metric { padding: 12px 0; min-width: 0; }
.metric:nth-child(odd) { padding-right: 10px; }
.metric:nth-child(even) { border-left: 1px solid var(--line); padding-left: 18px; }
.metric:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
.metric span { display: block; color: var(--muted); font-size: 12px; }
.metric strong { display: block; margin-top: 3px; color: var(--muted-strong); font-size: 14px; font-weight: 700; overflow-wrap: anywhere; }
.stage-meter { margin-top: 19px; }
.stage-meter-label { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; font-size: 12px; color: var(--muted); }
.stage-meter-label strong { color: var(--severity); font-weight: 600; text-align: right; }
.meter-track { display: block; width: 100%; height: 5px; margin-top: 9px; appearance: none; -webkit-appearance: none; border: 0; border-radius: 10px; overflow: hidden; background: #344957; }
.meter-track::-webkit-progress-bar { background: #344957; border-radius: 10px; }
.meter-track::-webkit-progress-value { background: var(--severity); border-radius: 10px; }
.meter-track::-moz-progress-bar { background: var(--severity); border-radius: 10px; }
.threshold-note { margin: 11px 0 0; min-height: 52px; font-size: 12px; line-height: 1.65; color: var(--muted); }
.card-links { display: flex; gap: 18px; margin-top: auto; padding-top: 13px; }
.card-link { display: inline-flex; align-items: center; gap: 5px; min-height: 36px; font-size: 12px; font-weight: 650; color: var(--accent-deep); text-decoration: none; }
.card-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.card-link svg { width: 13px; height: 13px; }
.route-panel { display: flex; flex-wrap: wrap; align-items: center; gap: 0 30px; padding: 20px 0; margin-top: 16px; border-bottom: 1px solid var(--line); }
.route-heading { min-width: 180px; }
.route-heading h2 { font-size: 15px; font-weight: 650; margin: 3px 0 0; letter-spacing: -.03em; }
.route-heading p { font-size: 12px; color: var(--muted); margin: 5px 0 0; }
.jump-nav { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: center; flex: 1; gap: 12px; }
.jump-button { display: flex; align-items: center; justify-content: flex-start; gap: 9px; padding: 8px 0; border: 0; background: none; text-align: left; color: var(--muted-strong); }
.jump-button:hover strong { text-decoration: underline; text-underline-offset: 4px; }
.route-step { display: grid; place-items: center; width: 27px; height: 27px; flex-shrink: 0; border: 1px solid var(--line-strong); border-radius: 50%; font-size: 12px; color: var(--accent); }
.jump-button.is-local-route .route-step { color: #fff; background: var(--accent-deep); border-color: var(--accent-deep); }
.jump-button svg { display: none; width: 16px; height: 16px; }
.jump-button strong { font-size: 12px; display: block; }
.jump-button small { display: block; font-size: 12px; color: var(--muted); }
.route-arrow { color: #91b5c8; }
.route-caption { flex-basis: 100%; color: var(--muted); font-size: 12px; margin: 13px 0 0; }
.system-map-heading, .official-heading { display: flex; justify-content: space-between; align-items: end; gap: 32px; }
.system-map-heading p, .official-heading p { max-width: 300px; text-align: right; color: var(--muted); font-size: 12px; margin: 0 0 2px; }
.system-map-wrap { position: relative; height: 260px; margin-top: 22px; border: 1px solid #355364; border-radius: 15px; overflow: hidden; background: #091f2f; }
.system-map-svg { width: 100%; height: 260px; }
.system-map-mobile-svg { display: none; }
.map-grid-line { fill: none; stroke: #76b6d015; stroke-width: 1; }
.map-river-shadow { fill: none; stroke: #174153; stroke-width: 25; stroke-linecap: round; }
.map-river { fill: none; stroke: #63cfe9; stroke-width: 8; stroke-linecap: round; }
.map-connector { fill: none; stroke: #7db2c9; stroke-width: 1; stroke-dasharray: 3 3; }
.map-river-node { fill: #fff; stroke: #79ddf4; stroke-width: 3; }
.map-river-node.is-local { fill: #83e7ff; }
.river-direction { fill: none; stroke: #fff; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.map-station { position: absolute; top: 25px; display: grid; width: 172px; min-height: 90px; padding: 12px 15px; border: 1px solid #406476; border-radius: 9px; background: #0c283bef; text-align: left; color: var(--text); box-shadow: 0 4px 12px #00000025; transition: background .15s, box-shadow .15s; }
.map-station:hover { background: var(--panel); box-shadow: 0 4px 20px #00000045; }
.map-station.is-local { border-color: #6fe4ff; }
.map-uvalde { left: calc(17% - 86px); }
.map-crystal { left: calc(50% - 86px); }
.map-asherton { left: calc(83% - 86px); }
.map-station small { font-size: 12px; color: var(--muted); text-transform: uppercase; font-weight: 650; letter-spacing: .08em; }
.map-station strong { font-size: 15px; letter-spacing: -.02em; margin-top: 2px; }
.map-station b { font-size: 12px; font-weight: 650; margin-top: 1px; color: var(--accent-deep); }
.map-link-mark { position: absolute; top: 34px; right: 14px; color: #9fd4e7; font-size: 15px; }
.map-legend { position: absolute; left: 19px; bottom: 13px; font-size: 12px; color: #bed5e2; }
.map-legend-item { display: flex; align-items: center; gap: 7px; }
.map-legend-swatch { display: block; height: 3px; width: 20px; background: #63cfe9; border-radius: 3px; }
.local-waterways { display: flex; align-items: center; gap: 13px; padding: 16px 4px 0; }
.local-waterways > svg { width: 45px; height: 39px; flex-shrink: 0; }
.local-waterways strong { display: block; font-size: 12px; font-weight: 650; color: var(--muted-strong); }
.local-waterways p { font-size: 12px; color: var(--muted); margin: 3px 0 0; }
.map-lake { fill: #17394b; stroke: #8ab6c9; stroke-width: 1.5; }
.map-overflow-shadow { stroke: #07121d; stroke-width: 5; }
.map-overflow { fill: none; stroke: #8ab6c9; stroke-width: 2; stroke-dasharray: 3 3; }
.map-label { fill: var(--muted-strong); }
.map-sub-label { fill: var(--muted); }
.unmeasured-label { margin-left: auto; white-space: nowrap; color: var(--muted); font-size: 12px; padding: 4px 7px; border: 1px dashed var(--line-strong); border-radius: 5px; }
.map-caption { margin: 13px 4px 0; font-size: 12px; line-height: 1.7; color: var(--muted); }
.official-panel { margin-top: 34px; padding: 30px 0 0; border-top: 1px solid var(--line); }
.official-links-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin-top: 22px; }
.official-link { display: grid; grid-template-columns: 1fr auto; position: relative; min-width: 0; padding: 19px 16px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); text-decoration: none; }
.official-link:hover { border-color: #6fe4ff; background: #143347; }
.official-link > svg { grid-column: 1; width: 23px; height: 23px; margin-bottom: 17px; color: var(--accent); }
.official-link > span { grid-column: 1 / -1; }
.official-link strong { display: block; font-size: 12px; font-weight: 650; }
.official-link small { display: block; color: var(--muted); margin-top: 4px; font-size: 12px; }
.official-link b { position: absolute; right: 15px; top: 16px; color: #90c3d8; font-weight: 500; }
.official-note { font-size: 12px; color: var(--muted); margin: 12px 0 0; }
.data-notes { margin-top: 26px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.data-notes-summary { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 20px 0; cursor: pointer; list-style: none; }
.data-notes-summary::-webkit-details-marker { display: none; }
.data-notes-summary::after { content: "+"; font-size: 22px; color: var(--accent); }
.data-notes[open] .data-notes-summary::after { content: "−"; }
.data-notes-summary h2 { margin: 4px 0 0; font-size: 17px; line-height: 1.2; letter-spacing: -.03em; font-weight: 650; }
.data-notes-summary p { margin: 0 0 0 auto; color: var(--muted); font-size: 12px; }
.data-notes-body { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 24px; padding-bottom: 23px; }
.data-note-card strong { font-size: 12px; font-weight: 650; }
.data-note-card p { font-size: 12px; color: var(--muted); margin: 6px 0 0; line-height: 1.7; }
.safety-note { display: flex; align-items: flex-start; gap: 11px; padding: 22px 0; color: var(--muted); }
.safety-note > svg { width: 18px; height: 18px; margin-top: 2px; flex-shrink: 0; }
.safety-note strong { font-size: 12px; font-weight: 650; }
.safety-note p { font-size: 12px; margin: 3px 0 0; line-height: 1.7; }
.app-footer { display: flex; justify-content: space-between; gap: 25px; padding-top: 17px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.app-footer span:last-child { max-width: 50%; text-align: right; }
.install-dialog { width: min(450px,calc(100% - 32px)); padding: 0; border: 1px solid var(--line); border-radius: 18px; color: var(--text); background: var(--panel); box-shadow: 0 25px 120px #051f3180; }
.install-dialog::backdrop { background: #08253299; backdrop-filter: blur(4px); }
.dialog-content { position: relative; padding: 30px; }
.dialog-close { position: absolute; top: 15px; right: 15px; border: 0; width: 35px; height: 35px; border-radius: 50%; background: var(--bg-2); color: var(--muted-strong); font-size: 23px; }
.dialog-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: #174153; color: var(--accent-deep); }
.dialog-icon svg { width: 24px; height: 24px; }
.install-dialog h2 { margin: 18px 0 12px; font-size: 25px; line-height: 1.15; letter-spacing: -.045em; font-weight: 650; }
.install-dialog p { color: var(--muted-strong); margin: 11px 0; font-size: 12px; line-height: 1.7; }
.install-dialog .pwa-status { font-size: 12px; color: var(--muted); }
.dialog-button { width: 100%; min-height: 43px; margin-top: 12px; border: 0; border-radius: 8px; background: var(--accent-deep); color: #fff; font-size: 13px; font-weight: 650; }
.skeleton { color: inherit; opacity: .45; animation: loading 1.5s ease-in-out infinite alternate; }
.noscript { max-width: 1200px; margin: 20px auto; padding: 16px; border: 1px solid #8a4c60; border-radius: 10px; color: #ffb0bd; background: #35212d; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes loading { to { opacity: .8; } }
@media (max-width: 1120px) {
  .app-shell { padding-left: 25px; padding-right: 25px; }
  .hero { gap: 30px; padding: 32px; }
  .gauge-grid { gap: 13px; }
  .gauge-card { padding: 19px; }
  .card-head { flex-wrap: wrap; min-height: 129px; gap: 7px; align-content: flex-start; }
  .card-location { width: 100%; }
  .gauge-name { text-wrap: initial; }
  .status-badge { margin: 0; max-width: 100%; }
  .history-heading { display: block; }
  .history-heading > p { margin-top: 6px; }
  .trend-chip { padding: 3px 5px; font-size: 12px; }
  .official-links-grid { gap: 9px; }
}
@media (max-width: 850px) {
  .app-shell { padding: calc(22px + var(--safe-top)) 22px calc(24px + var(--safe-bottom)); }
  .brand-copy h1 { font-size: 23px; }
  .text-button { width: 43px; padding: 0; }
  .text-button span { display: none; }
  .hero { grid-template-columns: 1fr .65fr; gap: 22px; padding: 27px; }
  .hero h2 { font-size: 32px; }
  .hero-reading { padding-left: 23px; }
  .hero-stage { font-size: 66px; }
  .hero-summary { font-size: 12px; }
  .feed-item { padding: 0 13px; }
  .feed-item strong { font-size: 12px; }
  .gauge-grid { grid-template-columns: 1fr; gap: 16px; }
  .gauge-card { padding: 25px; display: grid; grid-template-columns: 1fr 1fr; gap: 0 27px; }
  .gauge-card::before { left: 25px; }
  .card-head { grid-column: 1; grid-row: 1; min-height: 99px; flex-wrap: nowrap; }
  .card-location { width: auto; }
  .status-badge { max-width: 100px; }
  .reading-row { grid-column: 1; grid-row: 2 / 4; margin-top: 8px; }
  .stage-value { font-size: 62px; }
  .trend-chip { font-size: 12px; }
  .sparkline-box { grid-column: 2; grid-row: 1; height: 93px; margin-top: 0; }
  .chart-meta { grid-column: 2; grid-row: 2; min-height: 23px; margin-top: 6px; }
  .metrics { grid-column: 2; grid-row: 3 / 5; margin-top: 10px; }
  .metric { padding: 10px 0; }
  .stage-meter { grid-column: 1; grid-row: 4; margin-top: 12px; }
  .threshold-note { grid-column: 1; grid-row: 5; min-height: 0; margin-top: 11px; }
  .card-links { grid-column: 2; grid-row: 5; padding-top: 10px; align-self: end; }
  .system-map-heading h2, .official-heading h2 { font-size: 23px; }
  .system-map-heading p, .official-heading p { max-width: 230px; }
  .route-heading { min-width: 150px; }
  .jump-nav { gap: 8px; }
  .jump-button { gap: 6px; }
  .jump-button small { font-size: 12px; }
  .route-step { width: 24px; height: 24px; }
  .official-links-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
  .official-link { grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 18px; }
  .official-link > svg { margin: 0; }
  .official-link > span { grid-column: 2; }
  .official-link b { position: static; }
  .data-notes-body { gap: 18px; }
}
@media (max-width: 620px) {
  .app-shell { padding: calc(18px + var(--safe-top)) 17px calc(22px + var(--safe-bottom)); }
  .app-header { gap: 9px; padding-bottom: 17px; }
  .brand { gap: 9px; }
  .brand-mark { width: 37px; height: 42px; border-radius: 12px 12px 15px 3px; }
  .brand-mark svg { width: 25px; height: 25px; }
  .brand-eyebrow { font-size: 12px; letter-spacing: .12em; }
  .brand-copy h1 { font-size: 17px; letter-spacing: -.045em; margin-top: 4px; }
  .brand-copy p { display: none; }
  .header-actions { gap: 5px; }
  .icon-button, .text-button { width: 36px; height: 39px; padding: 0; border-radius: 7px; }
  .refresh-label { display: none; }
  .public-info { font-size: 12px; padding-top: 11px; padding-bottom: 13px; gap: 8px; align-items: flex-start; }
  .public-info-icon { margin-top: 2px; }
  .public-info > div:last-child { display: block; }
  .public-info strong { display: none; }
  .notice { font-size: 12px; padding: 12px; }
  .hero { grid-template-columns: 1fr; padding: 26px 23px; gap: 25px; border-radius: 17px; }
  .hero-copy { padding: 0; }
  .hero h2 { font-size: 31px; line-height: 1.1; margin-top: 13px; margin-bottom: 12px; }
  .hero-kicker { font-size: 12px; letter-spacing: .1em; }
  .hero-summary { font-size: 12px; line-height: 1.65; }
  .hero-note { margin-top: 14px; font-size: 12px; }
  .hero-reading { display: grid; grid-template-columns: 1fr auto; padding: 22px 0 0; border-left: 0; border-top: 1px solid #ffffff24; }
  .hero-reading-label { grid-column: 1; grid-row: 1; font-size: 12px; }
  .hero-reading-place { grid-column: 1; grid-row: 2; font-size: 12px; margin-top: 4px; }
  .hero-reading-value { grid-column: 1; grid-row: 3; margin-top: 13px; gap: 8px; }
  .hero-stage { font-size: 77px; }
  .hero-unit { font-size: 21px; }
  .hero-trend { grid-column: 2; grid-row: 3; margin: 15px 0 0; align-self: center; font-size: 12px; }
  .hero-reading-footnote { grid-column: 1 / -1; grid-row: 4; margin-top: 13px; font-size: 12px; }
  .feed-strip { grid-template-columns: 1fr 1fr; gap: 15px 0; padding: 18px 2px 14px; }
  .feed-item { padding: 0 0 0 14px; }
  .feed-item:nth-child(odd) { border-right: 1px solid var(--line); padding-left: 0; padding-right: 12px; }
  .feed-item:nth-child(even) { border-right: 0; }
  .feed-item span { font-size: 12px; }
  .feed-item strong { font-size: 12px; margin-top: 3px; }
  .feed-note { font-size: 12px; margin: 9px 2px 0; }
  .history-panel { flex-direction: column; align-items: stretch; gap: 15px; margin-top: 29px; }
  .history-heading h2 { font-size: 28px; }
  .history-heading > p { font-size: 12px; }
  .history-note { font-size: 12px; margin-top: 7px; }
  .history-controls { align-self: stretch; }
  .history-button { min-height: 38px; font-size: 12px; }
  .gauge-card { display: flex; padding: 23px; gap: 0; }
  .card-head { flex-wrap: nowrap; min-height: 80px; }
  .gauge-name { font-size: 18px; max-width: 210px; }
  .position-pill { font-size: 12px; }
  .status-badge { font-size: 12px; max-width: 104px; }
  .gauge-site { font-size: 12px; }
  .reading-row { margin-top: 20px; }
  .stage-value { font-size: 67px; }
  .reading-label { font-size: 12px; }
  .sensor-label, .observed-value { font-size: 12px; }
  .trend-chip { padding: 4px 8px; font-size: 12px; }
  .sparkline-box { margin-top: 20px; height: 99px; }
  .chart-meta { margin-top: 8px; }
  .metrics { margin-top: 12px; }
  .metric { padding: 12px 0; }
  .metric span { font-size: 12px; }
  .metric strong { font-size: 15px; }
  .stage-meter { margin-top: 18px; }
  .stage-meter-label { font-size: 12px; }
  .threshold-note { font-size: 12px; margin-top: 12px; }
  .card-links { align-self: auto; margin-top: 8px; padding-top: 0; gap: 23px; }
  .card-link { min-height: 39px; font-size: 12px; }
  .route-panel { display: block; margin-top: 11px; padding-bottom: 19px; }
  .route-heading { display: flex; justify-content: space-between; align-items: end; gap: 12px; }
  .route-heading p { max-width: 105px; text-align: right; font-size: 12px; }
  .jump-nav { margin-top: 13px; gap: 6px; }
  .jump-button { gap: 6px; }
  .jump-button strong { font-size: 12px; }
  .jump-button small { display: none; }
  .route-step { width: 21px; height: 21px; font-size: 12px; }
  .route-arrow { font-size: 12px; }
  .route-caption { font-size: 12px; }
  .section-panel { margin-top: 28px; }
  .system-map-heading, .official-heading { display: block; }
  .system-map-heading h2, .official-heading h2 { font-size: 25px; max-width: 290px; }
  .system-map-heading p, .official-heading p { max-width: 100%; text-align: left; margin-top: 10px; font-size: 12px; }
  .system-map-wrap { height: 386px; margin-top: 17px; }
  .system-map-svg { display: none; }
  .system-map-mobile-svg { display: block; width: 100%; height: 360px; }
  .map-station { left: 30.6%; width: calc(65% - 10px); min-height: 88px; padding: 12px 15px; }
  .map-uvalde { top: 29px; }
  .map-crystal { top: 140px; }
  .map-asherton { top: 251px; }
  .map-station small { font-size: 12px; }
  .map-station strong { font-size: 16px; }
  .map-station b { font-size: 12px; }
  .map-legend { bottom: 10px; left: 16px; font-size: 12px; }
  .local-waterways { align-items: flex-start; gap: 10px; padding-top: 17px; flex-wrap: wrap; }
  .local-waterways > div { flex: 1; }
  .local-waterways strong { font-size: 12px; }
  .local-waterways p { font-size: 12px; line-height: 1.6; }
  .unmeasured-label { display: none; }
  .map-caption { font-size: 12px; }
  .official-panel { margin-top: 26px; padding-top: 26px; }
  .official-links-grid { grid-template-columns: 1fr; gap: 9px; margin-top: 17px; }
  .official-link { min-height: 78px; padding: 16px; gap: 13px; }
  .official-link strong { font-size: 12px; }
  .official-link small { font-size: 12px; }
  .official-note { font-size: 12px; }
  .data-notes-summary { gap: 16px; }
  .data-notes-summary p { display: none; }
  .data-notes-body { grid-template-columns: 1fr; gap: 18px; }
  .data-note-card p { font-size: 12px; }
  .app-footer { display: block; font-size: 12px; }
  .app-footer span { display: block; }
  .app-footer span:last-child { max-width: none; text-align: left; margin-top: 5px; }
}
@media (max-width: 370px) {
  .app-shell { padding-left: 12px; padding-right: 12px; }
  .brand-copy h1 { font-size: 15px; }
  .brand-mark { width: 31px; height: 37px; }
  .brand-eyebrow { font-size: 12px; }
  .header-actions { gap: 4px; }
  .icon-button, .text-button { width: 33px; }
  .hero, .gauge-card { padding: 21px; }
  .hero h2 { font-size: 29px; }
  .hero-stage { font-size: 69px; }
  .status-badge { max-width: 87px; font-size: 12px; }
  .gauge-name { font-size: 17px; }
  .stage-value { font-size: 60px; }
  .route-step { width: 18px; height: 18px; }
  .jump-button { gap: 4px; }
  .jump-button strong { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  body { background: var(--panel); color: #f5fafc; }
  .app-shell { max-width: none; padding: 0; }
  .header-actions, .notice, .jump-nav, .history-controls, .card-links, .official-links-grid { display: none !important; }
  .hero { color: #f5fafc; background: var(--panel); border: 1px solid #466373; padding: 20px; }
  .hero::before { display: none; }
  .hero * { color: #173441 !important; }
  .hero-reading { border-color: #466373; }
  .gauge-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .gauge-card { display: flex; padding: 15px; }
  .gauge-card, .river-context, .official-panel { break-inside: avoid; }
  .stage-value { font-size: 42px; }
  .history-panel { margin-top: 20px; }
  .history-note { display: block; }
  .system-map-wrap { height: 220px; }
  .system-map-svg { display: block; height: 220px; }
  .system-map-mobile-svg { display: none; }
  .map-station { top: 20px; width: 130px; min-height: 80px; }
  .map-uvalde { left: calc(17% - 65px); }
  .map-crystal { left: calc(50% - 65px); }
  .map-asherton { left: calc(83% - 65px); }
}

/* Official weather bulletins remain separate from the gauge observations. */
.weather-alerts { margin: 16px 0 0; padding: 15px 18px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); }
.alerts-topline { display: flex; justify-content: space-between; align-items: center; gap: 15px; }
.alerts-heading { display: flex; align-items: center; gap: 8px; }
.alerts-heading svg { flex-shrink: 0; width: 18px; height: 18px; color: var(--accent); }
.alerts-heading h2 { margin: 0; font-size: 12px; font-weight: 650; }
.alerts-topline > a { color: var(--accent-deep); font-size: 12px; text-decoration: none; }
.alerts-topline > a:hover { text-decoration: underline; text-underline-offset: 3px; }
.alerts-status { margin: 6px 0 0 26px; color: var(--muted); font-size: 12px; }
.alerts-checked { display: block; margin: 5px 0 0 26px; font-size: 12px; color: var(--muted); }
.alerts-checked:empty { display: none; }
.weather-alerts[data-status="active"] { border-color: #786844; background: #2b281e; }
.weather-alerts[data-status="active"] .alerts-heading svg { color: #ffe096; }
.weather-alerts[data-status="unavailable"] { border-color: #536472; background: #172632; }
.alert-card { margin-top: 14px; padding: 17px 0 3px; border-top: 1px solid #675b3f; }
.alert-card h3 { margin: 0; font-size: 16px; line-height: 1.4; color: #ffe096; }
.alert-card h3 a { text-decoration: none; }
.alert-card h3 a:hover { text-decoration: underline; text-underline-offset: 3px; }
.alert-card p { margin: 7px 0; font-size: 12px; line-height: 1.65; color: #e7d7b6; }
.alert-card .alert-meta { margin: 5px 0 0; font-size: 12px; color: #cabc9c; }
.alert-details { margin-top: 11px; font-size: 12px; }
.alert-details summary { cursor: pointer; color: #ffe096; padding: 4px 0; font-weight: 650; }
.alert-details pre, .alert-description, .alert-instruction { max-width: 100%; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; color: #e7d7b6; line-height: 1.7; }
@media (max-width: 620px) {
  .weather-alerts { padding: 13px 14px; margin-top: 13px; }
  .alerts-topline { flex-wrap: wrap; gap: 5px; }
  .alerts-heading h2 { font-size: 12px; }
  .alerts-topline > a { margin-left: 26px; font-size: 12px; }
  .alerts-status { font-size: 12px; margin-top: 8px; }
  .alerts-checked { font-size: 12px; }
  .alert-card h3 { font-size: 14px; }
}
.alert-details > p { white-space: pre-wrap; overflow-wrap: anywhere; }

/* Optional context stays behind native disclosures so the river readings stay first. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.gauge-grid { align-items: start; }
.gauge-details { margin-top: 12px; padding-top: 4px; border-top: 1px solid var(--line); }
.gauge-details > summary { display: flex; justify-content: space-between; align-items: center; gap: 15px; min-height: 40px; cursor: pointer; color: var(--accent-deep); font-size: 12px; font-weight: 650; list-style: none; }
.gauge-details > summary::-webkit-details-marker, .rain-summary::-webkit-details-marker { display: none; }
.details-chevron { display: inline-block; font-size: 21px; line-height: 1; font-weight: 400; transition: transform .16s; }
.gauge-details[open] > summary .details-chevron, .rain-panel[open] > summary .details-chevron { transform: rotate(45deg); }
.gauge-details-body { padding: 5px 0 7px; font-size: 12px; line-height: 1.6; }
.gauge-details-body h3 { margin: 20px 0 8px; color: var(--text); font-size: 12px; font-weight: 650; }
.gauge-details-body p { margin: 8px 0; color: var(--muted); }
.gauge-details-body .context-status { color: var(--muted-strong); }
.context-source { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 5px 10px; }
.context-source a { color: var(--accent-deep); text-underline-offset: 3px; }
.context-source small { color: var(--muted); font-size: 12px; }
.crest-list, .impact-list { margin: 0; padding: 0; list-style: none; }
.crest-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 7px 0; border-bottom: 1px solid #2a4556; }
.crest-list strong { color: var(--muted-strong); white-space: nowrap; font-weight: 650; }
.crest-date { display: flex; flex-direction: column; color: var(--muted-strong); }
.crest-date small { margin-top: 2px; color: var(--muted); font-size: 12px; }
.gauge-details-body .context-caution { padding: 10px 12px; border-left: 2px solid #4b768c; background: #0c2434; color: #c6dbe6; font-size: 12px; }
.context-thresholds { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; margin: 9px 0 12px; }
.context-thresholds div { padding: 7px 10px; background: #102c3c; border-radius: 6px; }
.context-thresholds dt { color: var(--muted); font-size: 12px; }
.context-thresholds dd { margin: 2px 0 0; color: var(--muted-strong); font-size: 12px; font-weight: 650; }
.impact-disclosure { margin-top: 13px; }
.impact-disclosure > summary, .reporting-times > summary { padding: 7px 0; cursor: pointer; color: var(--accent-deep); font-size: 12px; font-weight: 650; }
.impact-list li { padding: 10px 0; border-bottom: 1px solid #2a4556; }
.impact-list li:last-child { border-bottom: 0; }
.impact-list strong { color: var(--muted-strong); }
.impact-list p { margin: 3px 0 0; }
.context-retry { margin-top: 8px; }
.rain-panel { margin: 20px 0 0; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--panel); box-shadow: var(--shadow-md); overflow: hidden; }
.rain-summary { display: flex; align-items: center; gap: 15px; padding: 21px 24px; cursor: pointer; list-style: none; }
.rain-icon { display: grid; place-items: center; width: 42px; height: 42px; flex-shrink: 0; background: #133a4a; color: var(--accent); border-radius: 10px; }
.rain-icon svg { width: 25px; height: 25px; }
.rain-summary-copy { min-width: 0; }
.rain-summary-copy strong { display: block; font-size: 17px; letter-spacing: -.02em; font-weight: 650; }
.rain-summary-copy > span { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.rain-summary-action { display: flex; gap: 15px; align-items: center; margin-left: auto; color: var(--accent-deep); font-size: 12px; font-weight: 650; white-space: nowrap; }
.rain-panel[open] .rain-summary { border-bottom: 1px solid var(--line); background: #103044; }
.rain-body { padding: 22px 24px 19px; }
.rain-intro { display: flex; justify-content: space-between; align-items: flex-start; gap: 25px; }
.rain-intro p { max-width: 760px; margin: 0; font-size: 12px; color: var(--muted); line-height: 1.7; }
.extras-refresh { flex-shrink: 0; min-height: 35px; border: 1px solid var(--line-strong); background: var(--panel); color: var(--accent-deep); padding: 6px 11px; border-radius: 7px; font: 700 14px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif; }
.extras-refresh:hover { background: var(--panel-soft); }
.extras-refresh:disabled { opacity: .65; cursor: wait; }
.extras-status { margin: 16px 0 10px; font-size: 12px; color: var(--muted-strong); }
.extras-status[data-state='unavailable'], .extras-status[data-state='stale'] { color: #ffe096; }
.rainfall-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 5px 16px; margin-top: 18px; }
.rainfall-heading h3 { margin: 0; font-size: 14px; font-weight: 650; }
.rainfall-heading a { font-size: 12px; color: var(--accent-deep); text-underline-offset: 3px; }
.rainfall-note { margin: 6px 0 15px; color: var(--muted); font-size: 12px; }
.rainfall-table { width: 100%; border-collapse: collapse; font-size: 12px; text-align: left; }
.rainfall-table thead th { color: var(--muted); font-size: 12px; font-weight: 600; padding: 10px 14px; background: #0b2131; }
.rainfall-table th:not(:first-child), .rainfall-table td { text-align: right; }
.rainfall-table thead th:first-child { border-radius: 7px 0 0 7px; }
.rainfall-table thead th:last-child { border-radius: 0 7px 7px 0; }
.rainfall-table tbody th { padding: 17px 14px; font-size: 12px; font-weight: 650; }
.rainfall-table td { padding: 12px 14px; font-size: 19px; letter-spacing: -.035em; white-space: nowrap; }
.rainfall-table tr { border-bottom: 1px solid #2a4556; }
.rainfall-table thead tr { border-bottom: 0; }
.rainfall-table td span { padding-left: 3px; color: var(--muted); font-size: 12px; letter-spacing: 0; }
.rainfall-table td small { display: block; color: var(--muted); font-size: 12px; letter-spacing: 0; }
.rainfall-table td.is-delayed { color: #ffe096; }
.rainfall-table tbody th small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; font-weight: 400; }
.rain-source-time { margin: 10px 0 0; color: var(--muted); font-size: 12px; }
.reporting-times { margin: 2px 0 0; }
.reporting-times dl { display: grid; grid-template-columns: max-content 1fr; gap: 7px 16px; margin: 6px 0 14px; padding: 12px 15px; border-radius: 7px; background: #0a2030; font-size: 12px; color: var(--muted); }
.reporting-times dt { font-weight: 650; color: var(--muted-strong); }
.reporting-times dd { margin: 0; }
.radar-section { margin-top: 25px; padding-top: 22px; border-top: 1px solid var(--line); }
.radar-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; }
.radar-heading .section-eyebrow { color: var(--accent-deep); font-size: 12px; letter-spacing: .13em; text-transform: uppercase; font-weight: 650; }
.radar-heading h3 { margin: 4px 0 0; font-size: 18px; letter-spacing: -.02em; font-weight: 650; }
.radar-heading a { color: var(--accent-deep); font-size: 12px; text-decoration: none; }
.radar-heading a:hover { text-decoration: underline; text-underline-offset: 3px; }
.radar-status { margin: 11px 0; color: var(--muted); font-size: 12px; }
.radar-figure { max-width: 760px; margin: 15px auto 0; }
.radar-figure img { width: 100%; height: auto; border: 1px solid var(--line); border-radius: 9px; background: #112c3c; }
.radar-figure figcaption { margin: 9px 0; font-size: 12px; color: var(--muted); }
.radar-note { margin: 12px 0 0; font-size: 12px; color: var(--muted); }
.extras-footnote { margin: 19px 0 0; padding-top: 15px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
@media (min-width: 621px) and (max-width: 850px) {
  .gauge-details { grid-column: 1 / -1; grid-row: 6; margin-top: 15px; }
  .gauge-details-body { max-width: 540px; }
}
@media (max-width: 620px) {
  .rain-panel { margin-top: 16px; }
  .rain-summary { padding: 18px 17px; gap: 11px; }
  .rain-icon { width: 36px; height: 39px; }
  .rain-summary-copy strong { font-size: 16px; }
  .rain-summary-copy > span { font-size: 12px; }
  .rain-summary-action { font-size: 0; gap: 0; }
  .rain-body { padding: 17px; }
  .rain-intro { display: block; }
  .rain-intro p { font-size: 12px; }
  .rain-intro .extras-refresh { margin-top: 10px; }
  .rainfall-table thead th { padding: 9px 6px; font-size: 12px; }
  .rainfall-table tbody th { padding: 13px 6px; font-size: 12px; }
  .rainfall-table td { padding: 11px 6px; font-size: 17px; }
  .rainfall-table td span { font-size: 12px; padding-left: 2px; }
  .rainfall-table td small { font-size: 12px; }
  .rainfall-table tbody th small { font-size: 12px; }
  .reporting-times dl { grid-template-columns: 1fr; gap: 4px; padding: 11px; }
  .reporting-times dd { margin-bottom: 5px; }
  .radar-heading { align-items: start; gap: 10px; }
  .radar-heading h3 { font-size: 16px; }
  .radar-heading a { max-width: 110px; text-align: right; font-size: 12px; }
  .radar-heading .section-eyebrow { font-size: 12px; }
}
@media print {
  .rain-panel:not([open]), .gauge-details:not([open]), .extras-refresh { display: none !important; }
  .rain-panel { break-inside: avoid; }
}


/* Readable public dashboard: familiar dark panels and explicit, touch-sized day controls. */
body { font-size: 15px; background: radial-gradient(ellipse at 80% 0, #12364a 0, transparent 55%), var(--bg-0); }
.app-shell { width: min(1380px, 100%); }
.app-header { padding-bottom: 18px; }
.brand-mark { color: var(--accent); background: #12384a; border: 1px solid #3d6b7e; }
.brand-copy h1 { letter-spacing: -.035em; }
.brand-copy p { font-size: 14px; }
.brand-eyebrow { font-size: 12px; letter-spacing: .08em; }
.icon-button, .text-button { min-height: 44px; height: auto; font-size: 14px; font-weight: 750; }
.icon-button, .dialog-button { color: #061b26; background: var(--accent); border-color: var(--accent); }
.text-button { background: #102a3b; }
.text-button:hover { background: #1c4054; }
.public-info { font-size: 13px; line-height: 1.55; padding: 13px 0; }
.hero { padding: 27px 30px; gap: 28px; border: 1px solid #3e6076; box-shadow: var(--shadow-lg); background: linear-gradient(115deg, #13364b, #0a2333); }
.hero h2 { font-size: clamp(28px, 3.1vw, 42px); font-weight: 760; letter-spacing: -.035em; }
.hero-kicker, .hero-reading-label { font-size: 12px; font-weight: 750; letter-spacing: .065em; }
.hero-summary { font-size: 16px; line-height: 1.6; }
.hero-note { font-size: 13px; margin-top: 16px; }
.hero-reading-place { font-size: 16px; }
.hero-reading-value { margin-top: 12px; }
.hero-stage { font-weight: 780; letter-spacing: -.055em; }
.hero-reading-footnote { font-size: 12px; }
.hero-trend { font-size: 15px; }
.notice { font-size: 14px; }
.feed-strip { margin-top: 14px; border: 1px solid var(--line); border-radius: 12px; background: #0c2231; padding: 15px; }
.feed-item span { font-size: 12px; letter-spacing: .025em; }
.feed-item strong { font-size: 14px; font-weight: 750; }
.feed-note { font-size: 12px; }
.history-panel { padding: 18px; gap: 18px; margin-top: 24px; border: 1px solid var(--line-strong); border-radius: 14px; background: #0c2231; }
.history-heading { display: block; }
.history-heading h2 { font-weight: 750; letter-spacing: -.035em; font-size: 25px; }
.history-heading > p, .history-note { font-size: 13px; line-height: 1.55; margin-top: 7px; }
.history-heading span, .route-heading span, .system-map-heading span, .official-heading span, .data-notes-summary span { font-size: 12px; letter-spacing: .06em; }
.history-controls, .card-history-controls { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 5px; padding: 5px; border: 1px solid #456578; border-radius: 12px; background: #061724; }
.history-controls { min-width: 288px; }
.card-chart-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; margin-top: 18px; font-size: 14px; }
.card-chart-heading strong { font-weight: 750; }
.chart-window-label { color: var(--accent); font-size: 13px; font-weight: 750; }
.card-history-controls { margin-top: 8px; }
.history-button { min-height: 48px; min-width: 0; padding: 6px 12px; border: 1px solid #355064; border-radius: 8px; color: #e1edf4; background: #102b3d; font-size: 15px; line-height: 1.3; font-weight: 800; }
.history-button:hover { color: #fff; background: #234c62; border-color: #91cfe4; }
.history-button.is-active { color: #031922; background: #6fe4ff; border-color: #6fe4ff; box-shadow: 0 0 0 1px #b1f1ff; }
.history-button:focus-visible { outline: 3px solid #ffd575; outline-offset: 3px; }
.gauge-grid { gap: 16px; align-items: start; }
.gauge-card { display: flex; padding: 20px; border: 1px solid #385463; background: linear-gradient(160deg,#122d3e,#091c2a); box-shadow: var(--shadow-md); }
.gauge-card::before { top: 17px; bottom: 17px; left: 0; width: 3px; height: auto; border-radius: 0 4px 4px 0; }
.gauge-card.is-local { border-color: #65bad4; box-shadow: 0 0 0 1px #6fe4ff18; }
.card-head { display: flex; flex-wrap: wrap; gap: 10px; min-height: 0; }
.card-location { width: 100%; }
.position-pill { font-size: 12px; letter-spacing: .045em; }
.gauge-name { max-width: none; font-size: 20px; font-weight: 750; letter-spacing: -.02em; line-height: 1.3; margin-top: 5px; }
.gauge-site { font-size: 12px; margin-top: 4px; }
.status-badge { max-width: 100%; min-height: 28px; padding: 5px 9px; margin: 0; border: 1px solid color-mix(in srgb,var(--severity) 45%,#153044); border-radius: 8px; font-size: 12px; font-weight: 800; }
.reading-row { margin-top: 16px; gap: 8px; }
.reading-label { font-size: 13px; font-weight: 700; }
.stage-value { font-size: clamp(50px,4.7vw,66px); font-weight: 780; letter-spacing: -.05em; }
.stage-unit { color: #d2e2eb; font-size: 20px; }
.sensor-label, .observed-value { font-size: 12px; line-height: 1.5; }
.sensor-label { margin-top: 6px; }
.trend-chip { flex-shrink: 0; margin-top: 28px; padding: 6px 8px; border: 1px solid #3b596a; border-radius: 8px; font-size: 13px; font-weight: 750; }
.sparkline-box { height: 108px; margin-top: 14px; border: 1px solid #2d495a; border-radius: 8px; background: #071b29; }
.sparkline-grid { stroke: #496273; opacity: .7; }
.sparkline-area { fill: color-mix(in srgb,var(--severity) 12%,transparent); }
.sparkline-line { stroke-width: 2.5; }
.sparkline-dot { stroke: #0a2030; }
.sparkline-empty { font-size: 13px; text-align: center; padding: 10px; }
.chart-meta { display: flex; flex-direction: column; gap: 4px; min-height: 0; font-size: 12px; line-height: 1.45; margin-top: 9px; }
.chart-range { text-align: left; }
.metrics { grid-template-columns: repeat(2,minmax(0,1fr)); margin-top: 15px; border: 1px solid #385260; border-radius: 9px; background: #071d2b; overflow: hidden; }
.metric, .metric:nth-child(odd), .metric:nth-child(even) { padding: 11px 12px; }
.metric span { font-size: 12px; }
.metric strong { margin-top: 4px; font-size: 17px; font-weight: 750; color: #f2f8fb; }
.stage-meter { margin-top: 16px; }
.stage-meter-label { font-size: 12px; }
.stage-meter-label strong { font-weight: 750; }
.meter-track { height: 7px; }
.threshold-note { min-height: 0; margin-top: 10px; font-size: 12px; line-height: 1.55; }
.card-links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; padding-top: 0; }
.card-link { justify-content: center; min-height: 44px; padding: 8px 5px; border: 1px solid #426071; border-radius: 9px; background: #091e2c; font-size: 12px; font-weight: 750; }
.card-link:hover { background: #16394e; text-decoration: none; }
.gauge-details { margin-top: 12px; }
.gauge-details > summary { min-height: 48px; font-size: 14px; font-weight: 750; }
.gauge-details-body { font-size: 14px; }
.gauge-details-body h3 { font-size: 15px; font-weight: 750; }
.context-source small, .crest-date small, .context-thresholds dt { font-size: 12px; }
.context-thresholds dd { font-size: 16px; font-weight: 750; }
.gauge-details-body .context-caution { font-size: 13px; }
.impact-disclosure > summary, .reporting-times > summary { min-height: 44px; font-size: 13px; }
.route-panel { padding: 20px 0; gap: 14px 24px; }
.route-heading h2 { font-size: 19px; font-weight: 750; }
.route-heading p, .route-caption { font-size: 13px; }
.jump-button { min-height: 48px; }
.jump-button strong { font-size: 14px; }
.jump-button small { font-size: 12px; }
.jump-button.is-local-route .route-step { color: #06202a; }
.route-step { font-size: 12px; }
.system-map-heading h2, .official-heading h2 { font-size: 26px; font-weight: 750; letter-spacing: -.025em; }
.system-map-heading p, .official-heading p { max-width: 360px; font-size: 13px; }
.map-station { min-height: 95px; background: #0b2536; }
.map-station:hover { background: #163b51; }
.map-station small { font-size: 12px; letter-spacing: 0; }
.map-station strong { font-size: 17px; font-weight: 750; }
.map-station b { font-size: 14px; font-weight: 750; }
.map-legend { font-size: 12px; color: var(--muted); }
.local-waterways strong { font-size: 14px; }
.local-waterways p, .map-caption { font-size: 13px; }
.unmeasured-label { font-size: 12px; }
.official-link { background: #0c2434; }
.official-link strong { font-size: 15px; font-weight: 750; }
.official-link small, .official-note { font-size: 13px; }
.data-notes-summary h2 { font-size: 20px; font-weight: 750; }
.data-notes-summary p { font-size: 13px; }
.data-note-card strong { font-size: 15px; }
.data-note-card p { font-size: 14px; }
.safety-note strong { font-size: 14px; }
.safety-note p { font-size: 13px; }
.app-footer { font-size: 12px; }
.install-dialog p { font-size: 15px; }
.install-dialog .pwa-status { font-size: 13px; }
.dialog-close, .dialog-button { min-height: 44px; }
.dialog-close { width: 44px; }
.dialog-button { font-size: 15px; font-weight: 750; }
.weather-alerts { background: #0c2637; padding: 16px 18px; }
.alerts-heading h2 { font-size: 16px; font-weight: 750; }
.alerts-topline > a { font-size: 13px; }
.alerts-status { font-size: 14px; }
.alerts-checked { font-size: 12px; }
.alert-card h3 { font-size: 18px; }
.alert-card p, .alert-details { font-size: 14px; }
.alert-card .alert-meta { font-size: 12px; }
.rain-summary-copy strong { font-size: 20px; font-weight: 750; }
.rain-summary-copy > span { font-size: 14px; }
.rain-summary-action { font-size: 14px; }
.rain-intro p, .extras-status, .rainfall-note, .radar-status { font-size: 14px; }
.extras-refresh { min-height: 44px; font-size: 14px; background: #123044; }
.rainfall-heading h3 { font-size: 17px; font-weight: 750; }
.rainfall-heading a { font-size: 13px; }
.rainfall-table { font-size: 14px; }
.rainfall-table thead th { color: #d2e3eb; font-size: 13px; font-weight: 750; }
.rainfall-table tbody th { font-size: 14px; }
.rainfall-table td { font-size: 22px; font-weight: 750; }
.rainfall-table td span, .rainfall-table td small, .rainfall-table tbody th small { font-size: 12px; }
.rain-source-time, .reporting-times dl, .radar-figure figcaption, .radar-note, .extras-footnote { font-size: 13px; }
.radar-heading h3 { font-size: 21px; font-weight: 750; }
.radar-heading a { font-size: 14px; }
.radar-heading .section-eyebrow { font-size: 12px; }
@media (max-width: 1120px) {
  .gauge-card { padding: 17px; }
  .card-head { min-height: 0; }
  .gauge-name { font-size: 19px; }
  .stage-value { font-size: 54px; }
  .trend-chip { font-size: 12px; padding: 5px 6px; }
  .history-panel { align-items: start; }
  .history-controls { min-width: 260px; }
  .history-button { padding-left: 8px; padding-right: 8px; }
}
@media (max-width: 950px) {
  .gauge-grid { grid-template-columns: 1fr; }
  .gauge-card { padding: 22px; display: flex; gap: 0; }
  .card-head { min-height: 0; }
  .card-location { width: auto; flex: 1; }
  .status-badge { max-width: 150px; }
  .reading-row { margin-top: 16px; }
  .stage-value { font-size: 66px; }
  .trend-chip { font-size: 14px; padding: 7px 10px; }
  .card-history-controls { max-width: 430px; }
  .sparkline-box { height: 125px; margin-top: 14px; }
  .chart-meta { min-height: 0; flex-direction: row; margin-top: 9px; }
  .metrics { margin-top: 15px; }
  .stage-meter { margin-top: 16px; }
  .threshold-note { margin-top: 10px; }
  .card-links { align-self: stretch; padding-top: 0; }
  .gauge-details-body { max-width: none; }
  .official-links-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .history-heading > p { margin-top: 7px; }
}
@media (max-width: 620px) {
  .app-shell { padding-left: 14px; padding-right: 14px; }
  .app-header { flex-wrap: wrap; row-gap: 12px; }
  .brand { flex: 1 1 220px; }
  .brand-eyebrow { display: none; }
  .brand-copy h1 { font-size: 20px; margin: 0; line-height: 1.2; }
  .brand-mark { width: 36px; height: 40px; }
  .header-actions { gap: 7px; margin-left: auto; }
  .icon-button, .text-button { width: 44px; height: 44px; min-height: 44px; }
  .public-info { font-size: 12px; }
  .hero { padding: 23px 21px; gap: 21px; }
  .hero h2 { font-size: 31px; }
  .hero-summary { font-size: 15px; }
  .hero-note { font-size: 12px; }
  .hero-kicker, .hero-reading-label { font-size: 12px; letter-spacing: .035em; }
  .hero-reading { padding-top: 20px; }
  .hero-reading-place { font-size: 15px; }
  .hero-stage { font-size: 76px; }
  .hero-trend { font-size: 14px; }
  .hero-reading-footnote { font-size: 12px; }
  .feed-strip { gap: 15px 0; padding: 15px 12px; }
  .feed-item span { font-size: 12px; letter-spacing: 0; }
  .feed-item strong { font-size: 14px; }
  .feed-note { font-size: 12px; margin-top: 9px; }
  .history-panel { margin-top: 20px; padding: 15px; gap: 14px; }
  .history-heading h2 { font-size: 25px; }
  .history-heading > p, .history-note { font-size: 13px; }
  .history-controls { min-width: 0; width: 100%; }
  .card-history-controls { max-width: none; }
  .history-button { font-size: 14px; min-height: 48px; }
  .gauge-card { padding: 20px; }
  .card-head { flex-wrap: wrap; gap: 10px; min-height: 0; }
  .card-location { flex: 0 0 100%; width: 100%; }
  .gauge-name { font-size: 21px; max-width: none; }
  .status-badge { font-size: 12px; max-width: 100%; }
  .position-pill, .gauge-site { font-size: 12px; }
  .stage-value { font-size: 66px; }
  .reading-label { font-size: 13px; }
  .sensor-label, .observed-value { font-size: 12px; }
  .trend-chip { font-size: 13px; padding: 6px 8px; }
  .sparkline-box { height: 115px; }
  .chart-meta { flex-direction: column; font-size: 12px; }
  .metric span { font-size: 12px; }
  .metric strong { font-size: 18px; }
  .stage-meter-label, .threshold-note, .card-link { font-size: 12px; }
  .card-links { margin-top: 14px; gap: 8px; }
  .route-heading { display: block; }
  .route-heading p { max-width: none; text-align: left; font-size: 13px; }
  .jump-nav { gap: 5px; }
  .jump-button { gap: 5px; }
  .jump-button strong { font-size: 13px; }
  .route-step { width: 24px; height: 24px; font-size: 12px; }
  .route-caption { font-size: 13px; }
  .system-map-heading h2, .official-heading h2 { font-size: 26px; max-width: none; }
  .system-map-heading p, .official-heading p { font-size: 13px; }
  .map-station { padding: 10px 13px; min-height: 90px; }
  .map-station small { font-size: 12px; }
  .map-station strong { font-size: 17px; }
  .map-station b { font-size: 14px; }
  .map-legend { font-size: 12px; left: 12px; right: 10px; }
  .local-waterways strong { font-size: 14px; }
  .local-waterways p, .map-caption { font-size: 13px; }
  .official-links-grid { grid-template-columns: 1fr; }
  .official-link strong { font-size: 15px; }
  .official-link small, .official-note { font-size: 13px; }
  .data-note-card p { font-size: 14px; }
  .app-footer { font-size: 12px; }
  .weather-alerts { padding: 15px; }
  .alerts-heading h2 { font-size: 15px; }
  .alerts-topline > a, .alerts-checked { font-size: 12px; }
  .alerts-status { font-size: 14px; }
  .alert-card h3 { font-size: 17px; }
  .rain-summary { padding: 18px 16px; }
  .rain-summary-copy strong { font-size: 19px; }
  .rain-summary-copy > span { font-size: 13px; }
  .rain-summary-action { font-size: 0; }
  .rain-body { padding: 16px 12px; }
  .rain-intro p { font-size: 14px; }
  .rainfall-table { table-layout: fixed; }
  .rainfall-table thead th, .rainfall-table tbody th, .rainfall-table td { padding-left: 4px; padding-right: 4px; }
  .rainfall-table th:first-child { width: 34%; }
  .rainfall-table thead th { font-size: 12px; }
  .rainfall-table tbody th { font-size: 13px; overflow-wrap: anywhere; }
  .rainfall-table td { font-size: 18px; letter-spacing: -.03em; }
  .rainfall-table td span { display: block; padding: 0; font-size: 12px; }
  .rainfall-table td small, .rainfall-table tbody th small { font-size: 12px; }
  .radar-heading { flex-wrap: wrap; }
  .radar-heading h3 { font-size: 21px; }
  .radar-heading a { max-width: none; font-size: 13px; text-align: left; }
  .radar-heading .section-eyebrow { font-size: 12px; }
}
@media (max-width: 370px) {
  .app-shell { padding-left: 10px; padding-right: 10px; }
  .brand-copy h1 { font-size: 20px; }
  .hero, .gauge-card { padding: 17px; }
  .hero-stage { font-size: 66px; }
  .hero-trend { font-size: 12px; }
  .stage-value { font-size: 59px; }
  .trend-chip { padding: 5px 6px; font-size: 12px; }
  .history-button { font-size: 14px; padding: 6px; }
  .jump-nav { grid-template-columns: 1fr; gap: 3px; }
  .route-arrow { display: none; }
  .jump-button { gap: 8px; min-height: 44px; }
  .jump-button strong { font-size: 14px; }
  .map-link-mark { display: none; }
  .map-station { padding-left: 10px; padding-right: 8px; }
  .map-station small { font-size: 12px; }
  .rainfall-table td { font-size: 17px; }
}
@media print {
  :root { color-scheme: light; --text: #173441; --muted: #405460; --muted-strong: #263d49; --accent: #075c70; --accent-deep: #075c70; --line: #b9c7ce; --line-strong: #92a8b2; }
  body, .hero, .gauge-card, .feed-strip, .history-panel, .weather-alerts, .rain-panel, .official-link, .metrics, .map-station, .system-map-wrap, .install-dialog { color: #173441; background: #fff; box-shadow: none; }
  .skip-link, .card-history-controls, .history-controls { display: none !important; }
  .hero-stage, .stage-value, .metric strong { color: #173441; }
  .gauge-grid { grid-template-columns: 1fr; }
  .gauge-card { padding: 16px; }
  .history-panel { padding: 12px; }
  .sparkline-box { background: #fff; }
}

/* Town weather is optional; the river gauges retain the primary layout. */
.quick-resources { display: flex; flex-wrap: wrap; gap: 6px 24px; margin: -3px 0 15px; }
.quick-resources a { display: inline-flex; align-items: center; min-height: 32px; color: var(--accent-deep); font-size: 13px; font-weight: 650; text-underline-offset: 3px; }
.weather-alerts { margin-top: 0; margin-bottom: 16px; }
.forecast-section { margin-top: 24px; }
.forecast-heading { display: flex; justify-content: space-between; align-items: end; gap: 8px 20px; flex-wrap: wrap; }
.forecast-heading .section-eyebrow { color: var(--accent-deep); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; }
.forecast-heading h3, .observed-rain-section > h3 { margin: 4px 0 0; color: var(--text); font-size: 21px; font-weight: 750; letter-spacing: -.02em; }
.forecast-horizon { color: var(--muted); font-size: 13px; }
.forecast-towns { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-top: 17px; padding: 4px; border: 1px solid var(--line); border-radius: 9px; background: #081e2e; }
.forecast-town { min-height: 44px; padding: 8px 15px; border: 1px solid transparent; border-radius: 6px; color: var(--muted-strong); background: transparent; font: inherit; font-size: 14px; font-weight: 700; }
.forecast-town:hover { background: #214557; }
.forecast-town.is-active { color: var(--accent-deep); border-color: #4c798e; background: #173c50; }
.forecast-source-link { display: inline-block; padding: 2px 0 8px; color: var(--accent-deep); font-size: 14px; font-weight: 650; text-underline-offset: 3px; }
.forecast-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin-top: 8px; }
.forecast-period { min-width: 0; padding: 17px; border: 1px solid var(--line); border-radius: 11px; background: #0b2435; }
.forecast-period h4 { margin: 0; color: var(--text); font-size: 16px; font-weight: 750; }
.forecast-validity { margin: 7px 0 14px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.forecast-temperature { margin: 0; color: var(--text); font-size: 33px; font-weight: 750; line-height: 1.1; letter-spacing: -.03em; }
.forecast-temperature-label { margin: 3px 0 12px; color: var(--muted); font-size: 12px; }
.forecast-description { margin: 8px 0 15px; min-height: 40px; color: var(--muted-strong); font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.forecast-chance { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 9px; margin: 0; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.forecast-chance strong { font-size: 16px; font-weight: 750; color: var(--accent-deep); }
.forecast-wind { margin: 7px 0 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.forecast-explanation { margin-top: 10px; color: var(--muted-strong); font-size: 13px; }
.forecast-explanation summary { padding: 7px 0; color: var(--accent-deep); cursor: pointer; font-weight: 650; }
.forecast-explanation p { margin: 5px 0 0; line-height: 1.65; overflow-wrap: anywhere; }
.forecast-note, .forecast-checked { margin: 12px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.forecast-checked:empty { display: none; }
.observed-rain-section { margin-top: 26px; padding-top: 23px; border-top: 1px solid var(--line); }
.observed-rain-section .rainfall-heading { margin-top: 12px; }
@media (max-width: 1000px) {
  .forecast-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 620px) {
  .quick-resources { gap: 3px 17px; margin-bottom: 12px; }
  .quick-resources a { min-height: 36px; font-size: 12px; }
  .forecast-town { padding: 7px 10px; font-size: 13px; }
  .forecast-period { padding: 14px; }
}
@media (max-width: 440px) {
  .forecast-towns { display: flex; }
  .forecast-town { flex: 1; padding: 7px 5px; }
  .forecast-grid { grid-template-columns: 1fr; }
  .forecast-description { min-height: 0; }
}
@media print {
  .quick-resources, .forecast-towns, .extras-refresh { display: none !important; }
  .forecast-period, .rain-panel[open] .rain-summary, .rainfall-table thead th { color: #173441; background: #fff; }
  .forecast-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .forecast-period { break-inside: avoid; }
  .forecast-period *, .rainfall-table * { color: #173441; }
}

/* Compact station overview replaces the decorative river schematic. */
.river-overview { margin-top: 22px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: #0c2231; }
.river-overview-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px 24px; }
.river-overview-heading .section-eyebrow { color: var(--accent); font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; }
.river-overview-heading h2 { margin: 4px 0 0; font-size: 25px; line-height: 1.2; font-weight: 750; letter-spacing: -.025em; }
.river-overview-heading p { max-width: 280px; margin: 0 0 2px; color: var(--muted); font-size: 13px; text-align: right; }
.station-strip { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: 18px; }
.station-strip::before { content: ""; position: absolute; inset: 50% 12px auto; height: 1px; background: var(--line-strong); }
.station-strip .map-station { position: relative; inset: auto; display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 3px 12px; width: auto; min-width: 0; min-height: 109px; padding: 14px 16px; border: 1px solid #416071; border-radius: 11px; color: var(--text); background: #0b2536; box-shadow: none; text-align: left; }
.station-strip .map-station:hover { border-color: #80c9de; background: #15384b; }
.station-strip .map-station.is-local { border-color: #507c91; }
.station-strip .map-station.is-selected { border-color: var(--accent); background: #14384a; box-shadow: 0 0 0 1px #6fe4ff20; }
.station-strip .map-station small { display: block; grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 12px; letter-spacing: .025em; text-transform: none; }
.station-strip .map-station strong { min-width: 0; margin: 0; font-size: 18px; line-height: 1.35; font-weight: 750; letter-spacing: -.025em; }
.station-strip .map-stage { min-width: 0; margin: 0; color: var(--accent); font-size: 18px; line-height: 1.35; font-weight: 750; overflow-wrap: anywhere; }
.station-jump { display: flex; grid-column: 1 / -1; justify-content: space-between; align-items: center; gap: 6px; margin-top: 3px; color: var(--muted); font-size: 12px; font-weight: 500; }
.station-jump > span { color: var(--accent); font-size: 16px; }
.river-explanation { margin-top: 13px; border-top: 1px solid var(--line); }
.river-explanation > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding-top: 4px; color: var(--muted-strong); font-size: 13px; font-weight: 650; cursor: pointer; list-style: none; }
.river-explanation > summary::-webkit-details-marker { display: none; }
.river-explanation[open] > summary .details-chevron { transform: rotate(45deg); }
.river-explanation > div { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding: 4px 0; }
.river-explanation p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.river-explanation strong { color: var(--muted-strong); }

/* Forecast, rainfall and radar retain their sources and automatic refresh. */
.weather-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; max-width: 440px; padding: 5px; margin-top: 22px; border: 1px solid var(--line-strong); border-radius: 11px; background: #061724; }
.weather-tabs > button { min-height: 44px; min-width: 0; padding: 8px 12px; border: 1px solid transparent; border-radius: 7px; color: var(--muted-strong); background: transparent; font-size: 14px; font-weight: 750; }
.weather-tabs > button:hover { color: var(--text); background: #214557; }
.weather-tabs > button[aria-selected="true"] { color: #031922; border-color: var(--accent); background: var(--accent); }
.rain-body [data-weather-panel][role="tabpanel"] { margin-top: 22px; padding-top: 0; border-top: 0; }
.rain-body [role="tabpanel"]:focus-visible { outline-offset: 7px; }

/* Sharing remains account-free, including the copy-link fallback. */
.share-status { margin: -5px 0 15px; color: var(--accent); font-size: 13px; text-align: right; }
.share-fallback { margin: 0 0 18px; padding: 16px; border: 1px solid var(--line-strong); border-radius: 11px; background: var(--panel); }
.share-fallback label { display: block; color: var(--muted-strong); font-size: 14px; }
.share-link-row { display: flex; gap: 10px; margin-top: 9px; }
.share-link-row input { flex: 1; min-width: 0; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 7px; color: var(--text); background: var(--bg-0); font: inherit; font-size: 14px; }
.share-link-row .text-button { width: auto; padding: 8px 14px; }
@media (max-width: 1050px) {
  .app-header { flex-wrap: wrap; row-gap: 14px; }
  .header-actions { margin-left: auto; }
}
@media (max-width: 800px) {
  .station-strip { gap: 16px; }
  .station-strip .map-station { grid-template-columns: 1fr; gap: 3px; padding: 13px; }
  .station-strip .map-stage { font-size: 20px; }
}
@media (max-width: 620px) {
  .header-actions .text-button > span { display: none; }
  .river-overview { margin-top: 20px; padding: 16px 12px 10px; }
  .river-overview-heading { display: block; }
  .river-overview-heading h2 { font-size: 23px; }
  .river-overview-heading p { max-width: none; margin-top: 8px; text-align: left; }
  .station-strip { gap: 8px; margin-top: 15px; }
  .station-strip .map-station { padding: 11px 8px; min-height: 128px; border-radius: 8px; }
  .station-strip .map-station small { font-size: 11px; letter-spacing: 0; line-height: 1.4; }
  .station-strip .map-station strong { font-size: 15px; }
  .station-strip .map-stage { font-size: 18px; }
  .station-jump { font-size: 11px; line-height: 1.4; align-items: start; }
  .station-jump > span { display: none; }
  .river-explanation > div { grid-template-columns: 1fr; gap: 12px; padding: 7px 0 8px; }
  .weather-tabs { max-width: none; margin-top: 18px; }
  .weather-tabs > button { padding: 8px 5px; }
}
@media (max-width: 340px) {
  .station-strip { gap: 6px; }
  .station-strip .map-station { padding-left: 6px; padding-right: 6px; }
  .station-strip .map-station strong { font-size: 14px; }
  .station-strip .map-stage { font-size: 17px; }
}
@media print {
  .river-overview { break-inside: avoid; color: #173441; background: #fff; }
  .station-strip .map-station, .station-strip .map-station.is-selected { color: #173441; background: #fff; box-shadow: none; }
  .station-jump, .weather-tabs, .share-status, .share-fallback { display: none !important; }
  .rain-panel[open] [data-weather-panel][hidden] { display: block !important; }
  .rain-panel[open] [data-weather-panel] { break-inside: avoid; }
}

/* Keep the larger history range and downloads readable at every card width. */
.history-controls, .card-history-controls { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.history-controls { min-width: 330px; }
.card-history-controls .history-button { padding: 6px 4px; font-size: 14px; }
.history-coverage { margin: 9px 0; color: #ffe096; font-size: 13px; line-height: 1.5; }
.download-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 12px; margin: 12px 0 0; }
.download-readings { min-height: 44px; padding: 8px 11px; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--accent); background: #0a1d2b; font-size: 13px; font-weight: 650; }
.download-readings:hover { background: #183e50; border-color: var(--accent); }
.download-readings:disabled { color: var(--muted); opacity: .7; cursor: wait; }
.download-status { font-size: 12px; color: var(--muted); }
.rain-extended { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 10px; }
.rain-extended > summary { cursor: pointer; min-height: 44px; padding: 9px 0; color: var(--accent); font-size: 14px; font-weight: 650; }
.rain-extended .rainfall-table { margin-top: 8px; }
.brand-copy h1 { max-width: 560px; text-wrap: balance; }
@media (max-width: 1000px) { .history-panel { flex-wrap: wrap; } }
@media (max-width: 640px) { .history-controls { min-width: 0; width: 100%; } }
@media print { .download-row, #historyRetry { display: none !important; } .history-coverage { color: #554000; } }

/* Three focused pages share the same calm, readable dashboard. */
.dashboard-tabs { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; padding: 6px; margin: 20px 0; border: 1px solid var(--line-strong); border-radius: 13px; background: #061724; }
.dashboard-tabs button { min-height: 52px; border: 1px solid transparent; border-radius: 8px; padding: 10px; color: var(--muted-strong); background: transparent; font-size: 16px; font-weight: 750; }
.dashboard-tabs button[aria-selected="true"] { color: #031922; background: var(--accent); }
.dashboard-tabs button:hover:not([aria-selected="true"]) { background: #1d3c4f; }
.batesville-heading { padding: 24px; border: 1px solid var(--line-strong); border-radius: 16px; background: var(--panel); }
.batesville-heading h2 { margin: 7px 0; font-size: 32px; letter-spacing: -.04em; }
.batesville-heading > p { max-width: 850px; color: var(--muted-strong); font-size: 15px; }
.batesville-grid { grid-template-columns: repeat(2,minmax(0,1fr)); margin-top: 18px; }
#weatherView > .rain-panel { margin-top: 0; }
#weatherView > .rain-panel > summary { pointer-events: none; cursor: default; }
#weatherView .rain-summary-action { display: none; }
.local-station { margin-bottom: 24px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.local-station h3, .rain-outlook h3 { font-size: 22px; margin: 5px 0; }
.local-station .forecast-heading > a, .rain-outlook .forecast-heading > a { color: var(--accent); font-size: 13px; }
.station-metrics { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin: 16px 0; }
.station-metric, .outlook-period { padding: 17px; background: #081e2e; border: 1px solid var(--line); border-radius: 12px; }
.station-metric dt { color: var(--muted); font-size: 13px; }
.station-metric dd { margin: 7px 0 0; font-size: 27px; font-weight: 750; }
.station-metric dd small { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; font-weight: 500; }
.station-rain { color: var(--muted-strong); font-size: 14px; }
.station-note, .outlook-note { color: var(--muted); font-size: 13px; }
.rain-outlook { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.outlook-periods { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin: 15px 0; }
.outlook-period h4 { margin: 0; color: var(--muted-strong); font-size: 14px; }
.outlook-amount { display: block; margin-top: 9px; font-size: 28px; font-weight: 750; color: var(--text); }
.outlook-period p { margin-bottom: 0; color: var(--muted); font-size: 12px; }
.outlook-risks { margin: 14px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; }
.outlook-risks li { border-left: 3px solid var(--line-strong); padding-left: 10px; color: var(--muted-strong); font-size: 13px; }
.outlook-risks li[data-risk="marginal"], .outlook-risks li[data-risk="slight"] { border-color: #f4d45f; }
.outlook-risks li[data-risk="moderate"], .outlook-risks li[data-risk="high"] { border-color: #ff8296; }
.outlook-risks strong, .outlook-risks span { display: block; }
.outlook-risks small { display: block; color: var(--muted); font-size: 11px; }
.drought-link { margin-top: 18px; font-size: 14px; }
.drought-link a { color: var(--accent); text-underline-offset: 3px; }
.drought-link span { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); }
@media (max-width: 800px) { .batesville-grid { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .dashboard-tabs button { font-size: 14px; padding: 8px 4px; } .station-metrics { gap: 7px; } .station-metric { padding: 11px 8px; } .station-metric dd { font-size: 23px; } .outlook-periods { grid-template-columns: 1fr; } .outlook-risks { grid-template-columns: 1fr; } }
@media print { .dashboard-tabs, #batesvilleRefresh, #batesvilleHistoryRetry { display: none !important; } .station-metric, .outlook-period { color: #173441; background: #fff; } }
