:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #eef5f1;
  color: #10231b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(71, 124, 89, 0.22), transparent 34rem),
    linear-gradient(180deg, #f7fbf8 0%, #e8f1ec 100%);
}

.page-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0;
}

.hero,
.panel {
  border: 1px solid rgba(16, 35, 27, 0.12);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 24px 80px rgba(21, 50, 37, 0.12);
}

.hero {
  padding: clamp(32px, 6vw, 72px);
}

.panel {
  margin-top: 24px;
  padding: clamp(24px, 4vw, 40px);
}

.condition-panel {
  background: rgba(244, 250, 246, 0.94);
}

.condition-panel[data-condition="good"] {
  background: rgba(239, 250, 242, 0.96);
}

.condition-panel[data-condition="caution"] {
  background: rgba(255, 250, 242, 0.96);
}

.condition-panel[data-condition="poor"] {
  background: rgba(255, 245, 245, 0.96);
}

.condition-badge {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 11px 16px;
  background: #10231b;
  color: #fff;
  font-weight: 950;
  letter-spacing: -0.02em;
}

.condition-panel[data-condition="good"] .condition-badge {
  background: #277148;
}

.condition-panel[data-condition="caution"] .condition-badge {
  background: #d97706;
}

.condition-panel[data-condition="poor"] .condition-badge {
  background: #b42318;
}

.condition-reason {
  max-width: 860px;
  margin-bottom: 22px;
  color: #10231b;
  font-size: 1.08rem;
  font-weight: 750;
  line-height: 1.55;
}

.condition-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
}

.condition-metrics div {
  border: 1px solid rgba(16, 35, 27, 0.12);
  border-radius: 18px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.82);
}

.condition-metrics dt {
  margin-bottom: 8px;
  color: #607367;
  font-size: 0.84rem;
  font-weight: 900;
}

.condition-metrics dd {
  margin: 0;
  color: #10231b;
  font-size: 1.2rem;
  font-weight: 950;
}

.alert-panel {
  background: rgba(255, 250, 242, 0.9);
}

.map-panel {
  overflow: hidden;
}

.muted {
  background: rgba(245, 249, 246, 0.86);
}

.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
  font-weight: 800;
  color: #477c59;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 780px;
  font-size: clamp(2.4rem, 7vw, 5.4rem);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  letter-spacing: -0.04em;
}

.lede,
.helper-text {
  max-width: 720px;
  color: #40564a;
  line-height: 1.7;
}

.lede {
  font-size: 1.18rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 12px 18px;
  background: #10231b;
  color: white;
  font-weight: 800;
  text-decoration: none;
}

.actions a + a {
  background: #477c59;
}

.section-heading {
  margin-bottom: 22px;
}

.split-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.count-pill {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 10px 14px;
  background: #10231b;
  color: #fff;
  font-weight: 900;
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  color: #40564a;
  font-size: 0.9rem;
  font-weight: 800;
}

.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(16, 35, 27, 0.25);
}

.station-dot {
  background: #1d5cff;
}

.overflow-dot {
  background: #d97706;
}

.river-map {
  width: 100%;
  height: min(68vh, 560px);
  min-height: 380px;
  border: 1px solid rgba(16, 35, 27, 0.12);
  border-radius: 22px;
  overflow: hidden;
  background: #dbe8df;
}

.leaflet-container {
  position: relative;
  overflow: hidden;
  outline: 0;
  touch-action: pan-x pan-y;
}

.leaflet-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-container,
.leaflet-pane > svg,
.leaflet-pane > canvas,
.leaflet-zoom-box,
.leaflet-image-layer,
.leaflet-layer {
  position: absolute;
  left: 0;
  top: 0;
}

.leaflet-container img.leaflet-tile {
  max-width: none !important;
  max-height: none !important;
  width: 256px;
  height: 256px;
  padding: 0;
  border: 0;
}

.leaflet-tile {
  user-select: none;
  visibility: hidden;
}

.leaflet-tile-loaded {
  visibility: inherit;
}

.leaflet-map-pane,
.leaflet-tile-pane,
.leaflet-overlay-pane,
.leaflet-shadow-pane,
.leaflet-marker-pane,
.leaflet-tooltip-pane,
.leaflet-popup-pane {
  position: absolute;
  left: 0;
  top: 0;
}

.leaflet-tile-pane {
  z-index: 200;
}

.leaflet-overlay-pane {
  z-index: 400;
}

.leaflet-shadow-pane {
  z-index: 500;
}

.leaflet-marker-pane {
  z-index: 600;
}

.leaflet-tooltip-pane {
  z-index: 650;
}

.leaflet-popup-pane {
  z-index: 700;
}

.leaflet-control-container {
  position: relative;
  z-index: 800;
}

.leaflet-popup {
  position: absolute;
  text-align: center;
  margin-bottom: 20px;
}

.leaflet-popup-content-wrapper {
  background: #ffffff;
  color: #10231b;
  border: 1px solid rgba(16, 35, 27, 0.14);
  border-radius: 14px;
  box-shadow: 0 14px 38px rgba(16, 35, 27, 0.28);
  padding: 2px;
}

.leaflet-popup-content {
  margin: 12px 14px;
  min-width: 210px;
  color: #10231b;
  font-size: 0.92rem;
  line-height: 1.55;
  text-align: left;
}

.leaflet-popup-content strong {
  display: block;
  margin-bottom: 4px;
  color: #10231b;
  font-size: 1rem;
}

.leaflet-popup-tip-container {
  position: absolute;
  left: 50%;
  width: 40px;
  height: 20px;
  margin-left: -20px;
  overflow: hidden;
  pointer-events: none;
}

.leaflet-popup-tip {
  width: 17px;
  height: 17px;
  margin: -10px auto 0;
  background: #ffffff;
  border-right: 1px solid rgba(16, 35, 27, 0.14);
  border-bottom: 1px solid rgba(16, 35, 27, 0.14);
  transform: rotate(45deg);
  box-shadow: 0 8px 18px rgba(16, 35, 27, 0.18);
}

.leaflet-popup-close-button {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 22px;
  height: 22px;
  color: #40564a;
  text-align: center;
  text-decoration: none;
  font-size: 18px;
  line-height: 22px;
  font-weight: 900;
  z-index: 1;
}

.leaflet-popup-close-button:hover {
  color: #10231b;
}

.map-marker {
  border: 3px solid #fff;
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(16, 35, 27, 0.28);
}

.station-marker {
  background: #1d5cff;
}

.overflow-marker {
  background: #d97706;
}

.station-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.station-card,
.overflow-card {
  border: 1px solid rgba(16, 35, 27, 0.12);
  border-radius: 20px;
  padding: 20px;
  background: #ffffff;
}

.overflow-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 26px 0 24px;
}

.summary-card {
  border: 1px solid rgba(16, 35, 27, 0.12);
  border-radius: 18px;
  padding: 18px;
  background: #ffffff;
  box-shadow: 0 12px 34px rgba(21, 50, 37, 0.08);
}

.summary-card span {
  display: block;
  margin-bottom: 10px;
  color: #40564a;
  font-size: 0.9rem;
  font-weight: 900;
}

.summary-card strong {
  display: block;
  color: #10231b;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 0.95;
}

.summary-card.warning {
  border-color: rgba(217, 119, 6, 0.35);
  background: #fff8ed;
}

.summary-card.good {
  border-color: rgba(71, 124, 89, 0.28);
  background: #f4faf6;
}

.summary-card.muted-card {
  background: #f5f7f6;
}

.subsection-title {
  margin: 10px 0 16px;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

.overflow-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.overflow-card {
  display: grid;
  gap: 10px;
}

.station-river {
  margin-bottom: 8px;
  color: #477c59;
  font-weight: 800;
}

.reading-list {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
}

.reading-list.compact {
  margin-top: 0;
}

.reading-list div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid rgba(16, 35, 27, 0.1);
  padding-top: 10px;
}

.reading-list dt {
  color: #607367;
  font-size: 0.82rem;
  font-weight: 800;
}

.reading-list dd {
  margin: 0;
  color: #10231b;
  font-weight: 900;
  text-align: right;
}

.status {
  display: inline-flex;
  margin-top: 12px;
  border-radius: 999px;
  padding: 7px 10px;
  background: #e8f1ec;
  color: #244334;
  font-size: 0.85rem;
  font-weight: 800;
}

.roadmap {
  margin: 0;
  padding-left: 1.25rem;
  color: #40564a;
  line-height: 1.8;
}

@media (max-width: 720px) {
  .split-heading {
    display: block;
  }

  .condition-badge,
  .count-pill {
    margin-top: 14px;
  }

  .condition-metrics,
  .overflow-summary {
    grid-template-columns: 1fr;
  }

  .map-legend {
    justify-content: flex-start;
    margin-top: 14px;
  }

  .river-map {
    min-height: 320px;
  }
}
