@font-face {
  font-family: "B612";
  src: url("fonts/B612-Regular.ttf?v=139dce659100") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "B612";
  src: url("fonts/B612-Bold.ttf?v=91749541ac7b") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Libertinus Serif";
  src: url("fonts/LibertinusSerif-Regular.otf?v=cdb45c79ec6e") format("opentype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Libertinus Serif";
  src: url("fonts/LibertinusSerif-Semibold.otf?v=5f7f33c54a17") format("opentype");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Libertinus Serif";
  src: url("fonts/LibertinusSerif-Bold.otf?v=8623034b0485") format("opentype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --ink: #142a36;
  --muted: #60727b;
  --surface: #ffffff;
  --surface-soft: #edf4f6;
  --line: #cfdee3;
  --river: #087ea0;
  --river-bright: #20a6d6;
  --river-chevron: #fff;
  --river-pale: #d8f0f7;
  --focus: #e16b36;
  --qa-warning: #9a4b18;
  --qa-warning-soft: #fff3e8;
  --qa-error: #a62b1f;
  --qa-error-soft: #fff0ee;
  --shadow: 0 14px 34px rgba(18, 54, 70, 0.13);
  --side-panel-min-width: 23rem;
  --side-panel-max-width: 52rem;
  --workspace-gap: 0.5rem;
  --diagram-fallback-width: 800px;
  --diagram-background: #ffffff;
  --diagram-background-soft: #f7fbfc;
  --diagram-ink: #111111;
  --diagram-muted: #777777;
  --diagram-symbol-fill: #ffffff;
  --diagram-symbol-stroke: #111111;
  --diagram-dam-fill: #dddddd;
  --diagram-underground-outline: #273744;
  font-family: "B612", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  min-width: 320px;
  color: var(--ink);
  background: var(--surface-soft);
}

button {
  font: inherit;
}

button:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus) 75%, white);
  outline-offset: 3px;
}

.site-header {
  height: 4.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0 1.5rem;
  color: white;
  background: #102f3e;
  border-bottom: 4px solid var(--river-bright);
}

.site-title {
  display: block;
  min-width: 0;
  color: inherit;
  font-family: "Libertinus Serif", Georgia, serif;
  font-weight: 700;
  font-size: 1.55rem;
  line-height: 1;
  text-decoration: none;
}

.site-tagline {
  font-family: "B612", ui-sans-serif, system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.eyebrow,
.section-label {
  margin: 0 0 0.25rem;
  color: var(--river-bright);
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.eyebrow a:hover,
.site-title:hover {
  color: #8ee4ff;
}

.app-status {
  max-width: 32rem;
  margin: 0;
  color: #cce7f0;
  font-size: 0.875rem;
  text-align: right;
}

.loading-state:not([hidden]),
.metadata-loading {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.loading-state {
  margin: 0;
  padding: 1.5rem;
  color: var(--muted);
}

.metadata-loading {
  margin: 0;
}

.loading-spinner,
.metadata-loading::before {
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 auto;
  border: 0.18rem solid var(--line);
  border-top-color: var(--river);
  border-radius: 50%;
  animation: loading-spin 0.8s linear infinite;
}

.metadata-loading::before {
  content: "";
}

@keyframes loading-spin {
  to { transform: rotate(360deg); }
}

.header-meta {
  display: grid;
  min-width: 0;
  justify-items: end;
  gap: 0.35rem;
}

.legal-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.4rem 0.9rem;
  font-size: 0.75rem;
}

.legal-nav a {
  color: #cce7f0;
  text-underline-offset: 0.2em;
}

.legal-nav a:hover,
.legal-nav a[aria-current="page"] {
  color: #8ee4ff;
}

.workspace {
  height: calc(100% - 4.5rem);
  display: grid;
  grid-template-columns:
    minmax(0, 1fr)
    clamp(var(--side-panel-min-width), 50%, var(--side-panel-max-width));
  gap: var(--workspace-gap);
  padding: 0;
}

.map-panel,
.side-panel {
  min-width: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.map-panel {
  position: relative;
  border-radius: 0 1.15rem 1.15rem 0;
}

#map {
  width: 100%;
  height: 100%;
  background: #d9e5e4;
}

.side-panel {
  overflow-y: auto;
  border-radius: 1.15rem 0 0 1.15rem;
}

.panel-header,
.river-header,
.metadata-section,
.error-view {
  padding: 1.5rem;
}

.panel-header,
.river-header {
  border-bottom: 1px solid var(--line);
}

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

h1,
h2 {
  font-family: "Libertinus Serif", Georgia, serif;
}

h1 {
  margin-bottom: 0.55rem;
  font-size: clamp(1.75rem, 3vw, 2.4rem);
  font-weight: 600;
  line-height: 1.08;
}

h2 {
  margin-bottom: 1rem;
  font-size: 1rem;
  letter-spacing: 0.04em;
}

.panel-hint {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.overview-intro {
  margin: 0 0 0.85rem;
  line-height: 1.55;
}

.example-rivers {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--line);
}

.example-rivers h2 {
  margin-bottom: 0.7rem;
}

.example-river-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.example-river-links button {
  padding: 0.5rem 0.8rem;
  color: var(--river);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  cursor: pointer;
}

.example-river-links button:hover {
  border-color: var(--river);
  background: var(--river-pale);
}

.river-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.river-list li {
  border-bottom: 1px solid var(--line);
}

.river-button,
.river-unavailable {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  color: var(--ink);
  text-align: left;
  background: transparent;
  border: 0;
}

.river-button {
  cursor: pointer;
}

.river-button:hover {
  background: var(--river-pale);
}

.river-name {
  display: block;
  font-weight: 700;
}

.river-id,
.availability {
  color: var(--muted);
  font-size: 0.8rem;
}

.availability {
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.river-header {
  min-height: 4.75rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  position: sticky;
  z-index: 2;
  top: 0;
  color: var(--ink);
  background: var(--surface);
}

.river-header h1 {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.river-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
}

.debug-button {
  min-height: 2.4rem;
  padding: 0.35rem 0.75rem;
  color: var(--river);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
}

.debug-button:hover,
.debug-button[aria-pressed="true"] {
  color: white;
  background: var(--focus);
  border-color: var(--focus);
}

.close-button {
  width: 2.75rem;
  height: 2.75rem;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  padding: 0 0 0.15rem;
  color: var(--ink);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.75rem;
  line-height: 1;
}

.close-button:hover {
  color: white;
  background: #a33b2d;
  border-color: #a33b2d;
}

.diagram {
  min-height: 16rem;
  padding: 0.75rem;
  overflow-x: hidden;
  overflow-y: auto;
  background: linear-gradient(var(--diagram-background), var(--diagram-background-soft));
  border-bottom: 1px solid var(--line);
}

.diagram svg {
  --water-area-fill: var(--river-pale);
  --water-area-stroke: var(--river);
  --underground-outline: var(--diagram-underground-outline);
  display: block;
  width: 100%;
  min-width: 0;
  max-width: var(--diagram-native-width, var(--diagram-fallback-width));
  height: auto;
  margin-inline: auto;
}

.diagram svg .background {
  fill: var(--diagram-background);
}

.diagram svg text {
  fill: var(--diagram-ink);
}

.diagram svg .river,
.diagram svg .branch,
.diagram svg .mouth-receiver-line {
  stroke: var(--river);
}

.diagram svg .flow-chevron-band {
  stroke: var(--river-chevron);
}

.diagram svg .flow-chevron {
  fill: var(--river-chevron);
  stroke: none;
}

.diagram svg .underground-outline {
  stroke: var(--diagram-underground-outline);
}

.diagram svg .label-leader {
  stroke: var(--diagram-muted);
}

.diagram svg .event-symbol,
.diagram svg .fish-pass-symbol-tail,
.diagram svg .fish-pass-symbol-body,
.diagram svg .passage-shape-rapids {
  fill: var(--diagram-symbol-fill);
  stroke: var(--diagram-symbol-stroke);
}

.diagram svg .event-mouth,
.diagram svg .event-source,
.diagram svg .event-formation,
.diagram svg .fish-pass-symbol-tail,
.diagram svg .fish-pass-symbol-body,
.diagram svg .passage-shape-rapids {
  stroke: var(--river);
}

.diagram svg .fish-pass-symbol-eye {
  fill: var(--river);
}

.diagram svg .event-dam {
  fill: var(--diagram-dam-fill);
}

.diagram svg .event-symbol .symbol-backdrop {
  fill: var(--diagram-symbol-fill);
  stroke: var(--diagram-symbol-stroke);
}

.diagram svg .event-symbol .symbol-line {
  fill: none;
  stroke: var(--diagram-symbol-stroke);
}

.diagram svg .event-symbol .symbol-stone,
.diagram svg .event-symbol .symbol-solid {
  fill: var(--diagram-symbol-stroke);
  stroke: none;
}

.diagram svg .event-symbol .symbol-water {
  fill: none;
  stroke: var(--river);
}

.diagram svg .event-symbol .symbol-spill {
  fill: none;
  stroke: var(--diagram-symbol-fill);
}

.diagram svg .debug {
  fill: var(--diagram-muted);
}

.diagram svg .debug-trigger-text,
.diagram svg .debug-card .debug-link tspan {
  fill: var(--river);
}

.diagram svg .debug-card-panel {
  fill: var(--surface);
  stroke: var(--river);
}

.diagram svg .debug-card-close-text {
  fill: var(--diagram-muted);
}

.diagram svg .passage-label,
.diagram svg .branch-label,
.diagram svg .event-label,
.diagram svg .mouth-receiver-label,
.diagram svg .source-waterbody-label,
.diagram svg .source-branch-label {
  font-size: 16px;
}

.diagram [data-osm-node-id],
.diagram [data-osm-way-id],
.diagram [data-osm-relation-id] {
  cursor: pointer;
}

.metadata-section + .metadata-section {
  border-top: 1px solid var(--line);
}

.metadata-list {
  display: grid;
  grid-template-columns: minmax(8rem, auto) 1fr;
  gap: 0.65rem 1rem;
  margin: 0;
}

.metadata-list dt {
  color: var(--muted);
}

.metadata-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.metadata-list a {
  color: var(--river);
}

.metadata-values {
  display: grid;
  gap: 0.3rem;
  margin: 0;
  padding-left: 1.15rem;
}

.metadata-values code {
  font-size: 0.85em;
}

.river-name-summary:not(:empty) {
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--line);
}

.expert-edit-links {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  vertical-align: middle;
}

.expert-edit-link {
  display: inline-grid;
  place-items: center;
  min-width: 1.65rem;
  min-height: 1.65rem;
  border: 1px solid currentColor;
  border-radius: 0.35rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}

.expert-edit-link:hover,
.expert-edit-link:focus-visible {
  color: var(--surface);
  background: var(--river);
}

.expert-edit-link-josm {
  font-family: sans-serif;
  font-size: 0.8rem;
}

.wikidata-metadata {
  margin-top: 1rem;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
}

.wikidata-measurements {
  margin-bottom: 1rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--surface);
}

.metadata-note {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.metadata-error {
  color: #8a2f22;
}

.metadata-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.metadata-links a,
.metadata-retry {
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 0.35rem;
  color: var(--river);
  background: var(--surface);
  font: inherit;
  text-decoration: none;
}

.metadata-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2rem;
}

.metadata-project-icon {
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 auto;
}

.metadata-project-icon-wikipedia text {
  fill: currentColor;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  font-weight: 700;
}

.metadata-project-icon-commons circle {
  fill: none;
  stroke: #1672b8;
  stroke-width: 2.5;
}

.metadata-project-icon-commons path {
  fill: #1672b8;
}

.metadata-link-language {
  padding: 0.05rem 0.25rem;
  border-radius: 0.25rem;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.25;
  text-transform: uppercase;
}

.metadata-retry {
  cursor: pointer;
}

.metadata-links a:hover,
.metadata-links a:focus-visible,
.metadata-retry:hover,
.metadata-retry:focus-visible {
  border-color: var(--river);
}

.name-comparison {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.name-comparison caption {
  margin-bottom: 0.5rem;
  color: var(--ink);
  font-weight: 700;
  text-align: left;
}

.name-comparison th,
.name-comparison td {
  padding: 0.45rem;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.name-comparison .comparison-result {
  width: 1%;
  text-align: center;
  white-space: nowrap;
}

.comparison-values {
  margin: 0;
  padding: 0;
  list-style: none;
}

.comparison-status {
  display: inline-grid;
  width: 1.65rem;
  height: 1.65rem;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  background: #e8eef1;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.comparison-status-exact {
  background: #dceedd;
}

.comparison-status-variant {
  background: #fff0c7;
}

.fact-comparison {
  margin-bottom: 1.25rem;
}

.fact-term {
  text-decoration: underline dotted;
  text-underline-offset: 0.2em;
  cursor: help;
}

.fact-term:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.river-identifiers {
  margin-bottom: 1.25rem;
  padding: 0.75rem;
  background: var(--surface-soft);
  border-radius: 0.5rem;
}

.river-image:not(:empty) {
  padding: 1.5rem 1.5rem 0;
}

.wikidata-image {
  margin: 0;
}

.wikidata-image-link,
.wikidata-image img {
  display: block;
  width: 100%;
}

.wikidata-image img {
  max-height: 18rem;
  object-fit: cover;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
}

.wikidata-image figcaption {
  margin-top: 0.45rem;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.wikidata-image figcaption a {
  color: var(--river);
}

.comparison-status-close,
.comparison-status-exact {
  background: #dceedd;
}

.comparison-status-partial,
.comparison-status-different {
  background: #fff0c7;
}

.comparison-status-missing,
.comparison-status-unverified,
.comparison-status-unsupported {
  color: var(--muted);
}

.raw-data {
  margin-top: 1rem;
}

.raw-data summary {
  color: var(--river);
  cursor: pointer;
}

.raw-data pre {
  max-width: 100%;
  padding: 0.8rem;
  overflow: auto;
  color: #dceef4;
  background: #102f3e;
  border-radius: 0.4rem;
  font-size: 0.75rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.debug-summary,
.debug-empty {
  margin: 0;
  color: var(--muted);
}

.debug-finding-list {
  display: grid;
  gap: 0.75rem;
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
}

.debug-finding {
  padding: 0.8rem;
  border: 1px solid var(--qa-warning);
  border-left-width: 0.35rem;
  border-radius: 0.45rem;
  background: var(--qa-warning-soft);
}

.debug-finding-error {
  border-color: var(--qa-error);
  background: var(--qa-error-soft);
}

.debug-finding-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.45rem;
}

.debug-severity {
  color: var(--qa-warning);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.debug-finding-error .debug-severity {
  color: var(--qa-error);
}

.debug-finding p {
  margin: 0.45rem 0 0;
  line-height: 1.45;
}

.debug-osm-objects a,
.osm-edit-link {
  color: var(--river);
}

.osm-edit-link {
  font-weight: 700;
}

.error-view {
  color: #812d22;
  background: #fff4f1;
}

.leaflet-control-attribution {
  font-size: 0.72rem;
}

.leaflet-tooltip.river-tooltip {
  color: var(--ink);
  background-color: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
}

.leaflet-tooltip.river-tooltip.leaflet-tooltip-top::before {
  border-top-color: var(--surface);
}

.leaflet-tooltip.river-tooltip.leaflet-tooltip-bottom::before {
  border-bottom-color: var(--surface);
}

.leaflet-tooltip.river-tooltip.leaflet-tooltip-left::before {
  border-left-color: var(--surface);
}

.leaflet-tooltip.river-tooltip.leaflet-tooltip-right::before {
  border-right-color: var(--surface);
}

.legal-page {
  height: auto;
  min-height: 100%;
}

.legal-content {
  width: min(100% - 2rem, 52rem);
  margin: 2rem auto 4rem;
  padding: clamp(1.25rem, 3vw, 2.5rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1rem;
  box-shadow: var(--shadow);
}

.legal-content h1 {
  margin-bottom: 1.5rem;
}

.legal-content h2 {
  margin-top: 2rem;
  margin-bottom: 0.65rem;
  font-size: 1.15rem;
  letter-spacing: 0;
}

.legal-content p,
.legal-content li {
  line-height: 1.65;
}

.legal-content a {
  color: var(--river);
}

.legal-content code {
  overflow-wrap: anywhere;
}

.legal-note {
  color: var(--muted);
  font-size: 0.9rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --ink: #e6f0f4;
    --muted: #a9bcc5;
    --surface: #102833;
    --surface-soft: #091d26;
    --line: #38525d;
    --river: #65c8ee;
    --river-bright: #83d8f4;
    --river-chevron: #173f50;
    --river-pale: #173f50;
    --focus: #ff9a68;
    --qa-warning: #ffad72;
    --qa-warning-soft: #3c2a1e;
    --qa-error: #ff958a;
    --qa-error-soft: #3d211f;
    --shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
    --diagram-background: #102833;
    --diagram-background-soft: #0b2029;
    --diagram-ink: #e6f0f4;
    --diagram-muted: #a9bcc5;
    --diagram-symbol-fill: #102833;
    --diagram-symbol-stroke: #e6f0f4;
    --diagram-dam-fill: #52646c;
    --diagram-underground-outline: #d9e5ea;
  }

  #map {
    background: #18343e;
  }

  .comparison-status {
    background: #263c45;
  }

  .comparison-status-exact,
  .comparison-status-close {
    background: #214a35;
  }

  .comparison-status-variant,
  .comparison-status-partial,
  .comparison-status-different {
    background: #594a20;
  }

  .error-view {
    color: #ffb4a8;
    background: #3a201d;
  }

  .diagram svg .debug-card-backdrop {
    fill-opacity: 0.55;
  }
}

@media (max-width: 800px) {
  .site-header {
    height: auto;
    min-height: 4.5rem;
    padding: 0.75rem 1rem;
    gap: 0.5rem;
  }

  .site-title {
    font-size: clamp(1.1rem, 5vw, 1.55rem);
    overflow-wrap: anywhere;
  }

  .app-status {
    display: none;
  }

  .header-meta {
    flex: 0 0 auto;
  }

  .legal-nav {
    max-width: 9rem;
  }

  .workspace {
    height: auto;
    min-height: calc(100% - 4.5rem);
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(20rem, 48vh) auto;
    padding: 0;
    gap: 0;
  }

  .map-panel,
  .side-panel {
    border-radius: 0;
    border-right: 0;
    border-left: 0;
    box-shadow: none;
  }

  .side-panel {
    overflow: visible;
  }

  .river-header {
    gap: 0.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .loading-spinner,
  .metadata-loading::before {
    animation: none;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

.map-tools { position:absolute; top:.75rem; right:.75rem; z-index:1000; display:flex; flex-direction:column; gap:.35rem; }
.map-tools a, .map-tools button { display:grid; place-items:center; width:2.75rem; height:2.75rem; padding:.5rem; border:1px solid #64748b; border-radius:.35rem; background:#fff; color:#153e52; cursor:pointer; }
.map-tools [hidden] { display:none; }
.map-tools svg { width:1.5rem; height:1.5rem; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linejoin:round; stroke-linecap:round; }
.map-tools :focus-visible { outline:3px solid #008ac0; outline-offset:2px; }
.map-tool-status, .map-share-url { position:absolute; right:4rem; top:.75rem; z-index:1000; max-width:calc(100% - 8rem); padding:.6rem; background:#fff; color:#153e52; border:1px solid #64748b; border-radius:.35rem; }
.map-share-url { top:4rem; width:24rem; }
@media (prefers-color-scheme:dark) { .map-tools a, .map-tools button, .map-tool-status, .map-share-url { background:#172b36; color:#e6f4fc; border-color:#91b2c5; } }

.brand-icon { width:1.25em; height:1.25em; fill:currentColor; vertical-align:middle; }
.map-tools .mastodon-share svg { fill:currentColor; stroke:none; }

.river-search { display: grid; gap: .35rem; margin: 1rem 0; }
.river-search input { box-sizing: border-box; width: 100%; min-width: 0; padding: .6rem; font: inherit; color: inherit; background: var(--surface); border: 1px solid currentColor; border-radius: .3rem; }
.river-search small { opacity: .8; }

/* Optional catchment data use geographic polygons and an area composition ring. */
.catchment-grid { display: grid; grid-template-columns: minmax(140px, 190px) minmax(0, 1fr); gap: 1rem; align-items: start; }
.catchment-grid svg { width: 100%; height: auto; }
.catchment-total { fill: var(--ink); font: 22px "B612", sans-serif; }
.catchment-unit { fill: var(--muted); font: 16px "B612", sans-serif; }
.catchment-parts { min-width: 0; display: grid; gap: .4rem; }
.catchment-part { display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: .4rem .6rem; align-items: center; text-align: left; width: 100%; }
.catchment-part[aria-pressed="true"] { background: var(--surface-soft); outline: 2px solid var(--focus); }
.catchment-swatch { width: 10px; height: 10px; border-radius: 50%; }
.catchment-value { grid-column: 2; color: var(--muted); font-size: .8rem; }
.catchment-detail { overflow-wrap: anywhere; }
.catchment-source { overflow-wrap: anywhere; }
.diagram svg .catchment-selected .branch { stroke: var(--focus); }
.diagram svg .catchment-selected text { fill: var(--focus); }
@media (max-width: 520px) { .catchment-grid { grid-template-columns: 1fr; } .catchment-grid svg { max-width: 220px; margin-inline: auto; } }

:root { --catchment-1: #207ca4; --catchment-2: #a65f24; --catchment-3: #537f50; --catchment-4: #8561a6; --catchment-5: #a74f6c; --catchment-6: #547688; }
@media (prefers-color-scheme: dark) { :root { --catchment-1: #75bfdf; --catchment-2: #e2ad75; --catchment-3: #a0c78d; --catchment-4: #c0a4e3; --catchment-5: #e59cae; --catchment-6: #9ebccc; } }

.catchment-part span { overflow-wrap: anywhere; }

/* The same directional palette as standing-water diagrams. */
.diagram { --flow-main:#087ea0; --flow-inflow:#21875b; --flow-outflow:#b76814; --flow-chevron:#fff; }
.diagram svg .river,.diagram svg .branch { stroke:var(--flow-main); }
.diagram svg .branch-tributary,.diagram svg .source-branch,.diagram svg .source-donor-line,.diagram svg .transfer-destination > .branch { stroke:var(--flow-inflow); }
.diagram svg .branch-distributary,.diagram svg .mouth-receiver-line:not(.source-donor-line),.diagram svg .transfer-source > .branch { stroke:var(--flow-outflow); }
.diagram svg .flow-chevron { fill:var(--flow-chevron); }
@media(prefers-color-scheme:dark){.diagram{--flow-main:#52cbe7;--flow-inflow:#83dbab;--flow-outflow:#ffc26d;--flow-chevron:#12232e;}}
