/* FloodCorrosion.com stylesheet
   Palette taken from the subject: Meadowlands marsh, galvanized zinc,
   copper verdigris, rust, and river water. */

:root {
  --marsh: #16383b;
  --marsh-2: #22494c;
  --zinc: #eef2f0;
  --paper: #ffffff;
  --ink: #1f3234;
  --steel: #546664;
  --line: #c9d4d0;
  --line-soft: #e0e7e4;
  --verdigris: #2f8a76;
  --verdigris-dark: #236a5b;
  --verdigris-tint: #e1f0eb;
  --rust: #a9462b;
  --rust-tint: #f6e4dd;
  --river: #2d6e9f;
  --river-tint: #e0ecf5;
  --lichen: #6a877a;
  --lichen-tint: #e8efeb;
  --ochre: #9a6b12;
  --ochre-tint: #f6ecd6;

  --surge-lt3: rgb(0, 92, 230);
  --surge-gt3: rgb(255, 255, 0);
  --surge-gt6: rgb(255, 170, 0);
  --surge-gt9: rgb(255, 0, 0);

  --font: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-cond: "Barlow Semi Condensed", "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-md: 1.25rem;
  --fs-lg: 1.5625rem;
  --fs-xl: 1.953rem;
  --fs-xxl: 2.441rem;

  --header-h: 60px;
  --radius-sm: 4px;
  --radius: 8px;
  --focus: 0 0 0 3px #ffffff, 0 0 0 5px var(--verdigris);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.55;
  color: var(--ink);
  background: var(--zinc);
}

img, svg { max-width: 100%; }

a { color: var(--verdigris-dark); text-underline-offset: 2px; }
a:hover { color: var(--marsh); }

:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius-sm); }

h1, h2, h3, h4 { font-family: var(--font-cond); line-height: 1.15; color: var(--marsh); margin: 0 0 0.5em; }

p { margin: 0 0 0.85em; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 100;
  background: var(--paper); color: var(--marsh); padding: 8px 12px; border-radius: var(--radius-sm);
}
.skip-link:focus { top: 8px; }

/* ---------- header and footer ---------- */

.site-header {
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 20px;
  background: var(--marsh);
  color: #fff;
}

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: #fff; text-decoration: none;
  font-family: var(--font-cond); font-weight: 700; font-size: var(--fs-md); letter-spacing: 0.01em;
}
.brand:hover { color: #fff; }
.brand-mark { width: 30px; height: 30px; flex: none; }

.site-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.site-nav a {
  color: #d6e6e1; text-decoration: none; font-weight: 500;
  padding: 6px 10px; border-radius: var(--radius-sm);
}
.site-nav a:hover { color: #fff; background: var(--marsh-2); }
.site-nav a[aria-current="page"] { color: #fff; box-shadow: inset 0 -2px 0 var(--verdigris); border-radius: 0; }

.site-footer {
  padding: 16px 20px;
  background: var(--paper);
  border-top: 1px solid var(--line);
  color: var(--steel);
  font-size: var(--fs-sm);
}
.site-footer p { margin: 0; max-width: 80ch; }

/* ---------- tool layout ---------- */

.tool {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(380px, 1fr);
  height: calc(100vh - var(--header-h));
  height: calc(100dvh - var(--header-h));
}

.map-pane { position: relative; min-height: 0; background: #dfe6e3; }
.map-pane arcgis-map { display: block; width: 100%; height: 100%; }

.panel {
  min-height: 0;
  overflow-y: auto;
  background: var(--paper);
  border-left: 1px solid var(--line);
  padding: 24px 24px 32px;
}

.panel-intro h1 { font-size: var(--fs-xl); font-weight: 700; max-width: 22ch; }
.panel-intro p { color: var(--steel); max-width: 62ch; }

body.map-failed .map-pane arcgis-map { visibility: hidden; }
body.map-failed .legend { display: none; }

/* ---------- map overlays ---------- */

.map-notices {
  position: absolute; z-index: 5; left: 12px; right: 12px; top: 64px;
  display: grid; gap: 8px; max-width: 460px; margin: 0 auto;
}
.notice {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--paper); border-left: 4px solid var(--ochre);
  box-shadow: 0 2px 10px rgba(22, 56, 59, 0.18);
  padding: 10px 10px 10px 14px; border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
}
.notice p { margin: 0; flex: 1; }
.notice-close {
  flex: none; border: 0; background: transparent; color: var(--steel);
  font-size: 1.25rem; line-height: 1; padding: 2px 6px; cursor: pointer; border-radius: var(--radius-sm);
}
.notice-close:hover { color: var(--ink); background: var(--zinc); }

.legend {
  position: absolute; z-index: 4; left: 12px; bottom: 28px;
  width: 248px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: var(--fs-sm);
  box-shadow: 0 2px 10px rgba(22, 56, 59, 0.12);
}
.legend-group { border: 0; margin: 0 0 8px; padding: 0; }
.legend-group legend { font-weight: 600; color: var(--marsh); padding: 0; margin-bottom: 6px; }

.seg { display: flex; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.seg label { flex: 1; position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span {
  display: block; text-align: center; padding: 4px 0; font-weight: 500; font-size: 0.8125rem;
  border-left: 1px solid var(--line); color: var(--steel);
}
.seg label:first-child span { border-left: 0; }
.seg input:checked + span { background: var(--marsh); color: #fff; }
.seg input:focus-visible + span { box-shadow: inset 0 0 0 2px var(--verdigris); }

.swatches { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; }
.swatches li { display: flex; align-items: center; gap: 6px; color: var(--ink); }

.band { display: inline-block; width: 14px; height: 10px; border-radius: 2px; flex: none; margin-right: 6px; vertical-align: -1px; border: 1px solid rgba(0, 0, 0, 0.15); }
.swatches .band { margin-right: 0; }
.band-lt3 { background: var(--surge-lt3); }
.band-gt3 { background: var(--surge-gt3); }
.band-gt6 { background: var(--surge-gt6); }
.band-gt9 { background: var(--surge-gt9); }
.band-none, .band-na { background: transparent; border-style: dashed; }
.band-levee { background: repeating-linear-gradient(45deg, #000 0 2px, #fff 2px 4px); }
.band-unknown { background: #8aa0a0; }

.legend-toggle { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--marsh); cursor: pointer; }
.legend-toggle input { width: 16px; height: 16px; accent-color: var(--verdigris); }
.zoom-hint { margin: 6px 0 0; color: var(--steel); }

/* ---------- tabs ---------- */

.tabs {
  display: flex; gap: 0; margin: 20px 0 20px;
  border-bottom: 1px solid var(--line);
}
.tabs [role="tab"] {
  font: inherit; font-family: var(--font-cond); font-weight: 600; font-size: 1.0625rem;
  background: none; border: 0; cursor: pointer;
  padding: 10px 14px 9px; margin-bottom: -1px;
  color: var(--steel);
  border-bottom: 3px solid transparent;
}
.tabs [role="tab"]:hover { color: var(--marsh); }
.tabs [role="tab"][aria-selected="true"] { color: var(--marsh); border-bottom-color: var(--verdigris); }

.panel-lead { color: var(--steel); }

/* ---------- empty and loading ---------- */

.empty {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  background: var(--zinc);
}
.empty-title { font-family: var(--font-cond); font-weight: 600; font-size: var(--fs-md); color: var(--marsh); margin-bottom: 4px; }
.empty p:last-child { margin: 0; color: var(--steel); }

.loading { padding: 8px 0 4px; color: var(--steel); }
.loading-bar {
  display: block; height: 4px; border-radius: 2px; margin-bottom: 12px;
  background: linear-gradient(90deg, var(--line-soft) 0%, var(--verdigris) 50%, var(--line-soft) 100%);
  background-size: 200% 100%;
  animation: slide 1.2s linear infinite;
}
@keyframes slide { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* ---------- flood profile ---------- */

.place { color: var(--steel); font-size: var(--fs-sm); margin-bottom: 8px; }

.water-result { border-left: 6px solid var(--lichen); padding: 4px 0 4px 16px; margin: 0 0 18px; }
.water-lead { margin: 0; color: var(--steel); }
.water-type { font-size: var(--fs-xxl); font-weight: 700; margin: 2px 0 0; letter-spacing: -0.005em; }
.water-salt { border-color: var(--rust); }
.water-salt .water-type { color: var(--rust); }
.water-fresh { border-color: var(--river); }
.water-fresh .water-type { color: var(--river); }
.water-low { border-color: var(--lichen); }
.water-low .water-type { color: var(--lichen); }
.water-unsure, .water-unknown { border-color: var(--ochre); }
.water-unsure .water-type, .water-unknown .water-type { color: var(--ochre); }

.facts { margin: 18px 0; display: grid; gap: 0; border-top: 1px solid var(--line-soft); }
.facts > div { display: grid; grid-template-columns: 9.5rem 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.facts dt { font-weight: 600; color: var(--marsh); }
.facts dd { margin: 0; }

.notes { background: var(--zinc); border-radius: var(--radius); padding: 14px 16px 4px; margin: 18px 0; }
.notes p { font-size: 0.9375rem; }

.next-steps { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }

.table-wrap { overflow-x: auto; margin: 16px 0; }
.surge-table, .comp-table { border-collapse: collapse; width: 100%; font-size: 0.9375rem; }
.surge-table caption, .comp-table caption { text-align: left; color: var(--steel); font-size: var(--fs-sm); padding-bottom: 6px; }
.surge-table th, .surge-table td { text-align: left; padding: 6px 8px 6px 0; border-bottom: 1px solid var(--line-soft); font-weight: 400; }
.surge-table th { font-weight: 600; color: var(--marsh); width: 7.5rem; }

/* ---------- the gauge: the one bold element ---------- */

.gauge { margin: 22px 0 8px; }
.gauge-body {
  position: relative;
  display: grid;
  grid-template-columns: 52px 46px 1fr;
  height: 300px;
}
.gauge-scale { position: relative; }
.gauge-tick {
  position: absolute; right: 8px; transform: translateY(50%);
  font-family: var(--font-cond); font-weight: 600; font-size: 0.8125rem; color: var(--steel);
  white-space: nowrap;
}
.gauge-staff {
  position: relative;
  border: 2px solid var(--marsh);
  border-radius: 3px;
  overflow: hidden;
  background:
    repeating-linear-gradient(to top, transparent 0, transparent calc(100% / 24 - 1px), rgba(22, 56, 59, 0.28) calc(100% / 24 - 1px), rgba(22, 56, 59, 0.28) calc(100% / 24)),
    linear-gradient(to right, #fff 0 50%, #f3f6f5 50% 100%);
}
.gauge-water {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: linear-gradient(to top, rgba(169, 70, 43, 0.92), rgba(169, 70, 43, 0.62));
  transform-origin: bottom;
  animation: rise 900ms cubic-bezier(.2, .7, .2, 1) both;
}
.gauge-water.is-fresh { background: linear-gradient(to top, rgba(45, 110, 159, 0.92), rgba(45, 110, 159, 0.6)); }
.gauge-range {
  position: absolute; left: 0; right: 0;
  background: repeating-linear-gradient(135deg, rgba(169, 70, 43, 0.38) 0 5px, rgba(169, 70, 43, 0.18) 5px 10px);
  border-top: 2px dashed rgba(169, 70, 43, 0.85);
  animation: fade-in 700ms 500ms ease-out both;
}
.gauge-range.is-fresh {
  background: repeating-linear-gradient(135deg, rgba(45, 110, 159, 0.38) 0 5px, rgba(45, 110, 159, 0.18) 5px 10px);
  border-top-color: rgba(45, 110, 159, 0.85);
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.gauge-range.is-over::after {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 10px;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,.7) 0 6px, transparent 6px 12px);
}
@keyframes rise { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.gauge-ground { position: absolute; left: -2px; right: -2px; height: 3px; background: var(--marsh); }

.gauge-markers { list-style: none; margin: 0; padding: 0; position: relative; }
.gauge-marker {
  position: absolute; left: 0; right: 0; transform: translateY(50%);
  display: flex; align-items: center; gap: 8px;
  font-size: var(--fs-sm); line-height: 1.25; color: var(--ink);
}
.gauge-marker-text { min-width: 0; }
.gauge-pin { flex: none; width: 22px; height: 2px; background: var(--steel); position: relative; }
.gauge-pin::after { content: ""; position: absolute; right: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--steel); }
.gauge-marker.is-wet { color: var(--rust); font-weight: 600; }
.gauge-marker.is-wet .gauge-pin, .gauge-marker.is-wet .gauge-pin::after { background: var(--rust); }
.gauge-marker.is-maybe { color: var(--ochre); font-weight: 600; }
.gauge-marker.is-maybe .gauge-pin, .gauge-marker.is-maybe .gauge-pin::after { background: var(--ochre); }
.gauge-maybe { display: block; font-weight: 400; font-size: 0.8125rem; }
.gauge figcaption { margin-top: 12px; font-size: var(--fs-sm); color: var(--steel); max-width: 60ch; }

/* ---------- questionnaires ---------- */

.quiz fieldset { border: 0; padding: 0; margin: 0 0 18px; }
.quiz legend { font-family: var(--font-cond); font-weight: 600; font-size: 1.0625rem; color: var(--marsh); padding: 0; margin-bottom: 8px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips label { position: relative; cursor: pointer; }
.chips input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chips span {
  display: inline-block; padding: 7px 13px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--paper); color: var(--ink); font-weight: 500; font-size: 0.9375rem;
  transition: background-color 120ms, border-color 120ms, color 120ms;
}
.chips label:hover span { border-color: var(--verdigris); }
.chips input:checked + span { background: var(--marsh); border-color: var(--marsh); color: #fff; }
.chips input:focus-visible + span { box-shadow: var(--focus); }

.field-note { font-size: var(--fs-sm); color: var(--steel); margin: 8px 0 0; }

.btn {
  font: inherit; font-weight: 600; cursor: pointer;
  border-radius: var(--radius-sm); padding: 10px 18px; border: 1px solid transparent;
  text-decoration: none; display: inline-block; line-height: 1.3;
}
.btn-primary { background: var(--verdigris); color: #fff; }
.btn-primary:hover { background: var(--verdigris-dark); color: #fff; }
.btn-secondary { background: var(--paper); color: var(--marsh); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--marsh); }

.link-btn { font: inherit; background: none; border: 0; padding: 0; color: var(--verdigris-dark); text-decoration: underline; cursor: pointer; }

.safety-strip {
  background: var(--rust-tint); border-left: 4px solid var(--rust);
  padding: 10px 14px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 0.9375rem;
}

/* ---------- results ---------- */

.output:empty { display: none; }
.output { margin-top: 28px; padding-top: 24px; border-top: 2px solid var(--marsh); }

.result-head { background: var(--zinc); border-radius: var(--radius); padding: 14px 16px 4px; margin-bottom: 22px; border-left: 5px solid var(--lichen); }
.result-head.risk-high { border-left-color: var(--rust); }
.result-head.risk-moderate { border-left-color: var(--ochre); }

.rec-section { margin-bottom: 28px; }
.rec-section h3 { font-size: var(--fs-lg); font-weight: 700; }
.rec-intro { color: var(--steel); }
.rec-list { list-style: none; margin: 0; padding: 0; }
.rec { padding: 12px 0; border-top: 1px solid var(--line-soft); }
.rec:first-child { border-top: 0; }
.rec-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; margin-bottom: 4px; }
.rec-name { font-weight: 600; color: var(--marsh); }
.rec p { margin: 0 0 4px; }
.learn { font-size: var(--fs-sm); }

.chip {
  display: inline-block; padding: 1px 8px; border-radius: 999px;
  font-size: 0.8125rem; font-weight: 600; white-space: nowrap;
  border: 1px solid transparent;
}
.chip-recommended { background: var(--verdigris-tint); color: var(--verdigris-dark); border-color: #b7dbd0; }
.chip-acceptable { background: var(--lichen-tint); color: #46604f; border-color: #cddcd3; }
.chip-use-care { background: var(--ochre-tint); color: var(--ochre); border-color: #e6d3a8; }
.chip-avoid { background: var(--rust-tint); color: var(--rust); border-color: #e7c4b7; }
.chip-info { background: var(--river-tint); color: var(--river); border-color: #c3d8e9; }
.chip-level-high { background: var(--rust-tint); color: var(--rust); border-color: #e7c4b7; }
.chip-level-moderate { background: var(--ochre-tint); color: var(--ochre); border-color: #e6d3a8; }
.chip-level-low { background: var(--lichen-tint); color: #46604f; border-color: #cddcd3; }
.chip-level-latent { background: var(--river-tint); color: var(--river); border-color: #c3d8e9; }
.comp-table .chip { white-space: normal; border-radius: 6px; padding: 2px 8px; }

.verdict { border-radius: var(--radius); padding: 16px 18px 6px; margin-bottom: 26px; border-left: 6px solid var(--lichen); background: var(--zinc); }
.verdict h3 { font-size: var(--fs-xl); }
.verdict-good { border-left-color: var(--verdigris); }
.verdict-good h3 { color: var(--verdigris-dark); }
.verdict-uncertain { border-left-color: var(--ochre); }
.verdict-uncertain h3 { color: var(--ochre); }
.verdict-replace { border-left-color: var(--rust); }
.verdict-replace h3 { color: var(--rust); }
.verdict-note { font-size: var(--fs-sm); color: var(--steel); }

.comp-table th, .comp-table td { text-align: left; vertical-align: top; padding: 10px 10px 10px 0; border-bottom: 1px solid var(--line-soft); }
.comp-table thead th { font-family: var(--font-cond); font-weight: 600; color: var(--steel); border-bottom: 1px solid var(--line); }
.comp-table tbody th { font-weight: 600; color: var(--marsh); min-width: 10rem; }
.comp-table td:nth-child(2) { min-width: 9rem; }
.comp-table td:last-child { min-width: 14rem; color: var(--ink); }

.steps { margin: 0; padding-left: 1.4em; }
.steps li { margin-bottom: 10px; padding-left: 4px; }
.steps li::marker { font-family: var(--font-cond); font-weight: 700; color: var(--verdigris-dark); }

.result-foot { font-size: var(--fs-sm); color: var(--steel); border-top: 1px solid var(--line-soft); padding-top: 14px; }

/* ---------- coordinates and diagnostics ---------- */

.coords, .diagnostics { margin-top: 18px; font-size: 0.9375rem; }
.coords summary, .diagnostics summary { cursor: pointer; color: var(--verdigris-dark); font-weight: 500; }
.coord-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; align-items: end; }
.coord-form label { display: grid; gap: 4px; font-weight: 600; color: var(--marsh); font-size: var(--fs-sm); }
.coord-form input {
  font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); min-width: 0;
}
.coord-form input:focus-visible { border-color: var(--verdigris); }
.coord-form .btn { grid-column: 1 / -1; justify-self: start; }
.form-error { grid-column: 1 / -1; color: var(--rust); margin: 0; font-size: var(--fs-sm); }

.diagnostics { border-top: 1px solid var(--line-soft); padding-top: 14px; margin-top: 32px; }
.diag-count { color: var(--steel); font-weight: 400; margin-left: 6px; font-size: var(--fs-sm); }
.diag-list { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 6px; }
.diag-item { display: grid; grid-template-columns: 12px 1fr; column-gap: 8px; align-items: baseline; }
.diag-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line); align-self: center; }
.diag-label { font-weight: 600; color: var(--marsh); }
.diag-text { grid-column: 2; color: var(--steel); font-size: var(--fs-sm); }
.diag-ok .diag-dot { background: var(--verdigris); }
.diag-warn .diag-dot { background: #c99a2e; }
.diag-error .diag-dot { background: var(--rust); }
.diag-skipped .diag-dot { background: var(--line); }
.diag-help { color: var(--steel); font-size: var(--fs-sm); }

/* ---------- content pages (library, about) ---------- */

.page {
  max-width: 1120px; margin: 0 auto; padding: 40px 24px 64px;
  display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 48px;
}
.page-head { grid-column: 1 / -1; max-width: 70ch; }
.page-head h1 { font-size: var(--fs-xxl); font-weight: 700; }
.page-head p { font-size: 1.125rem; color: var(--steel); }

.toc { position: sticky; top: 20px; align-self: start; font-size: 0.9375rem; }
.toc p { font-family: var(--font-cond); font-weight: 600; color: var(--marsh); margin-bottom: 6px; }
.toc ul { list-style: none; margin: 0 0 16px; padding: 0; }
.toc li { margin: 2px 0; }
.toc a { text-decoration: none; color: var(--steel); display: block; padding: 3px 0 3px 10px; border-left: 2px solid var(--line); }
.toc a:hover { color: var(--marsh); border-left-color: var(--verdigris); }

.prose { max-width: 72ch; }
.prose > section { margin-bottom: 48px; scroll-margin-top: 16px; }
.prose h2 { font-size: var(--fs-xl); font-weight: 700; padding-bottom: 6px; border-bottom: 2px solid var(--marsh); margin-bottom: 18px; }
.prose h3 { font-size: var(--fs-lg); font-weight: 600; margin-top: 30px; scroll-margin-top: 16px; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: 6px; }

.entry { background: var(--paper); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 18px 20px 6px; margin: 18px 0; scroll-margin-top: 16px; }
.entry h3 { margin-top: 0; }
.entry .tagline { color: var(--steel); margin-top: -4px; }

.deep { margin: 4px 0 14px; border-top: 1px dashed var(--line); padding-top: 10px; }
.deep summary { cursor: pointer; font-weight: 600; color: var(--verdigris-dark); }
.deep[open] summary { margin-bottom: 8px; }
.deep p, .deep li { font-size: 0.9375rem; }

.callout { border-left: 5px solid var(--rust); background: var(--rust-tint); padding: 14px 18px 4px; border-radius: var(--radius-sm); margin: 18px 0; }
.callout h3 { margin-top: 0; color: var(--rust); }
.callout-info { border-left-color: var(--river); background: var(--river-tint); }
.callout-info h3 { color: var(--river); }

.ref-table { border-collapse: collapse; width: 100%; font-size: 0.9375rem; margin: 12px 0 18px; }
.ref-table th, .ref-table td { text-align: left; vertical-align: top; padding: 8px 12px 8px 0; border-bottom: 1px solid var(--line-soft); }
.ref-table thead th { font-family: var(--font-cond); color: var(--steel); border-bottom: 1px solid var(--line); }
.ref-table tbody th { color: var(--marsh); font-weight: 600; }

.code-url { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.8125rem; word-break: break-all; background: var(--zinc); padding: 1px 4px; border-radius: 3px; }

.page-simple { max-width: 720px; margin: 0 auto; padding: 64px 24px; }

/* ---------- responsive ---------- */

@media (max-width: 899px) {
  .tool { display: block; height: auto; }
  .map-pane { height: 58vh; height: 58svh; min-height: 340px; }
  .panel { border-left: 0; border-top: 1px solid var(--line); padding: 20px 16px 28px; overflow: visible; }
  .panel-intro h1 { font-size: var(--fs-lg); }
  .legend { width: auto; right: 12px; bottom: 24px; padding: 8px 10px; }
  .swatches { grid-template-columns: repeat(4, auto); justify-content: start; }
  .page { grid-template-columns: 1fr; gap: 24px; padding-top: 28px; }
  .toc { position: static; }
  .toc ul { display: flex; flex-wrap: wrap; gap: 4px 12px; }
  .toc a { border-left: 0; padding: 2px 0; }
}

@media (max-width: 560px) {
  .site-header { height: auto; min-height: var(--header-h); flex-wrap: wrap; padding: 10px 16px; gap: 6px; }
  .site-nav a { padding: 4px 8px; font-size: 0.9375rem; }
  .tool { height: auto; }
  .facts > div { grid-template-columns: 1fr; gap: 2px; }
  .water-type { font-size: var(--fs-xl); }
  .tabs [role="tab"] { padding: 9px 10px; font-size: 1rem; }
  .gauge-body { grid-template-columns: 44px 38px 1fr; height: 270px; }
  .coord-form { grid-template-columns: 1fr; }
  .legend .seg span { font-size: 0.75rem; }
}

@media (prefers-reduced-motion: reduce) {
  .gauge-water, .gauge-range, .loading-bar { animation: none; }
  .chips span { transition: none; }
}

/* ---------- print ---------- */

@media print {
  .site-header, .site-nav, .map-pane, .tabs, .quiz, .diagnostics, .coords, .next-steps, .skip-link, .link-btn, .panel-intro p { display: none !important; }
  .tool { display: block; height: auto; }
  .panel { overflow: visible; border: 0; padding: 0; }
  .tabpanel[hidden] { display: block !important; }
  .output { border-top: 1px solid #000; }
  body { background: #fff; }
  a { color: #000; }
}
