/* Study page additions: interactive map, legend, schematic and motion.
   Colours: interface blue only for controls; data colours are set in study-map.js. */
.study-map { width: 100%; height: clamp(360px, 70vw, 600px); border: 1px solid #d7e3f3; border-radius: 8px; background: #f5f6f4; }
.study-map[data-state="failed"] { display: grid; place-items: center; }
.map-tools { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.map-btn { font: inherit; font-size: 14px; padding: 6px 11px; border-radius: 999px; border: 1px solid #b9cde8; background: #fff; color: #1f4f8f; cursor: pointer; transition: background-color 160ms ease, color 160ms ease; }
.map-btn:hover { background: #eef4fc; }
.map-btn[aria-pressed="true"] { background: #1f5fae; border-color: #1f5fae; color: #fff; }
.map-btn:focus-visible { outline: 2px solid #1f5fae; outline-offset: 2px; }
.map-status { font-size: 14px; color: #4a4a4a; margin: 8px 0 0; min-height: 1.4em; }
.map-legend { margin-top: 10px; font-size: 14px; color: #222; max-width: 520px; }
.legend-title { margin: 0 0 6px; font-weight: 500; }
.legend-title span { display: block; font-size: 14px; color: #555; }
.legend-bar { height: 12px; border-radius: 3px; border: 1px solid #c8c8c2; }
.legend-ends { display: flex; justify-content: space-between; font-size: 14px; color: #444; margin-top: 3px; }
.legend-key { display: flex; align-items: center; gap: 8px; margin: 8px 0 0; font-size: 14px; color: #444; }
.hatch-key { width: 16px; height: 12px; display: inline-block; border: 1px dashed #6b6b6b; background: #fff; }
.north-arrow { background: #fff; border-radius: 6px; padding: 4px 6px; text-align: center; font-size: 14px; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.north-arrow svg { display: block; margin: 0 auto; }
.schematic-wrap { overflow-x: auto; }
.schematic { width: 100%; min-width: 640px; height: auto; display: block; }
.schematic .unit-box { fill: #fff; stroke: #8aa6c9; stroke-width: 1.5; }
.schematic .u1 { fill: #e8f1fb; } .schematic .u2 { fill: #e6f5f1; } .schematic .u3 { fill: #fbf1e2; }
.schematic .u4 { fill: #fbe9e3; } .schematic .u5 { fill: #e9ecf3; }
.schematic text { font-family: "Range Dash", "Satoshi", system-ui, sans-serif; fill: #1c1c1c; }
.schematic .u-id { font-size: 16px; font-weight: 700; }
.schematic .u-name { font-size: 14px; fill: #444; }
.schematic .u-val { font-size: 14px; fill: #333; }
.schematic .axis-note { font-size: 14px; fill: #555; }
@keyframes flow { to { stroke-dashoffset: -24; } }
@media (prefers-reduced-motion: reduce) { .map-btn { transition: none; } }
.unit-label { background: rgba(255,255,255,.85); border: 0; box-shadow: none; font-weight: 700; font-size: 14px; color: #1c1c1c; padding: 1px 5px; }
.unit-label::before { display: none; }

/* ---- Study page layout upgrades (no change to content) ---- */
.map-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 18px; align-items: start; }
.map-main { min-width: 0; }
.map-side { display: flex; flex-direction: column; gap: 14px; }
.map-side .map-tools { flex-direction: column; flex-wrap: nowrap; margin: 0; }
.map-side .map-btn { text-align: left; border-radius: 8px; }
.study-map { height: clamp(420px, 40vw, 560px); }
@media (max-width: 760px) {
    .map-layout { grid-template-columns: minmax(0, 1fr); }
    .map-side .map-tools { flex-direction: row; flex-wrap: wrap; }
    .study-map { height: clamp(340px, 88vw, 460px); }
}
.table-units { width: 100%; }
.table-units table { table-layout: auto; font-size: 15px; }
.table-units th, .table-units td { white-space: normal; }
@media (max-width: 640px) {
    .table-units table { font-size: 14px; }
    .table-units th, .table-units td { padding: 6px 5px; }
}
.fig-small { display: block; max-width: 600px; width: 100%; height: auto; margin: 0 auto; }
.figure-series .series-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.chart-box { position: relative; height: 170px; }
@media (min-width: 900px) { .figure-series .series-grid { grid-template-columns: 1fr 1fr; } .chart-box { height: 190px; } }
.chart-status { font-size: 14px; color: #4a4a4a; margin: 0 0 8px; }
.figure-series .is-fallback { display: none; }
.chain { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.chain-unit { border: 1px solid #c8d8ec; border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 4px; background: #fff; }
.chain-unit .u-id { font-weight: 700; font-size: 17px; }
.chain-unit .u-name, .chain-unit .u-val { font-size: 14px; color: #333; }
.chain-unit.u1 { background: #e8f1fb; } .chain-unit.u2 { background: #e6f5f1; } .chain-unit.u3 { background: #fbf1e2; }
.chain-unit.u4 { background: #fbe9e3; } .chain-unit.u5 { background: #e9ecf3; }
.chain-note { font-size: 14px; color: #555; margin: 8px 0 0; }
@media (max-width: 760px) { .chain { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.flowdiag { list-style: none; padding: 0; margin: 18px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.flowdiag .node { border-radius: 10px; padding: 12px; border: 1px solid #c8d8ec; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.flowdiag .node strong { font-size: 14px; }
.flowdiag .measured { background: #f2f7fd; }
.flowdiag .modelled { background: #f5f5f1; border-style: dashed; }
.flowdiag .unmeasured { background: #fff; border: 1px dashed #8a8a86; color: #333; }
@media (max-width: 760px) { .flowdiag { grid-template-columns: minmax(0, 1fr); } }
/* Phone: the unit tables fit inside the card with no sideways scroll. */
@media (max-width: 640px) {
    .table-units table { table-layout: fixed; width: 100%; }
    .table-units th:first-child, .table-units td:first-child { width: 34%; }
    .table-units th, .table-units td { font-size: 14px; line-height: 1.3; word-break: normal; overflow-wrap: normal; hyphens: manual; }
}
.flowdiag, .chain, .chain-note, .flow-figure figcaption, .table-units figcaption { text-align: left; }
.flowdiag .flow-to { margin-top: auto; padding-top: 6px; color: #1f4f8f; font-size: 14px; }
.flowdiag .node { text-align: left; }
.table-units td.text, .table-units th.text, .table-units th[scope="row"] { text-align: left; vertical-align: top; }

/* Review fixes: chain direction, opaque header, border and alignment consistency in tables */
.chain-unit { position: relative; }
.chain-unit:not(:last-child)::after { content: "›"; position: absolute; right: -9px; top: 50%; transform: translateY(-50%); font-size: 20px; color: #1f5fae; line-height: 1; }
@media (max-width: 760px) { .chain-unit::after { display: none; } }
.site-header { background: #fff; }
.table-units th, .table-units td { border-bottom: 1px solid #d8d8d2; vertical-align: middle; }
.table-units th[scope="row"] { vertical-align: middle; }
@media (pointer: coarse) { .map-btn { min-height: 44px; } }
.flow-key { font-size: 14px; color: #444; margin: 8px 0 0; text-align: left; }
/* Map tools: context layers, basemap, share link */
.map-context { border: 1px solid #d7e3f3; border-radius: 8px; padding: 8px 10px; margin: 0; font-size: 14px; }
.map-context legend { font-size: 14px; color: #444; padding: 0 4px; }
.map-context label { display: flex; align-items: center; gap: 8px; margin: 4px 0; }
.map-context .is-unavailable { color: #777; }
.map-basemap { display: flex; flex-direction: column; font-size: 14px; gap: 4px; }
.map-basemap select { font: inherit; font-size: 14px; padding: 5px 6px; border-radius: 6px; border: 1px solid #b9cde8; background: #fff; }
.catch-share-btn { text-align: center; }
.catch-share-status { font-size: 14px; color: #444; margin: 0; word-break: break-all; }
.legend-source { font-size: 14px; color: #555; margin: 8px 0 0; }
.legend-extra { margin-top: 12px; padding-top: 10px; border-top: 1px solid #e0e0da; }
.lc-list { list-style: none; padding: 0; margin: 6px 0 0; font-size: 14px; }
.lc-list li { display: flex; align-items: center; gap: 6px; margin: 2px 0; }
.lc-list .swatch { width: 14px; height: 10px; border: 1px solid #999; display: inline-block; }
.lc-list .catch-share { margin-left: auto; color: #555; font-variant-numeric: tabular-nums; }
/* Phone: unit labels are hidden where they would overlap; the legend and table give every value. */
@media (max-width: 480px) { .unit-label { display: none; } }
@media (max-width: 640px) {
    .table-units th, .table-units td { padding: 5px 3px; }
    .table-units th:first-child, .table-units td:first-child { width: 30%; }
}
@media (max-width: 640px) { #tab-2 table { font-size: 14px; } #tab-2 th, #tab-2 td { padding: 5px 2px; } }
@media (max-width: 640px) { #tab-2 .name-full { display: none; } }
.ctx-note { color: #777; }
.print-link { font-size: 14px; color: #444; margin: 10px 0 0; }

/* ---- Round 2 of the study page: plain, black accents, small motion (all stop for reduced motion) ---- */
.explore-cta { margin: 56px 0 40px; }
.cta-card { background: #fff; color: #111; border: 1px solid #e3e7ee; border-radius: 16px; padding: 22px; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 22px; align-items: center; }
.cta-preview { position: relative; background: #f3f7fc; border: 1px solid #d9e4f2; border-radius: 10px; overflow: hidden; cursor: pointer; }
.cta-preview canvas { width: 100%; height: auto; display: block; }
.cta-live { position: absolute; top: 10px; left: 10px; z-index: 2; display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1px solid #cfdcec; border-radius: 999px; padding: 4px 10px; font-size: 14px; color: #1d4f85; }
.cta-live i { width: 7px; height: 7px; border-radius: 50%; background: #2b6cb0; animation: cta-pulse 1.6s ease-out infinite; }
@keyframes cta-pulse { 0% { box-shadow: 0 0 0 0 rgba(43,108,176,.55); } 70% { box-shadow: 0 0 0 8px rgba(43,108,176,0); } 100% { box-shadow: 0 0 0 0 rgba(43,108,176,0); } }
.cta-kicker { font-size: 14px; letter-spacing: .08em; text-transform: uppercase; color: #2b6cb0; margin: 0 0 8px; }
.cta-h { font-family: "Zodiak", Georgia, serif; font-size: 28px; line-height: 1.15; margin: 0 0 10px; color: #111; }
.cta-desc { font-size: 15px; line-height: 1.5; color: #444; margin: 0 0 18px; }
.cta-button { display: inline-flex; align-items: center; gap: 8px; background: #1d4f85; color: #fff; text-decoration: none; padding: 11px 18px; border-radius: 999px; font-weight: 500; transition: transform 180ms ease, background 180ms ease; }
.cta-button:hover span[aria-hidden] { transform: translateX(4px); }
.cta-button span[aria-hidden] { display: inline-block; transition: transform 200ms ease; }
.cta-button:focus-visible { outline: 2px solid #1d4f85; outline-offset: 3px; }
@media (max-width: 720px) { .cta-card { grid-template-columns: minmax(0, 1fr); padding: 16px; } .cta-h { font-size: 24px; } }

.stat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 22px 0 6px; }
.stat-row div { border-top: 1px solid #111; padding-top: 10px; }
.stat-row dt { font-size: 14px; color: #555; margin: 0 0 4px; }
.stat-row dd { margin: 0; font-size: 28px; font-weight: 500; font-variant-numeric: tabular-nums; color: #111; }
@media (max-width: 560px) { .stat-row { grid-template-columns: minmax(0, 1fr); } }

.data-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 12px 0 8px; }
.btn-primary { display: inline-block; background: #0b0b0b; color: #fff; padding: 11px 20px; border-radius: 999px; text-decoration: none; font-weight: 500; }
.btn-primary:hover { background: #2a2a2a; }
.btn-primary:focus-visible { outline: 2px solid #0b0b0b; outline-offset: 3px; }
.btn-quiet { color: #111; text-decoration: underline; text-underline-offset: 3px; }
.data-note { color: #555; font-size: 14px; }

/* Unit chain: neutral, not coloured by unit; the arrows move slowly to show direction */
.chain-unit, .chain-unit.u1, .chain-unit.u2, .chain-unit.u3, .chain-unit.u4, .chain-unit.u5 { background: #fff; border-color: #cfcfca; }
.chain-unit:not(:last-child)::after { color: #111; animation: nudge 2.6s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { transform: translate(-50%, -50%); opacity: .55; } 50% { transform: translate(-30%, -50%); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .chain-unit:not(:last-child)::after { animation: none; } .cta-button, .cta-button span { transition: none !important; } .cta-live i { animation: none; } }

/* Map: unit labels are plain codes with no box, so they do not cover the units */
.unit-label { background: none !important; border: 0 !important; box-shadow: none !important; font-weight: 700; font-size: 14px; color: #111; padding: 0; text-shadow: 0 0 3px #fff, 0 0 3px #fff; }
.catch-share-status:empty { display: none; }
.article > header.title h1 { font-size: clamp(30px, 3.4vw, 44px); line-height: 1.12; }
/* Unit chain: subtle blue shades, pale for the headwaters and a little deeper towards the lagoon */
.chain-unit.u1 { background: #f2f7fd; border-color: #c9dcf2; }
.chain-unit.u2 { background: #e8f1fb; border-color: #bcd3ee; }
.chain-unit.u3 { background: #deebf9; border-color: #aec9ea; }
.chain-unit.u4 { background: #d3e4f7; border-color: #9fbfe3; }
.chain-unit.u5 { background: #c7dcf4; border-color: #8fb4dc; }
/* Unit labels: white halo so they read on any fill, without a box */
.unit-label { text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 1px #fff; }
.legend-ticks { display: flex; justify-content: space-between; font-size: 14px; color: #444; margin-top: 3px; }
.map-title { background: rgba(255,255,255,.92); padding: 4px 9px; border-radius: 6px; font-size: 14px; font-weight: 500; color: #111; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.unit-label { background: none !important; border: 0 !important; box-shadow: none !important; font-size: 14px; font-weight: 700; color: #111; padding: 0; text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 1px #fff; }
.unit-label.on-dark { color: #fff; text-shadow: 0 0 3px #000, 0 0 2px #000; }
.unit-label::before { display: none; }
@media (max-width: 480px) { .unit-label.z5 { display: none; } }
.lc-list .swatch[style*="dashed"] { border-style: dashed; }

/* Review fixes: phone tables, explorer caption and pause, Z5 label, phone chain, touch targets */
@media (max-width: 640px) {
    .table-units { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .table-units table { table-layout: auto; min-width: 560px; width: 100%; }
    .table-units th, .table-units td { font-size: 14px; white-space: normal; vertical-align: bottom; }
}
.cta-preview .preview-month { position: absolute; left: 12px; bottom: 10px; margin: 0; font-size: 14px; color: #444; background: rgba(255,255,255,.92); border: 1px solid #d9e4f2; border-radius: 999px; padding: 4px 10px; z-index: 2; }
.preview-pause { position: absolute; right: 10px; bottom: 10px; z-index: 2; font: inherit; font-size: 14px; background: #fff; color: #1d4f85; border: 1px solid #cfdcec; border-radius: 999px; padding: 4px 12px; cursor: pointer; }
.preview-pause:hover { background: #eef4fc; }
.preview-pause:focus-visible { outline: 2px solid #1d4f85; outline-offset: 2px; }
.unit-label.z5, .unit-label.z5.on-dark { background: rgba(255,255,255,.92) !important; color: #111 !important; text-shadow: none !important; padding: 2px 6px !important; border-radius: 4px; }
@media (max-width: 480px) {
    .chain { grid-template-columns: minmax(0, 1fr); gap: 18px; }
    .chain-unit { position: relative; }
    .chain-unit::after { display: block !important; content: "↓"; position: absolute; left: 50%; right: auto; top: auto; bottom: -16px; transform: translateX(-50%); font-size: 16px; color: #1f5fae; animation: none; }
    .chain-unit:last-child::after { display: none; }
}
@media (pointer: coarse) { button, .btn-quiet, .cta-button { min-height: 44px; } }
@media (prefers-reduced-motion: reduce) { .preview-pause { display: none; } }
.preview-pause { top: 10px; bottom: auto; right: 10px; }
.cta-preview .preview-month { bottom: 10px; }
@media (max-width: 480px) {
    .chain .chain-unit::after { content: "↓" !important; display: block !important; }
    .chain .chain-unit:nth-child(5)::after { display: none !important; }
}
/* map fills the height of its column so there is no gap under it; plain background if tiles fail */
@media (min-width: 761px) {
    .map-layout { align-items: stretch; }
    .map-main { display: flex; flex-direction: column; }
    .map-main .study-map { flex: 1 1 auto; min-height: 520px; max-height: 900px; height: auto; }
}
.study-map { background: #f3f5f7; }
.zbadge { display: inline-block; min-width: 26px; text-align: center; font-weight: 700; font-size: 14px; border: 1px solid #3d3d3d; border-radius: 3px; padding: 0 3px; margin-right: 2px; background: #fff; color: #111; }
.zbadge.dashed { border-style: dashed; }
.legend-ticks { font-size: 14px; }
@media (max-width: 480px) { .study-map .leaflet-control-attribution { max-width: 62%; font-size: 14px; line-height: 1.3; } }

/* Figure 2: clear left-to-right chain with visible arrows and larger type */
.chain { gap: 30px; }
.chain-unit { padding: 16px; gap: 6px; }
.chain-unit .u-id { font-size: 22px; }
.chain-unit .u-name, .chain-unit .u-val { font-size: 15px; }
.chain-unit:not(:last-child)::after { content: "→" !important; right: -22px; font-size: 24px; color: #1f5fae; animation: none; }
@media (max-width: 760px) { .chain { gap: 14px; } }
/* Figure 6: four measured or modelled links in one row */
.flowdiag { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 960px) { .flowdiag { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .flowdiag { grid-template-columns: minmax(0, 1fr); } }

/* Audit fixes */
@media (max-width: 480px) {
    .chain .chain-unit:not(:last-child)::after { content: "↓" !important; display: block !important; position: absolute; left: 50%; right: auto; top: auto; bottom: -17px; transform: translateX(-50%); font-size: 18px; }
    .study-map { height: 470px; }
    .unit-label { display: block !important; font-size: 14px; }
    .unit-label.z5 { display: block !important; }
    header.title h1 { font-size: 28px; }
}
.sig, .sig span, .sig a, .sig time { font-size: 14px; }
@media (pointer: coarse) {
    .map-btn, #share-view, #copy-cite, .btn-quiet, .btn-primary, #preview-pause, a.site-id { min-height: 44px; display: inline-flex; align-items: center; }
    .leaflet-control-zoom a { width: 44px; height: 44px; line-height: 44px; font-size: 22px; }
    .leaflet-control-zoom { border-width: 0; }
    .study-map input[type="checkbox"], .map-side input[type="checkbox"] { width: 22px; height: 22px; }
    .map-side fieldset label { min-height: 44px; display: flex; align-items: center; gap: 8px; }
    .references a, .refs a, #references a { display: inline-block; padding: 6px 0; }
}
.study-map .leaflet-control-attribution { font-size: 14px; }
@media (max-width: 480px) { .study-map .leaflet-control-attribution { font-size: 14px; max-width: 62%; } }
.study-map .leaflet-control-scale-line { font-size: 14px; }
@media (max-width: 760px) {
    .map-btn, #share-view, #copy-cite, .btn-quiet, #preview-pause { min-height: 44px; display: inline-flex; align-items: center; }
    .leaflet-control-zoom a { width: 44px; height: 44px; line-height: 44px; font-size: 22px; }
}

.leaflet-tooltip { font-size: 14px; }
.study-map .leaflet-control-attribution { font-size: 14px; }
@media (max-width: 480px) { .study-map .leaflet-control-attribution { font-size: 14px; } }

/* Round 3 */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.flow-key { display: flex; flex-wrap: wrap; gap: 18px; color: #222; font-size: 15px; margin: 12px 0 0; }
.key-item { display: inline-flex; align-items: center; gap: 8px; }
.key-sw { width: 26px; height: 16px; border-radius: 4px; display: inline-block; }
.key-sw.measured { background: #f2f7fd; border: 1.5px solid #1f4f8f; }
.key-sw.modelled { background: #f5f5f1; border: 1.5px dashed #6b6b6b; }
.flowdiag .node { font-size: 15px; }
.flowdiag .node strong { font-size: 17px; }
.flow-figure figcaption, #fig-schematic figcaption, #fig-seasonal figcaption { font-size: 15px; color: #333; }
.band { list-style: none; padding: 0; margin: 14px 0 0; display: flex; height: 190px; border-radius: 10px; overflow: hidden; border: 1px solid #c8d8ec; }
.band-seg { flex-basis: 0; min-width: 96px; padding: 14px 14px 12px; display: flex; flex-direction: column; gap: 4px; border-right: 2px solid #fff; position: relative; }
.band-seg:last-child { border-right: 0; }
.band-id { font-size: 24px; font-weight: 700; }
.band-name { font-size: 15px; }
.band-val { font-size: 14px; opacity: .9; }
.band-seg:last-child::after { content: "Lagoon"; position: absolute; right: 10px; bottom: 10px; font-size: 14px; opacity: .8; }
@media (max-width: 760px) {
    .band { flex-direction: column; height: auto; min-height: 520px; }
    .band-seg { min-width: 0; min-height: 84px; flex-basis: auto; border-right: 0; border-bottom: 2px solid #fff; flex-direction: row; flex-wrap: wrap; align-items: baseline; column-gap: 12px; }
    .band-seg:last-child { border-bottom: 0; }
    .band-seg:last-child::after { display: none; }
}
.fb-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.fb-btn { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 16px; border: 1px solid #1d4f85; border-radius: 999px; color: #1d4f85; text-decoration: none; font-size: 15px; background: #fff; }
.fb-btn:hover { background: #eef4fc; }
.fb-btn:focus-visible { outline: 2px solid #1d4f85; outline-offset: 3px; }
#feedback { margin-top: 36px; }
.btn-primary { padding: 9px 18px; font-size: 15px; }
.cta-button { padding: 9px 16px; font-size: 15px; }
.cta-desc { font-size: 17px; }
.data-note { font-size: 15px; }
.scroll-progress { position: fixed; top: 0; left: 0; height: 3px; width: 100%; background: #1d4f85; transform-origin: 0 50%; transform: scaleX(0); z-index: 100; pointer-events: none; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
.band-seg:last-child::after { content: none; }

/* Review round 3 fixes */
img, svg { height: auto; }
.fig-scroll { overflow-x: auto; }
.fig-scroll img { min-width: 760px; max-width: none; }
@media (min-width: 761px) { .fig-scroll img { min-width: 0; max-width: 100%; } }
.band-seg { white-space: nowrap; min-width: 118px; }
.band-seg .band-name { white-space: normal; }
.band { padding-bottom: 0; }
.band-seg { padding-bottom: 14px; }
.btn-quiet { min-height: 44px; display: inline-flex; align-items: center; }
#note p { color: #111; }
.flow-card, .flowdiag .node { hyphens: manual; }
#feedback { margin-top: 64px; }
/* Reactions, version and views (as on the Benin and Ogun page) */
.feedback { margin-top: 64px; }
.feedback h2 { margin: 0 0 14px; }
.react-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 16px; }
.reactions { display: flex; flex-wrap: wrap; gap: 8px; }
.react { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 16px; border: 1px solid #d4d4cf; border-radius: 10px; background: #fff; color: #555; font: inherit; font-size: 16px; cursor: pointer; transition: background-color 160ms ease, border-color 160ms ease; }
.react:hover { border-color: #1d4f85; }
.react:focus-visible { outline: 2px solid #1d4f85; outline-offset: 3px; }
.react[aria-pressed="true"] { background: #eef4fd; border-color: #1d4f85; color: #1d4f85; }
.react.is-other { opacity: 0.55; }
.react .rc { font-variant-numeric: tabular-nums; color: #555; }
.react[aria-pressed="true"] .rc { color: #1d4f85; }
.react.pop { animation: react-pop 0.35s ease; }
@keyframes react-pop { 0% { transform: scale(1); } 40% { transform: scale(1.06); } 100% { transform: scale(1); } }
.react-status { font-size: 15px; color: #1d4f85; }
.meta-row { display: flex; flex-wrap: wrap; gap: 4px 22px; margin: 24px 0 0; font-size: 14px; letter-spacing: 0.06em; text-transform: uppercase; color: #6b6b6b; }
.meta-row [hidden] { display: none; }
.sec-no { color: #6b6b6b; font-variant-numeric: tabular-nums; margin-right: 6px; }
@media (prefers-reduced-motion: reduce) { .react.pop { animation: none; } }
/* Figure 2 monthly rainfall animation */
.band-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 14px 0 0; font-size: 15px; }
.band-play { min-height: 44px; padding: 8px 16px; border: 1px solid #1d4f85; border-radius: 999px; background: #fff; color: #1d4f85; font: inherit; cursor: pointer; }
.band-play:hover { background: #eef4fc; }
.band-play:focus-visible, #band-month:focus-visible { outline: 2px solid #1d4f85; outline-offset: 3px; }
.band-status { flex-basis: 100%; font-size: 14px; color: #555; }
.band-seg { position: relative; overflow: hidden; }
.band-seg > *:not(.band-water):not(.band-rain) { position: relative; z-index: 2; }
.band-water { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: rgba(29, 79, 133, 0.22); transition: height 0.7s ease; z-index: 1; }
.band-rain { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
.band-live { display: block; font-size: 14px; margin-top: 6px; font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .band-water { transition: none; } }
.sig-meta { display: inline-flex; gap: 18px; text-transform: uppercase; letter-spacing: 0.06em; font-size: 14px; color: #6b6b6b; }
.sig-meta [hidden] { display: none; }
.band-live { white-space: normal; overflow-wrap: anywhere; font-size: 14px; }
.band-live { font-size: 14px; }
/* Touch targets: at least 44 px tall at every width */
.map-btn, #copy-cite, .btn-quiet, .band-play, .preview-pause, .react, .fb-btn, #share-view { min-height: 44px; }
.map-btn, #copy-cite, .btn-quiet, .band-play, .preview-pause, .react, .fb-btn { display: inline-flex; align-items: center; }
/* Header navigation: the section in view */
.toc a.is-current { background: #eef4fd; color: #1d4f85; border-radius: 10px; }
/* Catchment share (study area) */
.catch-share { margin: 28px 0 8px; }
.catch-share-title { font-size: 15px; font-weight: 500; color: #111; margin: 0 0 10px; }
.catch-share-track { display: flex; height: 26px; border-radius: 6px; overflow: hidden; border: 1px solid #c8d8ec; }
.catch-share-seg { display: block; min-width: 4px; }
.catch-share-seg.u1 { background: #c9dcf2; } .catch-share-seg.u2 { background: #9fbfe3; } .catch-share-seg.u3 { background: #6f9bd0; } .catch-share-seg.u4 { background: #1d4f85; }
.catch-share-key { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 15px; color: #222; }
.catch-share-key li { display: inline-flex; align-items: center; gap: 8px; }
.catch-share-key .sw { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }
.catch-share-key .sw.u1 { background: #c9dcf2; } .catch-share-key .sw.u2 { background: #9fbfe3; } .catch-share-key .sw.u3 { background: #6f9bd0; } .catch-share-key .sw.u4 { background: #1d4f85; }
.catch-share-note { font-size: 14px; color: #555; margin: 10px 0 0; }
/* Unit labels on the interactive map: larger, lighter halo */
.unit-label { font-size: 15px; font-weight: 700; color: #111; text-shadow: 0 0 2px rgba(255,255,255,.55), 0 0 1px rgba(255,255,255,.4); background: none !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; }
.unit-label.z5 { font-size: 15px; background: rgba(255,255,255,.85) !important; padding: 1px 5px !important; border-radius: 4px; }
@media (max-width: 480px) { .unit-label { display: block !important; font-size: 14px; } }
/* Header: the Explorer is a separate page, so it is an outlined button, not a section highlight */
.toc a.toc-ex { color: #1d4f85; border: 1px solid #c9dcf2; border-radius: 999px; padding: 5px 12px; margin-left: 6px; }
.toc a.toc-ex:hover { background: #eef4fd; }
/* Audit round: navigation on narrow screens, back link target, note text, band overlay, phone labels */
@media (max-width: 1080px) {
    .site-header .toc { display: flex !important; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
    .site-header .toc::-webkit-scrollbar { display: none; }
    .site-header .toc a { flex: 0 0 auto; min-height: 44px; display: inline-flex; align-items: center; }
}
@media (max-width: 760px) {
    .site-header .toc { gap: 0; padding-bottom: 2px; }
    .site-header .toc a { font-size: 15px; padding: 8px 10px; }
}
.note p { text-align: left; hyphens: manual; max-width: 66ch; }
.band-seg > *:not(.band-water):not(.band-rain) { text-shadow: 0 0 3px rgba(255, 255, 255, 0.35); }
@media (max-width: 480px) { .unit-label { font-size: 14px !important; } }
@media (max-width: 760px) {
    .site-header { flex-wrap: wrap; }
    .site-header .toc { width: 100%; order: 3; justify-content: flex-start; padding: 0 0 6px; }
}
@media (max-width: 760px) {
    .site-header .site-inner { flex-wrap: wrap; row-gap: 0; }
    .site-header .site-inner .site-id { flex: 0 0 100%; }
    .site-header .toc { flex: 0 0 100%; width: 100%; max-width: 100%; }
}
/* The title block has no rule under it */
header.title { border-bottom: 0; }
/* Methods: processing chain, revealed step by step on scroll */
.pipeline { list-style: none; counter-reset: step; margin: 22px 0 8px; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.pipeline li { position: relative; border: 1px solid #c8d8ec; border-radius: 12px; padding: 14px 14px 16px; background: #f6f9fd; display: flex; flex-direction: column; gap: 6px; font-size: 14px; line-height: 1.45; color: #222; }
.pipeline li:not(:last-child)::after { content: "→"; position: absolute; right: -12px; top: 50%; transform: translateY(-50%); color: #1d4f85; font-size: 18px; background: #fff; }
.pipeline .pl-n { width: 26px; height: 26px; border-radius: 50%; background: #1d4f85; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; }
.pipeline strong { font-size: 16px; color: #111; }
.js-reveal .pipeline li { opacity: 0; transform: translateY(10px); transition: opacity 0.5s ease, transform 0.5s ease; }
.js-reveal .pipeline.in li { opacity: 1; transform: none; }
.js-reveal .pipeline.in li:nth-child(1) { transition-delay: 0.05s; } .js-reveal .pipeline.in li:nth-child(2) { transition-delay: 0.25s; }
.js-reveal .pipeline.in li:nth-child(3) { transition-delay: 0.45s; } .js-reveal .pipeline.in li:nth-child(4) { transition-delay: 0.65s; }
.js-reveal .pipeline.in li:nth-child(5) { transition-delay: 0.85s; }
@media (max-width: 900px) { .pipeline { grid-template-columns: minmax(0, 1fr); } .pipeline li:not(:last-child)::after { content: "↓"; right: auto; left: 16px; top: auto; bottom: -14px; transform: none; } }
@media (prefers-reduced-motion: reduce) { .js-reveal .pipeline li { opacity: 1; transform: none; transition: none; } }
/* The study-area explorer invitation has no outline */
.cta-card { border: 0 !important; }
.pipeline li { text-align: left; hyphens: manual; }
/* Band slider: a custom track with a tooltip thumb that glides between months */
.band-slider { position: relative; flex: 1 1 260px; min-width: 180px; height: 44px; }
.bs-track { position: absolute; left: 0; right: 0; top: 19px; height: 6px; border-radius: 3px; background: #d6e2f1; }
.bs-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 3px; background: #1d4f85; transition: width 0.8s cubic-bezier(.3,.7,.2,1); }
.bs-thumb { position: absolute; top: 12px; left: 0; width: 20px; height: 20px; margin-left: -10px; border-radius: 50%; background: #fff; border: 2px solid #1d4f85; transition: left 0.8s cubic-bezier(.3,.7,.2,1); pointer-events: none; }
.bs-tip { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); white-space: nowrap; background: #111; color: #fff; font-size: 14px; padding: 4px 9px; border-radius: 6px; font-variant-numeric: tabular-nums; }
.bs-tip::after { content: ""; position: absolute; left: 50%; top: 100%; margin-left: -5px; border: 5px solid transparent; border-top-color: #111; }
.bs-input { position: absolute; inset: 0; width: 100%; height: 44px; margin: 0; opacity: 0; cursor: pointer; }
.bs-input:focus-visible + .bs-thumb, .bs-slider:focus-within .bs-thumb { box-shadow: 0 0 0 3px rgba(29,79,133,.35); }
#band-month-label { display: block; }
.band-status { flex-basis: 100%; font-size: 14px; color: #555; }
/* Methodology chain: a vertical sequence, left-aligned, no hyphenation */
.pipeline { display: flex; flex-direction: column; gap: 12px; }
.pipeline li { flex-direction: row; align-items: flex-start; gap: 14px; border-radius: 10px; padding: 14px 18px; text-align: left; hyphens: none; }
.pipeline li::after { display: none !important; }
.pipeline li > span:last-child, .pipeline li > strong { text-align: left; }
.pipeline li > span:not(.pl-n) { flex: 1 1 auto; }
.pipeline li strong { display: block; margin-bottom: 2px; min-width: 96px; }
.pipeline li { display: grid; grid-template-columns: 28px 120px 1fr; align-items: start; }
.pipeline .pl-n { grid-row: span 1; }
@media (max-width: 640px) { .pipeline li { grid-template-columns: 28px 1fr; } .pipeline li > span:last-child { grid-column: 2; } .pipeline li strong { grid-column: 2; min-width: 0; } }
.band-controls { padding-top: 26px; }

/* Print and no-JavaScript: show all content */
@media print { .js-reveal .reveal, .js-reveal [data-reveal] { opacity: 1 !important; transform: none !important; } }

/* Audit fixes: slider inset and focus, text breaks, flow arrows, footer row, step numbers */
.band-slider { margin: 0 34px; }
.band-slider:focus-within .bs-thumb { box-shadow: 0 0 0 3px rgba(29,79,133,.5); }
.article .pipeline li, .article .note p, .article .note, .article section li { text-align: left; hyphens: manual; -webkit-hyphens: manual; }
.pipeline .pl-n { font-size: 14px; }
.flowdiag .node { position: relative; }
.flowdiag .node:not(:last-child)::after { content: "→"; position: absolute; right: -14px; top: 50%; transform: translateY(-50%); color: #1d4f85; font-size: 18px; background: #fff; }
@media (max-width: 1040px) { .flowdiag .node:not(:last-child)::after { content: "↓"; right: auto; left: 50%; top: auto; bottom: -15px; transform: translateX(-50%); } }
@media (max-width: 760px) { footer .sig { display: flex; flex-wrap: wrap; gap: 4px 16px; } }

/* Band controls sit under the band. The play button is a round icon with a text label for screen readers. */
.band-controls { display: flex; align-items: center; gap: 14px; padding: 12px 0 0; margin: 0; }
.band-controls { padding-top: 14px; }
.band-play { position: relative; width: 44px; height: 44px; min-height: 44px; padding: 0; flex: 0 0 44px; border-radius: 50%; border: 1px solid #1d4f85; background: #1d4f85; cursor: pointer; }
.band-play:hover { background: #163f6b; }
.band-play:focus-visible { outline: 2px solid #1d4f85; outline-offset: 3px; }
.band-play .bp-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.band-play .bp-icon { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 0; height: 0; border-style: solid; border-width: 8px 0 8px 13px; border-color: transparent transparent transparent #fff; margin-left: 3px; }
.band-play[data-state="playing"] .bp-icon { width: 12px; height: 14px; border: 0; margin-left: 0; background: linear-gradient(90deg, #fff 0 4px, transparent 4px 8px, #fff 8px 12px); }
.band-slider { flex: 1 1 auto; margin: 0 20px; }
.band-status { flex-basis: 100%; order: 3; margin-top: 4px; }
.band-controls { flex-wrap: wrap; }

/* Back to top: a button with an arrow, shown once the reader has scrolled */
.to-top { position: fixed; right: 20px; bottom: 20px; z-index: 900; width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid #c9d6e6; border-radius: 50%; background: #fff; color: #1d4f85; cursor: pointer; box-shadow: 0 4px 14px rgba(20, 50, 90, .12); opacity: 0; pointer-events: none; transition: opacity .3s ease, transform .3s ease; }
.to-top.is-visible { opacity: 1; pointer-events: auto; }
.to-top:hover { transform: translateY(-2px); }
.to-top:focus-visible { outline: 2px solid #1d4f85; outline-offset: 3px; }
/* small text: a 14 px floor across the study pages */
.article small, .article .small, .article figcaption, .article .sig, .article .keywords, .article .legend-source { font-size: 14px; }
/* the explorer's back link sits at the same size as the header buttons */
.back-link { min-height: 34px; }

/* Scroll-in for each block: rises and fades in, staggered within its section */
.js-reveal .rv { opacity: 0; transform: translateY(26px); transition: opacity 0.75s ease, transform 0.75s cubic-bezier(.2, .7, .2, 1); transition-delay: var(--d, 0s); }
.js-reveal .rv.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js-reveal .rv { opacity: 1; transform: none; transition: none; } }
/* Study-area map: no flat grey panel behind the map, so the basemap (topographic) shows through as on the explorer */
.study-map { background: #ffffff; }

/* ---- Design pass: Methodology as a timeline; Figure 6 as a row of quiet cards; smoother reveal ---- */
.pipeline { display: grid !important; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0 18px; margin: 28px 0 12px; padding: 0; list-style: none; position: relative; }
.pipeline::before { content: ""; position: absolute; left: 13px; right: 13px; top: 13px; height: 2px; background: linear-gradient(90deg, #1d4f85, #9fbfe3); }
.pipeline li { border: 0 !important; background: none !important; padding: 0 !important; display: flex !important; flex-direction: column !important; gap: 8px !important; grid-template-columns: none !important; position: relative; }
.pipeline li::after { display: none !important; }
.pipeline .pl-n { position: relative; z-index: 1; width: 28px; height: 28px; background: #fff; color: #1d4f85; border: 2px solid #1d4f85; }
.pipeline li strong { display: block; font-size: 17px; margin: 6px 0 0; min-width: 0 !important; }
.pipeline li > span:not(.pl-n) { font-size: 14px; color: #444; line-height: 1.5; }
@media (max-width: 900px) {
    .pipeline { grid-template-columns: minmax(0, 1fr); gap: 18px; }
    .pipeline::before { left: 13px; right: auto; top: 14px; bottom: 14px; width: 2px; height: auto; background: linear-gradient(180deg, #1d4f85, #9fbfe3); }
    .pipeline li { flex-direction: row !important; align-items: flex-start; gap: 12px !important; flex-wrap: wrap; }
    .pipeline li strong { margin: 4px 0 0; }
    .pipeline li > span:not(.pl-n) { flex-basis: 100%; }
}
.flowdiag { gap: 22px !important; }
.flowdiag .node { background: none !important; border: 0 !important; border-top: 3px solid #1d4f85 !important; border-radius: 0 !important; padding: 14px 0 0 !important; }
.flowdiag .node.modelled { border-top: 3px dashed #8a8a86 !important; }
.flowdiag .node::after { display: none !important; }
.flowdiag .node strong { font-size: 16px; }
.flowdiag .node span { font-size: 14px; color: #444; }
/* smoother reveal: earlier start, longer ease, a small rise */
.js-reveal .rv { opacity: 0; transform: translateY(18px); transition: opacity 1s cubic-bezier(.16,1,.3,1), transform 1s cubic-bezier(.16,1,.3,1); transition-delay: var(--d, 0s); will-change: opacity, transform; }
.js-reveal .rv.in { opacity: 1; transform: none; }
/* header: the explorer link has no outline */
.toc a.toc-ex { border: 0 !important; padding: 6px 10px !important; margin-left: 0 !important; border-radius: 6px !important; }
.toc a.toc-ex:hover { background: #eef4fd; }
