/*
 * monsoon.css — the look of the whole app (Monsoon v3 "Horizon instrument", Oct 2026; spec docs/DESIGN_SYSTEM.md,
 * choice docs/options/v3/REVIEW.md).
 *
 *   themes   html[data-theme="day" | "evening" | "night"], picked by the sun in Phnom Penh (static/look.js + ui.js).
 *            Colour tokens below are copied from docs/options/v3/tokens.json (measured with docs/tools/contrast.py, 0
 *            failures); tests/test_tokens.py fails if this file, sw.js or the rain fallbacks drift from it. Day: pastel blue / mint / peach / sage. Evening: warm brown and sand. Night: slate and mauve.
 *   layout   the sky window (scene.js paints it) with solid chips on top and the answer plate standing on its horizon;
 *            then the sheet: the day as a river line on the water (forecast above the line, observed below), then
 *            the detail. Four big labelled buttons at the bottom on phones. Desktop (>= 900 px): sky + plate = sticky
 *            left column, the day right.
 *   type     Kantumruy Pro for words (Khmer + Latin), Manrope for every number (tabular, lining figures).
 *            Sizes 12 · 14 · 16 · 18 · 20 · 24 · 30 · 56. Words 400 / 600 / 700, numbers 500 small, 800 large.
 *            Khmer line-height >= 1.35 on one-line display sizes, 1.5 elsewhere; never letter-spaced. Nothing under 12 px.
 *   colour   one accent (lantern gold: the primary button, ឥឡូវ, the current page), brass only on the plate's edge.
 *            Rain intensity is the only other colour: ONE scale (--rain-light / -moderate / -heavy), the same on the
 *            timeline, the table, the legend and the /beta map (beta.js reads these tokens), always with its word.
 *   motion   transform / opacity only, tokens --t-press / --t-ui / --t-settle / --t-dock; the 2 s theme cross-fade is
 *            the one exception (ui.js). prefers-reduced-motion and html.still: nothing moves.
 */

/* ---- fonts, served from this site (SIL OFL) so Khmer renders on a bad connection. A face is only downloaded
        when something on the page uses it, so every vendored weight is declared. ---- */
@font-face { font-family: "Kantumruy Pro"; font-weight: 300; font-display: swap; src: url(vendor/kantumruy-pro/kantumruy-pro-khmer-300-normal.woff2) format("woff2"); unicode-range: U+1780-17FF, U+19E0-19FF, U+200C-200D, U+25CC; }
@font-face { font-family: "Kantumruy Pro"; font-weight: 300; font-display: swap; src: url(vendor/kantumruy-pro/kantumruy-pro-latin-300-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+2190-21FF, U+2212, U+00D7; }
@font-face { font-family: "Kantumruy Pro"; font-weight: 400; font-display: swap; src: url(vendor/kantumruy-pro/kantumruy-pro-khmer-400-normal.woff2) format("woff2"); unicode-range: U+1780-17FF, U+19E0-19FF, U+200C-200D, U+25CC; }
@font-face { font-family: "Kantumruy Pro"; font-weight: 400; font-display: swap; src: url(vendor/kantumruy-pro/kantumruy-pro-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+2190-21FF, U+2212, U+00D7; }
@font-face { font-family: "Kantumruy Pro"; font-weight: 500; font-display: swap; src: url(vendor/kantumruy-pro/kantumruy-pro-khmer-500-normal.woff2) format("woff2"); unicode-range: U+1780-17FF, U+19E0-19FF, U+200C-200D, U+25CC; }
@font-face { font-family: "Kantumruy Pro"; font-weight: 500; font-display: swap; src: url(vendor/kantumruy-pro/kantumruy-pro-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+2190-21FF, U+2212, U+00D7; }
@font-face { font-family: "Kantumruy Pro"; font-weight: 600; font-display: swap; src: url(vendor/kantumruy-pro/kantumruy-pro-khmer-600-normal.woff2) format("woff2"); unicode-range: U+1780-17FF, U+19E0-19FF, U+200C-200D, U+25CC; }
@font-face { font-family: "Kantumruy Pro"; font-weight: 600; font-display: swap; src: url(vendor/kantumruy-pro/kantumruy-pro-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+2190-21FF, U+2212, U+00D7; }
@font-face { font-family: "Kantumruy Pro"; font-weight: 700; font-display: swap; src: url(vendor/kantumruy-pro/kantumruy-pro-khmer-700-normal.woff2) format("woff2"); unicode-range: U+1780-17FF, U+19E0-19FF, U+200C-200D, U+25CC; }
@font-face { font-family: "Kantumruy Pro"; font-weight: 700; font-display: swap; src: url(vendor/kantumruy-pro/kantumruy-pro-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+2190-21FF, U+2212, U+00D7; }
@font-face { font-family: "Manrope"; font-weight: 200; font-display: swap; src: url(vendor/manrope/manrope-latin-200-normal.woff2) format("woff2"); }
@font-face { font-family: "Manrope"; font-weight: 300; font-display: swap; src: url(vendor/manrope/manrope-latin-300-normal.woff2) format("woff2"); }
@font-face { font-family: "Manrope"; font-weight: 400; font-display: swap; src: url(vendor/manrope/manrope-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Manrope"; font-weight: 500; font-display: swap; src: url(vendor/manrope/manrope-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Manrope"; font-weight: 600; font-display: swap; src: url(vendor/manrope/manrope-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Manrope"; font-weight: 700; font-display: swap; src: url(vendor/manrope/manrope-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Manrope"; font-weight: 800; font-display: swap; src: url(vendor/manrope/manrope-latin-800-normal.woff2) format("woff2"); }

/* ---- theme tokens: copied from docs/options/v3/tokens.json (contrast.py: 0 failures; tests/test_tokens.py guards the copy) ----
   page:   --bg (the page) --surface (answer plate, cards, table, bottom bar) --surface-raised (chips, table head)
           --water (the timeline's ground) --bezel (the plate's brass edge)
   sky:    --sky-top / --sky-mid / --sky-low --glow --cloud-lit / --cloud-shade --storm --sun --moon / --moon-dark
           --drop (rain streaks, "r, g, b")
   rain:   --rain-light / --rain-moderate / --rain-heavy (+ --rain-heavy-ink); --horizon (the water line) --dry
   graph:  --chance / --chance-fill (the minute graph) */
html[data-theme="day"] {
    --bg: #F1EFE4; --bg-top: #A8CAE6; --surface: #FBFAF4; --surface-raised: #E3EBDD; --water: #DDEBE0;
    --text: #0F242B; --text-muted: #3B4F54; --accent: #F2B63C; --accent-ink: #2A1A00; --accent-edge: #8A5A06;
    --border: #CFD4C6; --border-strong: #627479; --legend: #3B4F54; --focus: #0E5A6B; --rain-light: #4A82C9;
    --rain-moderate: #274FA8; --rain-heavy: #1D1766; --rain-heavy-ink: #FFFFFF; --horizon: #4B6A70; --dry: #5F7478;
    --chance: #1B6A5E; --chance-fill: #BFE2D6; --hatch: #3B4F54; --sky-top: #A8CAE6; --sky-mid: #CFE4EE;
    --sky-low: #F5D6BE; --glow: #FBE4CE; --cloud-lit: #F7F9F6; --cloud-shade: #B5C8D3; --storm: #7B90A3;
    --sun: #FFF4D0; --moon: #1C2A38; --moon-dark: #8FA9C4; --drop: 62, 92, 116; --drop-hex: #3E5C74;
    --map-land: #E8EBDD; --map-block: #DFE4D3; --map-road: #FFFFFF; --map-water: #D2E5EE; --map-park: #CBE1C2;
    --bezel: #A8761B;
    color-scheme: light;
}
html[data-theme="evening"] {
    --bg: #2B211B; --bg-top: #3E2E27; --surface: #3A2C24; --surface-raised: #4A3A30; --water: #33271F;
    --text: #F7EAD3; --text-muted: #D6C3A6; --accent: #F3B84B; --accent-ink: #241600; --accent-edge: #F3B84B;
    --border: #55443A; --border-strong: #BCA68B; --legend: #D6C3A6; --focus: #F7EAD3; --rain-light: #D6E0FA;
    --rain-moderate: #92AEF6; --rain-heavy: #5180FB; --rain-heavy-ink: #050A1F; --horizon: #C9B294; --dry: #B09A80;
    --chance: #8CC8B4; --chance-fill: #2F4640; --hatch: #D6C3A6; --sky-top: #3E2E27; --sky-mid: #7A4F37;
    --sky-low: #C9A678; --glow: #F0A650; --cloud-lit: #B58463; --cloud-shade: #4A342B; --storm: #2A1E1A;
    --sun: #FFD58A; --moon: #E8DCC0; --moon-dark: #5A463C; --drop: 232, 216, 192; --drop-hex: #E8D8C0;
    --map-land: #3B2F28; --map-block: #34291F; --map-road: #5A4A3E; --map-water: #2E3F4A; --map-park: #3A4232;
    --bezel: #C99A3C;
    color-scheme: dark;
}
html[data-theme="night"] {
    --bg: #151927; --bg-top: #0E1220; --surface: #1E2335; --surface-raised: #2A3047; --water: #1A2032;
    --text: #ECEAF3; --text-muted: #B5B4C6; --accent: #E9B24C; --accent-ink: #241600; --accent-edge: #E9B24C;
    --border: #343B55; --border-strong: #8A8DA8; --legend: #B5B4C6; --focus: #ECEAF3; --rain-light: #D6E0FA;
    --rain-moderate: #92AEF6; --rain-heavy: #5180FB; --rain-heavy-ink: #050A1F; --horizon: #A9ACC8; --dry: #9A9DB8;
    --chance: #8FCFC4; --chance-fill: #2F4C52; --hatch: #B5B4C6; --sky-top: #0E1220; --sky-mid: #262B44;
    --sky-low: #5C4B66; --glow: #7A6483; --cloud-lit: #4A4362; --cloud-shade: #151A2C; --storm: #0A0D18;
    --sun: #DCE4E1; --moon: #EFEBD6; --moon-dark: #222844; --drop: 174, 185, 214; --drop-hex: #AEB9D6;
    --map-land: #1C2130; --map-block: #181D2B; --map-road: #343B52; --map-water: #1B2A3E; --map-park: #1F2E2F;
    --bezel: #B8913D;
    color-scheme: dark;
}

/* derived from the tokens above (same in every theme). The sky engine (scene.js, scene.css), beta.css and the old
   map pages read the v2 names: they are aliases of the v3 tokens, so no script carries a colour of its own. */
html[data-theme] {
    --band-top: var(--sky-top); --band-mid: var(--sky-mid); --band-mist: var(--sky-low); --band-ink: var(--text);
    --band-muted: var(--text-muted); --band-gold: var(--accent-edge); --band-glow: var(--glow); --band-after: var(--glow);
    --storm-base: var(--storm); --lantern: var(--accent); --water-hi: var(--surface);
    --band: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 62%, var(--sky-low) 100%);
    --status: var(--sky-top);
    --accent-2: color-mix(in srgb, var(--accent) 45%, var(--surface));
}

html { --words: "Kantumruy Pro", system-ui, sans-serif; --nums: "Manrope", "Kantumruy Pro", system-ui, sans-serif;
       --gutter: 16px; --r-ctl: 14px; --tap: 52px;
       --ease-out: cubic-bezier(.215, .61, .355, 1); --ease-in-out: cubic-bezier(.65, 0, .35, 1);
       --t-press: 120ms; --t-ui: 220ms; --t-settle: 380ms; --t-dock: 420ms;
       --above: 56px; --below: 24px; --room: 18px;            /* the timeline: forecast above the water line, observed below */
       background: var(--bg); }

/* ================================================================ base (pages with body.mx) */
/* the redesigned pages no longer load the v1 style.css: its global reset lives here */
body.mx, body.mx *, body.mx *::before, body.mx *::after { box-sizing: border-box; }
body.mx { margin: 0; font: 400 16px/1.55 var(--words); color: var(--text); background: var(--bg);
          -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; -webkit-tap-highlight-color: transparent;
          text-shadow: none; touch-action: manipulation; overflow-x: clip; }
body.mx .cloud, body.mx .ground, body.mx > .sky > .cloud { display: none; }       /* the old pixel world */
body.mx .sky { background: none; padding: 0; min-height: 0; overflow: visible; }
body.mx .khmer { font-family: var(--words); }
body.mx a { color: inherit; }
body.mx [hidden] { display: none !important; }
.num { font-family: var(--nums); font-feature-settings: "tnum" 1, "lnum" 1; }
.muted { color: var(--text-muted); }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
body.mx :focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
html { scroll-padding-bottom: 88px; }                 /* the sticky bottom nav never covers what has focus */
@media (min-width: 900px) { html { scroll-padding-bottom: 0; } }
.skip-link { position: absolute; left: 12px; top: -80px; z-index: 50; padding: 12px 16px; border-radius: 12px; background: var(--accent);
        color: var(--accent-ink); box-shadow: inset 0 0 0 1.5px var(--accent-edge); text-decoration: none; font-weight: 600; }
.skip-link:focus { top: 12px; }
.title, .a1, .login-mx h1 { text-wrap: balance; }
body.mx p, body.mx small { text-wrap: pretty; }
body.mx button:where(:not(.btn-mx)), body.mx input, body.mx select { font: inherit; color: inherit; }
/* style.css gives labels, badges and .btn the old pixel font (no Khmer glyphs): undo it everywhere here */
body.mx label, body.mx .badge, body.mx .btn, body.mx .label, body.mx .big, body.mx th small,
body.mx input, body.mx select, body.mx button, body.mx textarea { font-family: var(--words); letter-spacing: normal; }
body.mx .big.num, body.mx input.num, body.mx select.num { font-family: var(--nums); font-feature-settings: "tnum" 1, "lnum" 1; }

/* ================================================================ the live sky (backdrop) */
/* Behind everything, fixed: the theme's sky. scene.js + scene.css paint the monsoon on it, only over the band (the
   window above the answer plate). These rules are the plain fallback under that. */
body.mx .backdrop { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; background: var(--band); }

/* ================================================================ app frame: sky window + plate, then the sheet */
.mx-app { position: relative; z-index: 1; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; }
.band { position: relative; z-index: 2; color: var(--text); padding: 0 var(--gutter); display: flex; flex-direction: column; }
/* how much live sky shows above the plate: 40 px on a 667 px phone, up to 150 px on a tall one (the plate and the
   timeline come first: nothing important may go under the bottom bar) */
.sky-gap { flex: none; height: clamp(36px, calc(100svh - 630px), 150px); }
.band-day .sky-gap { height: clamp(20px, calc(100svh - 720px), 96px); }

/* the top: solid chips on the sky (words never sit on the bare sky) */
.top { display: flex; align-items: center; gap: 8px; min-height: 60px; padding-top: 8px; }
.tchip { min-height: 44px; display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; border-radius: 999px; text-decoration: none;
        background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--border), 0 4px 14px -6px rgba(0, 0, 0, .35);
        font: 600 14px/1.4 var(--words); }
.brand { min-width: 0; padding-left: 6px; margin-right: auto; }
.brand img { width: 32px; height: 32px; border-radius: 10px; flex: none; }
.brand .hello { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabs-top { display: none; }
.reload-top { width: 44px; padding: 0; justify-content: center; flex: none; }
.reload-top svg { width: 22px; height: 22px; }

/* the ☰ menu: a <details>, so it opens without JavaScript and closes with a second tap */
body.mx .menu { position: relative; padding: 0; text-align: left; flex: none; }
body.mx .menu summary { list-style: none; max-width: 42vw; padding: 0 10px 0 16px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.mx .menu summary::-webkit-details-marker { display: none; }
body.mx .menu summary svg { width: 22px; height: 22px; flex: none; }
body.mx .menu-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; min-width: 248px; padding: 8px; border-radius: 16px;
                    background: var(--surface); color: var(--text); box-shadow: 0 0 0 1.5px var(--bezel), 0 16px 36px -8px rgba(0, 0, 0, .4);
                    border: 0; transform-origin: top right; }
/* style.css (the old pixel look) makes .menu-pop glass with !important; with no --glass here it came out see-through */
body.mx { --glass: var(--surface); --glass-line: var(--border-strong); --shadow: 0 12px 32px rgba(0, 0, 0, .22); }
body.mx .menu-pop { -webkit-backdrop-filter: none; backdrop-filter: none; }
body.mx .menu-pop a { display: flex; align-items: center; min-height: 48px; padding: 0 12px; border-radius: 10px; text-decoration: none; color: var(--text); font-size: 16px; }
body.mx .menu-pop a + a { box-shadow: 0 -1px 0 var(--border); }
body.mx .menu-pop a:hover { background: var(--surface-raised); }
body.mx .menu-pop .who-line { padding: 0; margin: 4px 12px 8px; font: 500 12px/1.4 var(--words); color: var(--text-muted); }
@media (prefers-reduced-motion: no-preference) {
    body.mx .menu[open] .menu-pop { animation: pop-in var(--t-ui) var(--ease-out); }
}
@keyframes pop-in { from { opacity: 0; transform: scale(.96) translateY(-4px); } }

/* ================================================================ the answer plate */
/* Opaque, a 1.5 px brass bezel (A's instrument edge), radius 22. Order: the Khmer line (30/700), the minutes
   (56/800 + unit), the sub line (18/600, its own line), English (14), the minute graph, freshness. The plate is the
   sky's horizon: rain stops on its rim (scene.js). Blend (no radar): A's 0–100 % dial + the big %. */
.plate { position: relative; z-index: 1; padding: 16px 18px 14px; border-radius: 22px; background: var(--surface); color: var(--text);
         box-shadow: 0 0 0 1.5px var(--bezel), 0 14px 30px -18px rgba(0, 0, 0, .55); }
.band > .plate { view-transition-name: plate; }
.plate::after { content: ""; position: absolute; inset: -1.5px; border-radius: 23.5px; pointer-events: none; opacity: 0;
                box-shadow: 0 0 0 3px var(--accent); }
.a1 { margin: 0; font: 700 30px/1.35 var(--words); }
.a-eta { margin: 2px 0 0; display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 10px; }
.a-num { font: 800 56px/1.05 var(--nums); font-feature-settings: "tnum" 1, "lnum" 1; letter-spacing: -.02em; }
.a-unit, .a-lbl { font: 700 24px/1.3 var(--words); }
.a-sub { margin: 2px 0 0; font: 600 18px/1.5 var(--words); }
.a-en { margin: 2px 0 0; font: 400 14px/1.5 var(--words); color: var(--text-muted); }
/* "is it really raining here?" (glance.js): two big buttons under the answer while the radar shows rain on this place */
.ask-here { margin: 12px 0 0; padding: 12px 0 0; border-top: 1px solid var(--border); }
.ask-q { margin: 0; font: 600 17px/1.5 var(--words); }
.ask-en { display: block; font: 400 13px/1.5 var(--words); color: var(--text-muted); }
.ask-btns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 10px 0 0; }
.ask-btns .btn-mx { min-height: 52px; padding: 4px 10px; flex-direction: column; gap: 0; line-height: 1.25; }
.ask-btns .btn-mx [lang="en"] { font: 400 12px/1.3 var(--words); opacity: .85; }
.ask-here[data-done] .ask-btns { display: none; }
.plate .radar-note { margin: 8px 0 0; font: 400 12px/1.5 var(--words); color: var(--text-muted); }
/* while glance.js asks (first ~second, JS only): a quiet "loading", not a flash of the Blend dial then a jump */
.a-wait { display: none; margin: 4px 0; font: 600 20px/1.5 var(--words); color: var(--text-muted); }
html.js .plate[data-state="asking"] .a-wait { display: block; }
html.js .plate[data-state="asking"] .stat, html.js .plate[data-state="asking"] .a-none { display: none; }
.band > .plate[data-state="asking"] { min-height: 150px; }
.a-none { margin: 0; font: 700 24px/1.4 var(--words); }
.a-none span:last-child { display: block; font: 400 14px/1.5 var(--words); color: var(--text-muted); }
/* raining: "ស្ងួតក្នុង" on its own line above the minutes */
.a-eta .a-lbl { flex-basis: 100%; font-size: 20px; line-height: 1.4; color: var(--text-muted); }
.mg-cap { margin: 0 0 2px; font: 600 14px/1.5 var(--words); }
.mg-cap span:not(.khmer) [lang], .mg-cap [lang="en"] { font-weight: 400; color: var(--text-muted); }
.mg-cap .c-chance, .mg-cap .c-where { display: none; }
.mg-cap[data-which="chance"] .c-chance, .mg-cap[data-which="where"] .c-where { display: inline; }
.mg-you-lb { fill: var(--text); font-weight: 700; }
.plate[data-state="raining"] .a1 { font-size: 34px; }

/* Blend (no radar): the chance is the answer, on the barometer */
.stat { display: flex; align-items: center; gap: 14px; }
.stat-line { margin: 0; display: flex; flex-direction: column; }
.stat .big { font: 800 56px/1 var(--nums); font-feature-settings: "tnum" 1, "lnum" 1; letter-spacing: -.02em; white-space: nowrap; }
.stat .big small { font-size: .45em; font-weight: 700; letter-spacing: 0; margin-left: 2px; }
.stat .lbl { display: flex; flex-direction: column; margin-top: 4px; font: 400 14px/1.45 var(--words); color: var(--text-muted); }
.stat .lbl .khmer { font-size: 22px; font-weight: 700; line-height: 1.35; color: var(--text); }
.dial { flex: none; width: 150px; }
.dial-svg { display: block; width: 100%; height: auto; overflow: visible; }
.dl-track { fill: none; stroke: var(--surface-raised); stroke-width: 8; stroke-linecap: round; }
.dl-fill { fill: none; stroke: var(--chance); stroke-width: 8; stroke-linecap: round; }
.dl-tk { stroke: var(--text-muted); stroke-width: 1.5; stroke-linecap: round; }
.dl-tk.major { stroke: var(--text); stroke-width: 2.4; }
.dl-lb { font: 600 12px/1 var(--nums); fill: var(--text-muted); }
.dl-needle { fill: var(--accent); stroke: var(--accent-edge); stroke-width: 1.5; transform: rotate(var(--a)); }
@media (prefers-reduced-motion: no-preference) { html:not(.still) .dl-needle { animation: needle 700ms var(--ease-out) 200ms both; } }
@keyframes needle { from { transform: rotate(-60deg); } }

/* the minute graph (glance.js): chance of rain over the next 90 min, one label row under the axis */
.mg { margin: 10px -4px 0; }
.mg-svg { display: block; width: 100%; height: auto; overflow: visible; }
.mg-win { fill: var(--surface-raised); }
.mg-area { fill: var(--chance-fill); }
.mg-line { fill: none; stroke: var(--chance); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.mg-axis { stroke: var(--horizon); stroke-width: 2; }
.mg-now { fill: var(--accent); stroke: var(--accent-edge); stroke-width: 1.5; }
.mg-mark { stroke: var(--text); stroke-width: 2.5; }
.mg-tri { fill: var(--text); }
.mg-pk { font: 700 12px/1 var(--nums); fill: var(--text); paint-order: stroke; stroke: var(--surface); stroke-width: 3px; }
.mg-lb { font: 600 12px/1 var(--nums); fill: var(--text-muted); }
.mg-lb.kh { font-family: var(--words); }
.mg-blob { fill: var(--rain-moderate); }
.mg-core { fill: var(--rain-heavy); stroke: var(--surface); stroke-width: 1.5; }
.mg-you { fill: var(--accent); stroke: var(--accent-edge); stroke-width: 2.5; }
.mg-cover { fill: var(--surface); transform-box: fill-box; transform-origin: 100% 50%; }
@media (prefers-reduced-motion: no-preference) { html:not(.still) .mg-cover { animation: unveil 700ms var(--ease-in-out) 120ms both; } }
@keyframes unveil { to { transform: scaleX(0); } }

/* Today's compact answer, inside the title plate */
.plate-mini { padding: 10px 0 0; margin-top: 12px; border-radius: 0; background: none; box-shadow: inset 0 1px 0 var(--border); }
.plate-mini::after { display: none; }
.plate-mini .a1 { font-size: 20px; }
.plate-mini .a-num { font-size: 30px; }
.plate-mini .a-unit, .plate-mini .a-lbl { font-size: 18px; }
.plate-mini .a-sub { font-size: 16px; }
.plate-mini .stat .big { font-size: 30px; }
.plate-mini .stat .lbl .khmer { font-size: 16px; }
.plate-mini .stat-line { flex-direction: row; align-items: center; gap: 12px; }

/* ================================================================ the sheet: the timeline on the water, then detail */
.sheet-mx { position: relative; flex: 1 0 auto; background: var(--bg); padding: 30px var(--gutter) 32px; }
.water { position: absolute; left: 0; right: 0; top: -13px; height: 14px; overflow: hidden; pointer-events: none; }
.water i { position: absolute; top: 0; left: 0; bottom: 0; width: calc(100% + 400px); display: block;
           -webkit-mask: var(--wave) repeat-x 0 0 / 400px 14px; mask: var(--wave) repeat-x 0 0 / 400px 14px; }
.water i:first-child { --wave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='14' viewBox='0 0 400 14'%3E%3Cpath d='M0 7Q45 3 100 6.5Q150 10 200 7Q260 4 310 7.5Q360 10.5 400 7V14H0Z'/%3E%3C/svg%3E");
                       background: var(--water); }
.water i + i { --wave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='14' viewBox='0 0 400 14'%3E%3Cpath d='M0 7Q45 3 100 6.5Q150 10 200 7Q260 4 310 7.5Q360 10.5 400 7' fill='none' stroke='%23000' stroke-width='1.4'/%3E%3C/svg%3E");
               background: var(--horizon); opacity: .35; }
@media (prefers-reduced-motion: no-preference) {
    html:not(.still) .water i { animation: lap 14s linear infinite; }
}
@keyframes lap { to { transform: translate3d(-400px, 0, 0); } }
/* the plate overlaps the water a little, as if it stood in it */
.band > .plate { margin-bottom: -14px; }
.horizon { margin: -30px calc(-1 * var(--gutter)) 0; padding: 24px var(--gutter) 12px; background: var(--water); }

/* ================================================================ the day as a river line */
/* Hours to come rise above the water line (forecast: full colour + a light hatch in the water's colour, as the
   map hatches its forecast frames); hours gone hang below it, shorter and dimmed ("past"). Dry = a dash.
   timeline.js adds the readout (.rb-read), the cursor (.rb-cursor: a ring on the water line, never over a bar)
   and one invisible range input over the whole plot (drag anywhere). scene.js reads .bars > * and .nowline. */
.ribbon { position: relative; }
.rb-read { margin: 0 0 4px; min-height: 26px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font: 700 16px/1.5 var(--words); }
.rb-read .rb-t, .rb-read .rb-v { font-family: var(--nums); font-feature-settings: "tnum" 1, "lnum" 1; }
.rb-read .rb-v { font-weight: 600; color: var(--text-muted); }
.rb-read::after { margin-left: auto; font: 600 12px/1.5 var(--words); color: var(--text-muted); }
.rb-read[data-kind="future"]::after { content: "ព្យាករណ៍"; }
.rb-read[data-kind="past"]::after { content: "កន្លងទៅ"; }   /* "past": earlier hours are forecasts too, not measurements */
.rb-read[data-kind="now"]::after { content: "ឥឡូវ"; color: var(--text); }
.plot { position: relative; height: calc(var(--room) + var(--above) + var(--below)); }
.plot::after { content: ""; position: absolute; left: 0; right: 0; top: calc(var(--room) + var(--above) - 1px); height: 2.5px; border-radius: 2px;
               background: var(--horizon); pointer-events: none; }
.mm-ref { position: absolute; inset: var(--room) 0 auto 0; height: var(--above); pointer-events: none; }
.mm-ref span { position: absolute; left: 0; right: 0; border-top: 1px dashed color-mix(in srgb, var(--border-strong) 55%, transparent);
               font: 600 12px/1 var(--nums); color: var(--text-muted); text-align: right; padding-top: 2px; }
.mm-ref span:nth-child(1) { top: 0; } .mm-ref span:nth-child(2) { top: 50%; }
.kind-lbl { position: absolute; left: 0; top: var(--room); height: calc(var(--above) + var(--below)); pointer-events: none; z-index: 1; }
.kind-lbl span { position: absolute; left: 0; font: 600 12px/1 var(--words); color: var(--text-muted); white-space: nowrap;
                 padding: 2px 4px 2px 0; background: var(--water); }
.kind-lbl .fc { bottom: calc(var(--below) + 6px); }
.kind-lbl .ob { top: calc(var(--above) + 5px); }
.ribbon:has(.rb-input) .kind-lbl { opacity: .9; }
.bars { position: absolute; left: 0; right: 0; top: var(--room); height: calc(var(--above) + var(--below));
        display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); gap: 2px; }
.bars > * { position: relative; display: block; height: 100%; }
.bars i { position: absolute; left: 0; right: 0; bottom: calc(var(--below) + 1px); height: max(5px, calc(var(--h, 0) * var(--above)));
          border-radius: 3px 3px 1px 1px; transform-origin: 50% 100%;
          background-image: repeating-linear-gradient(135deg, transparent 0 4px, color-mix(in srgb, var(--water) 40%, transparent) 4px 6px); }
.bars .light i { background-color: var(--rain-light); } .bars .medium i { background-color: var(--rain-moderate); } .bars .heavy i { background-color: var(--rain-heavy); }
.bars .past i { bottom: auto; top: calc(var(--above) + 2px); height: max(4px, calc(var(--h, 0) * var(--below))); border-radius: 1px 1px 3px 3px;
                background-image: none; opacity: .55; transform-origin: 50% 0; }
.bars .dry i { left: 25%; right: 25%; height: 3px; border-radius: 2px; background: var(--dry); background-image: none; bottom: calc(var(--below) + 4px); }
.bars .dry.past i { top: calc(var(--above) + 4px); bottom: auto; opacity: .55; }
.bars .is-sel i { box-shadow: 0 0 0 2px var(--water), 0 0 0 4px var(--text); }
.bars a:focus-visible { outline-offset: 0; }
@media (prefers-reduced-motion: no-preference) {
    html:not(.still) .bars i { animation: rise var(--t-dock) var(--ease-out) both; animation-delay: calc(80ms + var(--i, 0) * 14ms); }
}
@keyframes rise { from { transform: scaleY(0); } }
.nowline { position: absolute; top: 0; height: calc(var(--room) + var(--above) + var(--below)); width: 2px; border-radius: 1px;
           background: var(--accent-edge); pointer-events: none; z-index: 1; }
.now-chip { position: absolute; top: -2px; left: 50%; transform: translateX(-50%); padding: 0 8px; border-radius: 6px;
            background: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 1px var(--accent-edge);
            font: 700 12px/20px var(--words); white-space: nowrap; }
.nowline.at-start .now-chip { left: -1px; transform: none; }
.nowline.at-end .now-chip { left: auto; right: -1px; transform: none; }
.rb-cursor { position: absolute; left: 0; top: var(--room); height: calc(var(--above) + var(--below)); width: 0; pointer-events: none; z-index: 2;
             transition: transform 160ms var(--ease-out); }
.rb-cursor::before { content: ""; position: absolute; left: -1px; top: 0; bottom: 0; width: 2px; background: var(--text); opacity: 0; }
.rb-cursor i { position: absolute; left: -15px; top: calc(var(--above) - 15px); width: 30px; height: 30px; border-radius: 50%;
               border: 3px solid var(--accent-edge); background: var(--surface); box-shadow: 0 2px 8px -2px rgba(0, 0, 0, .35);
               display: grid; place-items: center; font: 700 12px/1 var(--nums); color: var(--text); }
.rb-cursor i::before { content: "‹ ›"; letter-spacing: 1px; transform: translateY(-1px); }
.rb-read.can-jump { cursor: pointer; }
.rb-read.can-jump .rb-t { text-decoration: underline dotted 1.5px; text-underline-offset: 4px; }
.ribbon[data-scrub="1"] .rb-cursor { transition: none; }
.ribbon[data-scrub="1"] .rb-cursor::before { opacity: .55; }
.rb-input { position: absolute; inset: 0; z-index: 3; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; touch-action: pan-y; }
.ribbon:has(.rb-input:focus-visible) .plot { outline: 3px solid var(--focus); outline-offset: 4px; border-radius: 8px; }
.ticks { position: relative; height: 18px; margin-top: 4px; font: 600 12px/1.4 var(--nums); color: var(--text-muted); }
.ticks span { position: absolute; top: 0; transform: translateX(-50%); }
.ticks span:nth-child(1) { left: 0; transform: none; } .ticks span:nth-child(2) { left: 25%; } .ticks span:nth-child(3) { left: 50%; }
.ticks span:nth-child(4) { left: 75%; } .ticks span:nth-child(5) { left: 100%; transform: translateX(-100%); }
tr.flash, .hrow.flash { animation: none; }
@media (prefers-reduced-motion: no-preference) { html:not(.still) .hrow.flash { animation: rowflash 1200ms var(--ease-out); } }
@keyframes rowflash { from { box-shadow: inset 0 0 0 3px var(--accent); } }

/* the legend: the one rain scale (+ under home's timeline, what each side of the water line means) */
body.mx .legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 10px 0 0; padding: 0; border: 0; font: 400 14px/1.45 var(--words); color: var(--legend); }
body.mx .legend > span { display: inline-flex; align-items: center; gap: 8px; }
body.mx .legend i { display: inline-block; width: 22px; height: 12px; border-radius: 6px; }
.legend i.light { background: var(--rain-light); } .legend i.medium { background: var(--rain-moderate); } .legend i.heavy { background: var(--rain-heavy); }
.legend .sw { display: inline-block; width: 18px; height: 12px; border-radius: 3px; }
.legend .sw.fc { background: var(--text-muted) repeating-linear-gradient(135deg, transparent 0 3px, var(--water) 3px 5px); }
.legend .sw.ob { background: var(--text-muted); opacity: .55; }

/* short phones (375 × 667): the answer and the whole timeline first; the sky shrinks, the kinds key goes (the readout
   already says ព្យាករណ៍ / កន្លងទៅ) */
@media (max-width: 899.98px) and (max-height: 720px) {
    .sky-gap { height: 20px; }
    body.mx .legend > .kind { display: none; }
}

/* ================================================================ home: the four destinations */
.dest { display: grid; gap: 10px; margin-top: 18px; }
.day-row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto 22px; align-items: center; column-gap: 12px; row-gap: 2px;
           min-height: 64px; padding: 12px 14px 12px 16px; border-radius: 18px; text-decoration: none; background: var(--surface);
           box-shadow: 0 0 0 1px var(--border); }
.day-row .nm { grid-column: 1; display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.day-row .nm b { font: 700 22px/1.35 var(--words); }
.day-row .nm small, .row-link small { font: 400 14px/1.4 var(--words); color: var(--text-muted); }
.day-row .fact { grid-column: 2; display: flex; align-items: baseline; gap: 10px; }
.day-row .blk { font: 600 16px/1.3 var(--nums); color: var(--text-muted); }
.day-row .pct { font: 800 34px/1 var(--nums); letter-spacing: -.02em; }
.day-row .pct small { font-size: .5em; font-weight: 700; letter-spacing: 0; margin-left: 1px; }
.day-row .sum { grid-column: 1 / 3; display: flex; align-items: center; gap: 8px; font: 600 16px/1.45 var(--words); }
.day-row .sum i { width: 14px; height: 14px; border-radius: 4px; flex: none; }
.day-row .sum .light { background: var(--rain-light); } .day-row .sum .medium { background: var(--rain-moderate); } .day-row .sum .heavy { background: var(--rain-heavy); }
.day-row > svg { grid-column: 3; grid-row: 1 / span 3; width: 22px; height: 22px; color: var(--text-muted); }
.daystrip { grid-column: 1 / 3; display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); gap: 1.5px; align-items: end; height: 20px; margin-top: 4px;
         box-shadow: 0 1.5px 0 var(--border); }
.daystrip i { display: block; height: max(2px, calc(var(--h, 0) * 100%)); border-radius: 1.5px 1.5px 0 0; }
.daystrip .light { background: var(--rain-light); } .daystrip .medium { background: var(--rain-moderate); } .daystrip .heavy { background: var(--rain-heavy); }
.daystrip .dry { height: 2px; background: var(--border-strong); opacity: .5; }
.daystrip .past { opacity: .4; }
.daystrip .is-now { box-shadow: 0 -3px 0 var(--accent-edge) inset, 0 0 0 1px var(--accent-edge); }
.rows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.rows > .wide { grid-column: 1 / -1; }   /* Ask Monsoony: the whole width, above the two */
/* "ask Monsoony about this" (the _mx.ask chip): his face + a question, on the day plates */
.ask-mny { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 8px 14px 8px 8px; min-height: 48px; border-radius: 16px;
           text-decoration: none; color: var(--text); background: var(--surface-raised); box-shadow: inset 0 0 0 1px var(--border); }
.ask-mny img { width: 30px; height: 30px; flex: none; }
.ask-mny span { display: flex; flex-direction: column; min-width: 0; }
.ask-mny b { font: 600 15px/1.4 var(--words); }
.ask-mny small { font: 400 12px/1.4 var(--words); color: var(--text-muted); }
.ask-mny:active { transform: scale(.98); }
.row-link .mny-face-sm { width: 40px; height: 40px; flex: none; margin: -4px 0; }
.row-link { display: flex; align-items: center; gap: 10px; min-height: 64px; padding: 8px 12px; border-radius: 18px; text-decoration: none;
            background: var(--surface); box-shadow: 0 0 0 1px var(--border); }
.row-link > span { display: flex; flex-direction: column; min-width: 0; margin-right: auto; }
.row-link b { font: 600 17px/1.45 var(--words); }
.row-link svg { width: 22px; height: 22px; flex: none; color: var(--text-muted); }
.row-link > svg:first-child { color: var(--accent-edge); }
.day-row, .row-link, .btn-mx { transition: transform var(--t-press) var(--ease-out); }
.day-row:active, .row-link:active, .btn-mx:active { transform: scale(.98); }

/* ================================================================ Today / Tomorrow: the title plate, the hour table */
.day-plate .title { margin: 0; font: 700 30px/1.35 var(--words); display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 12px; }
.day-plate .title small { font: 600 16px/1.4 var(--nums); color: var(--text-muted); white-space: nowrap; }
.peak { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 6px; }
.peak p { margin: 0; font: 600 18px/1.5 var(--words); max-width: 15em; }
.peak p b { font: 800 18px/1.2 var(--nums); white-space: nowrap; }
.peak p .when { display: block; font: 800 24px/1.25 var(--nums); letter-spacing: -.01em; white-space: nowrap; }
.peak p .top { display: block; font: 500 15px/1.5 var(--words); color: var(--text-muted); }
.peak p .top b { font: 700 15px/1.2 var(--nums); color: var(--text); }
.peak .pct { font: 800 48px/1 var(--nums); letter-spacing: -.02em; white-space: nowrap; }
.peak .pct small { font-size: .45em; font-weight: 700; letter-spacing: 0; margin-left: 2px; }
.peak.calm p { font: 500 16px/1.5 var(--words); max-width: none; }
.table-title { margin: 28px 0 12px; font: 600 20px/1.45 var(--words); }
.table-title small { display: block; font: 400 14px/1.45 var(--words); color: var(--text-muted); }
.tbl { background: var(--surface); border-radius: 18px; overflow: hidden; box-shadow: 0 0 0 1px var(--border); }
/* time | chance of rain | mm if it rains (number + tube) | light / medium / heavy | ask Monsoony */
.hrow { display: grid; grid-template-columns: 62px 44px minmax(0, 1fr) 64px 34px; gap: 8px; align-items: center; padding: 0 14px; scroll-margin-top: 80px; }
.hrow + .hrow { box-shadow: inset 0 1px 0 var(--border); }
.hrow.head { min-height: 56px; padding-top: 6px; padding-bottom: 6px; background: var(--surface-raised); }
.hrow.head > span { display: flex; flex-direction: column; font: 600 14px/1.4 var(--words); }
.hrow.head small { font: 500 12px/1.3 var(--words); color: var(--text-muted); }
.hrow .t { display: flex; align-items: center; gap: 6px; font: 500 16px/1.3 var(--nums); font-feature-settings: "tnum" 1, "lnum" 1; white-space: nowrap; }
.nowtag { padding: 3px 6px; border-radius: 6px; background: var(--accent); color: var(--accent-ink); box-shadow: inset 0 0 0 1px var(--accent-edge);
          font: 700 12px/1.4 var(--words); }
/* "now" sits under the hour, so the time column stays narrow enough for the chance beside it */
.hrow.is-now .t { flex-direction: column; align-items: flex-start; gap: 2px; padding: 6px 0; }
.pc { justify-self: end; font: 700 16px/1.3 var(--nums); font-feature-settings: "tnum" 1, "lnum" 1; white-space: nowrap; }
.pc small { margin-left: 1px; font: 500 12px/1 var(--nums); color: var(--text-muted); }
.hrow.dry .pc { font-weight: 500; font-size: 14px; color: var(--text-muted); }
.hrow.head .pc-h { align-items: flex-end; }
.hrow.wet { min-height: 52px; }
.hrow.dry { min-height: 40px; }
.hrow.dry .t { font-size: 14px; color: var(--text-muted); }
.hrow.is-now { box-shadow: inset 4px 0 0 var(--accent-edge); }
.ask-hour { display: grid; place-items: center; width: 44px; height: 44px; margin: -6px -8px -6px -10px; border-radius: 50%; flex: none; }
.ask-hour img { width: 26px; height: 26px; }
.ask-hour:active { transform: scale(.92); }
.hrow.is-now + .hrow { box-shadow: inset 0 1px 0 var(--border); }
.hrow + .hrow.is-now { box-shadow: inset 4px 0 0 var(--accent-edge), inset 0 1px 0 var(--border); }
.amt { display: flex; align-items: center; gap: 8px; min-width: 0; font: 600 16px/1 var(--nums); font-feature-settings: "tnum" 1, "lnum" 1; }
.hrow.wet .amt { display: grid; grid-template-columns: 2.2em minmax(0, 1fr); }
.amt .v { text-align: right; }
.hrow.dry .amt { color: var(--text-muted); font-weight: 500; display: grid; grid-template-columns: 2.2em minmax(0, 1fr); justify-items: end; }
.hrow.dry .amt i { display: block; width: 14px; height: 2px; border-radius: 1px; background: var(--border-strong); opacity: .7; }
/* the tube: a track with a fill in proportion to the mm (10 mm = full), so 0.3, 0.8 and 1.4 mm differ */
.tube { position: relative; display: block; height: 14px; min-width: 0; border-radius: 7px;
        box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--border-strong) 45%, var(--border)); }
.tube i { position: absolute; left: 2px; top: 2px; bottom: 2px; width: max(3px, calc((100% - 4px) * var(--w, 0))); border-radius: 5px; transform-origin: 0 50%; }
.light .amt i { background: var(--rain-light); }
.medium .amt i { background: var(--rain-moderate); }
.heavy .amt i { background: var(--rain-heavy); }
@media (prefers-reduced-motion: no-preference) {
    html:not(.still) .tube i { animation: fillx 320ms var(--ease-out) both; animation-delay: 160ms; }
}
@keyframes fillx { from { transform: scaleX(0); } }
.lvl { font: 400 16px/1.45 var(--words); justify-self: start; }
.hrow.medium .lvl { font-weight: 600; }
.hrow.heavy .lvl { font-weight: 700; padding: 1px 10px; border-radius: 8px; background: var(--rain-heavy); color: var(--rain-heavy-ink); }
.hrow:target { background: var(--surface-raised); }
@media (max-width: 359px) {     /* the smallest phones: the number says the mm, the tube has no room left */
    .hrow { grid-template-columns: 56px 40px minmax(0, 1fr) 58px 30px; gap: 6px; padding: 0 10px; }
    .hrow.wet .amt { grid-template-columns: minmax(0, 1fr); }
    .hrow .tube { display: none; }
    .amt .v { text-align: left; }
}
.foot { margin: 24px 0 0; font: 400 12px/1.5 var(--words); color: var(--text-muted); }
.notice { margin: 24px 0 8px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.notice svg { width: 40px; height: 40px; color: var(--text-muted); }
.notice b { font-size: 20px; font-weight: 600; }

/* ================================================================ buttons, fields */
.btn-mx { min-height: 56px; padding: 0 20px; border-radius: var(--r-ctl); display: inline-flex; align-items: center; justify-content: center; gap: 10px;
          font: 600 16px/1.4 var(--words); text-decoration: none; cursor: pointer; color: var(--text); background: var(--surface);
          border: 1.5px solid var(--border-strong); }
.btn-mx.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent-edge); }
.btn-mx svg { width: 22px; height: 22px; flex: none; }
.btn-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 24px; }
.btn-pair .btn-mx { min-height: 60px; padding: 0 12px; }

/* bottom navigation: four big labelled buttons, always visible on phones; the current page wears the gold */
.nav-mx { position: sticky; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); background: var(--surface);
          box-shadow: 0 -1px 0 var(--border); padding: 0 6px env(safe-area-inset-bottom); view-transition-name: nav; }
.nav-mx a { position: relative; min-height: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
            text-decoration: none; color: var(--text-muted); font: 500 14px/1.4 var(--words); }
.nav-mx .ico { display: grid; place-items: center; width: 52px; height: 30px; border-radius: 15px; }
.nav-mx svg { width: 24px; height: 24px; }
.nav-mx .nav-face { width: 26px; height: 26px; }
.nav-mx .ico { width: 48px; }
.nav-mx a[aria-current="page"] { color: var(--text); font-weight: 700; }
.nav-mx a[aria-current="page"] .ico { background: var(--accent); color: var(--accent-ink); box-shadow: inset 0 0 0 1.5px var(--accent-edge); }
.nav-mx a[aria-current="page"]::before { content: ""; position: absolute; top: 0; left: 26%; right: 26%; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent-edge); }

.field { display: grid; gap: 6px; font-size: 16px; }
.field small { font-size: 14px; color: var(--text-muted); }
.field input, .field select { height: var(--tap); width: 100%; min-width: 0; padding: 0 16px; border-radius: var(--r-ctl); font: 400 17px var(--words);
          color: var(--text); background: var(--surface); border: 1.5px solid var(--border-strong); }
.field input:focus-visible, .field select:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.err-mx { display: flex; gap: 10px; margin: 0; font-size: 16px; }
.err-mx svg { width: 20px; height: 20px; flex: none; margin-top: 3px; }

/* shared with the map pages (sky.html has its own .menu-pop and .legend; the map section below restyles them):
   these generic rules are the v1 ones, unchanged; body.mx pages override them above */
.menu-pop { position: absolute; right: 0; top: 56px; z-index: 30; min-width: 240px; padding: 6px; border-radius: 18px;
            background: var(--surface); border: 1px solid var(--border); box-shadow: 0 12px 32px rgba(0, 0, 0, .18); }
.menu-pop a { display: flex; align-items: center; min-height: 48px; padding: 0 14px; border-radius: 12px; text-decoration: none; color: var(--text); font-size: 16px; }
.menu-pop a:hover { background: var(--surface-raised); }
.menu-pop .who-line { padding: 8px 14px 6px; font-size: 14px; color: var(--text-muted); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 2px; padding: 14px 0 4px; border-top: 1px solid var(--border); font-size: 14px; color: var(--legend); }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend i { display: inline-block; width: 22px; height: 10px; border-radius: 99px; }

/* ================================================================ login */
/* A's emblem on the sky (the gecko, Monsoon, the barometer at rest), the form on a plate low on the screen where
   the thumb is. Desktop: sky left, form right. */
.login-mx { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; }
.login-mx .band { flex: 1 0 auto; min-height: 260px; justify-content: flex-end; align-items: center; padding: 48px 24px 28px; }
.emblem { display: grid; justify-items: center; gap: 6px; padding: 18px 26px 14px; border-radius: 26px; text-align: center;
          background: var(--surface); box-shadow: 0 0 0 1.5px var(--bezel), 0 14px 30px -18px rgba(0, 0, 0, .55); }
.emblem img { display: block; width: 56px; height: 56px; border-radius: 16px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .08); }
.login-mx h1 { margin: 2px 0 0; font: 800 30px/1.2 var(--nums); letter-spacing: -.01em; }
.emblem .dial { width: 168px; }
.login-mx .tag { margin: 0; font: 600 16px/1.5 var(--words); color: var(--text-muted); }
.login-mx form { flex: 0 0 auto; display: grid; align-content: start; gap: 18px; margin: 0; background: var(--bg);
                 padding: 28px 20px calc(32px + env(safe-area-inset-bottom)); }
.login-mx .field { gap: 8px; }
.login-mx .field > span { font: 600 16px/1.45 var(--words); }
.login-mx .field > span small { font: 400 14px/1.45 var(--words); color: var(--text-muted); }
.login-mx .field input { height: 56px; font-size: 17px; }
.login-mx .field input[aria-invalid="true"] { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
.login-mx .err-mx { align-items: flex-start; padding: 12px 16px; border-radius: 14px; background: var(--surface-raised);
                    box-shadow: inset 4px 0 0 var(--text); font: 500 16px/1.5 var(--words); }
body.mx .login-mx button.btn-mx { min-height: 56px; margin-top: 4px; font: 600 17px/1.4 var(--words); }
@media (prefers-reduced-motion: no-preference) { .login-mx form.shake { animation: shake 300ms var(--ease-out); } }
@keyframes shake { 25% { transform: translateX(-6px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }
@media (min-width: 900px) {
    .login-mx { flex-direction: row; }
    .login-mx .band { flex: 1.2 1 0; min-height: 0; justify-content: center; padding: 64px; }
    .login-mx form { flex: 1 1 0; max-width: 560px; align-content: center; padding: 64px; box-shadow: -1px 0 0 var(--border); }
}

/* ================================================================ motion: one reading order (answer → day → detail) */
@media (prefers-reduced-motion: no-preference) {
    html:not(.still) .band > .plate { animation: settle var(--t-settle) var(--ease-out) both; }
    html:not(.still) .plate.settle .a-live, html:not(.still) .plate.settle .a-sub { animation: resettle var(--t-settle) var(--ease-out) both; }
    html:not(.still) .dest > *, html:not(.still) .sheet-mx > .tbl, html:not(.still) .sheet-mx > .table-title { animation: dock var(--t-dock) var(--ease-out) both; animation-delay: 260ms; }
    html:not(.still) .dest > :nth-child(2) { animation-delay: 300ms; }
    html:not(.still) .dest > :nth-child(3) { animation-delay: 340ms; }
    html.rain-beat .band > .plate::after { animation: beat 1600ms var(--ease-out); }
    html.rain-beat .plate .a1 { animation: settle 600ms var(--ease-out); }
}
@keyframes settle { from { opacity: 0; transform: translateY(8px); } }
@keyframes resettle { from { opacity: 0; transform: translateY(6px); } }
@keyframes dock { from { opacity: 0; transform: translateY(12px); } }
@keyframes beat { 0% { opacity: .95; transform: scale(1); } 100% { opacity: 0; transform: scale(1.035); } }

/* page to page (home ↔ Today ↔ Tomorrow): the plate morphs, the bottom bar stays, the rest cross-fades */
@media (prefers-reduced-motion: no-preference) { @view-transition { navigation: auto; } }
::view-transition-group(plate) { animation-duration: 320ms; animation-timing-function: var(--ease-out); }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 220ms; }

/* ================================================================ wide screens: sky + plate left (sticky), the day right */
@media (min-width: 900px) {
    .mx-app.split { display: grid; grid-template-columns: minmax(400px, 42%) minmax(0, 1fr); }
    .mx-app.split > .band { --gutter: 40px; position: sticky; top: 0; height: 100vh; height: 100svh; min-height: 0;
                            overflow: auto; overflow-x: hidden; padding-bottom: 40px; }
    .mx-app.split > .band .sky-gap { flex: none; height: clamp(90px, 24vh, 240px); }
    .band > .plate { margin-bottom: 0; }
    .mx-app.split > .sheet-mx { padding: 40px 48px 64px; box-shadow: -1px 0 0 var(--border); }
    .mx-app.split > .sheet-mx > * { max-width: 680px; }
    .sheet-mx > .horizon { margin: 0; padding: 20px 20px 16px; border-radius: 22px; }
    .water { display: none; }
    .mx-app .nav-mx { display: none; }
    .top { flex-wrap: wrap; padding-top: 16px; }
    .tabs-top { display: flex; gap: 6px; order: 3; width: 100%; margin: 8px 0 0; }
    .tabs-top a { min-height: 44px; padding: 0 16px; border-radius: 999px; display: inline-flex; align-items: center; text-decoration: none;
                  background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--border); font: 500 16px/1.4 var(--words); white-space: nowrap; }
    .tabs-top a[aria-current="page"] { color: var(--accent-ink); background: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent-edge); font-weight: 700; }
    .reload-top { order: 1; } .top .menu { order: 2; }
    .a1 { font-size: 34px; }
    .a-num { font-size: 64px; }
}

/* ================================================================ theme cross-fade (ui.js adds .theme-fading for 2 s) */
/* The one documented exception to "transform / opacity only": colours ease over 2 s when the sun crosses a boundary. */
html.theme-fading body.mx, html.theme-fading body.mx * {
    transition: background-color 2s ease, color 2s ease, border-color 2s ease, fill 2s ease, box-shadow 2s ease !important; }
.theme-veil { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

/* ================================================================ motion off: screenshots (html.still) and reduced motion */
html.still body.mx *, html.still body.mx *::before, html.still body.mx *::after { animation: none !important; transition: none !important; }
html.still .nav-mx { position: relative; }
html.still::view-transition-group(*), html.still::view-transition-old(*), html.still::view-transition-new(*) { animation: none !important; }
@media (prefers-reduced-motion: reduce) {
    body.mx *, body.mx *::before, body.mx *::after { animation: none !important; transition: none !important; }
    .btn-mx:active, .day-row:active, .row-link:active { transform: none; }
    ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* ================================================================ map pages (Sky: templates/sky.html, Radar check)
   The map stays the star. Floating controls are solid theme cards (--surface, a hairline, one soft shadow; no
   frosted glass), the bottom panel is the sheet (--bg; on phones its top edge is the water line, as on every page),
   words use the Khmer face, numbers Manrope, gold marks what is on / now / the main action. The street map takes
   the theme (dim and inverted at night, warm in the evening). The radar's own colours, the satellite swatches and
   the HOW TO READ text are unchanged: the Khmer legend names those colours. Layout comes from style.css. */
body.sky-page, body.compare-page { --glass: var(--surface); --glass-line: var(--border); --ink: var(--text); --muted: var(--text-muted);
    --soft: var(--surface-raised); --shadow: 0 0 0 1px var(--border), 0 6px 20px rgba(0, 0, 0, .16);
    background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
body.sky-page .sky, body.compare-page .sky { background: var(--bg) !important; padding: 0; min-height: 0; }
body.sky-page *, body.compare-page * { font-family: var(--words) !important; letter-spacing: normal !important; text-shadow: none; }
body.sky-page #frame-time, body.sky-page .chip b, body.sky-page .chip small, body.sky-page .marks b, body.sky-page .unit,
body.sky-page .strip-table td, body.sky-page .strip-table .hrs th, body.sky-page .strip-table .gecko b, body.sky-page #speed,
body.sky-page .scale-bar span, body.sky-page .pill-row b {
    font-family: var(--nums) !important; font-feature-settings: "tnum" 1, "lnum" 1; }

/* ---- floating controls: one card language ---- */
body.sky-page .glassy, body.sky-page .search, body.sky-page .round, body.sky-page .layer-menu, body.sky-page .rainpill,
body.sky-page .menu-pop, body.sky-page .loading, body.sky-page .results, body.sky-page .leaflet-bar,
body.sky-page .pick-popup .leaflet-popup-content-wrapper, body.compare-page .leaflet-bar {
    -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
    background: var(--surface) !important; color: var(--text); border: 0 !important; box-shadow: var(--shadow) !important; }
body.sky-page .pick-popup .leaflet-popup-tip { background: var(--surface); box-shadow: none; }
body.sky-page .search { height: 52px; border-radius: 26px; padding: 0 4px 0 8px; }
body.sky-page .search-logo { width: 36px; height: 36px; border-radius: 11px; }
body.sky-page .search input { color: var(--text); font: 400 16px/1.4 var(--words) !important; }
body.sky-page .search input::placeholder { color: var(--text-muted); opacity: 1; }
body.sky-page .search-go { width: 44px; height: 44px; border-radius: 22px; color: var(--text-muted); }
body.sky-page .results button { min-height: 44px; color: var(--text); font: 400 16px/1.4 var(--words); }
body.sky-page .results button:hover, body.sky-page .results button:focus { background: var(--surface-raised); }
body.sky-page .results span, body.sky-page .results small, body.sky-page .results .muted, body.sky-page .strip .muted { color: var(--text-muted); }
body.sky-page .results small { font-size: 14px; }
body.sky-page .round { width: 52px; height: 52px; border-radius: 26px; color: var(--text); }
body.sky-page .round.locate { color: var(--text); }
body.sky-page .round.on, body.sky-page .lyr.on { background: var(--accent) !important; color: var(--accent-ink) !important;
    box-shadow: inset 0 0 0 1.5px var(--accent-edge), var(--shadow) !important; }
body.sky-page .layer-menu { padding: 4px; border-radius: 22px; }
body.sky-page .lyr { width: 56px; height: 56px; border-radius: 18px; color: var(--text); background: transparent; transition: transform 200ms var(--ease-out); }
body.sky-page .layer-menu .lyr.on { box-shadow: inset 0 0 0 1.5px var(--accent-edge) !important; }
body.sky-page .lyr small { font: 500 12px/1.4 var(--words) !important; color: var(--text-muted); }
body.sky-page .lyr.on small { color: var(--accent-ink) !important; font-weight: 600 !important; }
body.sky-page .menu-pop { padding: 8px; border-radius: 16px; min-width: 248px; }
body.sky-page .menu-pop a { min-height: 48px; display: flex; align-items: center; padding: 0 12px; border-radius: 10px;
    color: var(--text); font: 400 16px/1.4 var(--words) !important; }
body.sky-page .menu-pop a + a { box-shadow: 0 -1px 0 var(--border); }
body.sky-page .menu-pop a:hover, body.sky-page .menu-pop a:focus { background: var(--surface-raised); }
body.sky-page .menu-pop a.danger { color: var(--text); }
body.sky-page .loading { padding: 10px 18px; font: 500 14px/1.4 var(--words) !important; color: var(--text); }
body.sky-page .loading, body.sky-page #frame-time { white-space: normal; overflow: visible; text-overflow: clip; }   /* status lines wrap, never cut */

/* the rain pill: one line under the search, its dot on the rain scale (dry = neutral) */
body.sky-page .rainpill { border-radius: 22px; }
body.sky-page .pill-head { min-height: 48px; padding: 10px 14px 10px 14px; color: var(--text); font: 500 14px/1.45 var(--words) !important; }
body.sky-page .pill-head .dot { background: var(--border-strong); box-shadow: 0 0 0 4px var(--surface-raised); }
body.sky-page .rainpill.maybe .dot { background: var(--rain-light); }
body.sky-page .rainpill.soon .dot { background: var(--rain-moderate); }
body.sky-page .rainpill.wet .dot { background: var(--rain-heavy); box-shadow: 0 0 0 4px var(--rain-moderate); }
body.sky-page .pill-caret, body.sky-page .pill-note { color: var(--text-muted); }
body.sky-page .pill-body { padding: 0 14px 12px; color: var(--text); font: 400 14px/1.45 var(--words) !important; }
body.sky-page .pill-row > span { width: 112px; }
body.sky-page .pill-row b { font-weight: 700; font-size: 14px; }
body.sky-page .pill-note { font-size: 12px; line-height: 1.5; }
body.sky-page .pbar { height: 8px; background: var(--surface-raised); box-shadow: inset 0 0 0 1px var(--border); }
body.sky-page .pbar.ghost { background: none; box-shadow: none; }
body.sky-page .pbar i { background: var(--rain-light); }
body.sky-page .hb { background: var(--surface-raised); box-shadow: inset 0 0 0 1px var(--border); }   /* radar band colours (.b1–.b4) unchanged */

/* ---- the bottom panel (timeline, next hours) and the 48 h strip: the sheet ---- */
body.sky-page .sheet { background: var(--bg) !important; color: var(--text); border: 0 !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
    box-shadow: 0 -1px 0 var(--border), 0 -8px 24px rgba(0, 0, 0, .12) !important; padding-top: 12px !important; }
body.sky-page .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--border-strong); opacity: .6; }
body.sky-page .player { gap: 12px; }
body.sky-page .player-top { color: var(--text); font: 600 16px/1.45 var(--words) !important; }
body.sky-page #frame-time { font-weight: 700; }
body.sky-page .play { width: 52px; height: 52px; font-size: 18px; background: var(--accent); color: var(--accent-ink); border: 0;
    box-shadow: inset 0 0 0 1.5px var(--accent-edge); transition: transform 200ms var(--ease-out); }
body.sky-page .play:active, body.sky-page .round:active, body.sky-page .chip:active { transform: scale(.96); }
body.sky-page #slider { height: 32px; accent-color: var(--accent); }
body.sky-page #slider::-webkit-slider-runnable-track { height: 6px; background: color-mix(in srgb, var(--border-strong) 45%, var(--border)); }
body.sky-page #slider::-moz-range-track { height: 6px; background: color-mix(in srgb, var(--border-strong) 45%, var(--border)); }
body.sky-page #slider::-webkit-slider-thumb { width: 24px; height: 24px; margin-top: -9px; background: var(--surface); border: 3px solid var(--text); box-shadow: 0 1px 4px rgba(0, 0, 0, .25); }
body.sky-page #slider::-moz-range-thumb { width: 18px; height: 18px; background: var(--surface); border: 3px solid var(--text); }
body.sky-page .track { padding-top: 18px; }
body.sky-page .marks i { top: 18px; }
body.sky-page .marks .now { border-left: 2px solid var(--accent-edge); }
body.sky-page .marks .now b { top: -18px; color: var(--text); font: 700 12px/1.4 var(--nums) !important; }
body.sky-page .marks .daytick { top: 24px; border-left-color: var(--border-strong); }
body.sky-page .marks .daytick b { top: -22px; color: var(--text-muted); font: 500 12px/1.4 var(--nums) !important; }
/* the next hours: each chip a small tube, filled with water up to its rain chance (--p, set by sky.html's tint()) */
body.sky-page .chips { gap: 6px; }
body.sky-page .chip { gap: 2px; padding: 8px 0; min-height: 76px; border-radius: 14px; color: var(--text);
    background: linear-gradient(0deg, color-mix(in srgb, var(--rain-light) 34%, var(--surface)) calc(var(--p, 0) * 100%), var(--surface) 0) !important;
    box-shadow: 0 0 0 1px var(--border); }
body.sky-page .chip small { color: var(--text-muted); font-size: 12px; font-weight: 500; }
body.sky-page .chip b { font-size: 16px; font-weight: 800; }
body.sky-page .chip.sel { box-shadow: inset 0 0 0 2px var(--text); color: var(--text) !important; }
body.sky-page .chip.sel small { color: var(--text-muted) !important; }
body.sky-page .chip.more { background: transparent !important; box-shadow: inset 0 0 0 1.5px var(--border-strong); }
body.sky-page .seg button, body.sky-page .pt-btn { min-height: 36px; background: var(--surface-raised); color: var(--text); font: 600 14px/1.4 var(--words) !important; }
body.sky-page .seg button.on, body.sky-page .pt-btn.on { background: var(--accent); color: var(--accent-ink); }
body.sky-page .unit { color: var(--text-muted); font-size: 12px; font-weight: 700; }
body.sky-page .scale-bar { height: 18px; }
body.sky-page .scale-bar span { font-size: 12px; font-weight: 700; color: #1d2433; text-shadow: 0 0 3px #fff, 0 0 3px #fff; }   /* on the radar colours */
body.sky-page .player .updated { color: var(--text-muted); font: 400 12px/1.5 var(--words) !important; }
body.sky-page .strip-head b { color: var(--text); font: 600 16px/1.45 var(--words) !important; }
body.sky-page .strip-close { width: 44px; height: 44px; background: var(--surface-raised); color: var(--text); }
body.sky-page .strip-table { color: var(--text); font-size: 14px; }
body.sky-page .strip-table th, body.sky-page .strip-table td { min-width: 40px; padding: 4px 5px; }
body.sky-page .strip-table th.day { color: var(--text-muted); font-size: 12px; font-weight: 600; border-left-color: var(--border-strong); }
body.sky-page .strip-table .hrs th { color: var(--text-muted); font-size: 12px; font-weight: 600; }
body.sky-page .strip-table tbody th, body.sky-page .strip-table thead th:first-child { background: var(--bg); }
body.sky-page .strip-table .gecko td[style] { background: linear-gradient(0deg, color-mix(in srgb, var(--rain-light) 34%, var(--surface)) calc(var(--p, 0) * 100%), var(--surface) 0); }
body.sky-page .strip-table .sel { box-shadow: inset 0 0 0 2px var(--text); }
/* phones: the panel spans the screen bottom and its top edge laps like the app's sheet */
@media (max-width: 899.98px) {
    body.sky-page .sheet { border-radius: 0 !important; box-shadow: none !important; }
    body.sky-page .sheet::before { content: ""; position: absolute; left: 0; right: 0; top: -13px; height: 14px; pointer-events: none; background: var(--bg);
        -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='14' viewBox='0 0 400 14'%3E%3Cpath d='M0 7Q45 3 100 6.5Q150 10 200 7Q260 4 310 7.5Q360 10.5 400 7V14H0Z'/%3E%3C/svg%3E") repeat-x 0 0 / 400px 14px;
                mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='14' viewBox='0 0 400 14'%3E%3Cpath d='M0 7Q45 3 100 6.5Q150 10 200 7Q260 4 310 7.5Q360 10.5 400 7V14H0Z'/%3E%3C/svg%3E") repeat-x 0 0 / 400px 14px; }
    body.sky-page .grab { margin-top: -2px; }
}
@media (min-width: 900px) {
    body.sky-page .sheet { border-radius: 24px !important; box-shadow: 0 0 0 1px var(--border), 0 12px 32px rgba(0, 0, 0, .2) !important; }
}

/* ---- Leaflet's own bits ---- */
body.sky-page .leaflet-bar { border-radius: 16px !important; }
body.sky-page .leaflet-bar a { width: 44px !important; height: 44px !important; line-height: 44px !important; color: var(--text) !important; font-weight: 700; }
body.sky-page .leaflet-bar a + a { border-top: 1px solid var(--border) !important; }
body.sky-page .leaflet-control-attribution, body.compare-page .leaflet-control-attribution {
    font: 400 12px/1.5 var(--words) !important; color: var(--text-muted); background: var(--surface) !important; padding: 0 8px; border-radius: 8px 0 0 0; }
body.sky-page .leaflet-control-attribution a, body.compare-page .leaflet-control-attribution a { color: var(--text); }
body.sky-page .leaflet-container, body.compare-page .leaflet-container { background: var(--surface-raised); font: 400 14px/1.4 var(--words); }
body.sky-page .pick { color: var(--text); font: 600 16px/1.45 var(--words) !important; }
body.sky-page .pick small { color: var(--text-muted); font-weight: 400; font-size: 14px; }
body.sky-page .pick-more { min-height: 44px; margin-top: 8px; background: var(--surface-raised); color: var(--text); border-radius: 12px;
    box-shadow: inset 0 0 0 1.5px var(--border-strong); font: 600 14px/1.4 var(--words) !important; }
body.sky-page .leaflet-popup-close-button { color: var(--text-muted) !important; }

/* ---- HOW TO READ, under the map: a card on the sheet (text and swatches unchanged) ---- */
body.sky-page .sky-main .legend { display: block; max-width: 820px; margin: 24px auto 40px; padding: 4px 20px 12px; background: var(--surface); color: var(--text);
    border: 0; border-radius: 22px; box-shadow: 0 0 0 1px var(--border), inset 0 1px 0 color-mix(in srgb, var(--water-hi) 40%, transparent); }
body.sky-page .legend summary { min-height: 56px; display: flex; align-items: center; font: 600 20px/1.45 var(--words) !important; }
body.sky-page .legend p { margin: 10px 0; gap: 8px 10px; font: 400 16px/1.55 var(--words) !important; }
body.sky-page .legend small, body.sky-page .legend .note { color: var(--text-muted); font-weight: 400; }
body.sky-page .legend small { font-size: 14px; }
body.sky-page .legend .note { font-size: 14px !important; }
body.sky-page .legend a { color: var(--text); }
body.sky-page .sw { border-color: var(--text); }
@media (max-width: 560px) { body.sky-page .sky-main .legend { margin: 20px 16px 32px; } }

/* the street map takes the theme */
html[data-theme="day"] body.sky-page .base-map { filter: brightness(.96) saturate(.7); }
html[data-theme="evening"] body.sky-page .base-map { filter: sepia(.3) saturate(.7) brightness(.9); }
html[data-theme="night"] body.sky-page .base-map { filter: invert(1) hue-rotate(180deg) saturate(.3) brightness(.85) contrast(.9); }
/* Radar check: only the street map (the first tile layer); RainViewer's own tiles keep their colours */
html[data-theme="night"] body.compare-page .leaflet-tile-pane > .leaflet-layer:first-child { filter: invert(1) hue-rotate(180deg) saturate(.3) brightness(.85) contrast(.9); }
body.sky-page :focus-visible, body.compare-page :focus-visible { outline: 3px solid var(--focus) !important; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
    body.sky-page .play:active, body.sky-page .round:active, body.sky-page .chip:active { transform: none; }
}

/* ---- Radar check: a plain tool page in the theme (a sheet over the map) ---- */
body.compare-page .cmp { font: 400 16px/1.5 var(--words); }
body.compare-page .cmp-bar { padding: 16px var(--gutter) 20px; gap: 12px; background: var(--bg); color: var(--text); border-bottom: 1px solid var(--border); box-shadow: none; }
body.compare-page .cmp-bar h1 { font: 700 24px/1.4 var(--words) !important; }
body.compare-page .cmp-bar label { min-height: 44px; font-size: 16px; }
body.compare-page .cmp-bar input[type=range] { accent-color: var(--accent-edge); height: 32px; }
body.compare-page .cmp-bar input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--accent-edge); flex: none; }
body.compare-page .cmp-ends { color: var(--text-muted); font-size: 14px; font-weight: 500; }
body.compare-page #cmp-result { font-size: 14px; padding: 10px 14px; border-radius: 14px; background: var(--surface); box-shadow: 0 0 0 1px var(--border); }
body.compare-page #cmp-result.ok, body.compare-page #cmp-result.bad { color: var(--text); }
body.compare-page #cmp-result.bad { box-shadow: inset 4px 0 0 var(--text), 0 0 0 1px var(--border); }
body.compare-page .cmp-bar a { justify-self: start; display: inline-flex; align-items: center; min-height: 44px; color: var(--text); font-size: 16px;
    text-decoration: underline; text-underline-offset: 4px; }
@media (min-width: 900px) {
    body.compare-page .cmp-bar { grid-template-columns: minmax(0, 720px); padding: 20px 40px; }
}


/* ================================================================ hover (pointer devices only: phones never get sticky hovers) */
@media (hover: hover) and (pointer: fine) {
    .btn-mx:hover { border-color: var(--text); }
    .btn-mx.primary:hover { border-color: var(--accent-ink); }
    .day-row:hover, .row-link:hover { box-shadow: 0 0 0 1.5px var(--border-strong); }
    .day-row:hover > svg, .row-link:hover > svg:last-child { transform: translateX(3px); }
    .day-row > svg, .row-link > svg:last-child { transition: transform var(--t-ui) var(--ease-out); }
    .nav-mx a:hover { color: var(--text); }
    .tchip:hover { box-shadow: 0 0 0 1.5px var(--border-strong), 0 4px 14px -6px rgba(0, 0, 0, .35); }
    .tabs-top a[aria-current="page"]:hover { color: var(--accent-ink); }
    .bars a:hover i { opacity: .8; }
}
