/* county.css — the county page (/county/{slug}): the design of 24 Nov 2026.
   Design: docs/superpowers/specs/2026-11-24-county-page-redesign-design.md. Markup: county.php, includes/county-page.php,
   the towns card's plain form in includes/area-links.php. The look was drawn first as a mock-up on the live page
   (docs/audits/county-page-redesign-2026-11-24/tools/mock-county-page.css); this is that look, with the dark theme.

   Every rule here is this page's own: each selector names .cp (the page's <main>), a cp- class or body.cp-page.
   scripts/test-county-page.php reads the file and fails on one that does not, so nothing here can reach another page.

   THEMES. The light values are written out, so the page looks right under the classic header (which has no theme
   and no --v4- variables) and before the theme script has run. Under :root[data-theme="dark"], the site's switch
   (public/home-v4/chrome.css), the values are the site's own variables, each with a fall-back.

   ICONS AND DOTS are drawn by the stylesheet (a mask over a colour), so the HTML holds no decorative picture. */

/* ── the ground and the colours ─────────────────────────────────────────────────────────────────────────────── */
body.cp-page {
  --cp-bg: #f8fafc; --cp-panel: #fff; --cp-soft: #f4f7fb; --cp-line: #dbe3ee;
  --cp-ink: #10294a; --cp-muted: #5a6b82; --cp-faint: #9fb0c6; --cp-accent: #1e6fd9;
  --cp-red: #dc2626; --cp-red-ink: #b91c1c; --cp-red-bg: #fdecec; --cp-red-line: #f8d2d2; --cp-red-pill: #991b1b;
  --cp-amber: #f59e0b; --cp-amber-ink: #a8690a; --cp-amber-bg: #fdf3e1; --cp-amber-line: #f6e2bb; --cp-amber-pill: #8a5a06; --cp-amber-icon: #d98a0b;
  --cp-green: #16a34a; --cp-green-bg: #e9f7ee; --cp-green-line: #cdebd8; --cp-green-pill: #166534;
  --cp-low: #2563eb; --cp-low-bg: #e8f0fb; --cp-low-line: #cfdff6; --cp-low-pill: #1e40af;
  --cp-grey: #94a3b8; --cp-grey-ink: #64748b; --cp-grey-bg: #eef2f6; --cp-grey-pill: #475569;
  --cp-shadow: 0 1px 2px rgba(16, 41, 74, .05);
  --cp-ic-alert: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3 2.5 20h19L12 3z'/%3E%3Cpath d='M12 10v4.5'/%3E%3Ccircle cx='12' cy='17.3' r='.6' fill='%23000'/%3E%3C/svg%3E");
  --cp-ic-ok: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='m8 12.5 2.8 2.8L16.2 9.6'/%3E%3C/svg%3E");
  --cp-ic-total: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m12 3 9 4.5-9 4.5-9-4.5L12 3z'/%3E%3Cpath d='m3 12 9 4.5 9-4.5'/%3E%3Cpath d='m3 16.5 9 4.5 9-4.5'/%3E%3C/svg%3E");
  --cp-ic-wave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M2 9c2.5-2.5 5-2.5 7.5 0s5 2.5 7.5 0 3.5-1.6 5-1'/%3E%3Cpath d='M2 15c2.5-2.5 5-2.5 7.5 0s5 2.5 7.5 0 3.5-1.6 5-1'/%3E%3C/svg%3E");
  --cp-ic-list: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M8 6h13M8 12h13M8 18h13'/%3E%3Ccircle cx='3.5' cy='6' r='1' fill='%23000'/%3E%3Ccircle cx='3.5' cy='12' r='1' fill='%23000'/%3E%3Ccircle cx='3.5' cy='18' r='1' fill='%23000'/%3E%3C/svg%3E");
  --cp-ic-cloud: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 16a4 4 0 0 1-.6-7.96A5.5 5.5 0 0 1 17 8.5a3.8 3.8 0 0 1 .3 7.5H7z'/%3E%3Cpath d='M9 19.5v1.5M13 19.5v1.5M17 19.5v1.5'/%3E%3C/svg%3E");
  --cp-ic-trend: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 17 6-6 4 4 8-8'/%3E%3Cpath d='M15 7h6v6'/%3E%3C/svg%3E");
  --cp-ic-pin: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21s7-6.2 7-11.5A7 7 0 0 0 5 9.5C5 14.8 12 21 12 21z'/%3E%3Ccircle cx='12' cy='9.5' r='2.5'/%3E%3C/svg%3E");
  --cp-ic-drop: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M12 3s6.5 7 6.5 11.5a6.5 6.5 0 0 1-13 0C5.5 10 12 3 12 3z'/%3E%3C/svg%3E");
  --cp-ic-bell: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9a6 6 0 0 1 12 0c0 6 2.5 7.5 2.5 7.5h-17S6 15 6 9z'/%3E%3Cpath d='M10 20a2 2 0 0 0 4 0'/%3E%3C/svg%3E");
  --cp-ic-home: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3 2.5 11.5h2.7V21h5v-6h3.6v6h5v-9.5h2.7L12 3z'/%3E%3C/svg%3E");
  background: var(--cp-bg);
  color-scheme: light;   /* whoever owns the background owns the scheme (public/styles.css) */
}
:root[data-theme="dark"] body.cp-page {
  --cp-bg: var(--v4-bg, #0a172e); --cp-panel: var(--v4-panel, #11274b); --cp-soft: var(--v4-input, #0a1830); --cp-line: var(--v4-border, #294261);
  --cp-ink: var(--v4-text, #e3ebf8); --cp-muted: var(--v4-muted, #a6b6ce); --cp-faint: var(--v4-faint, #7f94b2); --cp-accent: var(--v4-accent, #31bbee);
  --cp-red: var(--v4-high, #ff5b63); --cp-red-ink: #ff8389; --cp-red-bg: #3b1c2b; --cp-red-line: #6a2c3a; --cp-red-pill: #ffb4b8;
  --cp-amber: var(--v4-above, #ff9142); --cp-amber-ink: #ffb066; --cp-amber-bg: #3a2a1c; --cp-amber-line: #6b4a26; --cp-amber-pill: #ffcf9e; --cp-amber-icon: var(--v4-above, #ff9142);
  --cp-green: var(--v4-typical, #4cc38a); --cp-green-bg: #143a36; --cp-green-line: #1f5a4c; --cp-green-pill: #9be8c4;
  --cp-low: var(--v4-rain, #3c86ff); --cp-low-bg: #152f5c; --cp-low-line: #24467f; --cp-low-pill: #b5d2ff;
  --cp-grey: var(--v4-faint, #7f94b2); --cp-grey-ink: var(--v4-muted, #a6b6ce); --cp-grey-bg: #1b3257; --cp-grey-pill: #c6d3e6;
  --cp-shadow: none;
  color-scheme: dark;
}

body.cp-page .county-container { max-width: 1180px; margin: 0 auto; padding: 14px 20px 40px; }
.cp { display: flex; flex-direction: column; gap: 10px; color: var(--cp-ink); font-family: var(--v4-font, inherit); font-size: 15px; line-height: 1.5; }
/* Nothing here reaches every element or every link of .cp: the forecast line and the map are other parts' markup,
   printed inside it. (The site's base sheet already sizes every box by its border.) */
.cp-prio-link, .cp-towncard { color: inherit; }
.cp-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── breadcrumb, title, the four figures ────────────────────────────────────────────────────────────────────── */
.cp-crumb { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 13.5px; color: var(--cp-muted); }
.cp-crumb a { color: var(--cp-muted); text-decoration: none; display: inline-flex; align-items: center; }
.cp-crumb a:hover { color: var(--cp-accent); text-decoration: underline; }
.cp-crumb [aria-current] { color: var(--cp-ink); font-weight: 700; }
.cp-crumb-sep { color: var(--cp-faint); }
.cp-crumb-home::before { content: ""; width: 15px; height: 15px; background: currentColor; -webkit-mask: var(--cp-ic-home) center / contain no-repeat; mask: var(--cp-ic-home) center / contain no-repeat; }

.cp-head { margin: -4px 0 0; }
.cp-h1 { font-size: 36px; line-height: 1.12; font-weight: 800; letter-spacing: -.02em; margin: 0 0 2px; color: var(--cp-ink); }
.cp-sub { margin: 0; font-size: 15px; color: var(--cp-muted); display: flex; flex-wrap: wrap; gap: 4px 14px; }
.cp-sub .county-meta { color: var(--cp-ink); font-weight: 600; }

.cp-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.cp-tile { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 14px; align-items: center; padding: 9px 16px; border-radius: 12px; border: 1px solid transparent; }
.cp-tile::before { content: ""; grid-row: 1 / span 2; width: 26px; height: 26px; background: currentColor; -webkit-mask: var(--cp-ic-alert) center / contain no-repeat; mask: var(--cp-ic-alert) center / contain no-repeat; }
.cp-tile .alert-number { font-size: 24px; font-weight: 800; line-height: 1.05; color: var(--cp-ink); margin: 0; align-self: end; }
.cp-tile .alert-label { font-size: 13.5px; color: var(--cp-ink); opacity: .9; margin: 2px 0 0; align-self: start; }
.cp-tile-danger { background: var(--cp-red-bg); border-color: var(--cp-red-line); color: var(--cp-red); }
.cp-tile-warning { background: var(--cp-amber-bg); border-color: var(--cp-amber-line); color: var(--cp-amber-icon); }
.cp-tile-ok { background: var(--cp-green-bg); border-color: var(--cp-green-line); color: var(--cp-green); }
.cp-tile-ok::before { -webkit-mask-image: var(--cp-ic-ok); mask-image: var(--cp-ic-ok); }
.cp-tile-total { background: var(--cp-low-bg); border-color: var(--cp-low-line); color: var(--cp-accent); }
.cp-tile-total::before { -webkit-mask-image: var(--cp-ic-total); mask-image: var(--cp-ic-total); }

/* ── a card and its heading (the trends block and the towns card are cards too: their markup is not this page's) ── */
.cp-card, .cp .tr-block, .cp .area-links { background: var(--cp-panel); border: 1px solid var(--cp-line); border-radius: 12px; padding: 12px 16px; box-shadow: var(--cp-shadow); margin: 0; min-width: 0; }
.cp-card-h { position: relative; padding-left: 32px; margin: 0 0 8px; }
.cp-card-h h2, .cp .tr-block > h2, .cp .area-links > h2 { font-size: 17.5px; line-height: 1.25; font-weight: 800; letter-spacing: -.01em; margin: 0; color: var(--cp-ink); }
.cp-card-h p, .cp .tr-block > .tr-block-lede, .cp .area-links > .al-intro { margin: 1px 0 0; font-size: 12.5px; color: var(--cp-muted); line-height: 1.4; max-width: none; }
.cp-card-h::before, .cp .tr-block > h2::before, .cp .area-links > h2::before { content: ""; position: absolute; left: 0; top: 0; width: 22px; height: 22px; background: var(--cp-accent); -webkit-mask: var(--cp-ic-wave) center / contain no-repeat; mask: var(--cp-ic-wave) center / contain no-repeat; }
.cp-ic-list::before { -webkit-mask-image: var(--cp-ic-list); mask-image: var(--cp-ic-list); }
.cp-ic-cloud::before { -webkit-mask-image: var(--cp-ic-cloud); mask-image: var(--cp-ic-cloud); }
.cp .tr-block > h2::before { -webkit-mask-image: var(--cp-ic-trend); mask-image: var(--cp-ic-trend); }
.cp .area-links > h2::before { -webkit-mask-image: var(--cp-ic-pin); mask-image: var(--cp-ic-pin); }
.cp .tr-block > h2, .cp .area-links > h2 { position: relative; padding-left: 32px; }
.cp .tr-block > .tr-block-lede, .cp .area-links > .al-intro { padding-left: 32px; }

/* the colour of a dot: a priority gauge, a town card */
.cp-is-danger { --cp-dot: var(--cp-red); }
.cp-is-warning { --cp-dot: var(--cp-amber); }
.cp-is-ok { --cp-dot: var(--cp-green); }
.cp-is-low { --cp-dot: var(--cp-low); }
.cp-is-none { --cp-dot: var(--cp-grey); }

/* ── the forecast line's place, and the map beside the priority list ────────────────────────────────────────── */
.cp-forecast, .cp-map { min-width: 0; }
.cp-two { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: stretch; }
.cp-two-nomap { grid-template-columns: minmax(0, 1fr); }
.cp-prio-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.cp-prio-list li + li { border-top: 1px solid var(--cp-line); }
.cp-two-nomap .cp-prio-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 28px; }
.cp-two-nomap .cp-prio-list li, .cp-two-nomap .cp-prio-list li + li { border-top: 0; border-bottom: 1px solid var(--cp-line); }
/* Beside the map (Marc's picture): the row stretches to the taller of the two and the six rows share the card's height,
   so the two boxes end level and nothing is blank under the rows, whatever height the map's block takes. Only this page's
   own wrapper and card are styled: never the map's block or anything inside it. */
.cp-two:not(.cp-two-nomap) .cp-prio { display: flex; flex-direction: column; }
.cp-two:not(.cp-two-nomap) .cp-prio-list { flex: 1 1 auto; }
/* (the rows share the card's height equally, but a row is never shorter than its own content: the 44 px floor is on
   the link, not the row, so the row keeps its automatic minimum. With the floor on the row a long name on three lines
   ran into the row below, on Rutland, and every row was 44 px under a 59 px link on a phone) */
.cp-two:not(.cp-two-nomap) .cp-prio-list li { flex: 1 1 0; display: flex; align-items: center; }
.cp-two:not(.cp-two-nomap) .cp-prio-link { flex: 1 1 auto; min-height: 44px; padding-top: 6px; padding-bottom: 6px; }
.cp-prio-link { display: grid; grid-template-columns: auto minmax(0, 1fr) auto 10px; column-gap: 12px; align-items: center; padding: 9px 2px; text-decoration: none; }
.cp-prio-link::before { content: ""; grid-row: 1 / span 2; width: 10px; height: 10px; border-radius: 50%; background: var(--cp-dot, var(--cp-grey)); }
.cp-prio-link b { grid-column: 2; font-size: 14.5px; font-weight: 700; overflow-wrap: anywhere; }
.cp-prio-link small { grid-column: 2; font-size: 12.5px; color: var(--cp-muted); }
.cp-prio-word { grid-column: 3; grid-row: 1 / span 2; font-size: 12px; color: var(--cp-muted); text-align: right; max-width: 130px; }
.cp-prio-link:hover b { color: var(--cp-accent); }
.cp-prio-link::after, .cp-rows .station-item::after { content: "\203A"; grid-column: 4; grid-row: 1 / span 2; font-size: 19px; line-height: 1; color: var(--cp-muted); }
.cp-prio-link::before { grid-column: 1; }
.cp-rows .station-item::after { grid-column: 6; grid-row: auto; }

/* ── every gauge: the page's row links, laid out as a table ─────────────────────────────────────────────────── */
.cp-thead, .cp-rows .station-item { display: grid; grid-template-columns: minmax(0, 2.7fr) minmax(0, 1.35fr) 66px 160px minmax(0, 1.55fr) 12px; gap: 10px; align-items: center; }
.cp-thead { font-size: 12px; font-weight: 700; color: var(--cp-ink); background: var(--cp-soft); border-radius: 8px; padding: 5px 10px; }
.cp-rows { display: block; }
.cp-rows .station-item { padding: 3px 10px; border-bottom: 1px solid var(--cp-line); color: inherit; text-decoration: none; }
.cp-rows .station-item:hover { background: var(--cp-soft); }
/* a row the search box has set aside (public/county/county.js): it stays in the page, a plain link, only not drawn */
.cp-rows .station-item[hidden] { display: none; }
/* the search box (Marc's picture): beside the card's heading, printed hidden and shown by the page's script */
.cp-stations .cp-card-h { padding-right: 250px; }
.cp-search-wrap { position: absolute; right: 0; top: 2px; width: 230px; }
.cp-search { width: 100%; font: inherit; font-size: 13.5px; color: var(--cp-ink); background: var(--cp-panel) no-repeat 10px 50% / 15px; border: 1px solid var(--cp-line); border-radius: 8px; padding: 7px 10px 7px 32px; }
.cp-search { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E"); }
.cp-search:focus { outline: 2px solid var(--cp-accent); outline-offset: 1px; border-color: var(--cp-accent); }
.cp-nomatch { margin: 12px 0 0; font-size: 13.5px; color: var(--cp-muted); }
.cp-rows .station-info { min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; }
.cp-rows .station-name { font-size: 13.5px; font-weight: 700; color: var(--cp-ink); margin: 0; overflow-wrap: anywhere; }
.cp-rows .station-meta { font-size: 11px; color: var(--cp-muted); margin: 0; overflow-wrap: anywhere; }
.cp-river { font-size: 13px; color: var(--cp-ink); overflow-wrap: anywhere; }
/* all five are set: the site's base sheet (public/styles.css) makes any .station-level green */
.cp-rows .station-level { font-size: 13.5px; font-weight: 800; text-align: left; min-width: 0; }
.cp-rows .station-level.level-danger { color: var(--cp-red-ink); }
.cp-rows .station-level.level-above { color: var(--cp-amber-ink); }
.cp-rows .station-level.level-normal { color: var(--cp-ink); }
.cp-rows .station-level.level-below { color: var(--cp-low-pill); }
.cp-rows .station-level.level-nodata { color: var(--cp-grey-ink); }
.cp-trend { display: grid; grid-template-columns: 84px auto; column-gap: 6px; align-items: center; justify-content: start; color: var(--cp-accent); min-width: 0; }
.cp-rows .level-nodata ~ .cp-trend { color: var(--cp-grey); }   /* nothing is claimed of this reading: its line is drawn grey */
.cp-spark { display: block; grid-column: 1; width: 84px; height: 20px; }
.cp-trend .trend-badge { grid-column: 2; display: inline-block; font-size: 10.5px; font-weight: 700; padding: 1px 5px; border-radius: 6px; margin: 0; white-space: nowrap; }
.cp-trend .trend-rising { background: var(--cp-red-bg); color: var(--cp-red-pill); }
.cp-trend .trend-falling { background: var(--cp-green-bg); color: var(--cp-green-pill); }
.cp-trend .trend-steady { background: var(--cp-grey-bg); color: var(--cp-grey-pill); }
.cp-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: 7px; line-height: 1.3; }
.cp-pill::before { content: ""; flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: var(--cp-grey); }
.cp-pill-danger { background: var(--cp-red-bg); color: var(--cp-red-pill); }
.cp-pill-danger::before { background: var(--cp-red); }
.cp-pill-warning { background: var(--cp-amber-bg); color: var(--cp-amber-pill); }
.cp-pill-warning::before { background: var(--cp-amber); }
.cp-pill-ok { background: var(--cp-green-bg); color: var(--cp-green-pill); }
.cp-pill-ok::before { background: var(--cp-green); }
.cp-pill-low { background: var(--cp-low-bg); color: var(--cp-low-pill); }
.cp-pill-low::before { background: var(--cp-low); }
.cp-pill-none { background: var(--cp-grey-bg); color: var(--cp-grey-pill); }
.cp-rivers { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.cp-rivers .river-name { font-size: 12.5px; font-weight: 500; color: var(--cp-ink); background: var(--cp-soft); border: 1px solid var(--cp-line); border-radius: 999px; padding: 2px 10px; }

/* ── rainfall ───────────────────────────────────────────────────────────────────────────────────────────────── */
.cp-rain-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.cp-rain-chart { min-width: 0; }
/* The chart (rnTrendSvg(), shared) sets its reference label right-aligned so close to its left edge that the edge cut
   "1,277 mm" to "277 mm". The card's padding has room for it: let it show. */
.cp-rain-chart svg { overflow: visible; }
.cp-rain-side { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.cp-rain-tile { background: var(--cp-low-bg); border-radius: 10px; padding: 10px 14px; display: flex; flex-direction: column; gap: 3px; }
.cp-rain-k { display: flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 700; color: var(--cp-ink); }
.cp-rain-k::before { content: ""; flex: 0 0 auto; width: 22px; height: 22px; background: var(--cp-accent); -webkit-mask: var(--cp-ic-drop) center / contain no-repeat; mask: var(--cp-ic-drop) center / contain no-repeat; }
.cp-rain-tile b { font-size: 24px; font-weight: 800; line-height: 1.1; color: var(--cp-ink); }
.cp-rain-v { font-size: 12.5px; color: var(--cp-ink); }
.cp-about { background: var(--cp-soft); border-radius: 10px; padding: 8px 12px; font-size: 12px; color: var(--cp-muted); line-height: 1.5; }
.cp-about b { display: block; font-size: 13px; color: var(--cp-ink); margin: 0 0 3px; }
.cp-about p { margin: 0; }
.cp-rain-text { margin: 6px 0 0; font-size: 13.5px; color: var(--cp-muted); line-height: 1.55; }
.cp-rain-text strong { color: var(--cp-ink); }
/* The rainfall chart carries its colours as attributes (rnTrendSvg()), written for a light page. On the dark page
   they are retinted here, to the colours the trend charts beside it use in the dark (public/trends/trends.css). */
:root[data-theme="dark"] .cp-rain-chart rect[fill="#3b6fd4"] { fill: #6fa0f0; }
:root[data-theme="dark"] .cp-rain-chart rect[fill="#a9bcdd"] { fill: #425b83; }
:root[data-theme="dark"] .cp-rain-chart path { stroke: #c6dbff; }
:root[data-theme="dark"] .cp-rain-chart line { stroke: #93a5bd; }
:root[data-theme="dark"] .cp-rain-chart text { fill: #93a5bd; }

/* the rainfall chart's key (Marc's picture): a swatch for the bars, the ten-year line and the dashed 1991–2020 line */
.cp-rain-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; margin: 2px 0 0 62px; font-size: 12px; color: var(--cp-muted); }
.cp-rain-credit { margin: 2px 0 0 62px; font-size: 11px; line-height: 1.4; color: var(--cp-muted); }
.cp-rain-note { margin: 6px 0 0; font-size: 13px; color: var(--cp-muted); line-height: 1.55; }
/* lighter bars, as Marc's picture has them; the two tones (above and below the 1991–2020 average) still read */
.cp-rain-chart rect[fill="#3b6fd4"] { fill: #5b98e2; }
.cp-rain-chart rect[fill="#a9bcdd"] { fill: #c2d5ee; }
.cp-lg { display: inline-block; flex: 0 0 auto; width: 18px; height: 10px; }
.cp-lg-item { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.cp-lg-bar { height: 11px; width: 14px; border-radius: 2px; background: linear-gradient(90deg, #5b98e2 50%, #c2d5ee 50%); }
.cp-lg-line { height: 0; border-top: 2.5px solid #0f2d66; }
.cp-lg-dash { height: 0; border-top: 1.5px dashed #64748b; }
:root[data-theme="dark"] .cp-lg-bar { background: linear-gradient(90deg, #6fa0f0 50%, #425b83 50%); }
:root[data-theme="dark"] .cp-lg-line { border-top-color: #c6dbff; }
:root[data-theme="dark"] .cp-lg-dash { border-top-color: #93a5bd; }
:root[data-theme="dark"] .cp-rain-chart line.rn-grid { stroke: var(--cp-line); }

/* ── "Is it getting worse": the one renderer's block in its county layout (trBlockHtml(..., ['layout' => 'county'])) ──
   /trends has its own layout and none of these rules reach it. Three compact cards side by side, the legend row above
   them, then the Methodology and Sources folds and the link to /trends. */
.cp .tr-block { display: flex; flex-direction: column; gap: 0; position: relative; }
.cp .tr-block > * { min-width: 0; max-width: none; }
.cp .tr-block > .tr-block-lede { margin: 1px 0 6px; }
.cp .tr-block > .tr-stale { margin: 0 0 12px; }
.cp .tr-c-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 14px; margin: 0 0 8px; font-size: 11.5px; color: var(--cp-muted); }
.cp .tr-c-key { display: inline-flex; align-items: center; gap: 6px; }
.cp .tr-c-roll { display: inline-block; width: 18px; border-top: 2.5px solid var(--tr-roll, #0f2d66); }
.cp .tr-c-context { margin-left: auto; font-style: italic; }
.cp .tr-c-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0 0 8px; }
.cp .tr-c-card { margin: 0; padding: 9px 12px; border-radius: 10px; background: var(--cp-panel); border: 1px solid var(--cp-line); display: flex; flex-direction: column; min-width: 0; }
.cp .tr-card-head { flex-direction: column; gap: 1px; margin: 0 0 4px; }
.cp .tr-card h3 { font-size: 14px; font-weight: 800; line-height: 1.3; margin: 0; color: var(--cp-ink); }
/* each trends card's icon, as its section heads have one (Marc's picture): the measure's, drawn by the stylesheet */
.cp .tr-c-card h3 { display: flex; align-items: center; gap: 8px; }
.cp .tr-c-card h3::before { content: ""; flex: 0 0 auto; width: 20px; height: 20px; background: var(--cp-accent); -webkit-mask: var(--cp-ic-wave) center / contain no-repeat; mask: var(--cp-ic-wave) center / contain no-repeat; }
.cp .tr-c-alerts h3::before { -webkit-mask-image: var(--cp-ic-bell); mask-image: var(--cp-ic-bell); }
.cp .tr-c-sewage_spills h3::before, .cp .tr-c-sewage_hours h3::before { -webkit-mask-image: var(--cp-ic-drop); mask-image: var(--cp-ic-drop); }
.cp .tr-coverage { font-size: 11.5px; margin: 0; line-height: 1.35; }
.cp .tr-c-figs { display: flex; gap: 18px; margin: 2px 0 4px; }
.cp .tr-c-fig { margin: 0; display: flex; flex-direction: column; line-height: 1.15; }
.cp .tr-c-fig b { font-size: 18px; font-weight: 800; color: var(--cp-accent); letter-spacing: -.01em; }
.cp .tr-c-fig b small { font-size: 12.5px; font-weight: 700; }
.cp .tr-c-fig + .tr-c-fig b { color: var(--cp-ink); }
.cp .tr-c-fig span { font-size: 11px; color: var(--cp-muted); margin-top: 2px; }
.cp .tr-c-card .tr-svg { margin: 0 0 4px; }
.cp .tr-verdict { font-size: 12px; line-height: 1.4; margin: auto 0 0; font-weight: 650; }
.cp .tr-c-method { padding: 10px 0 0; }
.cp .tr-c-method + .tr-c-method { border-top: 1px solid var(--cp-line); margin-top: 10px; }
.cp .tr-c-name { margin: 0; font-size: 13.5px; font-weight: 800; color: var(--cp-ink); }
.cp .tr-enso-legend, .cp .tr-lag, .cp .tr-working, .cp .tr-method, .cp .tr-caveat { font-size: 12.5px; line-height: 1.55; margin: 6px 0 0; max-width: 110ch; }
.cp .tr-c-sources { margin: 8px 0 0; padding-left: 18px; font-size: 12.5px; color: var(--cp-muted); line-height: 1.6; }
.cp .tr-c-sources b { color: var(--cp-ink); }
.cp .tr-block .tr-fine { font-size: 12.5px; line-height: 1.5; margin: 8px 0 0; color: var(--cp-muted); }
.cp .tr-block > .tr-more { font-size: 12.5px; line-height: 1.5; margin: 4px 0 0; }
.cp .tr-block a { color: var(--cp-accent); }

/* ── the folds: native <details>, every item in the HTML ─────────────────────────────────────────────────────── */
.cp-more > summary, .cp-fold-sm > summary, .cp .al-fold > summary, .cp .tr-c-fold > summary { list-style: none; cursor: pointer; }
.cp-more > summary::-webkit-details-marker, .cp-fold-sm > summary::-webkit-details-marker,
.cp .al-fold > summary::-webkit-details-marker, .cp .tr-c-fold > summary::-webkit-details-marker { display: none; }
/* "View all N …": a button-like line under what shows; open, the rest show above it and it says "Show fewer". */
.cp-more { display: flex; flex-direction: column; }
.cp-more > summary { order: 2; align-self: flex-start; margin: 8px 0 0; display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px; border: 1.5px solid var(--cp-ink); border-radius: 8px; font-size: 12.5px; font-weight: 700; color: var(--cp-ink); }
.cp-more > summary::after { content: "\2192"; }
.cp-more > summary:hover { border-color: var(--cp-accent); color: var(--cp-accent); }
.cp-more[open] .cp-more-label { display: none; }
.cp-more[open] > summary::before { content: "Show fewer"; }
.cp-more[open] > summary::after { content: "\2191"; }
.cp-raintowns .cp-more > summary { border: 0; padding: 8px 0 0; color: var(--cp-accent); }
/* the rivers list: a small line, a chevron */
.cp-fold-sm { margin: 6px 0 0; }
.cp-fold-sm > summary { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--cp-accent); }
.cp-fold-sm > summary::after, .cp .al-fold > summary::after, .cp .tr-c-fold > summary::after { content: ""; flex: 0 0 auto; width: 7px; height: 7px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); margin: -3px 2px 0; }
.cp-fold-sm[open] > summary::after, .cp .al-fold[open] > summary::after, .cp .tr-c-fold[open] > summary::after { transform: rotate(225deg); margin-top: 3px; }
/* the trends block's Methodology and Sources: a full-width row, its title, a short line, a chevron */
.cp .tr-c-fold { border: 1px solid var(--cp-line); border-radius: 8px; margin: 0 0 6px; }
.cp .tr-c-fold > summary { display: flex; align-items: center; gap: 12px; padding: 6px 12px; font-size: 12.5px; color: var(--cp-muted); }
.cp .tr-c-fold > summary::after { margin-left: auto; color: var(--cp-ink); }
.cp .tr-c-sum { font-size: 13px; font-weight: 800; color: var(--cp-ink); }
.cp .tr-c-fold > :not(summary) { margin-left: 14px; margin-right: 14px; }
.cp .tr-c-fold[open] { padding-bottom: 12px; }
/* the towns card's two lists: the h3 is the fold's summary, with the count of its links */
.cp .al-fold { border-top: 1px solid var(--cp-line); }
.cp .al-fold > summary { display: flex; align-items: center; gap: 10px; padding: 6px 2px; }
.cp .al-fold > summary h3 { margin: 0; padding: 0; border: 0; font-size: 13.5px; font-weight: 700; color: var(--cp-accent); }
.cp .al-count { font-size: 12px; font-weight: 700; color: var(--cp-muted); background: var(--cp-soft); border: 1px solid var(--cp-line); border-radius: 999px; padding: 0 9px; }
.cp .al-fold > summary::after { margin-left: auto; color: var(--cp-muted); }
.cp .al-fold[open] > .al-links { margin-bottom: 10px; }

/* ── the two town cards ─────────────────────────────────────────────────────────────────────────────────────── */
.cp-duo { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1.85fr); gap: 10px; align-items: start; }
.cp-duo-one { grid-template-columns: minmax(0, 1fr); }
/* A list of links is a <p> with a dot between its links (as it has always been, and as it reads with no stylesheet).
   Here the links are laid out as a grid and the dots, which would each take a cell, are not drawn. Every link shows. */
.cp .al-links { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.cp .al-sep { display: none; }
.cp .al-links a { display: block; padding: 4px 0; border-bottom: 1px solid var(--cp-line); font-size: 13px; font-weight: 600; color: var(--cp-accent); text-decoration: none; overflow-wrap: anywhere; }
.cp .al-links a::after { content: "\00a0\2192"; font-weight: 500; }   /* a no-break space: the arrow keeps to its last word */
.cp .al-links a:hover { text-decoration: underline; }
.cp .area-links .al-links, .cp-duo-one .al-links { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cp .area-links h3 { font-size: 14.5px; font-weight: 800; color: var(--cp-ink); margin: 14px 0 2px; padding: 10px 0 0; border-top: 1px solid var(--cp-line); }
.cp .area-links { overflow-wrap: break-word; }
.cp-towncards { list-style: none; margin: 8px 0 6px; padding: 0; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
.cp-towncard { position: relative; display: flex; flex-direction: column; gap: 2px; height: 100%; min-width: 0; padding: 6px 7px; border: 1px solid var(--cp-line); border-radius: 8px; background: var(--cp-soft); text-decoration: none; }
.cp-towncard:hover { border-color: var(--cp-accent); }
.cp-towncard::after { content: "\2192"; position: absolute; right: 6px; top: 4px; font-size: 11px; color: var(--cp-muted); }
.cp-tc-top { display: flex; align-items: center; gap: 5px; font-size: 10.5px; color: var(--cp-muted); }
.cp-tc-top::before { content: ""; flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: var(--cp-dot, var(--cp-grey)); }
.cp-towncard b { font-size: 12px; font-weight: 800; line-height: 1.25; color: var(--cp-ink); overflow-wrap: break-word; }
.cp-towncard small { font-size: 10.5px; color: var(--cp-muted); line-height: 1.25; }

/* ── a wide window only (Marc's picture): what can share a line does ───────────────────────────────────────── */
@media (min-width: 1001px) {
  .cp .tr-c-legend { position: absolute; top: 15px; right: 16px; margin: 0; }
  .cp-stations .cp-more:not([open]) { display: inline-flex; vertical-align: middle; }
  .cp-stations .cp-more:not([open]) + .cp-fold-sm { display: inline-block; margin: 8px 0 0 18px; vertical-align: middle; }
  .cp-towncard::after { content: none; }
  .cp-towncard { padding: 5px 5px; hyphens: auto; }
  .cp-towncard b { font-size: 11px; letter-spacing: -.01em; overflow-wrap: normal; }
  /* eight in one row, each as wide as its longest word needs: a town's name is never broken inside a word */
  .cp-towncards { grid-template-columns: repeat(8, auto); }
  .cp-towncard small { font-size: 10px; line-height: 1.2; }
}

/* ── a narrow window: the table's rows become cards, the paired cards stack ─────────────────────────────────── */
@media (max-width: 1000px) {
  .cp-two, .cp-duo { grid-template-columns: minmax(0, 1fr); }
  .cp-two-nomap .cp-prio-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cp-thead { display: none; }
  /* Each row is a wrapping line of its cells: the name and the level, the river under them, then the trend line with
     its badge and the level's word, the word taking a line of its own when the two do not fit side by side. Neither of
     those two cells shrinks (on one grid line the word painted over the badge: "Falling" showed as "Fal"). `order`
     moves the picture only: read as text, a row is still name, river, level, trend, word. */
  .cp-rows .station-item { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 10px 2px; }
  .cp-rows .station-info { order: 1; flex: 1 1 0; min-width: 0; }
  .cp-rows .station-level { order: 2; flex: 0 0 auto; text-align: right; font-size: 16px; }
  .cp-river { order: 3; flex: 0 0 100%; font-size: 13px; color: var(--cp-muted); }
  .cp-trend { order: 4; flex: 0 0 auto; }
  .cp-status { order: 5; flex: 0 0 auto; margin-left: auto; }
  .cp-rows .station-item::after { display: none; }
  .cp .tr-c-context { margin-left: 0; }
  .cp .tr-c-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cp-towncards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ── the phone ──────────────────────────────────────────────────────────────────────────────────────────────── */
@media (max-width: 760px) {
  body.cp-page .county-container { padding: 10px 12px 30px; }
  .cp { gap: 12px; font-size: 14.5px; }
  .cp-h1 { font-size: 25px; }
  .cp-sub { font-size: 14.5px; flex-direction: column; gap: 2px; }
  .cp-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .cp-tile { padding: 10px 11px; column-gap: 9px; }
  .cp-tile::before { width: 24px; height: 24px; }
  .cp-tile .alert-number { font-size: 23px; }
  .cp-tile .alert-label { font-size: 12.5px; }
  .cp-card, .cp .tr-block, .cp .area-links { padding: 13px; border-radius: 12px; }
  .cp-card-h h2, .cp .tr-block > h2, .cp .area-links > h2 { font-size: 17px; }
  .cp-rain-grid { grid-template-columns: minmax(0, 1fr); }
  .cp-stations .cp-card-h { padding-right: 0; }
  .cp-search-wrap { position: static; width: auto; margin: 10px 0 0 -36px; }
  /* the rainfall chart is drawn 720 wide: at a phone's width its labels are drawn larger, and every other year */
  .cp-rain-chart svg text { font-size: 19px; }
  .cp-rain-chart svg text[data-alt], .cp-rain-chart svg text.rn-yt { display: none; }
  .cp-rain-legend { margin-left: 0; }
  .cp-two-nomap .cp-prio-list { grid-template-columns: minmax(0, 1fr); }
  .cp-prio-word { max-width: 110px; }
  .cp .tr-c-cards { grid-template-columns: minmax(0, 1fr); }
  .cp .area-links .al-links, .cp-duo-one .al-links, .cp-towncards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* a phone keeps every tap target at least 44 px tall (only the desktop is drawn as tight as Marc's picture) */
  .cp .al-links a { display: flex; align-items: center; min-height: 44px; }
  .cp-more > summary, .cp-fold-sm > summary, .cp .al-fold > summary, .cp .tr-c-fold > summary { min-height: 44px; }
  .cp-towncard { min-height: 44px; }
}
