@font-face {
    font-family: "Sora";
    src: url("/fonts/sora-600.woff2") format("woff2");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Sora";
    src: url("/fonts/sora-700.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Figtree";
    src: url("/fonts/figtree-400.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Figtree";
    src: url("/fonts/figtree-500.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Figtree";
    src: url("/fonts/figtree-600.woff2") format("woff2");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

:root {
    /* Smoke / cool-gray light theme — the only theme. Dark mode
       (prefers-color-scheme) was removed by request. Tuned darker than
       near-white so calibrated / bright monitors still read as gray. */
    --page: #d5d8de;
    --surface: #e4e7ec;
    --elevated: #eef0f4;
    --ink: #15181c;
    --ink-2: #3d4450;
    /* Darkened from #5a6270 (2026-07-29): that passed on --surface (4.96) but
       only reached 4.31 against --page, and plenty of muted text sits directly
       on --page — an axe run flagged 111 nodes on /pull-status alone. This
       clears 4.5:1 on all three backdrops (page 4.73 / surface 5.44 /
       elevated 5.91). */
    --muted: #545c69;
    --border: rgba(21, 24, 28, 0.14);
    --good: #0ca30c;
    --warn: #fab219;
    --critical: #d03b3b;
    /* Text-safe status colors. The vivid --good/--warn/--critical above are
       tuned for FILLS (dots, bars, chips) and must keep their hue there, but
       as text on this light theme they measured 2.34:1, 1.39:1 and 3.22:1 --
       all under the 4.5:1 WCAG AA floor for body text, with amber effectively
       unreadable. These same-hue darker variants clear 4.5:1 against --page,
       --surface AND the 14%-tinted badge backgrounds. Rule of thumb: painting
       a shape, use the vivid token; painting a glyph, use the -text one. */
    --good-text: #076b07;
    --warn-text: #7a4f00;
    --critical-text: #9c2323;
    --accent: #2a78d6;
    /* Darker accent for the one case the plain --accent can't serve: a solid
       fill carrying WHITE text (stage dots). White on --accent is 4.42:1,
       just under the AA floor; this clears it at 5.56:1 and still reads as
       the same blue. Also usable as accent-colored body text (4.48:1 on
       --surface, where plain --accent manages only 3.56:1). */
    --accent-deep: #2168bd;
    --accent-light: #86b6ef;
    --nav-hover: var(--accent); /* header nav links/kebab hover — same blue used site-wide */
    --seg-off: #d03b3b;
    --seg-empty: rgba(21, 24, 28, 0.14);
    --font-display: "Sora", "Segoe UI", sans-serif;
    --font-body: "Figtree", "Segoe UI", sans-serif;
    --rail-w: 232px;

    /* --- Scale tokens ---------------------------------------------------
       Colour and type family were tokenised from the start; the geometric
       scales never were, so they drifted: 12 distinct border-radius values
       (2/3/4/5/6/8/10/12px...), 23 distinct font sizes including 10.5px and
       11.5px, and 13 distinct shadows -- the half-pixel sizes being the
       signature of tuning one component at a time. These are the intended
       steps. Reach for the nearest one rather than adding a 14th shadow.  */

    /* Radius. --r-pill is the stadium/circle case (999px), not a size step. */
    --r-xs: 4px;
    --r-sm: 6px;
    --r-md: 8px;
    --r-lg: 12px;
    --r-pill: 999px;

    /* Spacing, on a 4px grid. */
    --sp-1: 4px;
    --sp-2: 8px;
    --sp-3: 12px;
    --sp-4: 16px;
    --sp-5: 20px;
    --sp-6: 24px;
    --sp-8: 32px;

    /* Type. --fs-xs (12px) is the floor for anything a user must READ --
       dense map/tool chrome had dropped to 9-11px. Smaller than this is
       reserved for non-essential ornament that repeats a visible label. */
    --fs-xs: 12px;
    --fs-sm: 13px;
    --fs-base: 14px;
    --fs-md: 16px;
    --fs-lg: 18px;
    --fs-xl: 24px;
    --fs-2xl: 28px;

    /* Elevation. Three steps: resting card, raised control, floating overlay. */
    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-2: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-3: 0 8px 24px rgba(0, 0, 0, 0.16);
}

* {
    box-sizing: border-box;
}

/* Off-screen but still in the a11y tree / still observable by
   IntersectionObserver. A class, not a style attribute: the sitewide CSP is
   style-src 'self', which blocks style ATTRIBUTES too -- inline, the scroll
   sentinel's hiding never applied and a 1px element was rendering in flow. */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* Global keyboard focus ring. Every page loads style.css, so this one rule
   is what gives /map, /map2d and /snippets a focus indicator at all -- those
   sheets previously defined none, leaving the map tool rail, layer toggles,
   date picker and site chips keyboard-operable but invisibly so. :focus-visible
   (not :focus) means mouse users never see it. --accent-deep, not
   --accent-light: the ring must clear 3:1 against its backdrop to count as a
   visible indicator, and --accent-light manages only 1.70:1 on --surface. */
:focus-visible {
    outline: 2px solid var(--accent-deep);
    outline-offset: 2px;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
    background-color: var(--page);
    color: var(--ink);
    line-height: 1.5;
}

/* Landing: full-viewport smoke wash (not fixed — fixed breaks on some GPUs).
   overflow-x hides the classic 100vw + scrollbar gutter spill from full-bleed
   sections. */
body.landing-page {
    overflow-x: hidden;
    background:
        radial-gradient(ellipse 120% 70% at 50% -5%, color-mix(in srgb, var(--accent) 14%, #c9ced6) 0%, transparent 60%),
        radial-gradient(ellipse 80% 50% at 100% 20%, color-mix(in srgb, #9aa3b2 35%, transparent), transparent 55%),
        radial-gradient(ellipse 70% 45% at 0% 40%, color-mix(in srgb, #aeb6c2 30%, transparent), transparent 50%),
        linear-gradient(180deg, #c9ced6 0%, var(--page) 32%, var(--page) 100%);
}

/* Header bar */
.header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    min-height: 52px;
    background-color: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

/* On the landing page, the header starts transparent so the hero reads as a
   full-bleed stage, then gains a solid/blurred background once the page
   scrolls past the sentinel (see landing-motion.js). */
/* Fixed (not sticky) here so it's removed from document flow entirely —
   otherwise its own height would still be reserved above the hero, leaving
   the hero just short of a true full-viewport fill. */
body.landing-page .header-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: transparent;
    border-bottom-color: transparent;
    transition: background 0.25s ease, border-color 0.25s ease, backdrop-filter 0.25s ease;
}

body.landing-page .header-bar.scrolled {
    background: color-mix(in srgb, var(--surface) 80%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.header-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--ink);
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
    white-space: nowrap;
}

.header-by {
    display: block;
    font-size: var(--fs-xs);
    font-weight: 500;
    letter-spacing: 0;
    line-height: 1.25;
    color: var(--muted);
    white-space: nowrap;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

/* Overlay drawer. Opening it covers the page; it does not narrow the page. */
.system-nav-scrim {
    position: fixed;
    z-index: 80;
    left: 0;
    right: 0;
    top: var(--header-h, 52px);
    bottom: 0;
    border: 0;
    padding: 0;
    margin: 0;
    background: rgba(21, 24, 28, 0.28);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

body.system-nav-open .system-nav-scrim {
    opacity: 1;
    pointer-events: auto;
}

.system-nav {
    position: fixed;
    z-index: 90;
    top: var(--header-h, 52px);
    left: 0;
    width: var(--rail-w);
    height: calc(100dvh - var(--header-h, 52px));
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 12px 10px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    box-shadow: none;
    overflow: auto;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
}

body.system-nav-open .system-nav {
    transform: translateX(0);
    box-shadow: 8px 0 28px rgba(21, 24, 28, 0.16);
}

.system-nav[hidden] {
    display: none;
}

.system-link {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 36px;
    padding: 0 10px;
    border-radius: var(--r-md);
    color: var(--ink-2);
    text-decoration: none;
    font-size: var(--fs-base);
    font-weight: 500;
}

.system-link::before {
    content: "";
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    background: currentColor;
    -webkit-mask: var(--nav-icon) center / 18px 18px no-repeat;
    mask: var(--nav-icon) center / 18px 18px no-repeat;
}

.system-link[data-nav="dashboard"] { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M4 10.5 12 4l8 6.5V20a1 1 0 0 1-1 1h-5v-6H10v6H5a1 1 0 0 1-1-1v-9.5z'/%3E%3C/svg%3E"); }
.system-link[data-nav="mapping"] { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-width='1.8' stroke-linejoin='round' d='M3 6.2 9 4l6 2.2L21 4v13.8L15 20l-6-2.2L3 20z'/%3E%3Cpath fill='black' d='M13.4 6.3 8.4 13.2h3.2l-1.1 4.6 5.1-7h-3.3z'/%3E%3C/svg%3E"); }
.system-link[data-nav="map2d"] { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M9 4 3 6.2V20l6-2.2 6 2.2 6-2.2V4l-6 2.2L9 4zm0 2.2 6 2.2v11.4l-6-2.2V6.2z'/%3E%3C/svg%3E"); }
/* 2D Map VHF + FALMA: flat map with a VHF radio mark. */
.system-link[data-nav="map2d-vhf-falma"] { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M8 3.5 3 5.3V18l5-1.8 5 1.8 5-1.8V3.5l-5 1.8L8 3.5zm0 2 5 1.8v9.2l-5-1.8V5.5z'/%3E%3Ccircle cx='17.5' cy='16.5' r='1.4' fill='black'/%3E%3Cpath fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' d='M15.4 14.6a3 3 0 0 0 0 3.8M19.6 14.6a3 3 0 0 1 0 3.8'/%3E%3C/svg%3E"); }
/* Report page: document with bar chart (thunder hours / density). */
.system-link[data-nav="thunder2d"] { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M6 2h9l5 5v14a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1zm8 1.5V8h4.5L14 3.5zM8 18h2v-5H8v5zm4 0h2V9h-2v9zm4 0h2v-7h-2v7z'/%3E%3C/svg%3E"); }
.system-link[data-nav="map"],
.system-link[data-nav="map-kilat"] { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 2 3 7v10l9 5 9-5V7l-9-5zm0 2.3 6.5 3.6L12 11.5 5.5 7.9 12 4.3zM5 9.6l6 3.3v6.8l-6-3.3V9.6zm14 0v6.8l-6 3.3v-6.8l6-3.3z'/%3E%3C/svg%3E"); }
/* 3D Map VHF + FALMA: cube with a VHF radio mark. */
.system-link[data-nav="map3d-vhf-falma"] { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 2 4 6.5v11L12 22l8-4.5v-11L12 2zm0 2.4 5.8 3.2L12 11.1 6.2 7.6 12 4.4zM6 9.2l5 2.8v7.2l-5-2.8V9.2zm12 0v7.2l-5 2.8v-7.2l5-2.8z'/%3E%3Ccircle cx='17.2' cy='16.8' r='1.2' fill='black'/%3E%3Cpath fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' d='M15.3 15.2a2.6 2.6 0 0 0 0 3.2M19.1 15.2a2.6 2.6 0 0 1 0 3.2'/%3E%3C/svg%3E"); }
.system-link[data-nav="prediction"] { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M7 13.5a4.5 4.5 0 0 1-.4-9A6 6 0 0 1 17.6 5.6 4 4 0 0 1 17.5 13.5H7z'/%3E%3Cpath fill='black' d='M12.8 14.5 9.5 19.5h2.6l-.9 3 3.8-5.2h-2.6l1.2-2.8z'/%3E%3C/svg%3E"); }
.system-link[data-nav="current"],
.system-link[data-nav="current2d"] { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M13 2 4 14h6l-1 8 9-12h-6l1-8z'/%3E%3C/svg%3E"); }
.system-link[data-nav="snippets"] { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M2 13h3l2-5 3 10 3-8 2 3h7v-2h-5.2l-2.3-3.4L12.2 16 9.5 7.2 7.8 12H2v1z'/%3E%3C/svg%3E"); }
.system-link[data-nav="pull"] { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M11 3h2v10.2l3.3-3.3 1.4 1.4L12 17.1 6.3 11.3l1.4-1.4 3.3 3.3V3zM5 19h14v2H5v-2z'/%3E%3C/svg%3E"); }
.system-link[data-nav="vhffa-pull"] { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M8 3h2v9.2l2.8-2.8 1.4 1.4L9 16.1l-5.2-5.3 1.4-1.4L8 12.2V3zM2.5 19H15v2H2.5v-2z'/%3E%3Ccircle cx='19' cy='15' r='1.5' fill='black'/%3E%3Cpath fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' d='M16.6 12.8a3.2 3.2 0 0 0 0 4.4M21.4 12.8a3.2 3.2 0 0 1 0 4.4'/%3E%3Cpath fill='black' d='M18.3 16.5h1.4V21h-1.4z'/%3E%3C/svg%3E"); }
.system-link[data-nav="doa"] { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' fill-rule='evenodd' d='M12 2a10 10 0 1 1 0 20a10 10 0 1 1 0-20zm0 2a8 8 0 1 0 0 16a8 8 0 1 0 0-16zM16.6 7.4l-3 6.2-6.2 3 3-6.2 6.2-3zM12 10.8a1.2 1.2 0 1 0 0 2.4a1.2 1.2 0 1 0 0-2.4z'/%3E%3C/svg%3E"); }
.system-link[data-nav="efm"] { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M2 16a10 10 0 0 1 20 0h-2a8 8 0 0 0-16 0H2zM16.3 8.3l1.4 1.4-4.3 4.6a1.6 1.6 0 1 1-1.4-1.4l4.3-4.6zM3 19h18v2H3v-2z'/%3E%3C/svg%3E"); }
.system-link[data-nav="efm-map"] { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Ccircle cx='12' cy='12' r='5'/%3E%3C/g%3E%3Ccircle cx='12' cy='12' r='1.8' fill='black'/%3E%3C/svg%3E"); }
.system-link[data-nav="vhf"] { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='10' r='2'/%3E%3Cpath d='M11 12h2v9h-2z'/%3E%3Cpath fill='none' stroke='black' stroke-width='2' stroke-linecap='round' d='M8.5 6.5a5 5 0 0 0 0 7M15.5 6.5a5 5 0 0 1 0 7M5.6 3.6a9 9 0 0 0 0 12.8M18.4 3.6a9 9 0 0 1 0 12.8'/%3E%3C/svg%3E"); }
.system-link[data-nav="upgrade"] { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M11 21V10.8L7.7 14.1 6.3 12.7 12 7l5.7 5.7-1.4 1.4L13 10.8V21h-2zM5 3h14v2H5V3z'/%3E%3C/svg%3E"); }

.system-link:hover {
    background: color-mix(in srgb, var(--ink) 6%, transparent);
    color: var(--ink);
}

.system-link[hidden] {
    display: none;
}

.system-link[aria-current="page"] {
    background: color-mix(in srgb, var(--accent) 14%, var(--surface));
    color: var(--accent-deep);
    font-weight: 600;
}

.system-link-upgrade {
    margin-top: 8px;
}

.system-nav-foot {
    margin-top: auto;
    flex: 0 0 auto;
    border-top: 1px solid var(--border);
    padding: 8px 8px 10px;
}

.system-nav-foot .header-menu {
    width: 100%;
    flex-direction: column-reverse;
    align-items: stretch;
}

.system-nav-foot .system-account-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 4px 6px;
    border-radius: 10px;
    font-size: var(--fs-base);
    font-family: var(--font-body);
    color: var(--ink);
    justify-content: flex-start;
    text-align: left;
}

.system-avatar {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: color-mix(in srgb, var(--accent) 16%, var(--elevated));
    color: var(--accent-deep);
    font-size: var(--fs-xs);
    font-weight: 700;
    letter-spacing: 0.02em;
}

.system-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.system-nav-foot .account-email {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: var(--fs-base);
    font-weight: 600;
    color: var(--ink);
    text-align: left;
}

.system-nav-foot [data-nav="snippets"] {
    display: none;
}

.system-nav-foot .header-menu-dropdown {
    position: static;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    width: 100%;
    min-width: 0;
    margin: 0 0 4px;
    padding: 4px;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

@media (max-width: 760px) {
    .system-nav {
        width: min(280px, 86vw);
    }

    .header-by {
        display: none;
    }
}

.system-nav-toggle {
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--ink);
    padding: 0;
    cursor: pointer;
}

.system-nav-toggle:hover {
    background: color-mix(in srgb, var(--ink) 8%, transparent);
}

.system-nav-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.system-nav-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.system-nav-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.system-nav-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.header-cta {
    padding: 8px 14px;
    font-size: var(--fs-sm);
    min-width: 0;
}

body.landing-page .header-bar:not(.scrolled) .header-cta.cta-secondary {
    background: color-mix(in srgb, var(--elevated) 70%, transparent);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

@media (max-width: 520px) {
    .header-title {
        font-size: var(--fs-base);
        max-width: 58vw;
    }

    .header-cta {
        padding: 7px 10px;
        font-size: var(--fs-xs);
    }
}

.page-intro {
    margin: 0 0 20px;
    font-size: var(--fs-base);
    color: var(--ink-2);
    max-width: 72ch;
}

.header-status {
    display: flex;
    gap: 12px;
    align-items: center;
    font-size: var(--fs-base);
    color: var(--ink-2);
}

.live-clock {
    font-variant-numeric: tabular-nums;
}

/* Display time zone: MYT / UTC / Local (time-pref.js) */
.tz-pref {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

.tz-pref-btn {
    appearance: none;
    margin: 0;
    padding: 3px 7px;
    border: 0;
    border-right: 1px solid var(--border);
    background: transparent;
    color: var(--ink-2);
    font: inherit;
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    line-height: 1.2;
}

.tz-pref-btn:last-child {
    border-right: 0;
}

.tz-pref-btn:hover,
.tz-pref-btn:focus-visible {
    background: rgba(21, 24, 28, 0.06);
    color: var(--ink);
    outline: none;
}

.tz-pref-btn.is-on {
    background: var(--ink);
    color: #fff;
}

@media (max-width: 640px) {
    .tz-pref-btn {
        padding: 3px 5px;
        font-size: 10px;
    }
}

/* Connection indicator */
.conn-indicator {
    font-size: var(--fs-sm);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.conn-indicator.live {
    color: var(--good-text);
}

.conn-indicator.polling {
    color: var(--warn-text);
}

.conn-indicator.down {
    color: var(--critical-text);
}

/* Main container */
.main-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 20px;
}

/* Status banner */
.status-banner {
    width: 100%;
    padding: 24px;
    border-radius: var(--r-lg);
    margin-bottom: 24px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-1);
}

.status-banner.good {
    background: linear-gradient(135deg, rgba(12, 163, 12, 0.08) 0%, rgba(12, 163, 12, 0.04) 100%);
}

.status-banner.warn {
    background: linear-gradient(135deg, rgba(250, 178, 25, 0.08) 0%, rgba(250, 178, 25, 0.04) 100%);
}

.status-banner.critical {
    background: linear-gradient(135deg, rgba(208, 59, 59, 0.08) 0%, rgba(208, 59, 59, 0.04) 100%);
}

.banner-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.banner-icon {
    font-size: 32px;
    font-weight: 600;
    line-height: 1;
}

.banner-text {
    font-size: var(--fs-xl);
    font-weight: 600;
    color: var(--ink);
}

/* Stat tiles */
.stat-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-tile {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 20px;
    box-shadow: var(--shadow-1);
}

.stat-label {
    font-size: var(--fs-sm);
    color: var(--ink-2);
    margin-bottom: 8px;
}

.stat-value {
    font-size: var(--fs-2xl);
    font-weight: 600;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

/* Sites grid */
.sites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.grid-empty {
    text-align: center;
    grid-column: 1 / -1;
    color: var(--muted);
}

.site-card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 20px;
    box-shadow: var(--shadow-1);
}

.site-card.offline {
    border-color: var(--critical);
}

.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.site-id {
    font-size: 20px;
    font-weight: 700;
    color: var(--ink);
}

.status-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--r-sm);
    font-size: var(--fs-xs);
    font-weight: 700;
    text-transform: uppercase;
    color: var(--ink);
}

.status-pill.online {
    background-color: rgba(12, 163, 12, 0.12);
}

.status-pill.offline {
    background-color: rgba(208, 59, 59, 0.12);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot.online {
    background-color: var(--good);
    animation: pulse-dot 2s ease-in-out infinite;
}

.status-dot.offline {
    background-color: var(--critical);
}

@keyframes pulse-dot {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.2);
    }
}

.site-row {
    font-size: var(--fs-sm);
    color: var(--ink);
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
}

.site-row-label {
    color: var(--ink-2);
    margin-bottom: 2px;
}

.site-row-value {
    color: var(--ink);
}

.site-row-value.monospace {
    font-family: "Courier New", monospace;
    font-size: var(--fs-xs);
}

/* Per-site uptime bar (Kuma-style) */
.uptime-block {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.uptime-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 6px;
}

.uptime-caption {
    font-size: var(--fs-xs);
    color: var(--ink-2);
}

.uptime-pct {
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--ink-2);
    font-variant-numeric: tabular-nums;
}

.uptime-bar {
    display: flex;
    gap: 2px;
    height: 22px;
    align-items: stretch;
}

.uptime-seg {
    flex: 1 1 0;
    border-radius: var(--r-xs);
    background-color: var(--seg-empty);
    min-width: 0;
}

.uptime-seg.online {
    background-color: var(--good);
}

.uptime-seg.offline {
    background-color: var(--seg-off);
}

/* Activity panel */
.activity-panel {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 20px;
    box-shadow: var(--shadow-1);
    margin-bottom: 24px;
}

.activity-panel h2 {
    margin: 0 0 16px 0;
    font-size: var(--fs-md);
    font-weight: 600;
    color: var(--ink);
}

.activity-chart {
    width: 100%;
    overflow-x: auto;
}

.activity-placeholder {
    text-align: center;
    color: var(--muted);
    padding: 32px 16px;
    font-size: var(--fs-base);
}

.activity-svg {
    display: block;
    margin: 0 auto;
    min-width: 100%;
}

.axis-label {
    fill: var(--muted);
}

.bar {
    fill: var(--accent);
}

.bar.current {
    fill: var(--accent-light);
}

/* Footer */
.footer {
    text-align: center;
    font-size: var(--fs-xs);
    color: var(--muted);
    padding: 16px 20px;
    border-top: 1px solid var(--border);
}

.footer-links {
    margin-top: 6px;
}

.footer-links a {
    color: var(--muted);
}

/* Simple content pages (landing, terms, privacy) */
.header-link {
    color: inherit;
    text-decoration: none;
}

.content-section {
    max-width: 72ch;
    margin: 0 auto;
    padding: 8px 0 32px;
}

.content-subheading {
    font-size: var(--fs-md);
    font-weight: 600;
    margin: 28px 0 8px;
    color: var(--ink);
}

.content-text {
    font-size: 15px;
    line-height: 1.65;
    color: var(--ink-2);
    margin: 0 0 12px;
}

.content-disclaimer {
    font-size: var(--fs-sm);
    color: var(--muted);
    margin: 0 0 24px;
}

.cta-row {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.cta-button {
    display: inline-block;
    padding: 12px 22px;
    border-radius: 10px;
    font-family: var(--font-display);
    font-size: var(--fs-base);
    font-weight: 600;
    letter-spacing: -0.01em;
    text-decoration: none;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.cta-primary {
    background-color: var(--ink);
    color: #f5f6f8;
    border-color: var(--ink);
    min-width: 11.5rem;
    text-align: center;
}

.cta-primary:hover {
    background-color: color-mix(in srgb, var(--ink) 88%, white);
    border-color: color-mix(in srgb, var(--ink) 88%, white);
    transform: translateY(-1px);
}

.cta-secondary {
    background-color: var(--elevated);
    color: var(--ink);
}

.cta-secondary:hover {
    background-color: color-mix(in srgb, var(--elevated) 70%, white);
    transform: translateY(-1px);
}

.account-email {
    color: var(--muted);
    font-size: var(--fs-xs);
}

/* Header nav links — plain text, Twitch-following/browse style: no button
   chrome, no focus outline box, just a color shift + underline on
   hover/focus so keyboard users still get an affordance. */
.nav-link {
    color: var(--ink);
    font-family: var(--font-display);
    font-size: var(--fs-base);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.15s ease;
}

.nav-link:hover,
.nav-link:focus-visible {
    color: var(--nav-hover);
    outline: none;
}

/* Header overflow ("kebab") menu — everything past the first two nav links
   collapses in here, same idea as Twitch's "..." menu, so the header bar
   never grows past one row regardless of how many pages/actions exist. */
.header-menu {
    position: relative;
    display: flex;
    align-items: center;
}

.header-menu-toggle {
    background: none;
    border: none;
    outline: none;
    cursor: pointer;
    color: var(--ink);
    font-size: var(--fs-lg);
    line-height: 1;
    padding: 6px 8px;
    border-radius: var(--r-md);
    transition: background-color 0.15s ease, color 0.15s ease;
}

.header-menu-toggle:hover,
.header-menu-toggle:focus-visible,
.header-menu-toggle[aria-expanded="true"] {
    background-color: color-mix(in srgb, var(--nav-hover) 14%, transparent);
    color: var(--nav-hover);
}

.header-menu-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 11rem;
    padding: 6px;
    background-color: var(--elevated);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(21, 24, 28, 0.18);
    z-index: 200;
}

.header-menu-dropdown[hidden] {
    display: none;
}

.header-menu-item {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    outline: none;
    color: var(--ink);
    font-family: var(--font-body);
    font-size: var(--fs-base);
    text-decoration: none;
    cursor: pointer;
    padding: 8px 10px;
    border-radius: var(--r-sm);
    transition: background-color 0.15s ease, color 0.15s ease;
}

.header-menu-item:hover,
.header-menu-item:focus-visible {
    background-color: color-mix(in srgb, var(--nav-hover) 12%, transparent);
    color: var(--nav-hover);
}

/* Auth forms (login/signup) — same smoke stage + primary CTA language as
   the landing "Open dashboard" button (ink fill, display type, 10px radius). */
body.auth-page {
    overflow-x: hidden;
    min-height: 100vh;
    background:
        radial-gradient(ellipse 120% 70% at 50% -5%, color-mix(in srgb, var(--accent) 14%, #c9ced6) 0%, transparent 60%),
        radial-gradient(ellipse 80% 50% at 100% 20%, color-mix(in srgb, #9aa3b2 35%, transparent), transparent 55%),
        linear-gradient(180deg, #c9ced6 0%, var(--page) 40%, var(--page) 100%);
}

body.auth-page .header-bar {
    background: color-mix(in srgb, var(--surface) 72%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.auth-container {
    max-width: 400px;
    margin: 56px auto 48px;
    padding: 0 16px;
}

.auth-card {
    background: var(--elevated);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 32px 28px;
    box-shadow: 0 12px 36px rgba(21, 24, 28, 0.08);
}

.auth-title {
    font-family: var(--font-display);
    font-size: var(--fs-xl);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 8px;
    color: var(--ink);
}

.auth-card > .content-text {
    margin: 0 0 20px;
    font-size: var(--fs-base);
    color: var(--ink-2);
}

.form-field {
    margin-bottom: 16px;
}

.form-field label {
    display: block;
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--ink-2);
    margin-bottom: 6px;
}

.password-field {
    position: relative;
}

.password-field input {
    padding-right: 44px;
}

.password-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    padding: 6px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--ink-2);
    cursor: pointer;
}

.password-toggle:hover {
    color: var(--ink);
}

.password-toggle svg {
    width: 20px;
    height: 20px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.password-toggle .eye-closed {
    display: none;
}

.password-toggle.is-revealed .eye-open {
    display: none;
}

.password-toggle.is-revealed .eye-closed {
    display: block;
}

.form-field input {
    width: 100%;
    padding: 11px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--elevated);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: var(--fs-base);
}

.form-field input:focus {
    outline: 2px solid var(--accent-light);
    outline-offset: 1px;
    border-color: var(--accent-light);
}

.form-field .password-field input {
    padding-right: 44px;
}

.form-consent {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: var(--fs-sm);
    color: var(--ink-2);
    margin: 4px 0 20px;
}

.form-consent input {
    margin-top: 3px;
}

.form-submit {
    width: 100%;
    padding: 12px 22px;
    border-radius: 10px;
    border: 1px solid var(--ink);
    background: var(--ink);
    color: #f5f6f8;
    font-family: var(--font-display);
    font-size: var(--fs-base);
    font-weight: 600;
    letter-spacing: -0.01em;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.form-submit:hover:not(:disabled) {
    background-color: color-mix(in srgb, var(--ink) 88%, white);
    border-color: color-mix(in srgb, var(--ink) 88%, white);
    transform: translateY(-1px);
}

a.form-submit {
    display: block;
    text-align: center;
    text-decoration: none;
    box-sizing: border-box;
    margin-bottom: 10px;
}

/* a.form-submit { display:block } must not beat the HTML hidden attribute
   (forgot/check-email show an empty "Open … link" button otherwise). */
a.form-submit[hidden] {
    display: none;
}

.form-submit:disabled {
    opacity: 0.6;
    cursor: default;
}

@keyframes form-submit-spin {
    to { transform: rotate(360deg); }
}

.form-submit.is-busy {
    pointer-events: none;
}

.form-submit.is-busy::before {
    content: "";
    display: inline-block;
    width: 0.85em;
    height: 0.85em;
    margin-right: 0.45em;
    border: 2px solid color-mix(in srgb, #f5f6f8 35%, transparent);
    border-top-color: #f5f6f8;
    border-radius: 50%;
    vertical-align: -0.15em;
    animation: form-submit-spin 0.7s linear infinite;
}

/* Signup honeypot: off-screen, not in the tab order, ignored by screen readers. */
.hp-field {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.form-error {
    background: color-mix(in srgb, var(--critical) 12%, transparent);
    border: 1px solid var(--critical);
    color: var(--critical-text);
    border-radius: var(--r-md);
    padding: 8px 12px;
    font-size: var(--fs-sm);
    margin-bottom: 16px;
    display: none;
}

.form-error.visible {
    display: block;
}

.form-divider {
    text-align: center;
    color: var(--muted);
    font-size: var(--fs-xs);
    margin: 18px 0;
}

.form-footer {
    text-align: center;
    font-size: var(--fs-sm);
    color: var(--ink-2);
    margin-top: 18px;
}

.form-footer a {
    color: var(--ink);
    font-weight: 600;
}

.account-card {
    max-width: 640px;
}

.account-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 8px 0 18px;
    max-height: 420px;
    overflow: auto;
}

.account-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: var(--fs-sm);
    color: var(--ink);
}

.account-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.account-secondary {
    background: transparent;
    color: var(--ink);
}

.form-divider {
    display: flex;
    align-items: center;
    gap: 12px;
}

.form-divider::before,
.form-divider::after {
    content: "";
    flex: 1;
    border-top: 1px solid var(--border);
}

.google-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
    padding: 12px 22px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--ink);
    font-family: var(--font-display);
    font-size: var(--fs-base);
    font-weight: 600;
    letter-spacing: -0.01em;
    text-decoration: none;
    cursor: pointer;
}

.google-button:hover {
    border-color: var(--ink-2);
}

.google-button:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 2px;
}

.google-g {
    width: 18px;
    height: 18px;
    flex: none;
}

.form-note {
    font-size: var(--fs-xs);
    color: var(--muted);
    text-align: center;
    margin: 10px 0 0;
}

.form-note a {
    color: var(--ink-2);
}

/* Pull-status page — real-time pull-worker pipeline view */
.pull-empty {
    text-align: center;
    color: var(--muted);
    padding: 40px 16px 32px;
    font-size: var(--fs-base);
}

/* Reserves one populated-card's worth of height for the "in progress" empty
   state only (not the trend/history empty states above), so the page below
   doesn't jump every time the live epoch feed drains to zero. Sized to one
   card, not the max concurrent count — a 3->0 collapse is a legible content
   change; only the constant 1<->0 flicker was the actual complaint. */
:root {
    --pull-card-h: 208px;
}

.pull-empty-slot {
    min-height: var(--pull-card-h);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px dashed var(--border);
    border-radius: var(--r-lg);
    padding: 16px;
}

/* Indeterminate loading bar for the "watching for epochs" idle state — a
   static line reads as stalled; this reads as "still listening." */
.pull-waiting-bar {
    width: 220px;
    height: 4px;
    margin: 14px auto 0;
    border-radius: 2px;
    background-color: var(--seg-empty);
    overflow: hidden;
    position: relative;
}

.pull-waiting-bar::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 40%;
    border-radius: 2px;
    background-color: var(--accent);
    animation: pull-waiting-sweep 1.4s ease-in-out infinite;
}

@keyframes pull-waiting-sweep {
    0% { left: -40%; }
    100% { left: 100%; }
}

/* Station status strip — live online/offline per station, sourced from
   /api/sites. Sits above everything else on the page so "is it working"
   has an answer before the reader has to interpret any epoch card. */
.station-status-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 8px;
}

.station-status-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--r-md);
    background-color: var(--surface);
    border: 1px solid var(--border);
}

.station-status-chip.offline {
    border-color: var(--critical);
}

.station-status-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.station-status-site {
    font-size: var(--fs-sm);
    font-weight: 700;
    color: var(--ink);
}

.station-status-detail {
    font-size: var(--fs-xs);
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.station-status-chip.offline .station-status-detail {
    color: var(--critical-text);
}

.epoch-progress-count {
    font-size: var(--fs-xs);
    font-weight: 700;
    color: var(--ink-2);
    font-variant-numeric: tabular-nums;
}

.pull-section-title {
    font-size: var(--fs-sm);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    margin: 28px 0 12px;
}

.pull-section-title:first-child {
    margin-top: 0;
}

.epoch-card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 20px;
    box-shadow: var(--shadow-1);
    margin-bottom: 16px;
}

.epoch-card.failed {
    border-color: var(--critical);
}

.epoch-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.epoch-time {
    font-size: var(--fs-md);
    font-weight: 600;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.epoch-meta {
    font-size: var(--fs-xs);
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.epoch-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: var(--r-sm);
    font-size: var(--fs-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.epoch-badge.pending, .epoch-badge.pulling { background-color: rgba(250, 178, 25, 0.14); color: var(--warn-text); }
.epoch-badge.localizing { background-color: rgba(42, 120, 214, 0.14); color: var(--accent-deep); }
.epoch-badge.processed { background-color: rgba(12, 163, 12, 0.14); color: var(--good-text); }
.epoch-badge.failed { background-color: rgba(208, 59, 59, 0.14); color: var(--critical-text); }
/* DECISIONS.md R12-9 (journal-lma2d/code/geomTrust2d): "expired" is a timeout waiting
   for a full pull, not a solve failure -- muted terminal, deliberately not
   red like .failed. */
/* --ink-2, not --muted: muted text on a muted-tinted chip is only 4.40:1.
   The chip still reads as the quiet, non-alarming state via its grey fill. */
.epoch-badge.expired { background-color: color-mix(in srgb, var(--muted) 16%, transparent); color: var(--ink-2); }

/* 3-stage tracker: Pull -> Localize -> Done */
.stage-tracker {
    display: flex;
    align-items: center;
    margin-bottom: 18px;
}

.stage-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 84px;
}

.stage-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--fs-xs);
    font-weight: 700;
    background-color: var(--seg-empty);
    color: var(--muted);
    border: 2px solid var(--border);
}

.stage-step.done .stage-dot { background-color: var(--good-text); border-color: var(--good-text); color: #fff; }
.stage-step.active .stage-dot { background-color: var(--accent-deep); border-color: var(--accent-deep); color: #fff; animation: pulse-dot 1.6s ease-in-out infinite; }
.stage-step.error .stage-dot { background-color: var(--critical-text); border-color: var(--critical-text); color: #fff; }

.stage-label {
    font-size: var(--fs-xs);
    color: var(--ink-2);
    text-align: center;
}

.stage-connector {
    flex: 1 1 0;
    height: 2px;
    background-color: var(--border);
    margin: 0 -4px;
    position: relative;
    top: -13px;
}

.stage-connector.filled {
    background-color: var(--good);
}

/* Station chips — one per site, live pull progress */
.station-chips {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.station-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--r-md);
    background-color: var(--page);
    border: 1px solid var(--border);
}

.station-chip.offline {
    opacity: 0.7;
}

/* Vanilla-download-manager look: a plain dot per status doesn't read as
   "in progress" vs "done" at a glance the way an icon + moving bar does. */
.station-chip-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.station-chip.pending .station-chip-icon { background-color: var(--seg-empty); }
.station-chip.offline .station-chip-icon { background-color: var(--seg-empty); }
.station-chip.offline .station-chip-icon::after {
    content: "×";
    font-size: 11px;
    font-weight: 700;
    color: var(--critical-text);
}
/* Amber = talking to the site (SSH request + it preparing the file);
   blue = the actual transfer back (SCP) — two distinct, honestly-observed
   phases from central/pull_worker.py's _pull_site, not just re-skinned. */
.station-chip.pulling .station-chip-icon {
    background-color: transparent;
    border: 2px solid var(--seg-empty);
    border-top-color: var(--warn);
    animation: station-chip-spin 0.8s linear infinite;
}
.station-chip.downloading .station-chip-icon {
    background-color: transparent;
    border: 2px solid var(--seg-empty);
    border-top-color: var(--accent-deep);
    animation: station-chip-spin 0.8s linear infinite;
}
.station-chip.downloading .station-chip-bar::after { background-color: var(--accent-deep); }
.station-chip.pulled .station-chip-icon { background-color: var(--good); }
.station-chip.pulled .station-chip-icon::after {
    content: "✓";
    font-size: 10px;
    font-weight: 700;
    color: #fff;
}
.station-chip.failed .station-chip-icon { background-color: var(--critical); }
.station-chip.failed .station-chip-icon::after {
    content: "!";
    font-size: 11px;
    font-weight: 700;
    color: #fff;
}

@keyframes station-chip-spin {
    to { transform: rotate(360deg); }
}

.station-chip-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1 1 auto;
}

/* Indeterminate mini progress bar under a "pulling" chip's label — this is
   the "vanilla downloading" cue the dot-only version was missing. */
.station-chip-bar {
    width: 100%;
    height: 3px;
    margin-top: 6px;
    border-radius: 2px;
    background-color: var(--seg-empty);
    overflow: hidden;
    position: relative;
}

.station-chip-bar::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 40%;
    border-radius: 2px;
    background-color: var(--warn);
    animation: pull-waiting-sweep 1.1s ease-in-out infinite;
}

.station-chip-site {
    font-size: var(--fs-sm);
    font-weight: 700;
    color: var(--ink);
}

.station-chip-time {
    font-size: var(--fs-xs);
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

/* History table — compact log of completed epochs */
.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--fs-sm);
}

.history-table th {
    text-align: left;
    font-size: var(--fs-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--muted);
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
}

.history-table td {
    padding: 10px;
    border-bottom: 1px solid var(--border);
    color: var(--ink);
    font-variant-numeric: tabular-nums;
    vertical-align: middle;
}

.history-table tr:last-child td {
    border-bottom: none;
}

.history-duration {
    font-weight: 600;
}

/* Responsive */
@media (max-width: 640px) {
    /* Single row, not a column. Stacking these put the header at ~160px tall
       on a 390px phone, and the map pages size their overlays against the
       height the header leaves behind — so /map2d's Live/Archive toggle
       landed at y=890 in an 844px viewport, off-screen and unreachable, with
       the legend clipped. Nav links stay reachable by scrolling the header
       strip itself; only the account email is dropped (the ⋮ menu covers the
       account actions). */
    .header-bar {
        padding: 10px 12px;
        gap: 8px;
    }

    .header-title {
        min-width: 0;
    }

    .header-status {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 10px;
        align-items: center;
        min-width: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        font-size: var(--fs-xs);
    }

    .header-status::-webkit-scrollbar {
        display: none;
    }

    .header-status > * {
        flex: 0 0 auto;
    }

    .header-status .account-email {
        display: none;
    }

    .banner-text {
        font-size: var(--fs-lg);
    }

    .stat-tiles {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-value {
        font-size: var(--fs-xl);
    }

    .sites-grid {
        grid-template-columns: 1fr;
    }
}

/* Pull-pipeline KPI strip and trend charts */
.stat-subtext {
    font-size: var(--fs-xs);
    color: var(--muted);
    margin-top: 4px;
    font-variant-numeric: tabular-nums;
}

.stat-tile.tile-critical {
    border-color: var(--critical);
}

.stat-tile.tile-critical .stat-value {
    color: var(--critical-text);
}

.trends-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.trends-panel {
    margin-bottom: 0;
}

.stage-legend {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px 16px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    font-size: var(--fs-xs);
    color: var(--ink-2);
    font-variant-numeric: tabular-nums;
}

.stage-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.stage-legend-swatch {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    flex-shrink: 0;
}

.dot-strip-caption {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-size: var(--fs-xs);
    color: var(--muted);
}

.dot-strip-caption-swatch {
    width: 2px;
    height: 12px;
    background-color: var(--ink);
    flex-shrink: 0;
}

@media (max-width: 900px) {
    .trends-grid {
        grid-template-columns: 1fr;
    }
}

/* Stat-tile sparklines */
.stat-sparkline {
    margin-top: 8px;
    line-height: 0;
}

.stat-sparkline svg {
    display: block;
    width: 100%;
    height: 28px;
}

/* Dashboard requests/bandwidth trend panel + range toggle */
.trend-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.trend-panel-head h2 {
    margin: 0;
}

.trend-range-controls {
    display: flex;
    gap: 6px;
}

.trend-range-btn {
    border: 1px solid var(--border);
    background-color: transparent;
    color: var(--ink-2);
    border-radius: var(--r-sm);
    padding: 4px 10px;
    font-size: var(--fs-xs);
    cursor: pointer;
}

.trend-range-btn.active {
    border-color: var(--accent-deep);
    background-color: var(--accent-deep);
    color: #fff;
}

.trend-chart-title {
    font-size: var(--fs-sm);
    color: var(--ink-2);
    margin: 16px 0 8px 0;
}

.trend-chart-title:first-of-type {
    margin-top: 0;
}

/* charts.js heatmap + lineChart primitives */
.heatmap rect {
    stroke: var(--surface);
    stroke-width: 1;
}

.line-chart circle {
    cursor: pointer;
}

/* ============================================================
   Landing page (index.html) — hero, features, workflow, FAQ, etc.
   ============================================================ */

.main-landing {
    max-width: 1080px;
    /* Hero is full-bleed; keep side padding only for in-flow content below. */
    padding-top: 0;
}

.section-heading,
.content-heading {
    font-family: var(--font-display);
    font-size: clamp(26px, 4vw, 38px);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin: 0 0 40px;
    color: var(--ink);
    text-align: center;
}

/* Full-bleed section rhythm: each top-level landing section owns its own
   vertical spacing via padding (not margin), so alternate-background
   sections (stats, why-section) can bleed edge-to-edge without a visible
   seam between padding and background. */
.stats-section,
.features-section,
.workflow-section,
.screenshots-section,
.why-section,
.faq-section {
    padding: 96px 0;
    margin-bottom: 0;
}

@media (max-width: 640px) {
    .stats-section,
    .features-section,
    .workflow-section,
    .screenshots-section,
    .why-section,
    .faq-section {
        padding: 64px 0;
    }
}

/* Hero — full-bleed out of .main-landing so wide monitors don't get empty
   gutters with atmosphere trapped in the 1080px column (the screenshot bug). */
.hero-section {
    position: relative;
    overflow: hidden;
    border: none;
    border-radius: 0;
    background: transparent;
    width: 100vw;
    left: 50%;
    margin-left: -50vw;
    margin-right: 0;
    margin-top: 0;
    margin-bottom: 0;
    padding: 100px clamp(20px, 6vw, 72px);
    text-align: center;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.hero-glow {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(ellipse 55% 50% at 20% 25%, color-mix(in srgb, var(--accent) 22%, transparent) 0%, transparent 70%),
        radial-gradient(ellipse 50% 45% at 85% 15%, color-mix(in srgb, #8b95a5 40%, transparent) 0%, transparent 65%),
        radial-gradient(ellipse 60% 40% at 50% 100%, color-mix(in srgb, var(--accent) 12%, transparent) 0%, transparent 70%),
        linear-gradient(180deg, color-mix(in srgb, #b8bec8 55%, transparent) 0%, transparent 45%);
}

/* Slow-drifting gradient wash + soft smoke grain — motion/texture
   substitute for a hero photo. Static unless reduced-motion is off. */
.hero-glow::before {
    content: "";
    position: absolute;
    inset: -25%;
    opacity: 0.9;
    background: conic-gradient(
        from 0deg at 65% 35%,
        color-mix(in srgb, var(--accent) 16%, transparent) 0deg,
        transparent 80deg,
        color-mix(in srgb, #9aa3b2 22%, transparent) 180deg,
        transparent 280deg,
        color-mix(in srgb, var(--accent) 16%, transparent) 360deg
    );
}

.hero-glow::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(21, 24, 28, 0.16) 1px, transparent 1px);
    background-size: 26px 26px;
    /* Full-width grain — previous center-only mask caused the "column" look. */
    -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 70%, transparent 100%);
    mask-image: linear-gradient(180deg, #000 0%, #000 70%, transparent 100%);
    opacity: 0.55;
}

@media (prefers-reduced-motion: no-preference) {
    .hero-glow::before {
        animation: hero-drift 28s linear infinite;
    }
}

@keyframes hero-drift {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.hero-bolt {
    position: absolute;
    top: 10%;
    right: clamp(2%, 8vw, 12%);
    width: clamp(180px, 22vw, 320px);
    height: clamp(180px, 22vw, 320px);
    color: color-mix(in srgb, var(--ink) 12%, transparent);
    transform: rotate(8deg);
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 880px;
    width: min(880px, 100%);
    margin: 0 auto;
}

.hero-brand {
    font-family: var(--font-display);
    font-size: clamp(34px, 6vw, 56px);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.03em;
    margin: 0 auto 8px;
    color: var(--ink);
}

.hero-by {
    margin: 0 auto 18px;
    color: var(--muted);
    font-size: var(--fs-sm, 14px);
}

.hero-heading {
    font-family: var(--font-display);
    font-size: clamp(22px, 3.4vw, 32px);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.02em;
    max-width: 22ch;
    margin: 0 auto 14px;
    color: var(--ink);
}

.hero-subheading {
    font-size: clamp(16px, 2vw, 19px);
    font-weight: 400;
    line-height: 1.55;
    max-width: 48ch;
    color: var(--ink-2);
    margin: 0 auto 8px;
}

.hero-section .cta-row {
    justify-content: center;
    margin-top: 28px;
}

/* Stats section — full-bleed alternate smoke surface, bleeding past the
   centered .main-landing column via the classic negative-margin trick. */
.stats-section {
    background: color-mix(in srgb, var(--surface) 70%, #d8dbe1);
    width: 100vw;
    position: relative;
    left: 50%;
    margin-left: -50vw;
}

/* Full-bleed sections have no inherent horizontal gutter (they're 100vw),
   so their direct heading/text children need their own padding to avoid
   touching the viewport edge on narrow screens — the grid/paragraphs below
   re-center at the page's normal 1080px/72ch content width above that. */
.stats-section > .section-heading {
    max-width: 1080px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px;
    box-sizing: border-box;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    min-height: 4px;
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

/* Landing stat tiles reuse the dashboard's .stat-tile/.stat-label/.stat-value
   base look (surface bg, border, radius, shadow) but read as a centered,
   at-a-glance "by the numbers" strip rather than a left-aligned data field. */
.stat-tile-landing {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
    background-color: var(--elevated);
    border-color: transparent;
    box-shadow: none;
    transition: background-color 0.15s ease, transform 0.15s ease;
}

.stat-tile-landing:hover {
    background-color: color-mix(in srgb, var(--elevated) 80%, white);
    border-color: transparent;
    transform: translateY(-2px);
}

.stat-tile-landing .stat-value {
    font-family: var(--font-display);
    font-size: 32px;
    color: var(--ink);
}

.stat-value-static {
    font-size: 22px;
}

@media (max-width: 900px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-tile-landing .stat-value {
        font-size: 26px;
    }
}

/* Feature cards */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.feature-card {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 8px 4px 20px;
    box-shadow: none;
    border-top: 1px solid var(--border);
    transition: transform 0.15s ease;
}

.feature-card:hover {
    transform: translateY(-2px);
}

.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background-color: color-mix(in srgb, var(--ink) 6%, transparent);
    color: var(--ink);
    margin: 16px 0 14px;
}

.feature-icon svg {
    width: 22px;
    height: 22px;
}

.feature-title {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 600;
    margin: 0 0 6px;
    color: var(--ink);
}

.feature-desc {
    font-size: 15px;
    line-height: 1.65;
    color: var(--ink-2);
    margin: 0;
}

/* Workflow timeline */
.workflow-timeline {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.workflow-step {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    min-width: 0;
}

.workflow-step:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 15px;
    left: calc(50% + 24px);
    width: calc(100% - 48px);
    height: 2px;
    background-color: var(--border);
}

.workflow-step-num {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    border-radius: 50%;
    background-color: var(--elevated);
    color: var(--ink);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: var(--fs-sm);
    font-weight: 700;
    z-index: 1;
    margin-bottom: 10px;
}

.workflow-step-body {
    max-width: 160px;
}

.workflow-step-title {
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 4px;
}

.workflow-step-desc {
    font-size: var(--fs-xs);
    color: var(--muted);
    line-height: 1.4;
}

/* Screenshots section — now the live public strike-density map */
.landing-map-caption {
    text-align: center;
    max-width: 60ch;
    margin: -8px auto 20px;
    color: var(--muted);
    font-size: var(--fs-sm);
    line-height: 1.5;
}

.landing-map {
    position: relative;
    width: 100%;
    height: 480px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background-color: var(--elevated);
    box-shadow: 0 8px 28px rgba(26, 29, 33, 0.08);
    overflow: hidden;
}

.landing-map-note {
    position: absolute;
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%);
    z-index: 2;
    max-width: min(92%, 420px);
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background-color: color-mix(in srgb, var(--elevated) 92%, transparent);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--ink-2);
    font-size: var(--fs-sm);
    line-height: 1.4;
    text-align: center;
    box-shadow: 0 4px 16px rgba(21, 24, 28, 0.08);
}

.landing-map-note-quiet {
    color: var(--ink);
}

.landing-map-status {
    margin: 10px 0 0;
    text-align: center;
    font-size: var(--fs-sm);
    color: var(--ink-2);
    min-height: 1.3em;
}

.landing-map-legend {
    margin-top: 10px;
    padding: 12px 16px 14px;
    border-radius: var(--r-lg);
    border: 1px solid var(--border);
    background-color: var(--elevated);
}

.landing-map-legend-gradient {
    height: 10px;
    border-radius: var(--r-pill);
    /* Smoke slate (1 hr ago) → amber → hot red (now) — matches landing-map.js */
    background: linear-gradient(
        to right,
        #5c6570 0%,
        #8b93a0 25%,
        #c9a66b 50%,
        #e67e22 75%,
        #c62828 100%
    );
}

.landing-map-legend-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: var(--fs-xs);
    color: var(--ink-2);
}

.landing-map-legend-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    font-size: var(--fs-xs);
    color: var(--muted);
}

.landing-map-legend-axis {
    margin: 0;
    text-align: left;
    font-size: var(--fs-xs);
    color: var(--muted);
}

@media (max-width: 640px) {
    .landing-map {
        height: 300px;
    }

    .landing-map-legend-labels {
        font-size: var(--fs-xs);
    }
}

/* Why this exists — full-bleed alternate background, same negative-margin
   bleed technique as the stats section. Overrides .content-section's
   max-width/padding (shared with terms/privacy/pending pages) since this
   element carries both classes. */
.why-section {
    max-width: none;
    background: color-mix(in srgb, var(--surface) 70%, #d8dbe1);
    width: 100vw;
    position: relative;
    left: 50%;
    margin-left: -50vw;
}

.why-section .content-heading,
.why-section .content-text {
    max-width: 72ch;
    margin-left: auto;
    margin-right: auto;
}

.faq-list {
    max-width: 72ch;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.faq-item {
    background-color: var(--elevated);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 4px 16px;
}

.faq-item[open] {
    border-color: var(--accent-light);
}

.faq-question {
    cursor: pointer;
    list-style: none;
    padding: 14px 24px 14px 0;
    font-size: var(--fs-base);
    font-weight: 600;
    color: var(--ink);
    position: relative;
}

.faq-question::-webkit-details-marker {
    display: none;
}

.faq-question::after {
    content: "+";
    position: absolute;
    right: 0;
    top: 12px;
    font-size: var(--fs-lg);
    font-weight: 400;
    color: var(--muted);
    transition: transform 0.15s ease;
}

.faq-item[open] .faq-question::after {
    content: "\2212";
    color: var(--accent-deep);
}

.faq-answer {
    font-size: 15px;
    line-height: 1.65;
    color: var(--ink-2);
    margin: 0 0 16px;
}

/* Focus visibility for interactive elements on the landing page. Colour comes
   from the global :focus-visible rule at the top of this file (--accent-deep);
   these keep a wider offset so the ring clears the CTA's own fill. */
.cta-button:focus-visible,
.faq-question:focus-visible {
    outline-offset: 3px;
}

/* Responsive breakpoints for landing sections */
@media (max-width: 900px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 720px) {
    .workflow-timeline {
        flex-direction: column;
        align-items: stretch;
        gap: 24px;
    }

    .workflow-step {
        flex-direction: row;
        text-align: left;
        align-items: flex-start;
    }

    .workflow-step-num {
        margin-bottom: 0;
        margin-right: 14px;
    }

    .workflow-step-body {
        max-width: none;
    }

    .workflow-step:not(:last-child)::after {
        content: "";
        position: absolute;
        top: 30px;
        left: 15px;
        width: 2px;
        height: calc(100% + 10px);
        background-color: var(--border);
    }
}

@media (max-width: 640px) {
    .hero-section {
        padding: 88px 18px 72px;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .hero-bolt {
        width: 140px;
        height: 140px;
        opacity: 0.7;
        right: -4%;
    }
}

/* Reveal-on-scroll motion. Hidden entirely inside the no-preference media
   query so reduced-motion visitors never see permanently-hidden content —
   outside it, .reveal/.reveal.in are both fully visible by default. */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(24px);
        transition: opacity 0.6s cubic-bezier(0.22, 0.61, 0.36, 1),
            transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
    }

    .reveal.in {
        opacity: 1;
        transform: translateY(0);
    }

    /* Stagger comes from nth-child, NOT from a style="--i: N" attribute.
       The sitewide CSP is style-src 'self', which blocks style ATTRIBUTES as
       well as <style> blocks -- so the inline --i never landed, every card
       fell back to --i: 0, and the whole group animated in at once instead of
       in sequence. Nothing in the CSS looked wrong, which is why this
       survived: only the browser console showed it. */
    .feature-card:nth-child(1),
    .stat-tile:nth-child(1) { transition-delay: 0ms; }
    .feature-card:nth-child(2),
    .stat-tile:nth-child(2) { transition-delay: 60ms; }
    .feature-card:nth-child(3),
    .stat-tile:nth-child(3) { transition-delay: 120ms; }
    .feature-card:nth-child(4),
    .stat-tile:nth-child(4) { transition-delay: 180ms; }
    .feature-card:nth-child(5),
    .stat-tile:nth-child(5) { transition-delay: 240ms; }
    .feature-card:nth-child(6),
    .stat-tile:nth-child(6) { transition-delay: 300ms; }
}

/* ---- Cookie notice (cookies.js), compact since 2026-10-22 ----------------
   A slim strip along the bottom of the window instead of a card in the middle
   of it. It no longer floats over anything: cookies.js writes its height to
   --cookie-h on <html>, map pages take that off the map's height (map.css),
   so the Live/Archive switch, Play, the time bar and the satellite switch
   sit above it, and every other page pads its end by it. */
.cookie-notice {
    position: fixed;
    z-index: 250;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    gap: var(--sp-2) var(--sp-4);
    padding: var(--sp-2) var(--sp-4);
    padding-bottom: max(var(--sp-2), env(safe-area-inset-bottom));
    background: var(--elevated);
    border-top: 1px solid var(--border);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
    font-size: var(--fs-sm);
    line-height: 1.4;
}

.cookie-notice[hidden] {
    display: none;
}

.cookie-notice-text {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    color: var(--ink-2);
}

.cookie-notice-text a {
    color: var(--accent-deep);
}

.cookie-notice-actions {
    display: flex;
    flex: 0 0 auto;
    gap: var(--sp-2);
}

.cookie-notice-accept,
.cookie-notice-essential {
    border-radius: var(--r-sm);
    padding: 5px 12px;
    font: inherit;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}

.cookie-notice-accept {
    border: 1px solid var(--ink);
    background: var(--ink);
    color: #f5f6f8;
}

.cookie-notice-essential {
    border: 1px solid var(--border);
    background: transparent;
    color: var(--ink);
}

.cookie-notice-essential:hover {
    border-color: var(--accent);
}

/* Pages that scroll keep their last lines reachable above the strip. Map
   pages (body > .map-page) shrink the map instead, see map.css. */
body:not(:has(> .map-page)) {
    padding-bottom: var(--cookie-h, 0px);
}

@media (max-width: 640px) {
    .cookie-notice {
        flex-wrap: wrap;
        padding: 6px var(--sp-3);
        padding-bottom: max(6px, env(safe-area-inset-bottom));
        font-size: var(--fs-xs);
    }

    .cookie-notice-actions {
        margin-left: auto;
    }
}

/* ---- Phones and touch screens (2026-10-09 mobile pass) --------------------
   Measured on every page at 360 and 390 px with a touch viewport. */

/* .cta-primary's 11.5rem min-width comes later in this file than .header-cta
   and won, so on a phone the two header buttons squeezed the site name on
   the landing page down to "Lig". */
.header-actions .header-cta {
    min-width: 0;
}

@media (max-width: 380px) {
    /* Both buttons and the site name do not fit; the hero and the sign-in
       page both link to signup. */
    body.landing-page .header-cta.cta-secondary {
        display: none;
    }
}

/* A grid column holding a fixed-width SVG chart would grow to the chart's
   width and push the page sideways (/pull-status at 390 px). */
.trends-grid > * {
    min-width: 0;
}

.chart-svg.dot-strip {
    max-width: 100%;
    height: auto;
}

@media (pointer: coarse) {
    /* iOS Safari zooms the page into any form field under 16 px when it is
       tapped, and does not zoom back out. */
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="button"]):not([type="submit"]):not([type="reset"]),
    select,
    textarea {
        font-size: 16px;
    }

    input[type="checkbox"],
    input[type="radio"] {
        width: 20px;
        height: 20px;
        flex: 0 0 auto;
    }

    input[type="range"] {
        min-height: 32px;
    }

    .footer-links a {
        display: inline-block;
        padding: 6px 4px;
    }

    .form-footer a {
        display: inline-block;
        padding: 4px 0;
    }
}

/* ---- Loading bar and region card (net-progress.js, 2026-10-22) ------------
   The bar sits right under the header (--np-top, measured by the script) and
   never takes clicks. Filled = known size; moving stripes = size unknown,
   bytes so far in the chip under it. */
.np-bar {
    position: fixed;
    top: var(--np-top, 0px);
    left: 0;
    right: 0;
    z-index: 300;
    height: 3px;
    overflow: hidden;
    pointer-events: none;
    background: color-mix(in srgb, var(--accent) 22%, transparent);
    opacity: 1;
    transition: opacity 0.26s ease;
}

.np-bar[hidden] {
    display: none;
}

.np-bar-fill {
    height: 100%;
    background: var(--accent-deep);
    transform-origin: left center;
    transform: scaleX(0);
    transition: transform 0.2s ease-out;
}

.np-bar.np-indeterminate .np-bar-fill {
    transform: none;
    background: repeating-linear-gradient(-45deg,
        var(--accent-deep) 0 8px,
        color-mix(in srgb, var(--accent-deep) 35%, transparent) 8px 16px);
    background-size: 22.63px 100%;
    animation: np-stripe 0.6s linear infinite;
}

.np-bar.np-error .np-bar-fill {
    background: var(--critical);
}

.np-bar.np-fade {
    opacity: 0;
}

@keyframes np-stripe {
    to { background-position: 22.63px 0; }
}

.np-chip {
    position: fixed;
    top: calc(var(--np-top, 0px) + 6px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 300;
    padding: 1px 8px;
    border-radius: var(--r-pill);
    background: var(--ink);
    color: #f5f6f8;
    font-size: var(--fs-xs);
    font-variant-numeric: tabular-nums;
    line-height: 1.5;
    pointer-events: none;
    box-shadow: var(--shadow-2);
}

.np-chip[hidden] {
    display: none;
}

.np-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* Region card: centred over the view that is waiting (map pages: .map-page). */
.np-region {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 16;
    width: min(300px, calc(100% - 32px));
    padding: var(--sp-3) var(--sp-4);
    border-radius: var(--r-md);
    background-color: color-mix(in srgb, var(--surface) 95%, transparent);
    backdrop-filter: blur(6px);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-3);
    color: var(--ink);
    font-size: var(--fs-sm);
    line-height: 1.4;
}

.np-region[hidden] {
    display: none;
}

.np-region-label {
    font-weight: 600;
    margin-bottom: var(--sp-2);
}

.np-region-track {
    height: 6px;
    border-radius: var(--r-pill);
    overflow: hidden;
    background: color-mix(in srgb, var(--accent) 18%, transparent);
}

.np-region-fill {
    height: 100%;
    background: var(--accent-deep);
    transform-origin: left center;
    transform: scaleX(0);
    transition: transform 0.2s ease-out;
}

.np-region.np-indeterminate .np-region-fill {
    transform: none;
    background: repeating-linear-gradient(-45deg,
        var(--accent-deep) 0 8px,
        color-mix(in srgb, var(--accent-deep) 35%, transparent) 8px 16px);
    background-size: 22.63px 100%;
    animation: np-stripe 0.6s linear infinite;
}

.np-region.np-error .np-region-fill {
    background: var(--critical);
}

.np-region.np-error .np-region-label {
    color: var(--critical-text);
}

.np-region-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-2);
    margin-top: 6px;
    min-height: 18px;
    font-size: var(--fs-xs);
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.np-region-actions {
    display: flex;
    gap: 6px;
    margin-left: auto;
}

.np-region-btn {
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    background: var(--elevated);
    color: var(--ink);
    font: inherit;
    font-weight: 600;
    padding: 3px 10px;
    cursor: pointer;
}

.np-region-btn[hidden] {
    display: none;
}

.np-region-retry {
    background: var(--accent-deep);
    border-color: var(--accent-deep);
    color: #fff;
}

@media (prefers-reduced-motion: reduce) {
    .np-bar,
    .np-bar-fill,
    .np-region-fill {
        transition: none;
    }

    .np-bar.np-indeterminate .np-bar-fill,
    .np-region.np-indeterminate .np-region-fill {
        animation: none;
    }
}

/* Cloudflare Turnstile slot on the auth forms (public/captcha.js). Empty and
   without height unless Cloudflare shows its checkbox. */
.captcha-slot:not(:empty) {
    display: flex;
    justify-content: center;
    margin: 12px 0;
    min-height: 65px;
}
