/* Idaho Whitewater: mobile-first styles */
@import url('../fonts/fonts.css');
:root {
  /* ---- Design tokens: change these to restyle the site ---- */
  /* Brand & neutrals */
  --c-ink: #0e2a33; --c-ink-2: #33474f; --c-ink-3: #5b6b73; --c-muted: #5f6f77;
  --c-paper: #f6f4ef; --c-card: #ffffff; --c-white: #fff; --c-line: #e3e0d8; --c-line-2: #d6d2c7;
  --c-accent: #0f766e; --c-accent-2: #5fd4c4; --c-accent-soft: #b7f5e9; --c-accent-on-dark: #9fe8dc; --c-chip-count-on: #b7d6d3;
  --c-head-2: #123c45; --c-head-3: #17505a; --c-foot-ink: #d7e3e2;
  --c-tag-bg: #eef2f1; --c-seg-bg: #e9e6de; --c-empty-bg: #faf9f6; --c-code-bg: #f3f1eb; --c-map-bg: #e8ebe6;
  /* Warnings / disclaimers */
  --c-warn: #b45309; --c-warn-bg: #fff4e0; --c-warn-line: #f3d9a8; --c-warn-line-2: #f1d6a4; --c-warn-ink: #6b4a12; --c-warn-ink-2: #5c4317; --c-warn-link: #8a4b0b; --c-warn-icon: #d98a1c;
  --c-live-dot: #3ddc97; --c-offline-dot: #f5b14c;
  /* Flow status colors (read by js/status.js for the map lines and charts too) */
  /* Fills (bars, dots, lines). High is blue = more water; Too high is red + hatch + warning glyph; Too low is calm slate. */
  --status-too-low: #94a3ab; --status-low: #e0a31f; --status-ideal: #1f9d6b; --status-runnable: #2a9d8f;
  --status-high: #2f6fd6; --status-too-high: #c62f3a; --status-unknown: #a8a29e;
  --status-too-high-hatch: #e8838b;
  /* Text-safe inks (AA on white and on their tint) */
  --status-ink-too-low: #4b5860; --status-ink-low: #8a5a00; --status-ink-ideal: #0f6b47; --status-ink-runnable: #12655b;
  --status-ink-high: #1d4d9c; --status-ink-too-high: #8f1d26; --status-ink-unknown: #57534e;
  /* Tints (pill and row backgrounds) */
  --status-tint-too-low: #eef1f2; --status-tint-low: #fdf3dc; --status-tint-ideal: #e3f5ec; --status-tint-runnable: #e2f3f1;
  --status-tint-high: #e5eefb; --status-tint-too-high: #fbe7e8; --status-tint-unknown: #f2f0ed;
  /* Trend, water level notes, hazards, access */
  --c-rising: #1d6fa5; --c-falling: #8a5a12; --c-lowwater-bg: #fbf3e2; --c-highwater-bg: #eaf3fb;
  --c-hazard: #e8642c; --c-put-in: #1f9d6b; --c-put-in-ink: #15805a;
  /* Whitewater class badges and map markers */
  --c-class-2-bg: #e6f0f1; --c-class-2-ink: #1f4f57; --c-class-3-bg: #cfe3e4; --c-class-3-ink: #123c43; --c-class-4-bg: #2f5a62; --c-class-6-bg: #7a1f1f;
  --c-marker-2: #5f8f96; --c-marker-3: #2f6f78; --c-marker-4: #234b52; --c-marker-6: #a32626;
  /* Type */
  --display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --fs-2xs: .7rem; --fs-xs: .76rem; --fs-sm: .82rem; --fs-md: .88rem; --fs-base: .95rem; --fs-lg: 1.04rem; --fs-xl: 1.2rem; --fs-2xl: 1.45rem;
  --fs-body: 16px; --fs-chart: 11.5px;
  --fs-h1-hero: clamp(2rem, 6.4vw, 4.2rem); --fs-h1-run: clamp(2rem, 6vw, 3.3rem); --fs-cfs: 2.3rem; --fs-cfs-big: clamp(3rem, 12vw, 4.4rem);
  /* Spacing */
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px; --space-6: 32px; --space-7: 48px;
  --section-gap: 26px; --card-pad: 18px;
  /* Motion (Emil Kowalski's curves): enter/exit ease-out, on-screen moves ease-in-out, sheets use the iOS drawer curve */
  --ease-out: cubic-bezier(.23, 1, .32, 1); --ease-in-out: cubic-bezier(.77, 0, .175, 1); --ease-drawer: cubic-bezier(.32, .72, 0, 1);
  --dur-press: 120ms; --dur-fast: 160ms; --dur-base: 220ms; --dur-sheet: 400ms;
  --tap: 44px;
  /* Shape & depth */
  --radius: 18px; --radius-md: 14px; --radius-sm: 10px; --radius-xs: 7px; --radius-pill: 999px;
  --shadow: 0 1px 2px rgba(14,42,51,.06), 0 6px 24px -8px rgba(14,42,51,.14);
  --shadow-lg: 0 2px 4px rgba(14,42,51,.06), 0 18px 40px -12px rgba(14,42,51,.22);
  /* Legacy aliases */
  --ink: var(--c-ink); --ink-2: var(--c-ink-2); --ink-3: var(--c-ink-3); --muted: var(--c-muted); --paper: var(--c-paper); --card: var(--c-card);
  --line: var(--c-line); --line-2: var(--c-line-2); --accent: var(--c-accent); --accent-2: var(--c-accent-2); --warn: var(--c-warn); --warn-bg: var(--c-warn-bg);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--body); color: var(--ink); background: var(--paper); font-size: var(--fs-body); line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
h1, h2, h3 { font-family: var(--display); font-weight: 650; letter-spacing: -.01em; line-height: 1.12; margin: 0 0 .5em; }
h2 { font-size: var(--fs-2xl); } h3 { font-size: var(--fs-lg); font-family: var(--body); font-weight: 650; letter-spacing: 0; }
p { margin: 0 0 1em; }
button { font: inherit; color: inherit; }
.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); } .small { font-size: var(--fs-md); }
.warn { color: var(--warn); }
.skip { position: absolute; left: -999px; } .skip:focus { left: 8px; top: 8px; z-index: 9999; background: var(--c-white); padding: 8px 12px; border-radius: var(--radius-xs); }
.boot { min-height: 60vh; display: grid; place-items: center; color: var(--muted); }
.tag { display: inline-block; font-size: var(--fs-2xs); font-weight: 600; padding: .12em .55em; border-radius: var(--radius-pill); background: var(--c-tag-bg); color: var(--ink-2); vertical-align: middle; letter-spacing: .01em; }
.tag-warn { background: var(--warn-bg); color: var(--warn); }
.link { background: none; border: 0; color: var(--accent); text-decoration: underline; cursor: pointer; padding: 0; }
:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 2px; border-radius: var(--radius-xs); }

/* ---------- Hero ---------- */
.hero { position: relative; color: var(--c-white); min-height: 260px; display: flex; align-items: flex-end; overflow: hidden; background: var(--ink); }
.hero picture, .hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 62%; }
.hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8,26,32,.55) 0%, rgba(8,26,32,.15) 35%, rgba(8,26,32,.78) 100%); }
.hero-inner { position: relative; z-index: 1; width: min(1180px, 100% - 32px); margin: 0 auto; padding: 22px 0 30px; }
.brand { position: absolute; top: 18px; left: 0; display: inline-flex; gap: var(--space-2); align-items: center; color: var(--c-white); text-decoration: none; font-weight: 650; letter-spacing: .01em; font-size: var(--fs-base); }
.brand svg { width: 26px; height: 26px; fill: none; stroke: var(--accent-2); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.hero-inner { min-height: 260px; display: flex; flex-direction: column; justify-content: flex-end; padding: 64px 0 20px; }
.hero h1 { font-size: var(--fs-h1-hero); margin: 0 0 .2em; text-shadow: 0 2px 20px rgba(0,0,0,.25); }
.hero-sub { font-size: clamp(1.02rem, 2.6vw, 1.3rem); margin: 0 0 .5em; opacity: .96; }
.hero-sub strong { color: var(--c-accent-soft); }
.updated { font-size: var(--fs-sm); margin: 0; display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.hero .updated { opacity: .92; }
.live-dot, .warn-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c-live-dot); box-shadow: 0 0 0 3px rgba(61,220,151,.25); flex: 0 0 auto; }
.warn-dot { background: var(--c-offline-dot); box-shadow: 0 0 0 3px rgba(245,177,76,.25); }
.refresh { border: 1px solid currentColor; background: transparent; border-radius: var(--radius-pill); padding: 2px 10px; font-size: var(--fs-xs); font-weight: 600; cursor: pointer; opacity: .9; min-height: 28px; }
.refresh:hover { opacity: 1; }
.hero-bar { display: flex; gap: var(--space-1); margin: 2px 0 12px; max-width: 360px; }
.hero-bar i { flex: 1; height: 6px; border-radius: 3px; background: var(--c); box-shadow: 0 0 0 1px rgba(0,0,0,.15); }
.dot-pulse { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-2); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; transform: scale(.8); } }

.disclaimer-strip { margin: 14px 0 0; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--warn-bg); border: 1px solid var(--c-warn-line-2); font-size: var(--fs-md); color: var(--c-warn-ink-2); display: flex; gap: 10px; align-items: flex-start; line-height: 1.45; }
.disclaimer-strip p { margin: 0; }
.disclaimer-strip a { color: var(--c-warn-link); font-weight: 600; }
.ds-icon { flex: 0 0 20px; height: 20px; border-radius: 50%; background: var(--c-warn-icon); color: var(--c-white); font-weight: 800; font-size: var(--fs-sm); display: grid; place-items: center; margin-top: 1px; }

/* ---------- Controls ---------- */
.controls { position: relative; z-index: 500; background: rgba(246,244,239,.92); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); padding: 12px 0 10px; margin: 6px 0 4px; border-bottom: 1px solid transparent; }
.chips { display: flex; gap: var(--space-2); overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); background: var(--c-white); border-radius: var(--radius-pill); padding: 7px 13px; font-size: var(--fs-md); font-weight: 550; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, color .15s; min-height: 38px; }
.chip i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.chip em { font-style: normal; font-weight: 600; color: var(--muted); font-size: var(--fs-sm); }
.chip:hover { border-color: var(--ink-3); }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--c-white); }
.chip.on em { color: var(--c-chip-count-on); }
.chips-tight .chip { padding: 6px 11px; font-size: var(--fs-md); }
.controls-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-top: 8px; }
.controls-row > .chips { max-width: 100%; }
.controls-right { display: grid; grid-template-columns: 1fr 1fr auto; gap: var(--space-2); align-items: center; width: 100%; }
.controls-right .select { min-width: 0; }
.controls-right .select select { min-width: 0; width: 100%; }
@media (max-width: 699px) { .select > span { display: none; } .select { padding-left: 6px; } }
@media (min-width: 700px) {
  .controls { position: sticky; top: 0; }
  .controls-right { display: flex; width: auto; }
}
.select { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--muted); background: var(--c-white); border: 1px solid var(--line-2); border-radius: var(--radius-pill); padding: 0 4px 0 12px; min-height: 38px; }
.select select { border: 0; background: transparent; font: inherit; font-size: var(--fs-md); color: var(--ink); font-weight: 550; padding: 8px 6px; cursor: pointer; }
.seg { display: inline-flex; background: var(--c-seg-bg); border-radius: var(--radius-pill); padding: 3px; }
.seg button { border: 0; background: transparent; padding: 6px 14px; border-radius: var(--radius-pill); font-size: var(--fs-md); font-weight: 600; cursor: pointer; color: var(--ink-2); min-height: 32px; }
.seg button.on { background: var(--c-white); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

/* ---------- Cards ---------- */
.cards { display: grid; gap: var(--space-4); grid-template-columns: 1fr; margin: 14px 0 40px; }
@media (min-width: 680px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .cards { grid-template-columns: repeat(3, 1fr); gap: 20px; } }
.card { position: relative; display: flex; flex-direction: column; background: var(--card); border-radius: var(--radius); padding: var(--card-pad) var(--card-pad) 14px; color: inherit; text-decoration: none; box-shadow: var(--shadow); border: 1px solid rgba(14,42,51,.05); transition: transform .18s ease, box-shadow .18s ease; overflow: hidden; }
.card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--c); }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); margin-bottom: 6px; }
.fork { font-size: var(--fs-xs); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 650; }
.card h2 { font-size: var(--fs-2xl); margin: 0; }
.card .sub { color: var(--ink-3); font-size: var(--fs-md); margin: 3px 0 0; line-height: 1.35; }
.card-main { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-3); margin-bottom: 12px; }
.card-title { min-width: 0; }
.card-num { display: flex; flex-direction: column; align-items: flex-end; text-align: right; flex: 0 0 auto; }
.card-num .status-word { margin-top: 4px; font-size: var(--fs-sm); white-space: nowrap; }
.cf-right { display: inline-flex; align-items: center; gap: var(--space-2); }
.cf-spark { display: inline-block; width: 72px; }
.cf-spark .spark { height: 22px; }
.card-foot .trend { margin: 0; font-size: var(--fs-xs); }
.status-word { font-weight: 700; color: var(--c); font-size: var(--fs-base); letter-spacing: .01em; filter: saturate(1.1) brightness(.88); }
.cfs { font-family: var(--display); font-size: var(--fs-cfs); font-weight: 650; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.cfs small { font-family: var(--body); font-size: var(--fs-sm); color: var(--muted); font-weight: 600; margin-left: 5px; letter-spacing: 0; }
.trend { font-size: var(--fs-sm); color: var(--ink-3); margin-top: 4px; font-weight: 550; }
.t-rising { color: var(--c-rising); } .t-falling { color: var(--c-falling); }
.spark { width: 100%; height: 40px; display: block; }
.card-foot { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); font-size: var(--fs-xs); color: var(--muted); margin-top: 12px; padding-top: 9px; border-top: 1px solid var(--line); }
.legend-key { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: var(--fs-sm); color: var(--ink-3); margin: -18px 0 36px; }
.legend-key i:not(.glyph) { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--c); margin-right: 6px; vertical-align: -1px; }
.cards-mini { margin: 10px 0 0; }
.empty { padding: 40px; text-align: center; color: var(--muted); grid-column: 1 / -1; }

/* ---------- Range bar ---------- */
.rangebar { position: relative; padding-top: 4px; }
.rb-track { display: flex; height: 8px; border-radius: var(--radius-pill); overflow: hidden; gap: 2px; }
.rb-seg { height: 100%; opacity: .85; }
.rb-marker { position: absolute; top: -3px; transform: translateX(-50%); width: 4px; height: 22px; background: var(--ink); border-radius: 3px; box-shadow: 0 0 0 2.5px var(--c-white); }
.rb-marker b { display: none; }
.rb-lg { padding: 30px 0 4px; }
.rb-lg .rb-track { height: 14px; }
.rb-lg .rb-marker { top: 22px; height: 30px; width: 5px; }
.rb-lg .rb-marker b { display: block; position: absolute; bottom: 100%; left: 50%; transform: translate(-50%, -4px); background: var(--ink); color: var(--c-white); font-size: var(--fs-xs); padding: 2px 8px; border-radius: var(--radius-pill); white-space: nowrap; font-variant-numeric: tabular-nums; }
.rb-labels { position: relative; height: 18px; margin-top: 6px; }
.rb-labels span { position: absolute; transform: translateX(-50%); font-size: var(--fs-xs); color: var(--ink-3); font-variant-numeric: tabular-nums; font-weight: 600; }
.rb-names { display: flex; margin-top: 0; }
.rb-names span { text-align: center; font-size: var(--fs-2xs); color: var(--muted); }

/* ---------- Status pill ---------- */
.pill { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; font-size: var(--fs-sm); padding: 4px 11px 4px 9px; border-radius: var(--radius-pill); background: color-mix(in srgb, var(--c) 16%, white); color: color-mix(in srgb, var(--c) 70%, black); }
.pill i:not(.glyph) { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.pill-big { font-size: var(--fs-lg); padding: 7px 16px 7px 13px; }
.pill-big i:not(.glyph) { width: 12px; height: 12px; }

/* ---------- Class badges ---------- */
.cls { display: inline-flex; align-items: center; justify-content: center; min-width: 2.2em; padding: 2px 9px; border-radius: var(--radius-xs); font-weight: 700; font-size: var(--fs-sm); font-family: var(--body); letter-spacing: .02em; white-space: nowrap; border: 1px solid transparent; }
.cls-1, .cls-2 { background: var(--c-class-2-bg); color: var(--c-class-2-ink); }
.cls-3 { background: var(--c-class-3-bg); color: var(--c-class-3-ink); }
.cls-4 { background: var(--c-class-4-bg); color: var(--c-white); }
.cls-5 { background: var(--c-ink); color: var(--c-white); }
.cls-6 { background: var(--c-class-6-bg); color: var(--c-white); }
.cls-lg { font-size: var(--fs-lg); padding: 6px 14px; border-radius: var(--radius-sm); }

/* ---------- Overview map ---------- */
.overview-map { height: min(64vh, 560px); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); margin: 14px 0 6px; z-index: 0; }
.cards-compact { margin-top: 18px; }
.river-intro { max-width: 760px; margin: 10px 0 60px; }
.lede { font-size: var(--fs-xl); color: var(--ink-2); }

/* ---------- Run page ---------- */
.run-head { background: linear-gradient(160deg, var(--c-ink) 0%, var(--c-head-2) 60%, var(--c-head-3) 100%); color: var(--c-white); padding: 14px 0 34px; position: relative; overflow: hidden; }
.run-head::after { content: ''; position: absolute; right: -60px; bottom: -40px; width: 420px; height: 220px; opacity: .14; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 420 220'%3E%3Cg fill='none' stroke='%235fd4c4' stroke-width='3'%3E%3Cpath d='M0 120c40-30 80-30 120 0s80 30 120 0 80-30 120 0 40 20 60 10'/%3E%3Cpath d='M0 150c40-30 80-30 120 0s80 30 120 0 80-30 120 0 40 20 60 10'/%3E%3Cpath d='M0 180c40-30 80-30 120 0s80 30 120 0 80-30 120 0 40 20 60 10'/%3E%3C/g%3E%3C/svg%3E") no-repeat; }
.run-head::before { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: var(--c); }
.rh-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; position: relative; z-index: 1; }
.rh-bar .brand { position: static; font-size: var(--fs-base); }
.rh-bar .brand svg { width: 22px; height: 22px; }
.rh-back { color: var(--c-white); text-decoration: none; font-size: var(--fs-sm); font-weight: 600; border: 1px solid rgba(255,255,255,.3); border-radius: var(--radius-pill); padding: 5px 12px; }
.rh-back::before { content: '← '; }
.rh-back:hover { background: rgba(255,255,255,.1); }
.crumbs { font-size: var(--fs-sm); display: flex; gap: var(--space-2); flex-wrap: wrap; opacity: .9; margin-bottom: 6px; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.crumbs a { color: var(--c-accent-soft); text-decoration: none; } .crumbs a:hover { text-decoration: underline; }
.crumbs span { opacity: .7; }
.rh-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.rh-title h1 { font-size: var(--fs-h1-run); margin: 0; }
.rh-sub { margin: 4px 0 0; opacity: .85; font-size: var(--fs-lg); }
.run-head .cls-lg { background: rgba(255,255,255,.12); color: var(--c-white); border-color: rgba(255,255,255,.3); flex: 0 0 auto; }
.rh-summary { max-width: 720px; margin: 12px 0 14px; font-size: var(--fs-lg); opacity: .92; position: relative; z-index: 1; }
.run-head .wrap { position: relative; z-index: 1; }
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); margin-top: 16px; max-width: 560px; }
.qbtn { display: flex; flex-direction: column; gap: 1px; padding: 9px 14px 9px 38px; border-radius: var(--radius-md); background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.22); color: var(--c-white); text-decoration: none; position: relative; min-width: 0; }
.qbtn::before { content: ''; position: absolute; left: 13px; top: 50%; width: 14px; height: 14px; margin-top: -7px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235fd4c4' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 11 21 3l-8 18-2-8z'/%3E%3C/svg%3E") no-repeat center/contain; }
.qbtn b { font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: .09em; color: var(--c-accent-on-dark); }
.qbtn span { font-weight: 600; font-size: var(--fs-md); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qbtn:hover { background: rgba(255,255,255,.16); }
.tabs { position: sticky; top: 0; z-index: 600; background: rgba(246,244,239,.94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.tabs .wrap { display: flex; gap: var(--space-1); overflow-x: auto; scrollbar-width: none; }
.tabs .wrap::-webkit-scrollbar { display: none; }
.tabs a { flex: 0 0 auto; padding: 12px 12px; font-size: var(--fs-md); font-weight: 600; color: var(--ink-2); text-decoration: none; border-bottom: 2px solid transparent; }
.tabs a:hover { color: var(--ink); border-bottom-color: var(--ink-3); }
.run > section { scroll-margin-top: 56px; }
.facts { display: flex; flex-wrap: wrap; gap: var(--space-2) 26px; margin: 0; position: relative; z-index: 1; }
.facts div { min-width: 0; } .facts dt { font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: .09em; opacity: .7; } .facts dd { margin: 0; font-weight: 600; }

.run > section { margin: var(--section-gap) 0; }
.run > .flow-panel { background: var(--c-white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-top: 18px; position: relative; overflow: hidden; }
.fp-grid { display: grid; gap: 18px; grid-template-columns: 1fr; }
.fp-grid::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 5px; background: var(--c); }
.fp-now { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.fp-chart-head { display: flex; justify-content: space-between; font-size: var(--fs-xs); font-weight: 650; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); margin-bottom: 4px; }
@media (min-width: 900px) {
  .fp-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 34px; }
  .fp-right { border-left: 1px solid var(--line); padding-left: 30px; }
}
.fp-cfs { font-family: var(--display); font-size: var(--fs-cfs-big); font-weight: 650; line-height: .95; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.fp-cfs small { font-family: var(--body); font-size: var(--fs-lg); color: var(--muted); margin-left: 6px; letter-spacing: 0; }
.fp-meta { display: flex; flex-direction: column; gap: 2px; font-size: var(--fs-md); color: var(--ink-2); margin-top: 8px; }
.fp-meta .updated { font-size: var(--fs-sm); }
.fp-meta .refresh { color: var(--ink-2); }
.fp-gauge { margin: 14px 0 6px; }
.fp-chart { min-height: 190px; }
.flow-chart { width: 100%; height: auto; display: block; }
.flow-chart .ch-tick { font-size: var(--fs-chart); fill: var(--c-muted); font-family: var(--body); }
.flow-chart .ch-line { stroke: var(--c-ink); }
.flow-chart .ch-dot { fill: var(--c-ink); stroke: var(--c-white); }
.flow-chart .ch-grid { stroke: var(--c-line); }
.flow-chart .ch-edgeline { stroke: var(--c-ink-3); }
.flow-chart .ch-edge { font-size: var(--fs-chart); fill: var(--c-ink-3); font-family: var(--body); font-weight: 600; }
.chart-empty { padding: 28px; text-align: center; color: var(--muted); background: var(--c-empty-bg); border-radius: var(--radius-md); }
.fp-foot { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 8px; font-size: var(--fs-md); }
.fp-foot .lbl { font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 650; margin-right: 4px; }
.fp-foot p { margin: 6px 0 0; }

.ranges h2, .explore h2, .access h2, .about h2, .sources h2, .unverified h2, .segments h2 { font-size: var(--fs-2xl); }
.range-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--space-2); margin-bottom: 10px; }
.rg { display: flex; flex-direction: column; gap: 2px; background: var(--c-white); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 10px 12px; position: relative; }
.rg i { width: 100%; height: 4px; border-radius: 4px; background: var(--c); margin-bottom: 6px; }
.rg span { font-size: var(--fs-sm); color: var(--muted); font-weight: 600; }
.rg b { font-variant-numeric: tabular-nums; font-size: var(--fs-lg); }
.rg-on { border-color: var(--c); box-shadow: 0 0 0 2px var(--c) inset; }
.unv { font-size: var(--fs-md); }

/* Explore: map + rapids */
.explore-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); flex-wrap: wrap; }
.explore-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
.map-wrap { position: relative; }
.run-map { height: 46vh; min-height: 300px; max-height: 520px; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); z-index: 0; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: var(--fs-xs); color: var(--ink-3); margin-top: 8px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.lg-in { background: var(--c-put-in); } .lg-out { background: var(--c-ink); } .lg-alt { background: var(--c-white); border: 2px solid var(--c-ink-3); border-radius: 50% !important; } .lg-rapid { background: var(--c-class-4-bg); border-radius: 50% !important; }
@media (min-width: 900px) {
  .explore-grid { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: start; }
  .map-wrap { position: sticky; top: 16px; }
  .run-map { height: 560px; max-height: none; }
  .rapids { max-height: 600px; overflow-y: auto; }
}
.rapids { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); scroll-behavior: smooth; overscroll-behavior: contain; padding-right: 2px; }
.rapid { background: var(--c-white); border: 1px solid var(--line); border-radius: var(--radius-md); transition: border-color .15s, box-shadow .15s; }
.rapid > button { width: 100%; display: flex; align-items: center; gap: var(--space-3); padding: 12px 14px; background: none; border: 0; text-align: left; cursor: pointer; min-height: 56px; }
.rp-num { flex: 0 0 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--c-tag-bg); color: var(--ink-2); font-size: var(--fs-sm); font-weight: 700; font-variant-numeric: tabular-nums; }
.rp-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rp-name { font-weight: 650; font-size: var(--fs-lg); }
.rp-meta { font-size: var(--fs-xs); color: var(--muted); }
.chev { width: 9px; height: 9px; border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3); transform: rotate(45deg); transition: transform .2s; margin: 0 4px 4px; flex: 0 0 auto; }
.rapid.open { border-color: var(--ink-3); box-shadow: var(--shadow); }
.rapid.open .chev { transform: rotate(-135deg); margin-bottom: -2px; }
.rapid.open .rp-num { background: var(--ink); color: var(--c-white); }
.rp-body { display: none; padding: 0 16px 14px 54px; font-size: var(--fs-base); color: var(--ink-2); }
.rapid.open .rp-body { display: block; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(-3px); } }
.rp-body p { margin: 0 0 .6em; }
.wl { padding: 8px 10px; border-radius: var(--radius-sm); font-size: var(--fs-md); }
.wl b { display: block; font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 2px; }
.wl-low { background: var(--c-lowwater-bg); } .wl-low b { color: var(--c-falling); }
.wl-high { background: var(--c-highwater-bg); } .wl-high b { color: var(--c-rising); }
.k-portage .rp-num { background: var(--c-class-6-bg); color: var(--c-white); }

/* Map markers */
.mk-rapid { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font: 700 10px/1 var(--body); color: var(--c-white); background: var(--c-class-4-bg); border: 2px solid var(--c-white); box-shadow: 0 1px 4px rgba(0,0,0,.35); transition: transform .15s; }
.mk-c1, .mk-c2 { background: var(--c-marker-2); } .mk-c3 { background: var(--c-marker-3); } .mk-c4 { background: var(--c-marker-4); } .mk-c5 { background: var(--c-ink); } .mk-c6 { background: var(--c-marker-6); }
.mk-play { border-style: dashed; }
.mk-portage { background: var(--c-marker-6); }
.mk-rapid.sel { transform: scale(1.35); box-shadow: 0 0 0 4px rgba(95,212,196,.7), 0 2px 8px rgba(0,0,0,.4); }
.mk-access { display: grid; place-items: center; height: 22px; padding: 0 6px; border-radius: var(--radius-xs); font: 800 10px/1 var(--body); letter-spacing: .04em; color: var(--c-white); border: 2px solid var(--c-white); box-shadow: 0 1px 4px rgba(0,0,0,.35); }
.mk-put-in { background: var(--c-put-in); } .mk-take-out { background: var(--c-ink); }
.mk-alternate { width: 14px; height: 14px; padding: 0; border-radius: 50%; background: var(--c-white); border: 3px solid var(--c-ink-3); }
.leaflet-container { font-family: var(--body); background: var(--c-map-bg); }
.leaflet-popup-content-wrapper { border-radius: var(--radius-md); box-shadow: var(--shadow-lg); }
.leaflet-popup-content { margin: 12px 14px; font-size: var(--fs-md); line-height: 1.45; }
.pop p { margin: 6px 0; } .pop .fork { margin-bottom: 2px; } .pop strong { font-size: var(--fs-lg); margin-right: 4px; }

/* Access */
.access-grid { display: grid; gap: var(--space-3); grid-template-columns: 1fr; }
@media (min-width: 700px) { .access-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .access-grid { grid-template-columns: repeat(3, 1fr); } }
.acc { background: var(--c-white); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 14px 16px; display: flex; flex-direction: column; }
.acc h3 { margin: 2px 0 6px; font-size: var(--fs-lg); }
.acc p { font-size: var(--fs-md); color: var(--ink-2); margin-bottom: .6em; }
.acc-top { display: flex; justify-content: space-between; align-items: center; }
.acc-kind { font-size: var(--fs-2xs); font-weight: 750; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); }
.acc-put-in .acc-kind { color: var(--c-put-in-ink); } .acc-take-out .acc-kind { color: var(--ink); }
.acc-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: auto; padding-top: 6px; }
.acc-actions code { font-size: var(--fs-xs); color: var(--ink-3); background: var(--c-code-bg); padding: 4px 8px; border-radius: var(--radius-xs); }
.btn-sm { display: inline-flex; align-items: center; min-height: 34px; border: 1px solid var(--line-2); background: var(--c-white); border-radius: var(--radius-pill); padding: 4px 12px; font-size: var(--fs-sm); font-weight: 600; cursor: pointer; color: var(--ink); text-decoration: none; }
.btn-sm:hover { border-color: var(--ink-3); }
.btn-primary { background: var(--ink); border-color: var(--ink); color: var(--c-white); }

/* About + notes */
.two-col { display: grid; gap: var(--space-5); grid-template-columns: 1fr; }
@media (min-width: 900px) { .two-col { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 40px; } }
.about p { font-size: var(--fs-lg); color: var(--ink-2); max-width: 68ch; }
.notes { display: flex; flex-direction: column; gap: 10px; }
.note { background: var(--c-white); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 12px 16px; }
.note h3 { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin-bottom: 4px; }
.note p { margin: 0; font-size: var(--fs-base); color: var(--ink-2); }
.note-hazards { border-left: 4px solid var(--c-hazard); }

.unverified { background: var(--warn-bg); border: 1px solid var(--c-warn-line); border-radius: var(--radius); padding: 16px 20px; }
.unverified h2 { font-size: var(--fs-xl); font-family: var(--body); }
.unverified ul { margin: 0; padding-left: 18px; color: var(--c-warn-ink); font-size: var(--fs-base); }
.unverified li { margin: 4px 0; }
.sources ul { padding-left: 18px; } .sources li { margin: 4px 0; }

/* Footer */
.site-foot { background: var(--ink); color: var(--c-foot-ink); padding: 36px 0 48px; margin-top: 40px; }
.site-foot h2 { color: var(--c-white); font-size: var(--fs-xl); }
.site-foot a { color: var(--c-accent-on-dark); }
.safety { max-width: 820px; } .safety p { font-size: var(--fs-base); }
.credits { border-top: 1px solid rgba(255,255,255,.14); margin-top: 18px; padding-top: 16px; opacity: .85; max-width: 900px; }

@media (min-width: 700px) {
  .hero, .hero-inner { min-height: 380px; }
  .run > .flow-panel { padding: 26px 28px; }
  .run-head { padding-bottom: 30px; }
}
/* Shorter laps */
.seg-grid { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .seg-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .seg-grid { grid-template-columns: repeat(4, 1fr); } }
.seg-card { text-align: left; background: var(--c-white); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 12px 14px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; transition: border-color .15s, box-shadow .15s; }
.seg-card:hover, .seg-card.on { border-color: var(--ink-3); box-shadow: var(--shadow); }
.seg-top { display: flex; justify-content: space-between; align-items: baseline; }
.seg-top b { font-size: var(--fs-lg); } .seg-top span { font-size: var(--fs-sm); color: var(--muted); font-weight: 600; }
.seg-route { font-size: var(--fs-sm); color: var(--ink-3); font-weight: 550; }
.seg-note { font-size: var(--fs-md); color: var(--ink-2); }
.rapid-tools { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.more-runs h2 { font-size: var(--fs-2xl); }
/* Reduced motion: no movement (transforms, keyframes, smooth scroll); opacity and color changes stay. */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto !important; }
  .card:hover, .card:active, .chip:active, .seg button:active, .btn-filter:active, .btn-sm:active, .btn-done:active, .qbtn:active, .refresh:active, .seg-card:active, .actionbar a:active, .rapid > button:active { transform: none !important; }
}

/* ---------- Status levels (JS only emits lvl-<level>; colors live in the tokens above) ---------- */
.river-line { stroke: var(--status-unknown); }
.river-casing { stroke: var(--c-white); }
.river-dot { stroke: var(--c-white); fill: var(--status-unknown); }
.river-line.lvl-too-low, .river-dot.lvl-too-low { stroke: var(--status-too-low); }
.river-line.lvl-low { stroke: var(--status-low); } .river-line.lvl-ideal { stroke: var(--status-ideal); }
.river-line.lvl-runnable { stroke: var(--status-runnable); } .river-line.lvl-high { stroke: var(--status-high); }
.river-line.lvl-too-high { stroke: var(--status-too-high); } .river-line.lvl-unknown { stroke: var(--status-unknown); }
.river-dot.lvl-too-low { fill: var(--status-too-low); stroke: var(--c-white); } .river-dot.lvl-low { fill: var(--status-low); }
.river-dot.lvl-ideal { fill: var(--status-ideal); } .river-dot.lvl-runnable { fill: var(--status-runnable); }
.river-dot.lvl-high { fill: var(--status-high); } .river-dot.lvl-too-high { fill: var(--status-too-high); }
.approx { font-size: .7em; margin-right: 2px; color: var(--c-ink-3); font-weight: 500; }
.need { font-size: var(--fs-xs); color: var(--c-ink-3); font-weight: 600; margin-top: 1px; }
.pill-stale { --c: var(--status-unknown); }
.high-note { background: var(--c-highwater-bg); border-radius: var(--radius-sm); padding: var(--space-2) var(--space-3); font-size: var(--fs-md); color: var(--c-ink-2); max-width: 75ch; }
.fp-left .high-note { margin: var(--space-2) 0 0; }


/* =====================================================================
   Design pass v2 (Web Design). Rules: skill ui-design-engineering.
   ===================================================================== */

/* ---- Status levels: one place maps level -> fill (--c), ink (--ci), tint (--ct) ---- */
.lvl-too-low  { --c: var(--status-too-low);  --ci: var(--status-ink-too-low);  --ct: var(--status-tint-too-low); }
.lvl-low      { --c: var(--status-low);      --ci: var(--status-ink-low);      --ct: var(--status-tint-low); }
.lvl-ideal    { --c: var(--status-ideal);    --ci: var(--status-ink-ideal);    --ct: var(--status-tint-ideal); }
.lvl-runnable { --c: var(--status-runnable); --ci: var(--status-ink-runnable); --ct: var(--status-tint-runnable); }
.lvl-high     { --c: var(--status-high);     --ci: var(--status-ink-high);     --ct: var(--status-tint-high); }
.lvl-too-high { --c: var(--status-too-high); --ci: var(--status-ink-too-high); --ct: var(--status-tint-too-high); }
.lvl-unknown  { --c: var(--status-unknown);  --ci: var(--status-ink-unknown);  --ct: var(--status-tint-unknown); }

/* Shapes so status never relies on color alone */
.glyph { display: inline-block; flex: 0 0 auto; width: .72em; height: .72em; margin-right: .38em; vertical-align: -.02em; background: var(--c); border-radius: 50%; }
.g-too-low  { background: transparent; box-shadow: inset 0 0 0 2px var(--c); }
.g-low      { background: linear-gradient(to top, var(--c) 50%, transparent 50%); box-shadow: inset 0 0 0 2px var(--c); }
.g-high     { border-radius: 0; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.g-too-high { border-radius: 0; width: .9em; height: .82em; clip-path: polygon(50% 0, 100% 100%, 0 100%); position: relative;
  background: linear-gradient(var(--c), var(--c)) ; }
.g-too-high::after { content: '!'; position: absolute; inset: 0; display: grid; place-items: end center; padding-bottom: .02em; font: 900 .58em/1 var(--body); color: #fff; }
.g-stale { border-radius: 50%; background: transparent; box-shadow: inset 0 0 0 2px var(--c); position: relative; }
.g-stale::after { content: ''; position: absolute; left: 50%; top: 22%; width: 2px; height: 32%; background: var(--c); transform: translateX(-50%); }

.status-word { color: var(--ci); filter: none; display: inline-flex; align-items: center; }
.pill { background: var(--ct); color: var(--ci); }
.pill i.glyph { width: .72em; height: .72em; }
.pill-big .glyph { width: .8em; height: .8em; }
.pill-big .g-too-high { width: 1em; height: .9em; }
.legend-key span { display: inline-flex; align-items: center; }
.rg span { color: var(--ci); }
.hero-bar i { background: var(--c); }

/* Range bar segments: hatched when too high */
.rb-seg { opacity: 1; background: var(--c); }
.rb-seg.s-too-low { background: var(--status-too-low); } .rb-seg.s-low { background: var(--status-low); }
.rb-seg.s-ideal { background: var(--status-ideal); } .rb-seg.s-runnable { background: var(--status-runnable); }
.rb-seg.s-high { background: var(--status-high); }
.rb-seg.s-too-high, .rg i.s-too-high { background: repeating-linear-gradient(135deg, var(--status-too-high) 0 4px, var(--status-too-high-hatch) 4px 7px); }
.rg i { background: var(--c); }
.rb-names span { color: var(--ci); font-weight: 600; }

/* ---- Hero: compact on phones so the first run is visible ---- */
@media (max-width: 699px) {
  .hero, .hero-inner { min-height: 0; }
  .hero-inner { padding: 60px 0 14px; }
  .hero h1 { font-size: clamp(1.8rem, 8.2vw, 2.3rem); }
  .hero-sub { font-size: var(--fs-base); margin-bottom: .4em; }
  .hero-bar { margin: 0 0 8px; }
  .disclaimer-strip { margin-top: 10px; padding: 8px 12px; font-size: var(--fs-sm); align-items: center; }
  .ds-icon { flex-basis: 18px; height: 18px; font-size: var(--fs-2xs); margin-top: 0; }
}
.refresh { position: relative; min-height: 32px; padding: 3px 12px; }
.refresh::after { content: ''; position: absolute; inset: -6px -4px; }

/* ---- Controls: one sticky row; filters inline on wide screens, bottom sheet on phones ---- */
.controls { position: sticky; top: 0; padding: 10px 0; margin: 4px 0 0; }
.ctl-row { display: flex; gap: var(--space-2); align-items: center; }
.seg { padding: 3px; }
.seg button { min-height: 38px; padding: 6px 14px; display: inline-flex; align-items: center; gap: 6px; }
.seg button em { font-style: normal; font-weight: 650; color: var(--muted); font-variant-numeric: tabular-nums; }
.seg button.on em { color: var(--ink-2); }
.seg-status { flex: 0 1 auto; }
.seg-view { margin-left: auto; }
.btn-filter { display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap); padding: 0 16px; border: 1px solid var(--line-2); background: var(--c-white); border-radius: var(--radius-pill); font-weight: 600; font-size: var(--fs-md); cursor: pointer; }
.btn-filter em { font-style: normal; min-width: 20px; height: 20px; border-radius: 10px; background: var(--ink); color: var(--c-white); font-size: var(--fs-2xs); display: grid; place-items: center; }
.chip { min-height: var(--tap); }
.select { min-height: var(--tap); }
.btn-sm { min-height: 40px; position: relative; }
.btn-sm::after { content: ''; position: absolute; inset: -2px 0; }
.sheet-head { display: flex; justify-content: space-between; align-items: baseline; }
.sheet-head h2 { font-size: var(--fs-xl); margin: 0; }
.filter-selects { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.filter-selects .select select { width: 100%; min-width: 0; }
.btn-done { min-height: 48px; border: 0; border-radius: var(--radius-pill); background: var(--ink); color: var(--c-white); font-weight: 650; cursor: pointer; }
.sheet-grip { width: 40px; height: 5px; border-radius: 3px; background: var(--line-2); margin: -4px auto 4px; }

@media (max-width: 759px) {
  .filters { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1200; display: flex; flex-direction: column; gap: var(--space-4);
    background: var(--c-white); border-radius: 20px 20px 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
    box-shadow: 0 -10px 40px -10px rgba(14,42,51,.3); transform: translateY(105%); visibility: hidden;
    transition: transform var(--dur-sheet) var(--ease-drawer), visibility 0s linear var(--dur-sheet); }
  .filters.open { transform: translateY(0); visibility: visible; transition: transform var(--dur-sheet) var(--ease-drawer), visibility 0s; }
  .filters .chips { flex-wrap: wrap; overflow: visible; }
  .sheet-backdrop { position: fixed; inset: 0; z-index: 1100; background: rgba(8,26,32,.38); opacity: 0; pointer-events: none; transition: opacity 200ms ease; }
  .sheet-backdrop.open { opacity: 1; pointer-events: auto; }
  .seg button { padding: 6px 11px; }
  .btn-filter { padding: 0 13px; }
  .select > span { display: inline; }
}
@media (min-width: 760px) {
  .filters { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin-top: var(--space-2); }
  .btn-filter, .sheet-backdrop, .sheet-grip, .sheet-head, .btn-done { display: none; }
  .filters .chips { flex: 0 1 auto; }
  .filter-selects { display: flex; margin-left: auto; }
}

/* ---- Groups on home ---- */
.group-h { font-family: var(--body); font-size: var(--fs-md); text-transform: uppercase; letter-spacing: .07em; color: var(--ink-2); margin: 18px 0 0; font-weight: 700; }
.group-h em { font-style: normal; color: var(--muted); margin-left: 4px; }
.cards { margin: 10px 0 24px; }
.not-now { margin: 0 0 36px; }
.rows { display: flex; flex-direction: column; margin-top: 10px; background: var(--c-white); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: var(--space-3); padding: 12px 16px; min-height: 60px; color: inherit; text-decoration: none; border-top: 1px solid var(--line); position: relative; }
.row:first-child { border-top: 0; }
.row::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--c); }
.row-name { display: flex; flex-direction: column; min-width: 0; }
.row-name b { font-weight: 650; font-size: var(--fs-lg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-name span { font-size: var(--fs-xs); color: var(--muted); }
.row-num { display: flex; flex-direction: column; align-items: flex-end; min-width: 92px; }
.row-cfs { font-family: var(--display); font-weight: 650; font-size: var(--fs-xl); font-variant-numeric: tabular-nums; line-height: 1.1; }
.row-cfs small { font-family: var(--body); font-size: var(--fs-2xs); color: var(--muted); margin-left: 3px; font-weight: 600; }
.row-status { font-size: var(--fs-xs); color: var(--ci); font-weight: 650; white-space: nowrap; display: inline-flex; align-items: center; }
@media (max-width: 420px) { .row-status { white-space: normal; text-align: right; } }
.card-note { margin: -4px 0 10px; font-size: var(--fs-sm); color: var(--ci); background: var(--ct); border-radius: var(--radius-xs); padding: 6px 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.stale { color: var(--status-ink-low); font-weight: 650; }
.card::before { width: 4px; }

/* ---- Run page: answer first ---- */
.run-intro { margin-top: var(--space-5) !important; }
.run-intro .rh-summary { font-size: var(--fs-lg); color: var(--ink-2); max-width: 65ch; margin: 0 0 var(--space-3); opacity: 1; }
.run-intro .facts dt { opacity: 1; color: var(--muted); }
.run-head { padding-bottom: 22px; }
.high-note { background: var(--ct, var(--c-highwater-bg)); color: var(--ci, var(--c-ink-2)); margin: var(--space-3) 0 0; }
.fp-left .high-note { margin: var(--space-3) 0 0; }
details.ranges > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); min-height: var(--tap); }
details.ranges > summary::-webkit-details-marker { display: none; }
details.ranges > summary h2 { margin: 0; font-size: var(--fs-xl); }
details.ranges > summary::after { content: ''; width: 9px; height: 9px; border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3); transform: rotate(45deg); transition: transform var(--dur-fast) var(--ease-out); }
details.ranges[open] > summary::after { transform: rotate(-135deg); }
details.ranges[open] > summary { margin-bottom: var(--space-3); }
.actionbar { display: none; }
@media (max-width: 899px) {
  .run-head .quick { display: none; }
  .actionbar { display: flex; gap: var(--space-2); position: fixed; left: 0; right: 0; bottom: 0; z-index: 900; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: rgba(246,244,239,.94); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
  .actionbar a { display: flex; flex-direction: column; justify-content: center; min-height: 48px; padding: 4px 16px; border-radius: var(--radius-md); text-decoration: none; min-width: 0; }
  .ab-primary { flex: 1; background: var(--ink); color: var(--c-white); }
  .ab-primary b { font-size: var(--fs-md); }
  .ab-primary span { font-size: var(--fs-xs); opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ab-secondary { background: var(--c-white); color: var(--ink); border: 1px solid var(--line-2); align-items: center; }
  .ab-secondary b { font-size: var(--fs-md); }
  body:has(.actionbar) .site-foot { padding-bottom: calc(48px + 68px + env(safe-area-inset-bottom)); }
  .run-head .rh-title h1 { font-size: clamp(1.9rem, 8vw, 2.6rem); }
  .run-head .rh-sub { font-size: var(--fs-base); }
  .run > .flow-panel { margin-top: 14px; }
}

/* ---- Rapid rows: animated expand without animating height ---- */
.rp-body { display: grid; grid-template-rows: 0fr; padding: 0; visibility: hidden;
  transition: grid-template-rows 180ms var(--ease-out), visibility 0s linear 180ms; }
.rp-inner { overflow: hidden; min-height: 0; padding: 0 16px 0 54px; }
.rapid.open .rp-body { display: grid; grid-template-rows: 1fr; visibility: visible; animation: none; transition: grid-template-rows var(--dur-base) var(--ease-out), visibility 0s; }
.rapid.open .rp-inner { padding-bottom: 14px; }
.chev { transition: transform var(--dur-fast) var(--ease-out); }

/* ---- Press feedback & hover (hover only on real pointers) ---- */
.chip, .seg button, .btn-filter, .btn-sm, .btn-done, .qbtn, .refresh, .rapid > button, .seg-card, .actionbar a {
  transition: transform var(--dur-press) var(--ease-out), background-color var(--dur-fast) ease, border-color var(--dur-fast) ease, color var(--dur-fast) ease; }
.chip:active, .seg button:active, .btn-filter:active, .btn-sm:active, .btn-done:active, .qbtn:active, .refresh:active, .seg-card:active, .actionbar a:active { transform: scale(.97); }
.rapid > button:active { transform: scale(.985); }
.card, .row { transition: transform var(--dur-press) var(--ease-out), box-shadow var(--dur-fast) ease, background-color var(--dur-fast) ease; }
.card:active { transform: scale(.985); }
.row:active { background: var(--c-empty-bg); }
.card:hover { transform: none; box-shadow: var(--shadow); }
.chip:hover, .btn-sm:hover { border-color: var(--line-2); }
@media (hover: hover) and (pointer: fine) {
  .card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
  .card:active { transform: translateY(-1px) scale(.99); }
  .row:hover { background: var(--c-empty-bg); }
  .chip:hover, .btn-sm:hover, .btn-filter:hover { border-color: var(--ink-3); }
}
.mk-rapid { transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) ease; }

@media (prefers-reduced-motion: reduce) {
  .filters, .filters.open, .rp-body, .rapid.open .rp-body { transition: visibility 0s !important; }
  .sheet-backdrop { transition: opacity 120ms ease !important; }
}

/* compact rows v2b: name + class on line 1, river + gap on line 2 */
.row { grid-template-columns: minmax(0, 1fr) auto; }
.row-name b { white-space: normal; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row-name b .cls { font-size: var(--fs-2xs); }
.row-name span { font-size: var(--fs-sm); margin-top: 2px; }
.row-name span strong { color: var(--ci); font-weight: 650; }
.row-status { white-space: nowrap !important; }
@media (max-width: 759px) {
  .ctl-row { gap: 6px; }
  .seg button { padding: 6px 10px; font-size: var(--fs-md); }
  .btn-filter { padding: 0 12px; font-size: var(--fs-md); }
}
.row-name span strong { white-space: nowrap; }
/* Phones: backdrop-filter would make .controls the containing block for the fixed filter sheet, pinning it to the top. Use a solid bar instead. */
@media (max-width: 759px) {
  .controls { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgb(246,244,239); }
}

/* Review fixes: stale marker on compact rows, no-data group */
.row-stale { display: inline-flex; align-items: center; font-size: var(--fs-2xs); font-weight: 650; color: var(--status-ink-low); background: var(--status-tint-low); border-radius: var(--radius-pill); padding: 1px 8px; margin-top: 3px; white-space: nowrap; }
.row-stale .glyph { --c: var(--status-ink-low); }
.group-note { margin: 4px 0 0; max-width: 65ch; }

/* ---- Round 3 ---- */
/* Number crossfade: only added when the reading changed (see cfsTick in app.js). Reduced motion removes it. */
@keyframes cfs-in { from { opacity: 0; filter: blur(2px); transform: translateY(3px); } }
.cfs-tick { animation: cfs-in 200ms var(--ease-out); }

/* Unverified rapids: dashed ring, lighter fill, small "?" badge, so they read as a different kind of marker */
.mk-rapid.mk-unv { border-style: dashed; border-color: var(--c-white); opacity: .82; position: relative; }
.mk-rapid.mk-unv::after { content: '?'; position: absolute; top: -7px; right: -7px; width: 14px; height: 14px; border-radius: 50%; background: var(--status-low); color: var(--ink); font: 800 9px/14px var(--body); text-align: center; box-shadow: 0 0 0 1.5px var(--c-white); }
.mk-rapid.mk-unv.sel { opacity: 1; }
.lg-unv { background: var(--c-class-4-bg); border-radius: 50% !important; outline: 2px dashed var(--status-low); outline-offset: -1px; opacity: .85; }

/* Home map view: list left, map stays put on the right on wide screens */
.overview-wrap .overview-map { margin: 14px 0 6px; }
@media (min-width: 1100px) {
  .home-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-5); align-items: start; }
  .home-split { margin-bottom: var(--space-5); }
  .home-split .overview-wrap { order: 2; position: sticky; top: 132px; }
  .home-split .overview-map { height: calc(100vh - 156px); max-height: 760px; margin: 18px 0 0; }
  .home-split .home-list { order: 1; min-width: 0; }
  .home-split .cards { grid-template-columns: 1fr; }
}
