:root {
  color-scheme: light;
  --channel: #073444;
  --channel-deep: #03242f;
  --channel-ink: #102f37;
  --chart-paper: #f3f1e6;
  --chart-white: #fbfaf4;
  --river-blue: #2d91a3;
  --river-pale: #c7e2e1;
  --buoy: #ff6b35;
  --signal: #d9ed77;
  --steel: #6e8f96;
  --mist: #dce9e6;
  --line: rgb(7 52 68 / 13%);
  --shadow: 0 16px 44px rgb(2 31 41 / 24%);
  --display: "Avenir Next Condensed", "Arial Narrow", "Bahnschrift Condensed", system-ui, sans-serif;
  --body: "Avenir Next", "Segoe UI", Roboto, system-ui, sans-serif;
  --utility: ui-monospace, "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overscroll-behavior: none; }
body { background: var(--channel-deep); color: var(--channel-ink); font-family: var(--body); -webkit-font-smoothing: antialiased; }
button, a { font: inherit; -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--buoy); outline-offset: 2px; }
[hidden] { display: none !important; }
.symbol-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.app-shell { height: 100dvh; min-height: 100%; overflow: hidden; position: relative; background: #83b3bb; }
.map-region, #map { width: 100%; height: 100%; }
.leaflet-container { background: #a9cbd0; font-family: var(--body); }
.leaflet-control-container { display: none; }

.glass-control {
  background: rgb(250 249 242 / 91%);
  border: 1px solid rgb(255 255 255 / 75%);
  box-shadow: 0 8px 28px rgb(0 39 49 / 18%);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
}

.map-header {
  position: absolute;
  z-index: 700;
  top: max(12px, env(safe-area-inset-top));
  left: 12px;
  right: 12px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  pointer-events: none;
}
.brand-lockup {
  min-height: 50px;
  max-width: 210px;
  padding: 6px 13px 6px 7px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  cursor: pointer;
  pointer-events: auto;
}
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: var(--channel);
  color: var(--signal);
  font: 800 13px/1 var(--utility);
  letter-spacing: -.08em;
}
.eyebrow, .section-kicker {
  display: block;
  margin: 0 0 2px;
  color: var(--steel);
  font: 750 9px/1.2 var(--utility);
  letter-spacing: .12em;
  text-transform: uppercase;
}
.brand-lockup strong {
  display: block;
  color: var(--channel);
  font: 760 20px/.95 var(--display);
  letter-spacing: -.035em;
}
.alert-beacon {
  max-width: 176px;
  min-height: 46px;
  border-radius: 14px;
  padding: 8px 12px;
  color: #7c2d14;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
  pointer-events: auto;
}
.alert-beacon svg { width: 18px; height: 18px; fill: var(--buoy); flex: 0 0 auto; }

.map-controls {
  position: absolute;
  z-index: 690;
  top: max(80px, calc(env(safe-area-inset-top) + 68px));
  right: 12px;
  display: grid;
  filter: drop-shadow(0 8px 20px rgb(0 39 49 / 20%));
}
.map-button {
  width: 48px;
  height: 46px;
  border: 0;
  border-bottom: 1px solid rgb(7 52 68 / 10%);
  background: rgb(250 249 242 / 94%);
  display: grid;
  place-items: center;
  color: var(--channel);
  font-size: 25px;
  font-weight: 450;
  cursor: pointer;
}
.map-button:first-child { border-radius: 14px 14px 0 0; }
.map-button.control-divider { border-radius: 0 0 14px 14px; }
.map-button.control-gap { margin-top: 10px; border-radius: 14px 14px 0 0; }
.map-button:last-child { border-radius: 0 0 14px 14px; border-bottom: 0; }
.map-button svg { width: 20px; height: 20px; fill: currentColor; }
.map-button.is-active { background: var(--channel); color: var(--signal); }
.map-button:active { transform: scale(.96); }

.gps-hud {
  position: absolute;
  z-index: 680;
  top: max(80px, calc(env(safe-area-inset-top) + 68px));
  left: 12px;
  min-height: 38px;
  max-width: min(74vw, 310px);
  padding: 8px 11px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--channel);
  font-size: 11px;
  font-weight: 700;
  transition: opacity .2s ease, transform .2s ease;
}
.gps-hud[data-state="tracking"] { color: #134d39; }
.gps-hud[data-state="error"] { color: #8a341b; }
.gps-pulse {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--steel);
  box-shadow: 0 0 0 0 rgb(45 145 163 / 35%);
}
.gps-hud[data-state="locating"] .gps-pulse, .gps-hud[data-state="tracking"] .gps-pulse {
  background: #27a970;
  animation: gps-pulse 1.8s ease-out infinite;
}
.gps-hud[data-state="error"] .gps-pulse { background: var(--buoy); }
.gps-hud button { border: 0; background: transparent; color: inherit; text-decoration: underline; font-weight: 800; padding: 3px; cursor: pointer; }
@keyframes gps-pulse { 70% { box-shadow: 0 0 0 7px rgb(39 169 112 / 0); } 100% { box-shadow: 0 0 0 0 rgb(39 169 112 / 0); } }

.map-source {
  position: absolute;
  z-index: 640;
  left: 12px;
  bottom: max(101px, calc(env(safe-area-inset-bottom) + 88px));
  min-height: 28px;
  max-width: calc(100vw - 84px);
  padding: 6px 9px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: #345e65;
  font: 700 9px/1.2 var(--utility);
  letter-spacing: .02em;
}
.source-dot { width: 7px; height: 7px; border-radius: 50%; background: #36a775; }
.source-dot.is-loading { background: #e4a62f; animation: source-blink .8s ease-in-out infinite alternate; }
.source-dot.is-error { background: var(--buoy); }
@keyframes source-blink { to { opacity: .25; } }

.river-sheet {
  --sheet-visible: min(46dvh, 420px);
  position: absolute;
  z-index: 800;
  left: 0;
  right: 0;
  bottom: 0;
  height: min(calc(100dvh - max(58px, env(safe-area-inset-top))), 760px);
  padding-bottom: env(safe-area-inset-bottom);
  border-radius: 24px 24px 0 0;
  background: var(--chart-white);
  box-shadow: var(--shadow);
  transform: translateY(calc(100% - var(--sheet-visible)));
  transition: transform .3s cubic-bezier(.2,.8,.2,1);
  overflow: hidden;
  touch-action: pan-x;
}
.river-sheet[data-state="collapsed"] { --sheet-visible: calc(86px + env(safe-area-inset-bottom)); }
.river-sheet[data-state="expanded"] { transform: translateY(0); }
.river-sheet.is-dragging { transition: none; }
.sheet-grabber {
  position: relative;
  width: 100%;
  height: 86px;
  padding: 18px 45px 12px 18px;
  border: 0;
  background: var(--channel);
  color: white;
  text-align: left;
  cursor: pointer;
  touch-action: none;
}
.grab-handle {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 38px;
  height: 4px;
  border-radius: 999px;
  transform: translateX(-50%);
  background: rgb(255 255 255 / 32%);
}
.sheet-summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.sheet-summary > span:first-child { min-width: 0; }
.sheet-summary .eyebrow { color: #92b8bd; }
.sheet-summary #place-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: white;
  font: 760 23px/1 var(--display);
  letter-spacing: -.025em;
}
.summary-weather { flex: 0 0 auto; display: grid; justify-items: end; }
.summary-weather strong { color: var(--signal); font: 760 21px/1 var(--display); }
.summary-weather span { margin-top: 4px; color: #b7d0d2; font: 700 9px/1 var(--utility); text-transform: uppercase; }
.sheet-chevron { position: absolute; right: 17px; top: 38px; width: 17px; height: 17px; fill: #9dc0c3; transition: transform .25s ease; }
.river-sheet[data-state="expanded"] .sheet-chevron { transform: rotate(180deg); }
.river-sheet[data-state="collapsed"] .sheet-chevron { transform: rotate(180deg); }
.sheet-content { height: calc(100% - 86px); display: flex; flex-direction: column; opacity: 1; transition: opacity .15s ease; }
.river-sheet[data-state="collapsed"] .sheet-content { opacity: 0; pointer-events: none; }

.sheet-tabs {
  flex: 0 0 auto;
  height: 48px;
  padding: 0 14px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--line);
  background: var(--chart-white);
}
.sheet-tab {
  position: relative;
  border: 0;
  background: transparent;
  color: var(--steel);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.sheet-tab span { margin-left: 3px; color: var(--buoy); font: 700 9px/1 var(--utility); }
.sheet-tab.is-active { color: var(--channel); }
.sheet-tab.is-active::after { content: ""; position: absolute; left: 20%; right: 20%; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--buoy); }
.sheet-scroll { flex: 1 1 auto; min-height: 0; padding: 16px 16px calc(24px + env(safe-area-inset-bottom)); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.tab-panel { animation: panel-in .18s ease-out; }
@keyframes panel-in { from { opacity: .55; transform: translateY(4px); } }

.condition-hero { display: grid; grid-template-columns: minmax(0,1fr) 104px; gap: 14px; align-items: stretch; }
.condition-hero > div:first-child { min-width: 0; padding: 7px 3px; }
.hero-temperature { display: block; color: var(--channel); font: 800 48px/.9 var(--display); letter-spacing: -.06em; }
.hero-summary { margin: 8px 0 0; color: #526e74; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wind-dial { min-height: 102px; border-radius: 19px; background: var(--river-pale); display: grid; place-items: center; align-content: center; color: var(--channel); }
.wind-dial svg { width: 25px; height: 25px; fill: var(--river-blue); margin-bottom: 4px; }
.wind-dial strong { font: 780 20px/1 var(--display); }
.wind-dial span { margin-top: 4px; color: #4f777d; font: 800 9px/1 var(--utility); }

.weather-alert-card {
  width: 100%;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid rgb(255 107 53 / 26%);
  border-radius: 13px;
  background: #fff0e8;
  color: #71321c;
  display: grid;
  grid-template-columns: 22px 1fr 10px;
  align-items: center;
  gap: 9px;
  text-align: left;
  cursor: pointer;
}
.weather-alert-card svg { width: 20px; height: 20px; fill: var(--buoy); }
.weather-alert-card span:nth-child(2) { min-width: 0; display: grid; }
.weather-alert-card strong { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.weather-alert-card small { margin-top: 2px; color: #9b5d46; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.condition-metrics { margin-top: 14px; display: grid; grid-template-columns: repeat(4,1fr); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.condition-metrics div { min-width: 0; padding: 11px 8px; border-right: 1px solid var(--line); display: grid; gap: 5px; }
.condition-metrics div:last-child { border-right: 0; }
.condition-metrics span { color: var(--steel); font: 750 8px/1 var(--utility); letter-spacing: .07em; }
.condition-metrics strong { color: var(--channel); font: 760 13px/1 var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.section-heading { margin: 22px 1px 10px; display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.section-heading h3, .offline-card h3 { margin: 0; color: var(--channel); font: 760 19px/1 var(--display); letter-spacing: -.02em; }
.section-heading > span { color: var(--steel); font: 650 9px/1.2 var(--utility); text-align: right; }
.hourly-forecast { display: grid; grid-auto-flow: column; grid-auto-columns: 82px; gap: 7px; overflow-x: auto; padding: 1px 1px 5px; scrollbar-width: none; }
.hourly-forecast::-webkit-scrollbar { display: none; }
.hourly-forecast.empty-state { display: block; padding: 14px; border: 1px dashed rgb(7 52 68 / 20%); border-radius: 13px; color: var(--steel); font-size: 12px; }
.hour-card { min-height: 98px; padding: 10px 8px; border: 1px solid var(--line); border-radius: 13px; background: #f7f6ee; display: grid; align-content: space-between; }
.hour-card time { color: var(--steel); font: 700 9px/1 var(--utility); }
.hour-card strong { color: var(--channel); font: 760 21px/1 var(--display); }
.hour-card span { color: #527078; font-size: 9px; line-height: 1.2; }
.hour-card small { color: var(--river-blue); font: 700 8px/1 var(--utility); }

.reach-heading { margin-top: 20px; }
.reach-list { display: flex; gap: 8px; overflow-x: auto; padding: 1px 1px 5px; scrollbar-width: none; }
.reach-list::-webkit-scrollbar { display: none; }
.reach-chip { flex: 0 0 auto; min-height: 42px; padding: 7px 13px; border: 1px solid var(--line); border-radius: 12px; background: white; text-align: left; cursor: pointer; }
.reach-chip strong { display: block; color: var(--channel); font-size: 11px; }
.reach-chip small { color: var(--steel); font-size: 9px; }

.nearest-lock-card { padding: 12px; border-radius: 16px; background: var(--channel); color: white; display: grid; grid-template-columns: 42px minmax(0,1fr) auto; gap: 10px; align-items: center; }
.lock-icon { width: 42px; height: 42px; border-radius: 12px; background: var(--signal); display: grid; place-items: center; }
.lock-icon svg { width: 21px; height: 21px; fill: var(--channel); }
.nearest-lock-card .section-kicker { color: #97bcc0; }
.nearest-lock-card strong { display: block; font: 740 16px/1 var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nearest-lock-card span { display: block; margin-top: 4px; color: #b7d2d4; font: 650 9px/1 var(--utility); }
.nearest-lock-card > button { min-height: 38px; padding: 0 12px; border: 1px solid rgb(255 255 255 / 18%); border-radius: 10px; background: rgb(255 255 255 / 9%); color: white; font-size: 10px; font-weight: 800; cursor: pointer; }

.dam-list { display: grid; gap: 7px; }
.dam-row { width: 100%; min-height: 57px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 13px; background: white; display: grid; grid-template-columns: 24px minmax(0,1fr) auto 9px; align-items: center; gap: 8px; text-align: left; cursor: pointer; }
.dam-row:active { background: #edf4f1; }
.dam-index { width: 23px; height: 23px; border-radius: 50%; background: var(--channel); color: var(--signal); display: grid; place-items: center; font: 800 9px/1 var(--utility); }
.dam-main { min-width: 0; display: grid; }
.dam-main strong { color: var(--channel); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dam-main small, .dam-live small { margin-top: 3px; color: var(--steel); font: 650 9px/1 var(--utility); }
.dam-live { display: grid; justify-items: end; }
.dam-live b { color: var(--river-blue); font: 760 12px/1 var(--display); }
.dam-arrow { color: var(--buoy); font-size: 20px; }

.dam-detail { margin-top: 10px; padding: 14px; border: 1px solid rgb(45 145 163 / 20%); border-radius: 15px; background: #e9f3f1; }
.dam-detail-head { display: flex; justify-content: space-between; gap: 10px; }
.dam-detail h3 { margin: 2px 0 0; color: var(--channel); font: 760 20px/1 var(--display); }
.dam-detail-close { width: 34px; height: 34px; border: 0; border-radius: 10px; background: rgb(7 52 68 / 8%); color: var(--channel); font-size: 20px; cursor: pointer; }
.water-metrics { margin: 13px 0; display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; }
.water-metrics div { min-width: 0; padding: 10px 8px; border-radius: 11px; background: rgb(255 255 255 / 70%); }
.water-metrics span { display: block; color: var(--steel); font: 700 8px/1 var(--utility); text-transform: uppercase; }
.water-metrics strong { display: block; margin-top: 5px; color: var(--channel); font: 760 15px/1 var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.water-metrics small { display: block; margin-top: 4px; color: var(--steel); font: 650 8px/1 var(--utility); }
.lock-contact { margin: 0 0 12px; color: #496a70; font-size: 11px; line-height: 1.5; }
.lock-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.lock-actions a { min-height: 39px; padding: 9px; border-radius: 10px; display: grid; place-items: center; text-decoration: none; text-align: center; font-size: 10px; font-weight: 800; }
.lock-actions a:first-child { background: var(--channel); color: white; }
.lock-actions a:last-child { border: 1px solid var(--line); background: white; color: var(--channel); }
.detail-loading { padding: 10px 0; color: var(--steel); font-size: 12px; }

.offline-card { padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: #eef4ef; display: grid; grid-template-columns: 45px minmax(0,1fr); column-gap: 12px; }
.offline-icon { width: 45px; height: 45px; border-radius: 13px; display: grid; place-items: center; background: var(--channel); }
.offline-icon svg { width: 22px; height: 22px; fill: var(--signal); }
.offline-card p { margin: 7px 0 0; color: #587178; font-size: 11px; line-height: 1.45; }
.primary-action { min-height: 42px; padding: 0 14px; border: 0; border-radius: 11px; background: var(--buoy); color: white; display: inline-grid; place-items: center; text-decoration: none; font-size: 11px; font-weight: 850; cursor: pointer; }
.offline-card .primary-action { grid-column: 1 / -1; margin-top: 14px; width: 100%; }
.primary-action:disabled { opacity: .55; cursor: wait; }
.cache-meter { grid-column: 1 / -1; height: 5px; margin-top: 14px; border-radius: 999px; background: rgb(7 52 68 / 10%); overflow: hidden; }
.cache-meter span { display: block; width: 0; height: 100%; background: var(--river-blue); transition: width .2s ease; }
.cache-meta { grid-column: 1 / -1; margin-top: 8px; display: flex; justify-content: space-between; color: var(--steel); font: 650 9px/1 var(--utility); }
.cache-meta button { border: 0; background: transparent; color: var(--channel); padding: 0; text-decoration: underline; cursor: pointer; }

.settings-list { margin-top: 12px; border: 1px solid var(--line); border-radius: 15px; overflow: hidden; }
.settings-row { width: 100%; min-height: 61px; padding: 9px 11px; border: 0; border-bottom: 1px solid var(--line); background: white; display: grid; grid-template-columns: 36px minmax(0,1fr) auto; align-items: center; gap: 10px; text-align: left; cursor: pointer; }
.settings-row:last-child { border-bottom: 0; }
.settings-icon { width: 36px; height: 36px; border-radius: 10px; background: #dcebea; display: grid; place-items: center; }
.settings-icon svg { width: 18px; height: 18px; fill: var(--channel); }
.settings-row > span:nth-child(2) { min-width: 0; display: grid; }
.settings-row strong { color: var(--channel); font-size: 12px; }
.settings-row small { margin-top: 3px; color: var(--steel); font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.settings-row > span:last-child:not(.toggle) { color: var(--buoy); }
.toggle { width: 35px; height: 20px; border-radius: 999px; background: #c5d1cf; padding: 2px; transition: background .2s; }
.toggle::after { content: ""; display: block; width: 16px; height: 16px; border-radius: 50%; background: white; box-shadow: 0 1px 3px rgb(0 0 0 / 20%); transition: transform .2s; }
.settings-row[aria-pressed="true"] .toggle { background: #3caf76; }
.settings-row[aria-pressed="true"] .toggle::after { transform: translateX(15px); }
.data-note { margin-top: 12px; padding: 13px; border-left: 3px solid var(--river-blue); background: rgb(45 145 163 / 7%); color: #567178; font-size: 10px; line-height: 1.45; }
.data-note strong { color: var(--channel); }
.data-note p { margin: 4px 0 0; }
.safety-note { margin: 20px 2px 4px; color: #758e92; font-size: 9px; line-height: 1.45; }

.toast { position: absolute; z-index: 1100; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom)); width: max-content; max-width: calc(100vw - 32px); padding: 10px 14px; border-radius: 11px; transform: translateX(-50%); background: var(--channel-deep); color: white; box-shadow: 0 8px 30px rgb(0 0 0 / 30%); font-size: 11px; font-weight: 700; }
.alert-dialog { width: min(430px, calc(100vw - 28px)); max-height: min(680px, calc(100dvh - 28px)); padding: 22px; border: 0; border-radius: 20px; background: var(--chart-white); color: var(--channel-ink); box-shadow: 0 25px 80px rgb(0 0 0 / 36%); }
.alert-dialog::backdrop { background: rgb(3 36 47 / 64%); backdrop-filter: blur(4px); }
.alert-dialog h2 { margin: 4px 35px 8px 0; color: var(--channel); font: 760 27px/1 var(--display); }
.alert-dialog > p:not(.section-kicker):not(.dialog-meta) { max-height: 45dvh; overflow-y: auto; color: #435f65; font-size: 12px; line-height: 1.55; white-space: pre-line; }
.dialog-meta { color: var(--buoy); font: 700 9px/1.3 var(--utility); }
.dialog-close { position: absolute; top: 13px; right: 13px; width: 36px; height: 36px; border: 0; border-radius: 10px; background: rgb(7 52 68 / 8%); font-size: 22px; cursor: pointer; }
.alert-dialog .primary-action { margin-top: 8px; width: 100%; }

.dam-map-marker { background: transparent; border: 0; }
.dam-marker-inner { width: 25px; height: 25px; border: 2px solid white; border-radius: 8px 8px 8px 2px; transform: rotate(-45deg); display: grid; place-items: center; background: var(--buoy); box-shadow: 0 3px 10px rgb(0 36 47 / 38%); }
.dam-marker-inner span { color: white; transform: rotate(45deg); font: 800 9px/1 var(--utility); }
.vessel-marker-shell { background: transparent; border: 0; overflow: visible !important; }
.vessel-course { --heading: 0deg; position: relative; width: 34px; height: 34px; display: grid; place-items: center; transform: rotate(var(--heading)); filter: drop-shadow(0 3px 4px rgb(0 42 55 / 38%)); }
.vessel-arrow { position: absolute; top: -9px; width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 13px solid var(--buoy); }
.vessel-dot { width: 21px; height: 21px; border: 4px solid white; border-radius: 50%; background: var(--channel); box-shadow: 0 0 0 3px var(--buoy); }
.vessel-marker-shell.is-stale { opacity: .6; }
.vessel-marker-shell.no-heading .vessel-arrow { display: none; }
.leaflet-popup-content-wrapper { padding: 0; border-radius: 14px; background: var(--chart-white); color: var(--channel); box-shadow: 0 12px 34px rgb(0 33 43 / 28%); }
.leaflet-popup-tip { background: var(--chart-white); }
.leaflet-popup-content { margin: 12px 14px; font-size: 11px; line-height: 1.4; }
.leaflet-popup-content strong { font: 760 15px/1 var(--display); }
.leaflet-popup-content button { margin-top: 8px; border: 0; background: transparent; color: var(--buoy); padding: 0; font-weight: 800; cursor: pointer; }

.app-shell[data-theme="night"] { --chart-white: #0b303b; --channel-ink: #e2efec; --line: rgb(196 227 224 / 14%); color-scheme: dark; }
.app-shell[data-theme="night"] .leaflet-tile-pane { filter: brightness(.43) contrast(1.3) saturate(.7) hue-rotate(145deg); }
.app-shell[data-theme="night"] .leaflet-container { background: #062833; }
.app-shell[data-theme="night"] .glass-control { background: rgb(7 40 51 / 91%); border-color: rgb(196 227 224 / 13%); color: #e5f0ed; }
.app-shell[data-theme="night"] .brand-lockup strong, .app-shell[data-theme="night"] .gps-hud, .app-shell[data-theme="night"] .map-source { color: #e5f0ed; }
.app-shell[data-theme="night"] .brand-mark { background: var(--signal); color: var(--channel); }
.app-shell[data-theme="night"] .map-button { background: rgb(8 46 58 / 96%); color: #dbe9e7; border-color: rgb(255 255 255 / 10%); }
.app-shell[data-theme="night"] .map-button.is-active { background: var(--signal); color: var(--channel); }
.app-shell[data-theme="night"] .sheet-tabs, .app-shell[data-theme="night"] .river-sheet { background: #0b303b; }
.app-shell[data-theme="night"] .hero-temperature, .app-shell[data-theme="night"] .section-heading h3, .app-shell[data-theme="night"] .offline-card h3, .app-shell[data-theme="night"] .condition-metrics strong, .app-shell[data-theme="night"] .dam-main strong, .app-shell[data-theme="night"] .settings-row strong { color: #eef6f2; }
.app-shell[data-theme="night"] .hero-summary, .app-shell[data-theme="night"] .hour-card span, .app-shell[data-theme="night"] .data-note, .app-shell[data-theme="night"] .offline-card p { color: #a9c3c3; }
.app-shell[data-theme="night"] .wind-dial { background: #174957; color: #ecf5f1; }
.app-shell[data-theme="night"] .condition-metrics, .app-shell[data-theme="night"] .hour-card, .app-shell[data-theme="night"] .reach-chip, .app-shell[data-theme="night"] .dam-row, .app-shell[data-theme="night"] .settings-row { background: #103845; }
.app-shell[data-theme="night"] .offline-card, .app-shell[data-theme="night"] .dam-detail { background: #133e49; }

@media (min-width: 800px) {
  .map-header { left: 22px; right: 22px; top: 22px; }
  .map-controls { right: 22px; top: 90px; }
  .gps-hud { left: auto; right: 80px; top: 90px; }
  .map-source { left: auto; right: 22px; bottom: 22px; }
  .river-sheet {
    left: 22px;
    right: auto;
    bottom: 22px;
    width: 410px;
    height: var(--sheet-visible);
    border-radius: 24px;
    transform: none;
    transition: height .3s cubic-bezier(.2,.8,.2,1);
  }
  .river-sheet[data-state="collapsed"] { --sheet-visible: 86px; }
  .river-sheet[data-state="peek"] { --sheet-visible: min(58dvh, 510px); }
  .river-sheet[data-state="expanded"] { --sheet-visible: calc(100dvh - 44px); }
  .condition-hero { grid-template-columns: 1fr 112px; }
  .toast { bottom: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
