:root {
  color-scheme: light;
  --ink: #182a22;
  --muted: #829188;
  --green: #477957;
  --green-dark: #173d30;
  --line: #e6ece6;
  --mono: "DM Mono", monospace;
  --sans: "DM Sans", sans-serif;
  --display: "Manrope", sans-serif;
}

* { box-sizing: border-box; }
body { min-height: 100vh; margin: 0; background: #f6f8f5; color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
.dashboard { width: min(1040px, 100%); min-height: 100vh; margin: 0 auto; padding: 0 42px 28px; background: #fff; box-shadow: 0 0 60px #24382d08; }
.topbar { height: 66px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #edf0ed; }
.brand { display: flex; align-items: center; gap: 10px; color: #243b2e; font: 800 10px var(--display); letter-spacing: 1.3px; }
.brand-mark { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 7px; background: #edf4ed; color: #4e7d5b; font: 24px var(--display); }
.brand-subtitle { display: block; margin-top: 3px; color: #86948a; font: 9px var(--mono); letter-spacing: 1.1px; }
.topbar-status { display: flex; align-items: center; gap: 15px; }
.live-label { display: flex; align-items: center; gap: 6px; color: #51805c; font: 9px var(--mono); letter-spacing: .5px; }
.live-label i, .update-chip i { width: 6px; height: 6px; border-radius: 50%; background: #5ea66e; box-shadow: 0 0 0 3px #e7f2e8; }
.updated-label { color: #929d95; font-size: 10px; }.updated-label time { color: #4f6255; }
.theme-button { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid #e7ece7; border-radius: 5px; background: #fff; color: #718478; cursor: pointer; }
.theme-button:hover { background: #f1f6f1; }.theme-button svg { width: 15px; height: 15px; }.theme-button .moon-icon { display: none; }
.refresh-button { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid #e7ece7; border-radius: 5px; background: #fff; color: #5e7964; cursor: pointer; }
.refresh-button:hover { background: #f1f6f1; }.refresh-button svg { width: 15px; height: 15px; }.refresh-button.spinning svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.intro { min-height: 166px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.eyebrow { margin: 0 0 9px; color: #698674; font: 500 9px var(--mono); letter-spacing: 1.4px; }
h1 { margin: 0; color: #1d3025; font: 700 34px/1.2 var(--display); letter-spacing: -1.6px; }
h1 span { color: #79a182; }
.intro-note { margin: 8px 0 0; color: #87938a; font-size: 11px; }
.update-chip { display: flex; align-items: center; gap: 8px; padding: 8px 11px; border: 1px solid #e8eee8; border-radius: 4px; color: #718077; font-size: 9px; white-space: nowrap; }
.update-chip i { width: 5px; height: 5px; box-shadow: none; }
.gauge-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.gauge-card { min-height: 318px; position: relative; padding: 20px 22px 18px; border: 1px solid var(--line); border-radius: 5px; background: #fff; }
.card-topline, .gauge-card h2, .reading-label, .level-reading, .trend-line, .card-footer, .card-status { position: relative; z-index: 1; }
.card-topline { display: flex; align-items: center; justify-content: space-between; }
.river-label { width: fit-content; padding: 5px 7px; border-radius: 3px; font: 9px var(--mono); letter-spacing: .6px; }
.river-label.lamine { background: #edf5ed; color: #527b59; }.river-label.missouri { background: #edf2f4; color: #607d8d; }
.category-label { width: fit-content; padding: 5px 7px; border-radius: 3px; background: #edf5ed; color: #527b59; font: 9px var(--mono); letter-spacing: .6px; }
.category-label.secondary { background: #edf2f4; color: #607d8d; }
.usgs-link { color: #8a998e; font: 9px var(--mono); }.usgs-link:hover { color: #477957; }
.gauge-card h2 { margin: 18px 0 16px; color: #2a3b30; font: 600 16px var(--display); letter-spacing: -.3px; }
.station-place { display: block; margin-top: 4px; color: #89958d; font: 10px var(--sans); letter-spacing: 0; }
.reading-label { color: #849289; font: 9px var(--mono); letter-spacing: 1px; }.reading-label span { margin-left: 5px; color: #a0aaa2; font-size: 8px; letter-spacing: .4px; }
.level-reading { height: 77px; display: flex; align-items: center; gap: 8px; margin-top: 1px; }
.level-value { color: #244d38; font: 600 clamp(49px, 7vw, 66px)/1 var(--display); letter-spacing: -3.5px; font-variant-numeric: tabular-nums; }
.level-unit { align-self: center; padding-top: 17px; color: #71877a; font: 500 16px var(--mono); }
.trend-line { min-height: 21px; display: flex; align-items: center; gap: 6px; color: #738378; font-size: 10px; }
.trend-line.up { color: #a06b48; }.trend-line.down { color: #568164; }.trend-line.steady { color: #738378; }.trend-arrow { font-size: 13px; }
.card-footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 12px; padding-top: 11px; border-top: 1px solid #edf0ed; }
.secondary-readings { display: grid; gap: 5px; }.flow-reading { color: #64766a; font: 10px var(--mono); }.reading-time { color: #929d95; font-size: 9px; text-align: right; }
.card-status { position: absolute; right: 22px; bottom: 18px; display: flex; align-items: center; gap: 6px; color: #9aa39c; font-size: 8px; }
.card-status i { width: 5px; height: 5px; border-radius: 50%; background: #a9b1ab; }.card-status.live { color: #66846d; }.card-status.live i { background: #64a675; }.card-status.delayed { color: #9a7a49; }.card-status.delayed i { background: #c39957; }
.card-status.error { color: #a56958; }.card-status.error i { background: #c57b68; }
.page-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 18px; padding: 17px 1px 0; color: #9aa49c; font-size: 9px; line-height: 1.6; }.page-footer a { color: #66836c; }
.toast { position: fixed; right: 20px; bottom: 18px; padding: 10px 13px; border: 1px solid #e3eae3; border-radius: 5px; background: #fff; box-shadow: 0 6px 24px #14241a15; color: #55675a; font-size: 11px; opacity: 0; pointer-events: none; transform: translateY(6px); transition: .2s; }.toast.show { opacity: 1; transform: translateY(0); }

html[data-theme="dark"] { color-scheme: dark; }
html[data-theme="dark"] body { background: #0d1410; color: #e2ebe3; }
html[data-theme="dark"] .dashboard { background: #131b16; box-shadow: 0 0 60px #00000018; }
html[data-theme="dark"] .topbar { border-color: #27342c; }
html[data-theme="dark"] .brand { color: #e1ece1; }
html[data-theme="dark"] .brand-mark { background: #20352a; color: #a1c9a0; }
html[data-theme="dark"] .brand-subtitle { color: #8d9f92; }
html[data-theme="dark"] .live-label { color: #9bc49d; }
html[data-theme="dark"] .live-label i { background: #70c181; box-shadow: 0 0 0 3px #25412e; }
html[data-theme="dark"] .updated-label { color: #8e9d91; }
html[data-theme="dark"] .updated-label time { color: #c1d0c3; }
html[data-theme="dark"] .theme-button,
html[data-theme="dark"] .refresh-button { border-color: #344238; background: #1b261f; color: #b2c6b3; }
html[data-theme="dark"] .theme-button:hover,
html[data-theme="dark"] .refresh-button:hover { background: #26372b; }
html[data-theme="dark"] .theme-button .sun-icon { display: none; }
html[data-theme="dark"] .theme-button .moon-icon { display: block; }
html[data-theme="dark"] h1 { color: #e2ece3; }
html[data-theme="dark"] h1 span { color: #91b89a; }
html[data-theme="dark"] .eyebrow { color: #91b79a; }
html[data-theme="dark"] .intro-note { color: #a0ada2; }
html[data-theme="dark"] .update-chip { border-color: #2a3a30; color: #a9b7aa; }
html[data-theme="dark"] .update-chip i { background: #75bd83; }
html[data-theme="dark"] .gauge-card { border-color: #2a3930; background: #19231d; }
html[data-theme="dark"] .river-label.lamine { background: #293d2c; color: #afd0ad; }
html[data-theme="dark"] .river-label.missouri { background: #28363a; color: #b0c8d1; }
html[data-theme="dark"] .category-label { background: #293d2c; color: #afd0ad; }
html[data-theme="dark"] .category-label.secondary { background: #28363a; color: #b0c8d1; }
html[data-theme="dark"] .usgs-link { color: #9aa99d; }
html[data-theme="dark"] .usgs-link:hover { color: #b0d2ad; }
html[data-theme="dark"] .gauge-card h2 { color: #dce8dc; }
html[data-theme="dark"] .station-place { color: #9ba99d; }
html[data-theme="dark"] .reading-label { color: #a2b0a4; }
html[data-theme="dark"] .reading-label span { color: #819184; }
html[data-theme="dark"] .level-value { color: #b7dab6; }
html[data-theme="dark"] .level-unit { color: #a5b9a7; }
html[data-theme="dark"] .trend-line { color: #a5b2a7; }
html[data-theme="dark"] .trend-line.up { color: #e0a878; }
html[data-theme="dark"] .trend-line.down { color: #99c9a1; }
html[data-theme="dark"] .trend-line.steady { color: #a5b2a7; }
html[data-theme="dark"] .card-footer { border-color: #2b3830; }
html[data-theme="dark"] .flow-reading { color: #b2c0b4; }
html[data-theme="dark"] .reading-time { color: #94a196; }
html[data-theme="dark"] .card-status { color: #a2b0a4; }
html[data-theme="dark"] .card-status.live { color: #a0c6a1; }
html[data-theme="dark"] .card-status.delayed { color: #d8b476; }
html[data-theme="dark"] .card-status.error { color: #dfa18f; }
html[data-theme="dark"] .page-footer { color: #96a298; }
html[data-theme="dark"] .page-footer a { color: #a5c6a2; }
html[data-theme="dark"] .toast { border-color: #344238; background: #202b23; color: #d0ded1; box-shadow: 0 6px 24px #00000035; }

@media (min-width: 900px) { .gauge-card { min-height: 336px; padding: 22px 25px 18px; }.level-reading { height: 91px; }.gauge-card h2 { margin-top: 21px; margin-bottom: 18px; } }
@media (min-width: 900px) and (min-height: 680px) and (min-aspect-ratio: 4/3) {
  body { min-height: 100svh; display: grid; place-items: center; }
  .dashboard { width: min(100%, 177.78svh, 1920px); height: min(100svh, 56.25vw); min-height: 0; display: grid; grid-template-rows: 66px clamp(105px, 14vh, 125px) minmax(0, 1fr) auto; padding: 0 clamp(24px, 3.3vw, 56px) 16px; aspect-ratio: 16 / 9; }
  .intro { min-height: 0; }
  .gauge-grid { min-height: 0; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .gauge-card { min-height: 0; padding: 14px 18px; }
  .gauge-card h2 { margin: 12px 0 8px; }
  .level-reading { height: 60px; }
  .level-value { font-size: clamp(42px, 5vw, 66px); }
  .trend-line { min-height: 18px; }
  .card-footer { margin-top: 8px; padding-top: 8px; }
  .card-status { right: 18px; bottom: 12px; }
  .page-footer { padding-top: 10px; }
}
@media (max-width: 899px) and (min-width: 621px) { .gauge-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .dashboard { padding: 0 18px 22px; }.topbar { height: 58px; }.topbar-status { gap: 9px; }.updated-label { font-size: 9px; }.intro { min-height: 148px; }.intro-note { max-width: 250px; line-height: 1.5; }.update-chip { padding: 7px 8px; font-size: 8px; }.gauge-grid { gap: 10px; }.gauge-card { min-height: 285px; padding: 15px 13px; }.gauge-card h2 { margin: 15px 0 14px; font-size: 14px; }.level-reading { height: 67px; }.level-value { font-size: clamp(42px, 10vw, 57px); }.reading-label { font-size: 8px; }.reading-label span { display: block; margin: 4px 0 0; }.card-footer { align-items: flex-start; flex-direction: column; gap: 5px; }.reading-time { text-align: left; }.card-status { right: 13px; bottom: 15px; font-size: 7px; }.page-footer { flex-direction: column; gap: 4px; } }
@media (max-width: 420px) { .dashboard { padding-right: 12px; padding-left: 12px; }.intro { align-items: flex-start; flex-direction: column; justify-content: center; gap: 10px; padding: 15px 0; }.intro-note { margin-top: 5px; }.update-chip { margin-bottom: 1px; }.gauge-grid { gap: 8px; }.gauge-card { min-height: 277px; padding: 13px 10px; }.river-label { padding: 4px 5px; font-size: 8px; }.usgs-link { font-size: 8px; }.level-value { font-size: 42px; letter-spacing: -2.5px; }.card-status { right: 10px; } }
