:root {
  --navy: #1B5EA8;
  --navy-deep: #123F73;
  --blue: #3D78BB;
  --yellow: #F5C200;
  --ink: #0F2740;
  --muted: #4A5B6E;
  --line: #DCE4EE;
  --ground: #F3F6FA;
  --card: #FFFFFF;
  --amber: #E0A21A;
  /* Theme colors. Light values here; dark values in the prefers-color-scheme block below. */
  --brand: #1B5EA8; --accent: #1B5EA8; --accent-strong: #123F73;
  --header: #1B5EA8; --header-sub: #D6E4F5; --deep: #0F2740;
  --soft: #E6EEF8; --hair: #E6ECF3; --hover: #F7F9FC; --body-ink: #2D3E52;
  --chip-bg: #EEF2F7; --chip-ink: #3A4B5E; --chip-border: #C7D6E8;
  --bar: #FFFFFF; --tab-ink: #56677A; --toggle-bg: rgba(255, 255, 255, 0.94);
  --note-bg: #FFF3D6; --note-ink: #5E3B00; --map-bg: #E8EEE4;
  --seg-base: #D3E3F5; --seg-opacity: 0.5; --marker-bg: #FFFFFF; --marker-ring: #0F2740;
  --dial: #FFFFFF; --dial-ring: #C7D6E8; --shadow: 0 1px 2px rgba(15, 39, 64, 0.08);
  --ok: #2E9E6A;
  color-scheme: light dark;
  --font: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Barlow Semi Condensed', 'Barlow', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--accent); }
a:hover { color: var(--accent-strong); }
button { font: inherit; }
[hidden] { display: none !important; }

.app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--ground);
}

/* Header */
.top {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--header);
  color: #FFFFFF;
  padding: calc(env(safe-area-inset-top, 0px) + 14px) 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand .tile {
  width: 38px; height: 38px; border-radius: 10px; background: #FFFFFF;
  display: flex; align-items: center; justify-content: center; flex: none;
}
.brand .tile img { width: 32px; height: 27px; object-fit: contain; }
.eyebrow { font-weight: 700; font-size: 12px; letter-spacing: 0.14em; color: var(--yellow); }
.top h1 { margin: 0; font: 700 26px/1.1 var(--display); }
.top .sub { margin: 0; font-size: 14px; color: var(--header-sub); }
/* Show-day status banner along the bottom of the header, on every tab. */
.show-banner {
  display: block; margin: 6px -20px -18px; padding: 10px 20px; border-top: 1px solid rgba(255, 255, 255, 0.14);
  background: #123F73; color: #F5C200; font-weight: 700; font-size: 15px; line-height: 1.3; text-decoration: none;
}
.show-banner:hover { color: #F5C200; }

/* Main */
main {
  flex: 1;
  padding: 16px 16px calc(96px + env(safe-area-inset-bottom, 0px));
}
.view { display: flex; flex-direction: column; gap: 14px; }

.card {
  background: var(--card);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.card h2 { margin: 0; font: 700 19px/1.15 var(--display); }
.card.flush { padding: 0; gap: 0; overflow: hidden; }
.card.flush > h2, .card.flush > .card-head { padding: 14px 16px 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; line-height: 1.45; }
.foot { margin: 0 2px 8px; font-size: 13px; line-height: 1.45; color: var(--muted); }

/* River now */
.stage-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.stage { font: 700 60px/0.9 var(--display); }
.unit { font: 700 20px/1 var(--display); color: var(--muted); margin-left: 6px; }
.stage-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; text-align: right; }
.pill { font-weight: 700; font-size: 15px; line-height: 1; padding: 7px 12px; border-radius: 999px; background: var(--chip-bg); color: var(--ink); }
.cat-none { background: #E2F3EA; color: #17603F; }
.cat-action { background: #FCE9B8; color: #6B4200; }
.cat-minor { background: #FBD9C3; color: #8A2E05; }
.cat-moderate { background: #F7CFCF; color: #8F1616; }
.cat-major { background: #E4D8F8; color: #4C1D95; }

.gauge { position: relative; height: 14px; }
.gauge .segs { display: flex; height: 100%; border-radius: 999px; overflow: hidden; opacity: var(--seg-opacity); }
.gauge .seg { height: 100%; }
.gauge .fill {
  position: absolute; left: 0; top: 0; height: 100%; border-radius: 999px; overflow: hidden;
  transform: scaleX(0); transform-origin: left center;
  transition: transform 0.75s cubic-bezier(0.2, 0.8, 0.2, 1) 0.1s;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.6) inset;
}
.gauge.ready .fill { transform: scaleX(1); }
.gauge .sheen {
  position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 0%, rgba(255, 255, 255, 0.45) 45%, transparent 60%);
  transform: translateX(-100%);
  animation: sheen 2.1s ease-in-out 1.05s infinite;
}
/* 1.3 s sweep, then 0.8 s rest */
@keyframes sheen { 0% { transform: translateX(-100%); } 62%, 100% { transform: translateX(160%); } }
.gauge .marker {
  position: absolute; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px;
  background: var(--marker-bg); border: 4px solid var(--marker-ring); border-radius: 999px;
  box-shadow: 0 2px 6px rgba(15, 39, 64, 0.3);
  opacity: 0; transform: scale(0.4);
  transition: opacity 0.3s ease 0.7s, transform 0.4s cubic-bezier(0.3, 1.6, 0.5, 1) 0.7s;
}
.gauge.ready .marker { opacity: 1; transform: scale(1); }
.gauge-labels { position: relative; height: 14px; font-weight: 600; font-size: 12px; color: var(--muted); }
.gauge-labels span { position: absolute; transform: translateX(-50%); }
.gauge-labels span:first-child { transform: none; }

.banner {
  display: flex; gap: 10px; align-items: flex-start;
  border-radius: 12px; padding: 12px 14px;
  font-weight: 600; font-size: 15px; line-height: 1.35;
}
.banner svg { flex: none; margin-top: 1px; }
.banner.info { background: #E6EEF8; color: var(--navy-deep); }
.banner.warn { background: #FFF3D6; color: #5E3B00; }
.banner.danger { background: #FBE1E1; color: #7F1414; }
.banner.purple { background: #EEE6FB; color: #41187F; }

/* Forecast chart */
.chart { position: relative; height: 160px; display: flex; align-items: flex-end; gap: 10px; padding: 0 2px; }
.chart.empty { height: auto; }
.fc-none { margin: 0; font-size: 15px; line-height: 1.45; color: var(--body-ink); }
.chart .bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.chart .bar-val { font: 700 14px/1 var(--display); }
.chart .bar { width: 100%; border-radius: 6px 6px 2px 2px; background: var(--blue); transform-origin: bottom center; animation: grow 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: var(--d, 0ms); }
.chart .bar-val { animation: fadein 0.4s ease both; animation-delay: calc(var(--d, 0ms) + 350ms); }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.chart .bar.high { background: var(--amber); }
.chart .action-line { position: absolute; left: 0; right: 0; border-top: 2px dashed #B26B00; }
.chart .action-label {
  position: absolute; right: 0; font-weight: 700; font-size: 11px; line-height: 1; color: #8A5300;
  background: var(--card); padding: 0 0 0 4px;
}
.chart-days { display: flex; gap: 10px; padding: 0 2px; }
.chart-days span { flex: 1; text-align: center; font-weight: 600; font-size: 13px; color: var(--muted); }

/* Weather tiles */
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tile-wx { background: var(--ground); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 6px; min-width: 0; animation: rise 0.38s cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: var(--d, 0ms); }
.tile-wx strong { font-variant-numeric: tabular-nums; }
.wx-ic { color: var(--accent); }
.tile-wx strong { font: 700 20px/1.05 var(--display); }
.tile-wx span { font-size: 13px; color: var(--muted); }
.ext { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; min-height: 36px; }

.next-event {
  text-decoration: none; background: var(--deep); color: #FFFFFF; border-radius: 16px; padding: 16px 18px;
  display: flex; align-items: center; gap: 14px;
}
.next-event:hover { color: #FFFFFF; }
.next-event .ne-body { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.next-event .ne-label { font-weight: 700; font-size: 12px; letter-spacing: 0.12em; color: var(--yellow); }
.next-event .ne-title { font: 700 19px/1.15 var(--display); }
.next-event .ne-when { font-size: 14px; color: #C9D8EA; }

/* Refresh: soft full-width button; fills green from the left when the update succeeds. */
.refresh-bar {
  position: relative; overflow: hidden; width: 100%; min-height: 46px; border: none; border-radius: 12px;
  background: var(--soft); color: var(--accent); font: 700 15px var(--font); cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: transform 0.12s ease, color 0.2s ease, background-color 0.2s ease;
}
.refresh-bar:active { transform: scale(0.98); }
.refresh-bar[disabled] { cursor: default; }
.refresh-bar .rb-fill { position: absolute; inset: 0; background: var(--ok); transform: scaleX(0); transform-origin: left center; }
.refresh-bar .rb-label { position: relative; display: inline-flex; align-items: center; gap: 8px; }
.refresh-bar.busy .ic { animation: spin 0.8s cubic-bezier(0.5, 0.1, 0.3, 1) infinite; }
.refresh-bar.done { color: #FFFFFF; }
.refresh-bar.done .rb-fill { transform: scaleX(1); transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1); }
.refresh-bar.done .ic { animation: pop 0.35s cubic-bezier(0.3, 1.6, 0.5, 1) 0.25s both; }
.refresh-bar.failed { background: var(--note-bg); color: var(--note-ink); font-size: 14px; }
.refresh-bar.fading .rb-label { opacity: 0; transition: opacity 0.4s ease; }
.refresh-bar.fading .rb-fill { opacity: 0; transition: opacity 0.4s ease; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { from { transform: scale(0.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Wind compass */
.dial { width: 40px; height: 40px; }
.dial svg { width: 100%; height: 100%; display: block; overflow: visible; animation: dialin 0.45s ease-out 0.06s both; }
@keyframes dialin { from { opacity: 0; transform: scale(0.6); } 70% { opacity: 1; transform: scale(1.06); } to { opacity: 1; transform: scale(1); } }
.dial .d-face { fill: var(--dial); stroke: var(--dial-ring); stroke-width: 1.5; }
.dial .d-ticks { stroke: var(--muted); stroke-width: 1.4; stroke-linecap: round; opacity: 0.55; }
.dial .d-n { font: 700 6.4px var(--font); fill: var(--accent); }
.dial .needle { transform-origin: 20px 20px; transform-box: view-box; }
.dial .d-head { fill: var(--brand); }
.dial .d-tail { stroke: var(--brand); stroke-width: 2.2; stroke-linecap: round; opacity: 0.55; }
.dial .d-hub { fill: var(--card); stroke: var(--brand); stroke-width: 1.4; }

/* Events */
.featured { background: var(--deep); color: #FFFFFF; border-radius: 18px; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.featured .f-label { font-weight: 700; font-size: 12px; letter-spacing: 0.12em; color: var(--yellow); }
.featured h2 { margin: 0; font: 700 30px/1.05 var(--display); }
.featured p { margin: 0; color: #C9D8EA; font-size: 15px; line-height: 1.4; }
.featured .f-meta { display: flex; flex-direction: column; gap: 8px; font-weight: 600; font-size: 15px; line-height: 1.3; }
.featured .f-meta div { display: flex; align-items: center; gap: 10px; }
.featured .f-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.featured .f-actions .btn { min-width: 120px; }
.btn {
  flex: 1; min-height: 46px; border-radius: 12px; border: none; cursor: pointer;
  font-weight: 700; font-size: 15px; display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none; padding: 0 14px;
}
.btn-yellow { background: var(--yellow); color: #1B3A5C; }
.btn-yellow:hover { color: #1B3A5C; }
.btn-ghost { background: transparent; color: #FFFFFF; border: 1.5px solid rgba(255, 255, 255, 0.6); }
.btn-ghost:hover { color: #FFFFFF; }
.btn-blue { background: var(--brand); color: #FFFFFF; }

.ev { background: var(--card); border-radius: 14px; padding: 12px; display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow); }
.ev-date { flex: none; width: 54px; height: 58px; border-radius: 10px; background: var(--soft); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.ev-date .m { font-weight: 700; font-size: 12px; letter-spacing: 0.06em; color: var(--accent); }
.ev-date .d { font: 700 20px/1 var(--display); }
.ev-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ev-body strong { font-size: 16px; line-height: 1.2; }
.ev-body span { font-size: 14px; color: var(--muted); line-height: 1.3; }
.icon-btn {
  flex: none; width: 44px; height: 44px; border-radius: 12px; border: 1.5px solid var(--chip-border); background: var(--card);
  color: var(--accent); display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.section-title { margin: 4px 2px 0; font: 700 19px/1.1 var(--display); }

/* Map */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--chip-border); background: var(--card);
  color: var(--ink); font-weight: 600; font-size: 14px; cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #FFFFFF; }
.map-wrap { position: relative; z-index: 0; isolation: isolate; border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); }
#harbor-map { height: 46vh; min-height: 280px; background: var(--map-bg); }
.map-note { background: var(--note-bg); color: var(--note-ink); padding: 10px 14px; font-weight: 600; font-size: 13px; line-height: 1.4; }
.pin {
  width: 30px; height: 30px; border-radius: 999px; color: #FFFFFF; border: 2px solid #FFFFFF;
  display: flex; align-items: center; justify-content: center; font: 700 14px/1 var(--font);
  box-shadow: 0 1px 4px rgba(15, 39, 64, 0.35);
}
.leaflet-marker-icon .pin { animation: drop 0.45s cubic-bezier(0.3, 1.5, 0.5, 1) both; animation-delay: var(--d, 0ms); }
@keyframes drop { from { opacity: 0; transform: translateY(-14px) scale(0.7); } to { opacity: 1; transform: none; } }
.place {
  width: 100%; text-align: left; background: var(--card); border: none; border-radius: 14px; padding: 12px 14px;
  display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow); cursor: pointer; color: var(--ink);
}
.place .pin { flex: none; border: none; box-shadow: none; }
.place .p-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.place .p-body strong { font-size: 16px; line-height: 1.2; }
.place .p-body span { font-size: 14px; color: var(--muted); }
.place .p-cat { flex: none; font-weight: 600; font-size: 12px; color: var(--chip-ink); background: var(--chip-bg); padding: 5px 8px; border-radius: 6px; }

/* Club */
.row {
  display: flex; align-items: center; gap: 12px; padding: 13px 16px; min-height: 48px;
  text-decoration: none; color: var(--ink); border-top: 1px solid var(--hair);
}
.row:hover { background: var(--hover); color: var(--ink); }
.row .r-body { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.row .r-body strong { font-weight: 600; font-size: 16px; line-height: 1.25; }
.row .r-body span { font-size: 13px; color: var(--muted); }
.call-911 {
  flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 18px;
  border-radius: 12px; background: #B91C1C; color: #FFFFFF; text-decoration: none; font-weight: 700; font-size: 17px;
}
.call-911:hover { color: #FFFFFF; }
.club-head { display: flex; align-items: center; gap: 14px; }
.club-head img { width: 70px; height: 60px; object-fit: contain; flex: none; }
.card.flush > .row:first-child { border-top: none; }
.hub-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hub-tile {
  background: var(--card); border-radius: 16px; padding: 16px; min-height: 96px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; justify-content: space-between; gap: 12px;
  color: var(--ink); text-decoration: none;
}
.hub-tile svg { color: var(--accent); }
.hub-tile span { font-weight: 600; font-size: 16px; line-height: 1.2; }
.hub-tile:hover { background: var(--hover); color: var(--ink); }
.timeline { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.timeline li { display: flex; gap: 14px; align-items: baseline; padding: 11px 0; border-top: 1px solid var(--hair); font-size: 16px; line-height: 1.4; color: var(--body-ink); }
.timeline li:first-child { border-top: none; padding-top: 0; }
.timeline li:last-child { padding-bottom: 0; }
.timeline .yr { flex: none; width: 52px; font: 700 17px/1.2 var(--display); color: var(--accent); }
.shop-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.product {
  background: var(--card); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 4px; padding-bottom: 12px; color: var(--ink); text-decoration: none;
}
.product:hover { color: var(--ink); background: var(--hover); }
.product .p-img { aspect-ratio: 1; background: var(--soft); margin-bottom: 6px; }
.product .p-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product strong { padding: 0 12px; font-weight: 600; font-size: 15px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product span { padding: 0 12px; font-weight: 700; font-size: 15px; color: var(--accent); }
.photo-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.photo-row img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; background: var(--soft); }

/* River: what this level means */
.impacts { display: flex; flex-direction: column; gap: 10px; padding-top: 12px; border-top: 1px solid var(--hair); }
.impacts h3 { margin: 0; font: 700 16px/1.2 var(--display); }
.imp { display: flex; flex-direction: column; gap: 3px; }
.imp-label { font-weight: 700; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.imp p { margin: 0; font-size: 15px; line-height: 1.4; color: var(--body-ink); }
.imp p strong { color: var(--ink); }
.imp-gap { font-size: 13px; color: var(--muted); }
.imp-foot { margin: 0; font-size: 12px; line-height: 1.4; color: var(--muted); }

/* Tab bar */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000;
  max-width: 560px; margin: 0 auto;
  display: flex; background: var(--bar); border-top: 1px solid var(--line);
  padding: 6px 6px calc(8px + env(safe-area-inset-bottom, 0px));
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  text-decoration: none; color: var(--tab-ink); font-weight: 600; font-size: 12px; line-height: 1; min-height: 52px;
}
.tab:hover { color: var(--accent); }
.tab[aria-current="page"] { color: var(--accent); }

/* Skeleton */
.loading { color: var(--muted); font-size: 14px; }

@media (min-width: 600px) {
  main { padding-left: 20px; padding-right: 20px; }
}

/* ---------- header back link ---------- */
.back {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; min-height: 36px;
  margin: 2px 0 -2px -6px; padding: 0 8px 0 2px; border-radius: 10px;
  color: #FFFFFF; text-decoration: none; font-weight: 600; font-size: 15px;
}
.back:hover { color: #FFFFFF; background: rgba(255, 255, 255, 0.12); }

/* ---------- motion ---------- */
/* Fade up as it scrolls into view (classes added by app.js). */
.reveal { opacity: 0; transform: translateY(16px); }
.reveal.in {
  opacity: 1; transform: none;
  transition: opacity 0.5s ease var(--rd, 0ms), transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) var(--rd, 0ms);
}
/* These wait until their container is on screen. */
.chart:not(.in) .bar, .chart:not(.in) .bar-val,
.tiles:not(.in) .tile-wx, .tiles:not(.in) .dial svg { animation-play-state: paused; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.row, .btn, .chip, .place, .ev, .icon-btn, .next-event, .person, .sponsor, .hub-tile, .product, .call-911 { transition: transform 0.12s ease, background-color 0.15s ease; }
.row:active, .btn:active, .chip:active, .place:active, .ev:active, .icon-btn:active, .next-event:active, .sponsor:active, .hub-tile:active, .product:active { transform: scale(0.98); }
.tab svg { transition: transform 0.25s cubic-bezier(0.3, 1.6, 0.5, 1); }
.tab[aria-current="page"] svg { transform: translateY(-2px) scale(1.08); }
.tab { position: relative; }
.tab[aria-current="page"]::after {
  content: ""; position: absolute; top: 0; left: 50%; width: 24px; height: 3px; margin-left: -12px;
  border-radius: 0 0 3px 3px; background: var(--accent); animation: fadein 0.25s ease;
}
.pill.cat-action, .pill.cat-minor, .pill.cat-moderate, .pill.cat-major { animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(224, 162, 26, 0); } 50% { box-shadow: 0 0 0 6px rgba(224, 162, 26, 0.22); } }
.loading { position: relative; display: inline-block; background: linear-gradient(90deg, var(--muted) 0%, #A9B6C4 50%, var(--muted) 100%); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 1.6s linear infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- map style toggle ---------- */
.map-toggle {
  position: absolute; top: 10px; right: 10px; z-index: 1000;
  display: flex; padding: 3px; border-radius: 999px;
  background: var(--toggle-bg); box-shadow: 0 1px 6px rgba(15, 39, 64, 0.25);
}
.map-toggle button {
  position: relative; z-index: 1; flex: 1 1 0; min-width: 84px; min-height: 34px; padding: 0 12px; border: none; background: none; cursor: pointer;
  font-weight: 700; font-size: 13px; color: var(--chip-ink); border-radius: 999px; transition: color 0.2s ease;
}
.map-toggle button[aria-pressed="true"] { color: #FFFFFF; }
.map-toggle .thumb {
  position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); border-radius: 999px; background: var(--brand);
  transition: transform 0.28s cubic-bezier(0.3, 1.3, 0.5, 1);
}
.map-toggle.on-sat .thumb { transform: translateX(100%); }

/* ---------- club pages ---------- */
.lead { margin: 0 2px; font-size: 16px; line-height: 1.5; color: var(--body-ink); }
.body { margin: 0; font-size: 16px; line-height: 1.5; color: var(--body-ink); }
.ticks { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.steps { margin: 8px 0 10px; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; font-size: 15px; line-height: 1.4; color: var(--body-ink); }
.ticks li { position: relative; padding-left: 28px; font-size: 16px; line-height: 1.45; color: var(--body-ink); }
.ticks li::before {
  content: ""; position: absolute; left: 2px; top: 3px; width: 18px; height: 18px; border-radius: 999px;
  background: var(--soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231B5EA8' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12 4 4 8-8'/%3E%3C/svg%3E") center / 12px no-repeat;
}
.hero-card { align-items: center; text-align: center; padding: 22px 18px; }
.hero-logo { width: 130px; height: auto; }

.board-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.person {
  background: var(--card); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow);
  display: flex; flex-direction: column;
}
.person .photo { position: relative; aspect-ratio: 1 / 1; background: var(--soft); overflow: hidden; }
.person .photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s ease; }
.person:hover .photo img { transform: scale(1.03); }
.person .photo.no-photo {
  background:
    radial-gradient(120% 60% at 50% 120%, rgba(61, 120, 187, 0.65) 0 45%, transparent 46%),
    radial-gradient(120% 60% at 30% 135%, rgba(255, 255, 255, 0.08) 0 50%, transparent 51%),
    linear-gradient(160deg, #1B5EA8 0%, #123F73 100%);
}
.person .photo.no-photo::before {
  content: attr(data-initials); position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font: 700 46px/1 var(--display); letter-spacing: 0.04em; color: var(--yellow);
}
.person .p-info { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.person .role { font-weight: 700; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.person strong { font: 700 17px/1.15 var(--display); }
.person .bio { font-size: 13px; line-height: 1.35; color: var(--muted); }
.person .mail { font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }

.commodores { margin: 0; padding: 4px 0; list-style: none; }
.commodores li { display: flex; gap: 14px; align-items: baseline; padding: 11px 16px; border-top: 1px solid var(--hair); font-size: 16px; }
.commodores li:first-child { border-top: none; }
.commodores .yr { flex: none; width: 86px; font: 700 16px/1 var(--display); color: var(--accent); }

.price-card { background: var(--deep); color: #FFFFFF; border-radius: 18px; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.price-card .f-label { font-weight: 700; font-size: 12px; letter-spacing: 0.12em; color: var(--yellow); }
.price-card .price { display: flex; align-items: baseline; gap: 8px; }
.price-card .amt { font: 700 52px/1 var(--display); }
.price-card .per { font-size: 16px; color: #C9D8EA; }
.price-card p { margin: 0; color: #C9D8EA; font-size: 15px; line-height: 1.45; }
.price-card .fine { font-size: 12px; color: #9FB4CC; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 10px; background: var(--ground); font-size: 15px; }
.kv span { color: var(--muted); }
.kv strong { text-align: right; }
.btn-outline { background: var(--card); color: var(--accent); border: 1.5px solid var(--chip-border); }
.btn-blue:hover { color: #FFFFFF; }
.tiers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tier { background: var(--ground); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.tier strong { font: 700 16px/1.1 var(--display); }
.tier span { font-size: 13px; color: var(--muted); }
.sponsor-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.sponsor {
  /* Stays light in dark mode: sponsor logos are made for a white background. */
  background: #FFFFFF; border-radius: 14px; padding: 14px; min-height: 96px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px; text-align: center; text-decoration: none; color: #0F2740;
  box-shadow: 0 1px 3px rgba(15, 39, 64, 0.1);
}
.sponsor img { max-width: 100%; max-height: 56px; object-fit: contain; }
.sponsor strong { font: 700 16px/1.2 var(--display); }
.sponsor span { font-size: 12px; font-weight: 600; color: #1B5EA8; letter-spacing: 0.04em; text-transform: uppercase; }

/* ---------- river trend ---------- */
.trend { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: 13px; line-height: 1.2; }
.trend.up { color: #A15C00; }
.trend.down { color: #1F7A52; }
.trend.steady { color: var(--muted); }
.spark-wrap { display: flex; flex-direction: column; gap: 6px; }
.spark-head { display: flex; justify-content: space-between; align-items: baseline; font-weight: 700; font-size: 13px; }
.spark-head span:last-child { font-weight: 600; color: var(--muted); }
.spark-plot { position: relative; height: 64px; }
.spark { display: block; width: 100%; height: 64px; overflow: visible; }
.spark .s-line { fill: none; stroke: var(--brand); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.spark .s-area { opacity: 0; }
.spark .sf-top { stop-color: var(--brand); stop-opacity: 0.22; }
.spark .sf-bottom { stop-color: var(--brand); stop-opacity: 0; }
.spark .s-action { stroke: #B26B00; stroke-width: 1.5; stroke-dasharray: 4 4; fill: none; }
.spark-dot { position: absolute; right: -5px; width: 10px; height: 10px; margin-top: -5px; border-radius: 999px; background: var(--brand); box-shadow: 0 0 0 3px var(--card); opacity: 0; transform: scale(0.3); }
.spark-wrap.in .s-line { stroke-dashoffset: 0; transition: stroke-dashoffset 1.4s cubic-bezier(0.4, 0, 0.2, 1) 0.1s; }
.spark-wrap.in .s-area { opacity: 1; transition: opacity 0.6s ease 0.9s; }
.spark-wrap.in .spark-dot { opacity: 1; transform: none; transition: opacity 0.3s ease 1.4s, transform 0.4s cubic-bezier(0.3, 1.6, 0.5, 1) 1.4s; }
.spark-days { position: relative; height: 14px; font-weight: 600; font-size: 12px; color: var(--muted); }
.spark-days span { position: absolute; transform: translateX(-50%); }
.spark-days span.now { right: 0; transform: none; }

/* ---------- July 3rd fireworks card ---------- */
.fw { position: relative; overflow: hidden; background: var(--deep); color: #FFFFFF; border-radius: 18px; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.fw .f-label { font-weight: 700; font-size: 12px; letter-spacing: 0.12em; color: var(--yellow); padding-right: 96px; }
.fw h2 { margin: 0; font: 700 28px/1.05 var(--display); padding-right: 64px; }
.fw .f-meta { display: flex; flex-direction: column; gap: 8px; font-weight: 600; font-size: 15px; line-height: 1.3; }
.fw .f-meta div { display: flex; align-items: center; gap: 10px; }
.fw .f-actions { display: flex; gap: 10px; }
.fw-status { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; margin-right: 84px; border-radius: 12px; background: rgba(255, 255, 255, 0.08); }
.fw-st-head { display: flex; align-items: center; gap: 8px; font-size: 17px; }
.fw-dot { flex: none; width: 12px; height: 12px; border-radius: 999px; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.15); }
.fw-by { margin: -6px 0 0; font-weight: 600; font-size: 15px; color: #C9D8EA; }
.fw-p { margin: 0; color: #C9D8EA; font-size: 15px; line-height: 1.45; }
.fw-sec { padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, 0.14); }
.fw-sec summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 32px; cursor: pointer; list-style: none; color: var(--yellow); }
.fw-sec summary::-webkit-details-marker { display: none; }
.fw-sec summary svg { flex: none; transition: transform 0.25s ease; }
.fw-sec[open] summary svg { transform: rotate(180deg); }
.fw-sec .fw-list { margin-top: 8px; }
.fw-sec[open] .fw-list, .fw-sec[open] .fw-src { animation: fadein 0.3s ease; }
.fw-sec .fw-src { margin-top: 8px; }
.fw-sec h3 { margin: 0; font-weight: 700; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--yellow); }
.fw-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.fw-list li { position: relative; padding-left: 16px; font-size: 15px; line-height: 1.4; color: #E3ECF6; }
.fw-list li::before { content: ""; position: absolute; left: 2px; top: 8px; width: 6px; height: 6px; border-radius: 999px; background: var(--yellow); }
.fw-src { margin: 0; font-size: 12px; color: #9FB4CC; }
.fw-bursts { position: absolute; top: 10px; right: 10px; width: 96px; height: 70px; pointer-events: none; }
.fw .burst { position: absolute; width: 40px; height: 40px; opacity: 0; animation: burst 3.2s ease-out infinite; }
.fw .burst:nth-child(1) { top: 0; right: 4px; color: #F5C200; }
.fw .burst:nth-child(2) { top: 22px; right: 46px; width: 30px; height: 30px; color: #8DBBF0; animation-delay: 1.1s; }
.fw .burst:nth-child(3) { top: 34px; right: 0; width: 24px; height: 24px; color: #FFFFFF; animation-delay: 2.1s; }
@keyframes burst { 0% { opacity: 0; transform: scale(0.2); } 15% { opacity: 1; } 45% { opacity: 0.9; transform: scale(1); } 70%, 100% { opacity: 0; transform: scale(1.12); } }
.fw:not(.in) .burst { animation-play-state: paused; }

/* ---------- upriver gauges ---------- */
.up-list { display: flex; flex-direction: column; }
.up-row { display: flex; flex-direction: column; gap: 6px; padding: 12px 0; color: inherit; text-decoration: none; border-top: 1px solid var(--hair); }
.up-row:first-child { border-top: none; padding-top: 2px; }
.up-row:hover { color: inherit; }
.up-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.up-name { font: 700 17px/1.1 var(--display); }
.pill.sm { font-size: 13px; padding: 5px 10px; }
.up-mid { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.up-stage { font: 700 26px/1 var(--display); }
.up-stage small { font-size: 15px; color: var(--muted); }
.up-bar { position: relative; height: 6px; border-radius: 999px; background: var(--seg-base); }
.up-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; transform-origin: left; transform: scaleX(0); transition: transform 0.75s cubic-bezier(.2,.8,.2,1); }
.up-list.in .up-fill { transform: scaleX(1); }
.up-bar i { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--muted); opacity: 0.6; border-radius: 1px; }
.up-bar i.t-action { background: #E0A21A; opacity: 1; }
.up-bar i.t-minor { background: #D9692A; opacity: 1; }
.up-foot { display: flex; justify-content: space-between; gap: 10px; }
.up-foot span:last-child { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .gauge .fill { transform: none; }
  .gauge .marker { opacity: 1; transform: none; }
  .up-fill { transform: none; }
}

/* ---------- dark mode (follows the phone setting) ---------- */
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #E8EEF5; --muted: #9FB0C2; --line: #24364A; --ground: #0B1520; --card: #14212F;
    --brand: #2F6DB5; --accent: #8DBBF0; --accent-strong: #B5D3F5;
    --header: #133B69; --header-sub: #B9CDE4; --deep: #10294A;
    --soft: #1C2D40; --hair: #22334A; --hover: #18283A; --body-ink: #C9D6E4;
    --chip-bg: #1C2D40; --chip-ink: #C5D3E2; --chip-border: #2E4560;
    --bar: #101C29; --tab-ink: #8C9DB0; --toggle-bg: rgba(20, 33, 47, 0.94);
    --note-bg: #3A2E12; --note-ink: #F3D9A4; --map-bg: #1B2530;
    --seg-base: #2A4563; --seg-opacity: 0.65; --marker-bg: #E8EEF5; --marker-ring: #0B1520;
    --dial: #0F1B28; --dial-ring: #2E4560; --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  }
  .cat-none { background: #173A2A; color: #8FDDB4; }
  .cat-action { background: #3D2F0C; color: #F3CF73; }
  .cat-minor { background: #40220F; color: #F5AE7E; }
  .cat-moderate { background: #431818; color: #F4A1A1; }
  .cat-major { background: #2E2148; color: #CDB6F0; }
  .banner.info { background: #16304F; color: #BBD6F5; }
  .banner.warn { background: #3A2E12; color: #F3D9A4; }
  .banner.danger { background: #431818; color: #F4B4B4; }
  .banner.purple { background: #2E2148; color: #D9C8F5; }
  .chart .action-line { border-top-color: #D69A3A; }
  .chart .action-label { color: #E7B45A; }
  .trend.up { color: #F3B65A; }
  .trend.down { color: #7FD3A8; }
  .spark .s-action { stroke: #D69A3A; }
  .ticks li::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238DBBF0' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12 4 4 8-8'/%3E%3C/svg%3E"); }
  /* Street map: dim slightly so it doesn't glare; aerial imagery is left as is. */
  .map-wrap:not(.base-sat) .leaflet-tile-pane { filter: brightness(0.8) contrast(1.05) saturate(0.9); }
  .leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--card); color: var(--ink); }
  .leaflet-popup-content a { color: var(--accent); }
  .leaflet-bar a, .leaflet-bar a:hover { background: var(--card); color: var(--ink); border-bottom-color: var(--line); }
  .leaflet-container .leaflet-control-attribution { background: rgba(20, 33, 47, 0.85); color: var(--muted); }
  .leaflet-container .leaflet-control-attribution a { color: var(--accent); }
}
