:root {
  --rw-ink: #14251d;
  --rw-muted: #596a61;
  --rw-primary: #315f49;
  --rw-primary-strong: #244b39;
  --rw-river: #39788c;
  --rw-page: #f4f6f2;
  --rw-surface: #ffffff;
  --rw-surface-muted: #eaeFaa;
  --rw-soft: #eef2ee;
  --rw-border: #d5ddd7;
  --rw-good-bg: #e6f2e9;
  --rw-good: #24623d;
  --rw-caution-bg: #fff2d8;
  --rw-caution: #8a5700;
  --rw-poor-bg: #fce7e4;
  --rw-poor: #9b3029;
  --rw-overflow-bg: #e2f1f3;
  --rw-overflow: #22616d;
  --rw-radius-sm: 8px;
  --rw-radius-md: 14px;
  --rw-radius-lg: 20px;
  --rw-shadow-sm: 0 4px 14px rgba(20, 37, 29, 0.05);
  --rw-shadow-md: 0 12px 34px rgba(20, 37, 29, 0.08);
  --rw-space-1: 4px;
  --rw-space-2: 8px;
  --rw-space-3: 12px;
  --rw-space-4: 16px;
  --rw-space-5: 24px;
  --rw-space-6: 32px;
  --rw-space-7: 48px;
  --rw-space-8: 64px;
}

html { scroll-behavior: smooth; }
body {
  background: var(--rw-page);
  color: var(--rw-ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 400;
}

.page-shell,
.home-shell {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
  padding: 0 0 var(--rw-space-7);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  min-height: 72px;
  margin: 0;
  padding: 12px 0;
  border-bottom: 1px solid rgba(20, 37, 29, 0.08);
  background: rgba(244, 246, 242, 0.92);
  backdrop-filter: blur(14px);
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--rw-ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 11px;
  background: var(--rw-primary);
  color: #fff;
  box-shadow: var(--rw-shadow-sm);
}

.brand-mark svg { width: 22px; height: 22px; }
.brand-copy { display: grid; gap: 1px; }
.brand-name {
  color: var(--rw-ink);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: none;
}
.brand-subtitle {
  color: var(--rw-muted);
  font-size: 0.75rem;
  font-weight: 500;
}

.site-nav { gap: 6px; }
.site-nav a {
  border-radius: 10px;
  padding: 9px 12px;
  color: var(--rw-muted);
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 150ms ease, color 150ms ease;
}
.site-nav a::after { display: none; }
.site-nav a:hover { background: rgba(49, 95, 73, 0.08); color: var(--rw-ink); }
.site-nav a[aria-current='page'] { background: var(--rw-primary); color: #fff; }

.site-status-strip {
  min-height: 40px;
  margin: 0 0 var(--rw-space-5);
  border: 1px solid var(--rw-border);
  border-top: 0;
  border-radius: 0 0 var(--rw-radius-md) var(--rw-radius-md);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: none;
  font-size: 0.86rem;
}
.site-status-label,
.site-status-copy,
.site-status-time { font-weight: 600; }
.site-status-copy { color: var(--rw-muted); }
.site-status-dot { width: 8px; height: 8px; }

.hero,
.panel {
  border: 1px solid var(--rw-border);
  border-radius: var(--rw-radius-lg);
  background: var(--rw-surface);
  box-shadow: var(--rw-shadow-md);
}
.panel {
  margin-top: var(--rw-space-5);
  padding: clamp(20px, 3vw, 32px);
}

.home-shell .hero-compact,
.page-hero {
  min-height: clamp(340px, 48vw, 440px);
  border-radius: var(--rw-radius-lg);
  box-shadow: 0 16px 42px rgba(7, 31, 22, 0.16);
}
.home-shell .hero-compact {
  padding: clamp(28px, 5vw, 56px);
  background:
    linear-gradient(90deg, rgba(4, 18, 13, 0.78) 0%, rgba(4, 18, 13, 0.50) 48%, rgba(4, 18, 13, 0.15) 100%),
    linear-gradient(180deg, rgba(4, 18, 13, 0.04) 0%, rgba(4, 18, 13, 0.38) 100%),
    url('/river-ure-hero.webp');
  background-position: center 58%;
}
.page-hero {
  min-height: 300px;
  padding: clamp(26px, 4vw, 44px);
  background:
    linear-gradient(90deg, rgba(4, 18, 13, 0.80) 0%, rgba(4, 18, 13, 0.48) 52%, rgba(4, 18, 13, 0.14) 100%),
    linear-gradient(180deg, rgba(4, 18, 13, 0.04) 0%, rgba(4, 18, 13, 0.42) 100%),
    url('/river-ure-hero.webp');
}

h1, h2, h3 { color: var(--rw-ink); font-weight: 700; }
h1 {
  max-width: 760px;
  font-size: clamp(2.5rem, 5vw, 4.25rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
}
h2 {
  font-size: clamp(1.65rem, 3vw, 2.25rem);
  line-height: 1.12;
  letter-spacing: -0.025em;
}
h3 { line-height: 1.25; letter-spacing: -0.015em; }
.eyebrow {
  margin-bottom: 8px;
  color: var(--rw-primary);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.11em;
}
.lede,
.helper-text { color: var(--rw-muted); line-height: 1.65; }
.lede { max-width: 680px; font-size: 1.08rem; }

.hero-actions,
.actions { gap: 10px; margin-top: var(--rw-space-5); }
.hero-actions a,
.actions a,
.jump-links a {
  min-height: 44px;
  border-radius: 11px;
  padding: 11px 16px;
  font-weight: 600;
}
.home-shell .hero-compact .actions a:first-child { background: #fff; color: var(--rw-ink); }
.home-shell .hero-compact .actions a + a {
  border: 1px solid rgba(255,255,255,.45);
  background: rgba(255,255,255,.11);
  color: #fff;
}

.condition-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
  gap: var(--rw-space-6);
  overflow: hidden;
  background: var(--rw-surface);
}
.condition-panel::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--rw-primary);
}
.condition-panel { position: relative; }
.condition-panel[data-condition='good']::before { background: var(--rw-good); }
.condition-panel[data-condition='caution']::before { background: var(--rw-caution); }
.condition-panel[data-condition='poor']::before { background: var(--rw-poor); }
.condition-panel[data-condition='overflow alert']::before { background: var(--rw-overflow); }
.condition-panel[data-condition],
.condition-panel[data-condition='good'],
.condition-panel[data-condition='caution'],
.condition-panel[data-condition='poor'],
.condition-panel[data-condition='overflow alert'] { background: var(--rw-surface); }

.condition-badge,
.confidence-pill,
.count-pill {
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  box-shadow: none;
}
.condition-panel[data-condition='good'] .condition-badge { background: var(--rw-good-bg); color: var(--rw-good); }
.condition-panel[data-condition='caution'] .condition-badge { background: var(--rw-caution-bg); color: var(--rw-caution); }
.condition-panel[data-condition='poor'] .condition-badge { background: var(--rw-poor-bg); color: var(--rw-poor); }
.condition-panel[data-condition='overflow alert'] .condition-badge { background: var(--rw-overflow-bg); color: var(--rw-overflow); }

.condition-reason { color: var(--rw-ink); font-size: 1.05rem; font-weight: 500; }
.condition-metrics { gap: 0; border: 1px solid var(--rw-border); border-radius: var(--rw-radius-md); background: var(--rw-soft); overflow: hidden; }
.condition-metrics > div,
.condition-metrics > a > div {
  min-height: 78px;
  border: 0;
  border-bottom: 1px solid var(--rw-border);
  border-radius: 0;
  padding: 14px 16px;
  background: transparent;
  box-shadow: none;
}
.condition-metrics > *:last-child > div,
.condition-metrics > div:last-child { border-bottom: 0; }
.condition-metrics dt { margin-bottom: 4px; color: var(--rw-muted); font-size: .78rem; font-weight: 600; }
.condition-metrics dd { color: var(--rw-ink); font-size: 1.08rem; font-weight: 700; }
.card-action-hint { color: var(--rw-primary); font-size: .74rem; font-weight: 600; }
.clickable-card { transition: background 150ms ease; }
.clickable-card:hover { background: rgba(49,95,73,.07); transform: none; }

.status-transparency {
  grid-column: 1 / -1;
  margin-top: 0;
  border-color: var(--rw-border);
  border-radius: var(--rw-radius-md);
  background: var(--rw-soft);
}
.transparency-header strong,
.calculation-details summary { font-weight: 700; }
.data-quality-pill { background: #fff; color: var(--rw-muted); font-weight: 600; }

.guide-grid { gap: 0; border: 1px solid var(--rw-border); border-radius: var(--rw-radius-md); overflow: hidden; }
.guide-card {
  min-height: auto;
  border: 0;
  border-right: 1px solid var(--rw-border);
  border-bottom: 1px solid var(--rw-border);
  border-radius: 0;
  padding: 22px;
  background: #fff;
  box-shadow: none;
}
.guide-grid .guide-card:nth-child(2n) { border-right: 0; }
.guide-card h3 { font-weight: 700; }
.guide-card p,
.guide-list li { color: var(--rw-muted); font-weight: 400; }
.guide-list li span:first-child { color: var(--rw-river); }

.method-reason-card { margin-top: var(--rw-space-4); border: 1px solid var(--rw-border); border-radius: var(--rw-radius-md); background: var(--rw-soft); }
.reason-grid { grid-template-columns: repeat(4, minmax(0,1fr)); gap: 0; border: 1px solid var(--rw-border); border-radius: 12px; overflow: hidden; }
.reason-item {
  border: 0;
  border-right: 1px solid var(--rw-border);
  border-radius: 0;
  padding: 14px;
  background: #fff;
}
.reason-item:last-child { border-right: 0; }
.reason-item span { color: var(--rw-primary); font-weight: 700; }
.reason-item strong { font-weight: 700; }
.reason-item p { color: var(--rw-muted); font-weight: 400; }
.result-card { grid-column: auto; background: var(--rw-primary); }
.result-card span,
.result-card strong,
.result-card p { color: #fff; }

.fly-section { gap: 12px; }
.fly-choice-grid { gap: 12px; }
.fly-card {
  min-height: 0;
  border: 1px solid var(--rw-border);
  border-radius: var(--rw-radius-md);
  padding: 18px;
  background: #fff;
  box-shadow: none;
  transition: border-color 150ms ease, transform 150ms ease;
}
.fly-card:hover { transform: translateY(-2px); border-color: rgba(49,95,73,.38); }
.fly-card-title { font-weight: 700; }
.fly-rank { background: var(--rw-primary); font-weight: 700; }
.fly-card-meta { gap: 4px 10px; }
.fly-card-meta span {
  min-height: auto;
  padding: 0;
  background: transparent;
  color: var(--rw-muted);
  font-size: .76rem;
  font-weight: 600;
}
.fly-card-meta span + span::before { content: '·'; margin-right: 10px; color: #a3aea7; }
.fly-card-note { color: var(--rw-ink); font-weight: 500; }
.fly-card-reason { color: var(--rw-muted); font-weight: 400; }
.avoid-grid { grid-template-columns: 1fr; gap: 0; border: 1px solid #efdcb8; border-radius: var(--rw-radius-md); overflow: hidden; }
.avoid-grid li {
  border: 0;
  border-bottom: 1px solid #efdcb8;
  border-radius: 0;
  background: #fff9ed;
  color: #725024;
  font-weight: 500;
}
.avoid-grid li:last-child { border-bottom: 0; }

.snapshot-card,
.station-card,
.weather-card,
.overflow-card {
  border-radius: var(--rw-radius-md);
  border-color: var(--rw-border);
  box-shadow: var(--rw-shadow-sm);
}
.snapshot-card:hover { transform: translateY(-2px); box-shadow: var(--rw-shadow-md); }
.river-map { border-radius: var(--rw-radius-md); border-color: var(--rw-border); }

button,
a,
[role='link'] { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid rgba(57, 120, 140, 0.36); outline-offset: 3px; }

@media (max-width: 960px) {
  .reason-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .reason-item:nth-child(2n) { border-right: 0; }
  .reason-item { border-bottom: 1px solid var(--rw-border); }
}

@media (max-width: 820px) {
  .page-shell,
  .home-shell { width: min(100% - 24px, 1180px); }
  .site-header { position: relative; min-height: 64px; }
  .brand-subtitle { display: none; }
  .site-status-strip { margin-bottom: 16px; }
  .site-status-copy { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .site-status-time { display: none; }
  .home-shell .hero-compact { min-height: 360px; }
  .condition-panel { grid-template-columns: 1fr; gap: 20px; }
  .condition-panel .section-heading,
  .condition-panel .condition-reason,
  .condition-panel .condition-metrics { grid-column: 1; grid-row: auto; }
  .condition-badge { justify-self: start; }
  .guide-grid { grid-template-columns: 1fr; }
  .guide-grid .guide-card { border-right: 0; }
  .reason-grid { grid-template-columns: 1fr; }
  .reason-item { border-right: 0; }
  .result-card { grid-column: auto; }
}

@media (max-width: 560px) {
  .page-shell,
  .home-shell { width: min(100% - 20px, 1180px); }
  .panel { padding: 19px; }
  h1 { font-size: clamp(2.15rem, 12vw, 3.25rem); }
  .home-shell .hero-compact,
  .page-hero { min-height: 330px; padding: 24px; }
  .site-status-label { flex: 0 0 auto; }
  .site-status-copy { font-size: .78rem; }
  .condition-metrics > div,
  .condition-metrics > a > div { min-height: 72px; }
}
