/* Riverwatch: phone-first map UI. Fonts are the Webborne site's self-hosted ones. */
/* headings: Riverwatch's own 31 KB cut of the site's Bricolage (Latin, weights 600–800, normal width; the full font is 154 KB) */
@font-face { font-family: 'Bricolage Grotesque'; src: url(bricolage-rw.woff2) format('woff2'); font-weight: 600 800; font-display: swap; }
@font-face { font-family: 'Figtree'; src: url(/fonts/figtree.woff2) format('woff2'); font-weight: 300 900; font-display: swap; }

:root {
  --ink: #10212f; --ink-2: #3d4f5e; --muted: #5d6d7a; --line: #dde3e8; --bg: #f3f6f8; --card: #fff;
  --river: #0e3a57; --accent: #1565a6; --ok: #1d7a46;
  --sev1: #7a0010; --sev2: #e3000f; --sev3: #f18700;
  --s-record: #c62828; --s-high: #f0a202; --s-normal: #1e7d3a; --s-low: #1e7d3a; --s-none: #a3a3a3; /* RAG, see STATES in logic.js */
  --top: 0px; --peek: 150px;
  --r: 16px; --shadow: 0 2px 10px rgba(16, 33, 47, .14), 0 1px 2px rgba(16, 33, 47, .12);
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  font-family: Figtree, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; color: var(--ink);
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; height: 100dvh; overflow: hidden; background: var(--bg); }
body { font-size: 16px; line-height: 1.4; }
button { font: inherit; color: inherit; }
a { color: var(--accent); }
h1, h2, h3, h4 { font-family: 'Bricolage Grotesque', Figtree, system-ui, sans-serif; margin: 0; letter-spacing: -0.01em; }
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); }

#map { position: fixed; inset: 0; background: #e8ecee; }
.leaflet-container { font: inherit; }
.leaflet-tile-pane { filter: saturate(.55) brightness(1.03) contrast(.95); }
.leaflet-bottom { bottom: calc(var(--peek) + var(--strip, 0px) + 2px); transition: bottom .2s; }
.leaflet-control-attribution { font-size: 10.5px; line-height: 1.35; background: rgba(255, 255, 255, .85) !important; border-radius: 8px 0 0 8px; max-width: 86vw; }
.leaflet-top { top: var(--top); }

/* ---- header ---- */
.top { position: fixed; z-index: 1000; left: 0; right: 0; top: 0; padding: calc(var(--safe-t) + 8px) 8px 0; display: grid; gap: 8px; pointer-events: none; }
.top > * { pointer-events: auto; }
.brand { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 8px 14px; gap: 8px; }
.brand .title { min-width: 0; }
.brand h1 { font-size: 22px; font-weight: 750; color: var(--river); line-height: 1.05; }
.brand p { margin: 1px 0 0; font-size: 13px; white-space: nowrap; color: var(--muted); font-weight: 600; }
.upd { display: flex; align-items: center; gap: 6px; color: var(--ink-2); white-space: nowrap; flex: none; }
#updated { display: grid; text-align: right; line-height: 1.15; }
#updated small { font-size: 12px; color: var(--muted); font-weight: 600; }
#updated b { font-size: 16px; font-variant-numeric: tabular-nums; }
#updated b.old { color: #9a5b00; }
.iconbtn { width: 44px; height: 44px; border-radius: 12px; border: 0; background: #e9f1f8; color: var(--accent); display: grid; place-items: center; cursor: pointer; }
.iconbtn.spin svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.modes { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; gap: 4px; }
.modes button { border: 0; background: transparent; border-radius: 12px; min-height: 44px; font-weight: 700; font-size: 16px; color: var(--ink-2); display: flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; }
.modes svg { width: 20px; height: 20px; fill: currentColor; }
.modes button[aria-selected="true"] { background: var(--river); color: #fff; }
.feedbar { background: #fff6e0; color: #6a4a00; border: 1px solid #f0d48a; font-size: 14px; padding: 7px 12px; border-radius: 12px; box-shadow: var(--shadow); }
.feedbar .linkbtn { padding: 0; font-size: 14px; color: #6a4a00; text-decoration: underline; }
.newver { background: #e9f1f8; color: var(--river); border-color: #c6dbee; } .newver .linkbtn { color: var(--river); }

/* ---- key ---- */
.keybtn { position: fixed; z-index: 990; left: 8px; top: var(--top); border: 0; padding: 0 14px; min-height: 40px; font-weight: 700; font-size: 15px; color: var(--river); cursor: pointer; transition: bottom .2s; }
.keybtn[aria-expanded="true"] { background: var(--river); color: #fff; }
.key { position: fixed; z-index: 995; left: 8px; top: calc(var(--top) + 48px); width: min(310px, calc(100vw - 16px)); max-height: calc(100vh - var(--peek) - var(--top) - 64px); overflow: auto; padding: 12px 14px; font-size: 14.5px; transition: bottom .2s; }
.key h4 { font-size: 14px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 10px 0 6px; }
.key h4:first-child { margin-top: 0; }
.key .ki { display: flex; align-items: center; gap: 10px; margin: 5px 0; }
.key .sw { width: 22px; height: 16px; border-radius: 4px; flex: none; border: 2px solid var(--c); background: color-mix(in srgb, var(--c) 40%, transparent); }
.key img { max-width: 100%; display: block; }
.key .note { color: var(--muted); font-size: 13px; margin: 8px 0 0; }

/* ---- gauge markers ---- */
.gmi { background: none; border: 0; display: grid; place-items: center; } /* 40 px tap target, dot centred */
.gmi:focus-visible { outline: none; } .gmi:focus-visible .gm { outline: 3px solid var(--accent); outline-offset: 3px; }
.gm { width: 28px; height: 28px; border-radius: 50%; background: var(--c); border: 2.5px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .35); display: grid; place-items: center; color: var(--k, #fff); font: 800 16px/1 Figtree, system-ui, sans-serif; }
.gm.hollow { background: #fff; border: 3px solid var(--c); color: var(--k, var(--c)); }
.gm.rag-red { box-shadow: 0 0 0 2px var(--c), 0 1px 5px rgba(0, 0, 0, .45); } /* extra ring: red is not told apart from green by colour alone */
.gm.kg { width: 24px; height: 24px; font-size: 13px; flex: none; }
.gm.kg.up { width: 21px; height: 21px; margin-left: 2px; }
.key .sw.area { border-width: 2.5px; background: color-mix(in srgb, var(--c) 22%, transparent); }
.rc { display: inline-flex; align-items: center; gap: 5px; margin-right: 12px; white-space: nowrap; }
.rd { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.rd.rag-red { box-shadow: 0 0 0 1.5px #fff, 0 0 0 3px #c62828; margin: 0 3px; }
.gm.up { border-radius: 6px; transform: rotate(45deg) scale(.9); }
.gm.up b { transform: rotate(-45deg); }
.zlo .gm { width: 22px; height: 22px; font-size: 13px; border-width: 2px; }
/* county zoom: quiet gauges (green, grey) become small dots so the amber and red ones stand out */
.zvlo .gm.rag-green:not(.sel):not(.seed), .zvlo .gm.rag-grey:not(.sel):not(.seed) { width: 13px; height: 13px; border-width: 2px; box-shadow: 0 1px 2px rgba(0, 0, 0, .3); }
.zvlo .gm.rag-green:not(.sel) b, .zvlo .gm.rag-grey:not(.sel) b { display: none; }
.zvlo .gm.hollow.rag-grey:not(.sel) { border-width: 2.5px; }
.gm.sel { outline: 3px solid var(--ink); outline-offset: 2px; }
.gm.seed { outline: 3px dashed var(--river); outline-offset: 3px; }
.rainm { background: none; border: 0; }
.rainm div { border-radius: 50%; background: rgba(28, 92, 171, .18); border: 2px solid #1c5cab; color: #0d366b; display: grid; place-items: center; font: 800 12px/1 Figtree, system-ui, sans-serif; }

/* ---- bottom panel ---- */
.panel { position: fixed; z-index: 1001; left: 0; right: 0; bottom: 0; background: var(--card); border-radius: 20px 20px 0 0; box-shadow: 0 -4px 18px rgba(16, 33, 47, .18); display: flex; flex-direction: column; max-height: calc(100dvh - var(--top) - 4px); transition: height .22s ease; }
.panel[data-state="peek"] { height: var(--peek); overflow: hidden; }
.panel[data-state="open"] { height: min(72vh, calc(100vh - var(--top) - 8px)); }
.panel[data-state="auto"] { height: auto; max-height: min(62vh, calc(100vh - var(--top) - 8px)); }
.panel[data-state="min"] { height: 64px; overflow: hidden; }
.grab { border: 0; background: none; padding: 8px 0 4px; width: 100%; cursor: pointer; flex: none; }
.grab span { display: block; width: 44px; height: 5px; border-radius: 3px; background: #c5cfd7; margin: 0 auto; }
.panel-body { overflow-y: auto; overscroll-behavior: contain; padding: 0 14px calc(var(--safe-b) + 14px); flex: 1; -webkit-overflow-scrolling: touch; }
.panel[data-state="peek"] .panel-body, .panel[data-state="min"] .panel-body { overflow: hidden; }

.sum { display: flex; align-items: center; gap: 10px; font-weight: 750; font-size: 17px; line-height: 1.25; }
.sum .ico { width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center; color: #fff; font-weight: 900; font-size: 16px; }
.sum.ok .ico { background: var(--ok); }
.sum.s1 .ico { background: var(--sev1); } .sum.s2 .ico { background: var(--sev2); } .sum.s3 .ico { background: var(--sev3); }
.sum.na .ico { background: var(--s-none); }
.subsum { margin: 4px 0 0 40px; color: var(--ink-2); font-size: 14.5px; display: flex; flex-wrap: wrap; row-gap: 2px; }
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 10px 0 6px; }
.tabs button { min-height: 42px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; font-weight: 700; font-size: 15px; cursor: pointer; color: var(--ink-2); }
.tabs button[aria-selected="true"] { border-color: var(--river); background: #e7f0f7; color: var(--river); }
.tabs .n { display: inline-block; min-width: 22px; padding: 0 6px; border-radius: 11px; background: var(--sev2); color: #fff; font-size: 13px; margin-left: 4px; line-height: 20px; }
.tabs .n.a { background: var(--sev3); } .tabs .n.z { background: #c5cfd7; color: var(--ink); }
.disc { font-size: 12.5px; color: var(--muted); margin: 2px 0 8px; }
.tabbody { padding-top: 4px; }

/* warnings */
.wcard { border: 1px solid var(--line); border-left: 6px solid var(--c); border-radius: 12px; padding: 10px 12px; margin: 10px 0; }
.wcard.hl { box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 35%, transparent); }
.badge { display: inline-flex; align-items: center; gap: 6px; background: var(--c); color: #fff; font-weight: 800; font-size: 13.5px; border-radius: 8px; padding: 3px 8px; }
.badge.s3 { color: #2b1700; }
.wcard h3 { font-size: 17px; margin: 6px 0 2px; font-weight: 700; }
.wcard .meta { color: var(--muted); font-size: 14px; margin: 0; }
.wcard details { margin-top: 6px; font-size: 15px; }
.wcard summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.wcard details p { white-space: pre-line; margin: 6px 0 0; color: var(--ink-2); }
.linkbtn { border: 0; background: none; color: var(--accent); font-weight: 700; padding: 6px 0 0; cursor: pointer; font-size: 15px; }
.empty { text-align: center; padding: 18px 10px; }
.empty .big { width: 54px; height: 54px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; font-size: 28px; font-weight: 900; margin: 0 auto 8px; }
.empty h3 { font-size: 19px; }
.empty p { color: var(--muted); margin: 4px 0 0; }
h4.sec { font-size: 13.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 18px 0 4px; }

/* rivers list */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.chip { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; min-height: 38px; padding: 0 14px; font-weight: 700; font-size: 14.5px; cursor: pointer; color: var(--ink-2); }
.chip[aria-pressed="true"] { background: var(--river); border-color: var(--river); color: #fff; }
.row { display: grid; grid-template-columns: 30px 1fr auto; grid-template-rows: auto auto; column-gap: 10px; row-gap: 5px; align-items: center; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: none; padding: 10px 2px; cursor: pointer; }
.row .dot { width: 28px; height: 28px; grid-row: span 2; }
.row .nm b { display: block; font-size: 16px; font-weight: 700; }
.row .nm small { color: var(--muted); font-size: 13.5px; }
.row .val { text-align: right; }
.row .val b { display: block; font-size: 16px; font-variant-numeric: tabular-nums; }
.row .val small { font-size: 13px; font-weight: 700; color: var(--t, var(--c)); }
.row .bar { grid-column: 2 / 4; height: 8px; border-radius: 4px; background: #eef2f5; position: relative; }
.row .bar .band { position: absolute; top: 0; bottom: 0; background: rgba(30, 125, 58, .28); border-radius: 4px; }
.row .bar .rec { position: absolute; top: -3px; bottom: -3px; width: 2px; background: #c62828; }
.row .bar .mk { position: absolute; top: -3px; width: 14px; height: 14px; border-radius: 50%; background: var(--c); border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.25); transform: translateX(-7px); }

/* outlook */
.ol { border-left: 5px solid var(--c, #8aa1b3); background: #f6f8fa; border-radius: 10px; padding: 9px 12px; margin: 8px 0; font-size: 15.5px; }
.ol.warn { --c: var(--sev2); background: #fdf0f0; } .ol.watch { --c: var(--sev3); background: #fff6ea; } .ol.info { --c: #7aa6cc; }
.rainchart { width: 100%; display: block; }
.legend2 { display: flex; gap: 14px; font-size: 14px; color: var(--ink-2); margin: 4px 0; flex-wrap: wrap; }
.legend2 i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
table.tot { width: 100%; border-collapse: collapse; font-size: 14.5px; margin-top: 8px; font-variant-numeric: tabular-nums; }
table.tot th, table.tot td { padding: 6px 4px; border-bottom: 1px solid var(--line); text-align: right; }
table.tot th:first-child, table.tot td:first-child { text-align: left; }
table.tot th { font-size: 12.5px; color: var(--muted); font-weight: 700; }
table.tot tr.grp td { font-weight: 800; color: var(--river); background: #f3f7fa; text-align: left; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); margin-top: 14px; font-weight: 700; }
.switch input { width: 46px; height: 26px; accent-color: var(--river); }

/* risk + sim panels */
.phead { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.phead h2 { font-size: 19px; color: var(--river); }
.tag { font-size: 12.5px; font-weight: 800; color: #6a4a00; background: #fff1c7; border-radius: 6px; padding: 2px 7px; white-space: nowrap; }
.small { font-size: 14px; color: var(--ink-2); margin: 4px 0 8px; }
.rng { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; margin: 8px 0; font-weight: 700; font-size: 15px; }
.rng output { min-width: 64px; text-align: right; font-variant-numeric: tabular-nums; }
/* Plus slider: own track + knob (so the 0 tick lines up on every browser); the dark fill runs from 0 to the knob. */
.rng .slide { --t: 26px; --at: calc(var(--t) / 2 + (100% - var(--t)) * var(--z, .25)); position: relative; display: block; min-width: 0; }
.rng .zero { position: absolute; left: var(--at); top: 50%; width: 2px; height: 20px; margin: -10px 0 0 -1px; border-radius: 1px; background: var(--ink-2); pointer-events: none; }
/* other .rng sliders (Layers opacity) keep the browser's own look */
.rng input { width: 100%; accent-color: var(--river); height: 32px; }
.rng .slide input { -webkit-appearance: none; appearance: none; position: relative; z-index: 1; display: block; width: 100%; height: 32px; margin: 0; background: transparent; cursor: pointer; touch-action: pan-y; }
.rng .slide input:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 8px; }
.rng .slide input::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(to right, var(--line) calc(var(--t) / 2 + (100% - var(--t)) * var(--lo)), var(--river) 0 calc(var(--t) / 2 + (100% - var(--t)) * var(--hi)), var(--line) 0); }
.rng .slide input::-moz-range-track { height: 6px; border-radius: 3px; background: linear-gradient(to right, var(--line) calc(var(--t) / 2 + (100% - var(--t)) * var(--lo)), var(--river) 0 calc(var(--t) / 2 + (100% - var(--t)) * var(--hi)), var(--line) 0); }
.rng .slide input::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: var(--t); height: var(--t); margin-top: calc((6px - var(--t)) / 2); border-radius: 50%; background: var(--river); border: 3px solid #fff; box-shadow: 0 1px 4px rgba(16, 33, 47, .35); }
.rng .slide input::-moz-range-thumb { width: var(--t); height: var(--t); box-sizing: border-box; border-radius: 50%; background: var(--river); border: 3px solid #fff; box-shadow: 0 1px 4px rgba(16, 33, 47, .35); }
.lg { margin: 10px 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.lg h3 { font-size: 15.5px; } .lg p { margin: 4px 0 0; font-size: 14px; color: var(--ink-2); }
.lg img { display: block; margin-top: 6px; max-width: 100%; }
.info { background: #f3f7fa; border-radius: 12px; padding: 10px 12px; font-size: 14.5px; margin: 10px 0; }
.info dl { margin: 4px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; }
.info dt { color: var(--muted); } .info dd { margin: 0; font-weight: 600; }
.towns { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.simstat { font-size: 15px; margin: 8px 0; padding: 9px 12px; background: #eef5fb; border-radius: 12px; }
.simstat.warn { background: #fff6e0; }
.depthkey { display: flex; gap: 10px; flex-wrap: wrap; font-size: 13.5px; color: var(--ink-2); margin: 6px 0; }
.depthkey i { display: inline-block; width: 14px; height: 14px; border-radius: 3px; margin-right: 4px; vertical-align: -2px; }

/* ---- gauge sheet ---- */
.sheet { position: fixed; z-index: 1002; left: 0; right: 0; bottom: 0; max-height: calc(100dvh - var(--top) - 8px); height: min(64vh, 640px); height: min(64dvh, 640px); background: var(--card); border-radius: 20px 20px 0 0; box-shadow: 0 -6px 24px rgba(16, 33, 47, .25); overflow-y: auto; overscroll-behavior: contain; padding: 0 16px calc(var(--safe-b) + 16px); }
.sheet .grab { position: sticky; top: 0; background: var(--card); z-index: 2; }
.shead { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; }
.shead h2 { font-size: 22px; line-height: 1.15; }
.shead p { margin: 2px 0 0; color: var(--muted); font-size: 14.5px; }
.close { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; background: #eef2f5; font-size: 24px; line-height: 1; cursor: pointer; }
.uptag { display: inline-block; margin-top: 6px; font-size: 13px; font-weight: 800; color: var(--river); background: #e3eef7; border-radius: 6px; padding: 2px 8px; }
.now { display: flex; align-items: center; gap: 12px; margin: 12px 0 4px; flex-wrap: wrap; }
.now .lvl { font-family: 'Bricolage Grotesque', Figtree, sans-serif; font-size: 40px; font-weight: 750; line-height: 1; font-variant-numeric: tabular-nums; }
.now .lvl small { font-size: 20px; font-weight: 600; color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 4px 11px; font-weight: 800; font-size: 14.5px; color: var(--k, #fff); background: var(--c); }
.pill.hollow { background: #fff; color: var(--t, var(--c)); border: 2px solid var(--c); }
.trendl { font-weight: 700; color: var(--ink-2); }
.changes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.changes div { background: #f3f6f8; border-radius: 12px; padding: 8px 10px; }
.changes span { display: block; font-size: 13px; color: var(--muted); font-weight: 700; }
.changes b { font-size: 18px; font-variant-numeric: tabular-nums; }
.chart { position: relative; margin: 30px 0 2px; touch-action: pan-y; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .tip { position: absolute; top: -28px; transform: translateX(-50%); background: var(--ink); color: #fff; font-size: 13px; font-weight: 700; border-radius: 8px; padding: 3px 8px; pointer-events: none; white-space: nowrap; }
.facts { margin: 10px 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 15px; }
.facts dt { color: var(--muted); } .facts dd { margin: 0; font-weight: 600; }
.btnrow { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.btn { border: 0; border-radius: 12px; min-height: 44px; padding: 0 16px; font-weight: 750; font-size: 15.5px; cursor: pointer; background: var(--river); color: #fff; text-decoration: none; display: inline-flex; align-items: center; }
.btn.alt { background: #e7f0f7; color: var(--river); }

.foot { font-size: 13.5px; color: var(--muted); border-top: 1px solid var(--line); margin-top: 18px; padding-top: 10px; }
.foot p { margin: 0 0 8px; }
.foot b { color: var(--ink); }
.noscript { position: fixed; inset: auto 0 0; z-index: 2000; background: #fff; padding: 16px; margin: 0; }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

@media (min-width: 720px) {
  .top { left: 12px; right: auto; width: 400px; }
  .panel, .sheet { left: 12px; right: auto; width: 420px; bottom: 12px; border-radius: 20px; }
  .panel[data-state="open"], .sheet { height: min(70vh, 700px); }
  .leaflet-bottom.leaflet-right { bottom: 0; }
  .keybtn, .key { left: 424px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* loading states (22 Nov 2026) */
body.cached .gm { opacity: .6; }
body.cached .leaflet-overlay-pane path { opacity: .6; }
.spinner { display: inline-block; width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid rgba(14, 58, 87, .2); border-top-color: var(--river); animation: spin .8s linear infinite; vertical-align: -3px; margin-right: 8px; }
.busy { display: flex; align-items: center; color: var(--ink-2); }
.skel { height: 200px; border-radius: 12px; background: linear-gradient(90deg, #eef2f5 0, #f6f8fa 50%, #eef2f5 100%) 0 0 / 200% 100%; animation: shimmer 1.4s linear infinite; display: grid; place-items: center; color: var(--ink-2); font-weight: 600; }
@keyframes shimmer { to { background-position: -200% 0; } }
.simprog { position: fixed; z-index: 996; left: 50%; transform: translateX(-50%); top: var(--top); width: min(300px, calc(100vw - 140px)); margin-left: 30px; padding: 8px 12px 10px; font-size: 14px; font-weight: 700; color: var(--river); }
.simprog span { display: block; margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.simprog b { display: block; height: 6px; border-radius: 3px; background: #e3ebf2; overflow: hidden; }
.simprog i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 3px; transition: width .2s; }
.simprog i.indet { width: 35%; animation: indet 1.1s ease-in-out infinite; }
@keyframes indet { from { transform: translateX(-100%); } to { transform: translateX(290%); } }
.chip.on { background: var(--river); border-color: var(--river); color: #fff; }
.iconbtn.spin { background: var(--river); color: #fff; }

/* ---- two tabs, day strip, layers (22 Nov 2026) ---- */
.fabs { position: fixed; z-index: 990; left: 8px; top: var(--top); display: grid; gap: 8px; }
.fab { border: 0; padding: 0 14px; min-height: 40px; font-weight: 700; font-size: 15px; color: var(--river); cursor: pointer; }
.fab[aria-expanded="true"] { background: var(--river); color: #fff; }
.fab[hidden] { display: none; }
.keybtn { display: none; }
#layers, .key { top: calc(var(--top) + 96px); max-height: calc(100vh - var(--top) - 96px - var(--peek) - var(--strip, 0px) - 12px); }
.lyr { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; cursor: pointer; }
.lyr input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--river); flex: none; }
.lyr b { display: block; font-size: 15px; } .lyr small { display: block; color: var(--muted); font-size: 13px; line-height: 1.35; }
.days { position: fixed; z-index: 999; left: 8px; right: 8px; bottom: calc(var(--peek) + 8px); padding: 6px; transition: bottom .2s; }
.days[hidden] { display: none; }
.dayrow { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; }
.day { border: 0; background: #f1f5f8; border-radius: 12px; min-height: 48px; padding: 4px 2px; font-weight: 750; font-size: 14.5px; color: var(--ink-2); cursor: pointer; display: grid; justify-items: center; gap: 3px; }
.day[aria-selected="true"] { background: var(--river); color: #fff; }
.dd { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dd.now { background: transparent; box-shadow: inset 0 0 0 2px currentColor; }
.day[aria-selected="true"] .dd { box-shadow: 0 0 0 2px #fff; }
.day[aria-selected="true"] .dd.now { box-shadow: inset 0 0 0 2px #fff; }
.cases { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 6px; background: #f1f5f8; border-radius: 12px; padding: 3px; }
.cases button { border: 0; background: transparent; border-radius: 9px; min-height: 36px; font-weight: 700; font-size: 14.5px; color: var(--ink-2); cursor: pointer; }
.cases button[aria-checked="true"] { background: #fff; color: var(--river); box-shadow: 0 1px 3px rgba(16,33,47,.18); }
.sum.proj { font-size: 16px; font-weight: 650; }
.sum.proj .ico { background: #5b8fc7; font-size: 18px; }
.tagline { margin: 6px 0 0 40px; display: flex; flex-wrap: wrap; gap: 6px; }
.tag.soft { background: #e8f0f8; color: #234a6e; }
.fgs { font-size: 12.5px; font-weight: 800; border-radius: 6px; padding: 2px 7px; background: #eef2f5; color: var(--ink-2); }
.rainline { margin: 6px 0 0 40px; font-size: 14px; color: var(--ink-2); }
.rainline:empty { display: none; }
.fgsrow { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin: 8px 0; }
.fgsd { border-radius: 8px; padding: 5px 2px; text-align: center; font-size: 12.5px; font-weight: 700; }
.fgsd b { display: block; font-size: 13.5px; }
.fgsd.l1 { background: #e4f2e7; color: #1d4d2a; } .fgsd.l2 { background: #fff3bf; color: #5c4600; } .fgsd.l3 { background: #ffd8a8; color: #6a3a00; } .fgsd.l4 { background: #ffc9c9; color: #7a0010; }
.fgs.l2 { background: #fff3bf; color: #5c4600; } .fgs.l3 { background: #ffd8a8; color: #6a3a00; } .fgs.l4 { background: #ffc9c9; color: #7a0010; }
.how { margin: 12px 0; font-size: 14.5px; } .how summary { cursor: pointer; color: var(--accent); font-weight: 700; } .how p { color: var(--ink-2); margin: 6px 0; }
.expect { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: #eef5fb; border-radius: 12px; padding: 8px 12px; margin: 6px 0; font-size: 15px; }
table.outl tr.on td { background: #eef5fb; font-weight: 800; }
table.outl .rd { margin-right: 6px; vertical-align: -1px; }
.gm.proj { border-style: dashed; }
.simprog { left: 104px; right: 8px; transform: none; margin-left: 0; width: auto; max-width: 320px; }
.hint { color: var(--ink-2); padding: 8px 12px; }
.infopop dl { margin: 2px 0 6px; display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; font-size: 13px; }
.infopop dt { color: var(--muted); } .infopop dd { margin: 0; font-weight: 600; } .infopop p { margin: 4px 0; }
/* outlook method: EA forecast (violet, like its dashed chart line) vs Riverwatch estimate (blue-grey) */
.mt { display: inline-block; font-size: 11.5px; font-weight: 800; border-radius: 5px; padding: 1px 5px; line-height: 1.3; }
.mt.ea { background: #ece9fb; color: #46379e; } .mt.est { background: #e8f0f8; color: #234a6e; }
table.outl td.how { text-align: right; white-space: nowrap; }
.method { font-size: 14px; color: var(--ink-2); margin: 4px 0 2px; padding: 8px 10px; border-radius: 10px; }
.method.ea { background: #f4f2fd; } .method.est { background: #f3f7fa; }
.mlist { margin: 4px 0 8px; padding-left: 18px; font-size: 14.5px; } .mlist li { margin: 2px 0; }
button.link { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
/* flood defences (Layers + Key) */
.deflegend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--ink-2); margin: 2px 0 6px; }
.deflegend span { display: inline-flex; align-items: center; gap: 6px; } .deflegend i { display: inline-block; width: 22px; height: 0; }
.sw.dline { height: 0 !important; border: 0 !important; border-top: 4px solid #37474f !important; background: none !important; align-self: center; }

/* ---- 28 Nov 2026: 5-day line, Check a place, search, toast ---- */
.next5 { margin: 4px 0 0 40px; font-size: 15px; line-height: 1.3; }
.next5 .link { text-align: left; color: var(--river); font-weight: 750; text-decoration: none; }
.next5 .link span { font-size: 18px; line-height: 0; }
.next5 .small { margin: 0; font-size: 13px; color: var(--muted); white-space: nowrap; }
.placebar { display: grid; grid-template-columns: auto 1fr; gap: 8px; margin: 8px 0 0; }
.pbtn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 0 14px; border-radius: 12px; border: 1.5px solid #c6dbee; background: #f1f7fc; color: var(--river); font-weight: 750; font-size: 15px; cursor: pointer; }
.pbtn svg { width: 19px; height: 19px; fill: currentColor; flex: none; }
.pcard { --c: var(--ok); margin: 8px 0 0; border: 1px solid var(--line); border-left: 6px solid var(--c); border-radius: 12px; padding: 8px 12px 6px; }
.pcard.calm { --c: #5b8fc7; } .pcard.watch { --c: #5b8fc7; background: #f4f8fc; } .pcard.alert { --c: var(--sev3); } .pcard.warn { --c: var(--sev2); background: #fdf3f3; } .pcard.na, .pcard.out { --c: var(--s-none); }
.ptop { display: flex; align-items: center; gap: 10px; font-size: 12.5px; line-height: 1; color: var(--muted); font-weight: 700; }
.ptop .pname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-transform: uppercase; letter-spacing: .04em; }
.ptop .linkbtn { padding: 4px 2px; font-size: 14px; min-height: 32px; }
.ptop [data-unplace] { font-size: 20px; line-height: 1; width: 32px; color: var(--muted); }
.phd { display: flex; align-items: center; gap: 8px; margin: 2px 0 0; font-weight: 750; font-size: 16.5px; line-height: 1.25; }
.phd .ico { width: 24px; height: 24px; border-radius: 50%; flex: none; display: grid; place-items: center; color: #fff; font-weight: 900; font-size: 14px; background: var(--c); }
.pcard.alert .phd .ico { color: #2b1700; }
.pl1 { margin: 2px 0 2px 32px; font-size: 14.5px; color: var(--ink-2); }
.pl1 .more { padding: 0 2px; font-size: 14.5px; }
.plines { margin: 6px 0 0 32px; padding: 0 0 0 16px; font-size: 14px; color: var(--ink-2); }
.plines li { margin: 2px 0; }
.pacts { display: flex; flex-wrap: wrap; gap: 0 14px; margin: 2px 0 0 32px; }
.pacts .linkbtn { font-size: 14px; padding: 6px 0; text-decoration: none; }
a.linkbtn { display: inline-block; }
.find { position: fixed; inset: 0; z-index: 1100; background: rgba(16, 33, 47, .35); padding: calc(var(--safe-t) + 8px) 8px 0; }
.findbox { max-width: 480px; margin: 0 auto; padding: 12px 14px 14px; max-height: calc(100vh - 24px); overflow: auto; }
.findhead { display: flex; align-items: center; justify-content: space-between; }
.findhead h2 { font-size: 19px; color: var(--river); }
#findform { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin: 10px 0 8px; }
#findq { min-height: 48px; border-radius: 12px; border: 1.5px solid var(--line); padding: 0 12px; font: inherit; font-size: 17px; color: var(--ink); min-width: 0; }
#findq:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.locbtn { width: 100%; justify-content: center; gap: 8px; }
.findlist { list-style: none; margin: 6px 0 0; padding: 0; }
.findlist button { width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: none; padding: 10px 4px; min-height: 48px; cursor: pointer; display: grid; }
.findlist b { font-size: 16px; } .findlist small { color: var(--muted); font-size: 13.5px; }
.findbox .note { color: var(--muted); font-size: 12.5px; margin: 10px 0 0; }
#findmsg:empty { display: none; }
.toast { position: fixed; z-index: 1200; left: 50%; transform: translateX(-50%); bottom: calc(var(--peek) + var(--strip, 0px) + 16px); background: var(--ink); color: #fff; font-weight: 700; font-size: 15px; padding: 10px 16px; border-radius: 12px; box-shadow: var(--shadow); max-width: calc(100vw - 32px); }
.pin { background: none; border: 0; }
.pin span { display: block; width: 26px; height: 26px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--river); border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .4); }
.pin span::after { content: ''; position: absolute; inset: 6px; border-radius: 50%; background: #fff; }
.btn.alt[data-share] { gap: 6px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.zvlo .gmi:has(.gm.rag-green:not(.sel):not(.seed)), .zvlo .gmi:has(.gm.rag-grey:not(.sel):not(.seed)) { width: 26px !important; height: 26px !important; margin: -13px 0 0 -13px !important; }
.say { font-size: 15.5px; line-height: 1.4; margin: 6px 0 4px; color: var(--ink); }

/* ==== 29 Nov 2026: room for the map (Ben, iPhone: "I can barely see the map on mobile") ====
   One compact top bar (~52 px), round Key/Layers buttons on the right, a small hint chip, and a real bottom sheet whose peek is
   only the status line + the day strip (What if: presets + Plus). Target: the map keeps >= 65 % of a 390 x 664 screen at peek. */
.top { gap: 6px; padding: calc(var(--safe-t) + 6px) 6px 0; }
.bar { display: flex; align-items: center; gap: 4px; padding: 5px; min-height: 52px; }
.brand { display: flex; align-items: center; justify-content: flex-start; gap: 4px; font-size: 15.5px; font-weight: 780; color: var(--river); line-height: 1; padding-left: 4px; min-width: 0; flex: 0 1 auto; }
.brand svg { width: 22px; height: 22px; flex: none; }
.brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar .modes { display: grid; grid-template-columns: auto auto; gap: 2px; padding: 3px; margin-left: auto; background: #eef3f7; border-radius: 12px; flex: none; }
.bar .modes button { min-height: 36px; padding: 0 9px; font-size: 14px; border-radius: 9px; gap: 4px; }
.bar .modes svg { width: 16px; height: 16px; }
.modes .t-short { display: none; }
.bar .iconbtn { width: 40px; height: 40px; flex: none; border-radius: 11px; }
.iconbtn.upd { width: auto; min-width: 50px; padding: 0 6px; display: flex; gap: 3px; color: var(--ink-2); }
.iconbtn.upd svg { color: var(--accent); }
#updated { line-height: 1.05; }
#updated small { font-size: 10.5px; } #updated b { font-size: 13.5px; }
.feedbar { font-size: 13px; padding: 5px 10px; }
@media (max-width: 429px) { .bar .modes svg { display: none; } .bar .modes button { padding: 0 10px; } }
@media (max-width: 400px) { .modes .t-long { display: none; } .modes .t-short { display: inline; } }
@media (max-width: 350px) { .brand span { display: none; } }

/* Key + Layers: round buttons on the right edge */
.fabs { left: auto; right: 6px; top: calc(var(--top) + 2px); gap: 6px; }
.fab { width: 42px; height: 42px; min-height: 0; padding: 0; border-radius: 50%; display: grid; place-items: center; }
.fab svg { width: 20px; height: 20px; fill: currentColor; }
.fab span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
#layers, .key { left: auto; right: 54px; top: calc(var(--top) + 2px); width: min(310px, calc(100vw - 64px)); max-height: calc(100dvh - var(--top) - var(--peek) - 16px); }

/* progress + hint: small chips under the bar, clear of the right-hand buttons */
.simprog { left: 8px; right: auto; top: calc(var(--top) + 2px); width: auto; max-width: calc(100vw - 70px); min-width: 0; margin: 0; transform: none; padding: 6px 10px 7px; font-size: 13px; }
.simprog span { margin-bottom: 4px; }
.simprog.hint { padding: 6px 12px; font-size: 13px; font-weight: 700; } .simprog.hint span { margin: 0; }

/* the sheet */
.panel { border-radius: 18px 18px 0 0; }
.sheethead { flex: none; touch-action: none; padding: 0 10px; user-select: none; -webkit-user-select: none; }
.panel .grab { padding: 6px 0 3px; }
.panel .grab span { width: 40px; }
.statusline { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; padding: 2px 2px 6px; text-align: left; cursor: pointer; color: var(--ink); font-weight: 750; font-size: 15px; line-height: 1.22; min-height: 40px; }
.statusline .ico { width: 24px; height: 24px; border-radius: 50%; flex: none; display: grid; place-items: center; color: #fff; font-weight: 900; font-size: 14px; background: var(--s-none); }
.statusline.ok .ico, .statusline.calm .ico { background: var(--ok); } .statusline.s1 .ico { background: var(--sev1); } .statusline.s2 .ico, .statusline.warn .ico { background: var(--sev2); } .statusline.s3 .ico, .statusline.alert .ico { background: var(--sev3); color: #2b1700; }
.statusline.proj .ico, .statusline.watch .ico, .statusline.sim .ico { background: #5b8fc7; }
.statusline .st { flex: 1; min-width: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.statusline .more { color: var(--muted); font-size: 22px; font-weight: 600; transition: transform .2s; }
.panel:not([data-state="peek"]) .statusline .more { transform: rotate(90deg); }
.days { position: static; padding: 0; box-shadow: none; background: none; border-radius: 0; }
.dayrow { gap: 4px; }
.day { min-height: 40px; padding: 3px 2px; font-size: 13.5px; gap: 2px; border-radius: 10px; grid-template-columns: auto; align-content: center; }
.day .dd { width: 8px; height: 8px; }
.disc.mini { font-size: 11.5px; margin: 5px 0 0; padding-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.simhead .presets { flex-wrap: nowrap; overflow-x: auto; margin: 0 -10px; padding: 0 10px 2px; scrollbar-width: none; }
.simhead .presets::-webkit-scrollbar { display: none; }
.simhead .chip { min-height: 34px; padding: 0 11px; font-size: 14px; white-space: nowrap; flex: none; }
.simhead .rng { margin: 4px 0 0; }
.panel-body { padding-top: 4px; border-top: 1px solid var(--line); }
.panel[data-state="peek"] .panel-body { visibility: hidden; }
.panel-body .cases { margin: 8px 0 10px; }
.area { font-size: 13px; color: var(--muted); margin: 10px 0 0; }
.panel-body > .sum:first-child, .panel-body > .cases + .sum { margin-top: 8px; }
.leaflet-bottom { bottom: var(--peek); }
.leaflet-right .leaflet-control-attribution { font-size: 10px; }
.toast { bottom: calc(var(--peek) + 12px); }
@media (min-width: 720px) {
  .top { width: 470px; }
  .panel { bottom: 12px; border-radius: 18px; }
  .fabs { right: auto; left: 490px; top: 10px; }
  #layers, .key { right: auto; left: 540px; top: 10px; max-height: calc(100dvh - 24px); }
  .simprog { left: 12px; top: var(--top); max-width: 440px; }
  .leaflet-bottom { bottom: 0; }
}
@media (prefers-reduced-motion: reduce) { .panel { transition: none; } }
/* day chips: name and dot on one line, 38 px */
.panel .day { display: flex; align-items: center; justify-content: center; gap: 5px; min-height: 38px; padding: 2px; }
.panel .day span { white-space: nowrap; }
.simhead .chip { min-height: 32px; }
.simhead .rng { margin: 2px 0 0; } .simhead .rng input, .simhead .rng .slide input { height: 28px; }
.panel .dd.now { display: none; } /* Today has no outlook colour */
