/**
 * @file public/assets/css/app.css
 * @brief Core application styles (landing, modal, indicator, map container).
 */

@import url('/assets/css/tokens.css');
/* Google Fonts moved out of an @import into a non-blocking <link> in
 * each view's <head> (src/views/home/index.phtml and friends). Loading
 * them here made app.css render-blocking on Google's domain too, and
 * the font swap-in caused the .app-shell CLS spike (0.186) reported
 * by Lighthouse 2026-04. */

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
    color: var(--fg-0);
    background: var(--bg-0);
    min-height: 100vh;
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    font-family: var(--font-ui);
    letter-spacing: -0.01em;
    margin: 0 0 var(--space-4);
    font-weight: 600;
    /* Syne has prominent descenders (g, ê, y, j). An explicit roomy
     * line-height prevents the browser from clipping them on titles
     * like "Qu'est-ce qui vous gêne ?". */
    line-height: 1.25;
    padding-bottom: 0.04em;
}

a { color: var(--aurora-blue); text-decoration: none; transition: opacity var(--dur-1) var(--ease); }
a:hover { opacity: 0.8; }

button {
    font-family: inherit;
    cursor: pointer;
    border: 0;
    padding: 0.7rem 1rem;
    border-radius: var(--radius);
    font-weight: 600;
    transition: transform var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}
button:focus-visible {
    outline: 2px solid var(--aurora-violet);
    outline-offset: 2px;
}

.btn-primary {
    background: var(--grad-primary);
    color: #fff;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-2); }

.btn-ghost {
    background: transparent;
    color: var(--fg-0);
    border: 1px solid var(--border);
}

/* --------------------------------------------------------------- */
/* Layout                                                          */
/* --------------------------------------------------------------- */
.app-shell {
    min-height: 100vh;
    display: flex; flex-direction: column;
}
header.top {
    --cs-header-h: 64px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: var(--space-4) var(--space-5);
    padding: var(--space-4) var(--space-6);
    border-bottom: 1px solid var(--border);
    background: rgba(13, 17, 23, 0.8);
    backdrop-filter: blur(8px);
    /* Must sit above the globe zoom controls (850) and FAB rail (26) so the
     * language picker and burger menu overlay them cleanly on every page. */
    position: sticky; top: 0; z-index: 900;
    min-width: 0;
    /* CLS guard: reserve final header height so DM Sans / Syne swapping
     * in does NOT nudge the sticky bar by a few pixels (each px translates
     * into layout-shift score for the full app-shell width). Value tuned
     * to match the steady-state header after web fonts load. */
    min-height: 64px;
    box-sizing: border-box;
}
/* About / Places mega-menu + language dropdown use fixed or tall panels that overlap
 * #stage-canvas. #cs-location-share-fab is z-index 1100; without this, the share
 * tile paints above the header stacking context (900) and clips the open menu. */
header.top:has(details.cs-about-nav[open]),
header.top:has(details.cs-lang-switch[open]) {
    z-index: 1150;
}
@media (max-width: 640px) {
    header.top { min-height: 56px; --cs-header-h: 56px; }
}
header.top .brand {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    flex: 0 0 auto;
    flex-shrink: 0;
    max-width: 100%;
}
header.top .brand .brand-mark {
    width: 28px;
    height: 28px;
    display: block;
    filter: drop-shadow(0 0 8px rgba(0, 255, 178, 0.30));
}

/* -------------------------------------------------------------------
 * Brand wordmark (Aurora split "Clear" in aurora-green + glow,
 * followed by "Spot" in neutral foreground). Rendered via the
 * productBrandHtml() PHP helper which emits a <span class="brand-name">
 * wrapping two inner spans (.brand-name-accent + .brand-name-mute).
 * ------------------------------------------------------------------- */
.brand-name {
    font-family: var(--font-ui);
    font-weight: 800;
    font-size: 1.125rem;
    letter-spacing: 0.01em;
    color: var(--fg-0);
    display: inline-flex;
    align-items: baseline;
}
.brand-name-accent {
    color: var(--aurora-green);
    letter-spacing: 0.04em;
    text-shadow: var(--glow-brand);
}
.brand-name-mute {
    color: var(--fg-0);
    letter-spacing: 0.01em;
}
header.top .top-end {
    margin-left: auto;
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-2) var(--space-4);
}
header.top .top-nav {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    align-items: center;
    overflow: visible;
}
header.top .top-end { overflow: visible; }
header.top .top-nav a { color: var(--fg-1); font-size: 0.9rem; }
header.top .top-nav a[aria-current="page"] { color: var(--aurora-green); font-weight: 600; }
header.top .top-nav .cs-about-summary { color: var(--fg-1); font-size: 0.9rem; }
header.top .top-nav .cs-about-summary.is-active { color: var(--aurora-green); font-weight: 600; }

/* Burger: hidden on wide screens */
.cs-nav-burger {
    display: none;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin-left: auto;
    margin-right: var(--space-2);
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(10, 13, 26, 0.75);
    color: var(--fg-0);
    cursor: pointer;
    box-shadow: var(--shadow-2);
    transition: background var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease);
}
.cs-nav-burger:hover {
    border-color: rgba(123, 94, 167, 0.45);
    background: rgba(124, 92, 255, 0.18);
}
.cs-nav-burger:focus-visible {
    outline: 2px solid var(--brand, #7c5cff);
    outline-offset: 2px;
}
.cs-nav-burger-inner {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 18px;
}
.cs-nav-burger-inner span {
    display: block;
    height: 2px;
    border-radius: 1px;
    background: currentColor;
    transition: transform var(--dur-2) var(--ease), opacity var(--dur-2) var(--ease);
}
header.top.nav-open .cs-nav-burger-inner span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
header.top.nav-open .cs-nav-burger-inner span:nth-child(2) {
    opacity: 0;
}
header.top.nav-open .cs-nav-burger-inner span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}
.cs-nav-backdrop {
    display: none;
}

@media (max-width: 768px) {
    header.top {
        flex-wrap: nowrap;
        align-items: center;
        padding: var(--space-3) var(--space-4);
        gap: var(--space-2);
    }
    header.top .brand {
        min-width: 0;
        flex: 1 1 auto;
    }
    header.top .brand-name {
        font-size: clamp(0.92rem, 4.2vw, 1.05rem);
    }
    .cs-nav-burger {
        display: inline-flex;
        order: 2;
        margin-left: 0;
    }
    header.top .brand {
        order: 1;
    }
    header.top .top-end {
        order: 3;
        margin-left: 0;
        width: auto;
        flex: 0 0 auto;
        flex-wrap: nowrap;
        justify-content: flex-end;
        gap: var(--space-2);
    }
    header.top .top-nav {
        position: fixed;
        left: 0;
        right: 0;
        top: 0;
        margin-top: calc(env(safe-area-inset-top, 0px) + 52px);
        max-height: min(72vh, calc(100dvh - 64px));
        overflow-y: auto;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: var(--space-4);
        background: rgba(13, 17, 23, 0.98);
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-2);
        /* Above the header itself (900) so the expanded menu sits on top of
         * the globe controls and FAB rail. */
        z-index: 920;
        display: none;
    }
    header.top.nav-open .top-nav {
        display: flex;
    }
    header.top .top-nav > a,
    header.top .top-nav > details {
        padding: var(--space-3) 0;
        border-bottom: 1px solid var(--border);
        font-size: 1rem;
    }
    header.top .top-nav > a:last-child,
    header.top .top-nav > details:last-child {
        border-bottom: none;
    }
    header.top .top-nav > a {
        color: var(--fg-0);
        text-decoration: none;
    }
    header.top .top-nav .cs-about-summary {
        width: 100%;
        padding: var(--space-2) 0;
        font-size: 1rem;
    }
    /* Flex column + min-width:auto can shrink <details> to summary text width;
     * submenu then looks like a narrow floating strip. Match other items: full width. */
    header.top .top-nav > details.cs-about-nav {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        align-self: stretch;
        box-sizing: border-box;
    }
    header.top .top-nav .cs-about-menu {
        position: static;
        margin-top: var(--space-2);
        width: 100%;
        min-width: 0;
        box-shadow: none;
        border: 1px solid var(--border);
    }
    /* Burger open: force About / Places dropdowns to span the drawer like root links.
     * Desktop mega uses position:fixed + right:10px; without a hard override some
     * engines still resolve the open panel to the viewport edge beside a narrow <details>. */
    header.top.nav-open .top-nav > details.cs-about-nav {
        display: block;
        width: 100%;
        max-width: 100%;
    }
    header.top.nav-open .top-nav .cs-about-nav .cs-about-menu,
    header.top.nav-open .top-nav .cs-about-nav--mega > .cs-about-menu,
    header.top.nav-open .top-nav .cs-about-nav--mega[open] > .cs-about-menu {
        position: static !important;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        box-sizing: border-box;
        align-self: stretch;
    }
    header.top.nav-open .top-nav .cs-about-summary {
        display: flex;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    header.top.nav-open .top-nav .cs-about-datasources-guides {
        margin-left: 0;
        margin-right: 0;
        padding-left: var(--space-3);
        max-width: 100%;
        box-sizing: border-box;
    }
    header.top.nav-open .top-nav .cs-about-item.cs-about-item--nested {
        display: flex;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    .cs-nav-backdrop {
        display: block;
        position: fixed;
        left: 0;
        right: 0;
        top: 52px;
        bottom: 0;
        /* Between the globe stage (<=850) and the header row (>=900) so it
         * dims the map/globe but stays below the menu + burger controls. */
        z-index: 890;
        margin: 0;
        padding: 0;
        border: 0;
        background: rgba(5, 8, 15, 0.55);
        backdrop-filter: blur(4px);
        cursor: pointer;
    }
    .cs-nav-backdrop[hidden] {
        display: none !important;
    }
    header.top.nav-open {
        /* Match desktop :has(details[open]) bump so burger drawer stays above share FAB (1100). */
        z-index: 1150;
    }
    header.top.nav-open .brand,
    header.top.nav-open .cs-nav-burger,
    header.top.nav-open .top-end {
        position: relative;
        z-index: 940;
    }
}

body.cs-header-nav-open {
    overflow: hidden;
    touch-action: none;
}

/* While the first-visit onboarding is on screen, hide every stage overlay
 * (globe zoom/compass controls, FAB rail, exposure indicator) so the modal
 * stands alone. They all come back automatically when the modal closes. */
body.cs-onboarding-open .cs-globe-controls,
body.cs-onboarding-open .cs-stage-fabs,
body.cs-onboarding-open .exposure-indicator,
body.cs-onboarding-open .cs-stage-loading,
body.cs-onboarding-open .cs-globe-loading,
body.cs-onboarding-open .cs-map-loading,
body.cs-onboarding-open .cs-pwa-install {
    display: none !important;
}

.cs-about-nav { position: relative; overflow: visible; }
.cs-about-summary {
    list-style: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.35rem 0.5rem;
    border-radius: var(--radius);
    border: 1px solid transparent;
    color: var(--fg-1);
    font-size: 0.95rem;
    transition: background var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease), color var(--dur-2) var(--ease);
}
.cs-about-summary::-webkit-details-marker { display: none; }
.cs-about-summary:hover { color: var(--fg-0); background: rgba(124, 92, 255, 0.08); }
.cs-about-summary.is-active { color: var(--fg-0); border-color: rgba(123, 94, 167, 0.35); background: rgba(124, 92, 255, 0.12); }
.cs-about-menu {
    position: absolute;
    left: 0;
    top: calc(100% + 8px);
    min-width: 13rem;
    margin: 0;
    padding: var(--space-2);
    list-style: none;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-2);
    z-index: 30;
}
/* About mega: fixed to viewport so the panel is not clipped by flex/overflow-x; right edge = screen minus 10px. */
@media (min-width: 769px) {
    header.top .top-nav .cs-about-nav--mega[open] > .cs-about-menu {
        position: fixed;
        left: auto;
        right: 10px;
        top: calc(env(safe-area-inset-top, 0px) + var(--cs-header-h, 64px) + 6px);
        /* Sits just under the sticky bar (min-height can be a few px short of the painted bar). */
        margin-top: 0;
        /* Above .cs-lang-menu (30) inside .top-end so the panel is not covered by the flag tile. */
        z-index: 50;
        min-width: min(28rem, calc(100vw - 20px));
        max-width: calc(100vw - 20px);
        width: max-content;
        max-height: min(80vh, calc(100dvh - env(safe-area-inset-top, 0px) - var(--cs-header-h, 64px) - 24px));
        overflow-x: visible;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    header.top .top-nav .cs-about-nav--mega .cs-about-datasources-guides a.cs-about-item--nested {
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
        max-width: none;
        flex-shrink: 1;
    }
}
@media (max-width: 768px) {
    header.top .top-nav .cs-about-nav--mega > .cs-about-menu {
        position: static;
        left: auto;
        right: auto;
        top: auto;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
        overflow-x: visible;
    }
    header.top .top-nav .cs-about-nav--mega .cs-about-datasources-guides a.cs-about-item--nested {
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
        max-width: none;
    }
}
.cs-about-item {
    display: block;
    padding: 0.45rem 0.6rem;
    border-radius: var(--radius);
    color: var(--fg-1);
    text-decoration: none;
    font-size: 0.9rem;
}
.cs-about-item:hover { background: rgba(124, 92, 255, 0.12); color: var(--fg-0); }
.cs-about-item[aria-current="page"] { color: var(--accent-0); font-weight: 600; }

.cs-about-datasources-guides {
    list-style: none;
    margin: 0.35rem 0 0 0.35rem;
    padding: 0 0 0 0.65rem;
    border-left: 2px solid rgba(123, 94, 167, 0.35);
}
.cs-about-datasources-guides > li { margin: 0.1rem 0; }
.cs-about-guide-tier {
    list-style: none;
    margin: 0.4rem 0 0 0;
    padding: 0;
}
.cs-about-guide-tier:first-child { margin-top: 0.12rem; }
.cs-about-guide-tier__head { margin: 0 0 0.1rem 0.05rem; }
.cs-about-guide-tier__tag {
    display: block;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(233, 238, 249, 0.45);
    line-height: 1.2;
}
.cs-about-guide-tier__list {
    list-style: none;
    margin: 0.12rem 0 0 0;
    padding: 0;
}
.cs-about-guide-tier__list > li { margin: 0.1rem 0; }
.cs-about-item.cs-about-item--nested {
    font-size: 0.82rem;
    line-height: 1.35;
    padding: 0.22rem 0.4rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.about-subnav-guides {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.5rem;
    width: 100%;
    margin: -0.25rem 0 var(--space-4) 0;
    padding-top: var(--space-3);
    border-top: 1px solid var(--border);
}
.about-subnav-guides--tiered {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0.75rem;
}
.about-subnav-guides-tier { margin: 0; padding: 0; }
.about-subnav-guides-tier__tag {
    margin: 0 0 0.35rem 0;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(233, 238, 249, 0.45);
}
.about-subnav-guides-tier__links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.5rem;
    align-items: center;
}
.about-subnav-guides a {
    font-size: 0.82rem;
    color: var(--fg-2);
    text-decoration: none;
    padding: 0.28rem 0.55rem;
    border-radius: var(--radius);
    border: 1px solid transparent;
}
.about-subnav-guides a:hover { color: var(--fg-0); background: rgba(124, 92, 255, 0.1); }
.about-subnav-guides a.is-active {
    color: var(--accent-0);
    border-color: rgba(123, 94, 167, 0.4);
    background: rgba(124, 92, 255, 0.12);
}
/* Data guide links: map/layers colour scale + POI SVGs (header + about chips). */
.about-subnav-guides a[data-cs-guide],
.cs-about-datasources-guides a[data-cs-guide] {
    display: inline-flex;
    align-items: center;
}
.about-subnav-guides a[data-cs-guide]::before,
.cs-about-datasources-guides a[data-cs-guide]::before {
    content: '';
    display: inline-block;
    width: 1.2rem;
    height: 1.2rem;
    margin-right: 0.48rem;
    flex-shrink: 0;
    background: center / contain no-repeat;
    filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.45));
}
/* Header + mobile drawer: slightly larger than about-page chips. */
header.top .cs-about-datasources-guides a[data-cs-guide]::before {
    width: 1.4rem;
    height: 1.4rem;
    margin-right: 0.55rem;
}
.about-subnav-guides a[data-cs-guide="nuclear"]::before,
.cs-about-datasources-guides a[data-cs-guide="nuclear"]::before {
    background-image: url('/assets/img/poi-icon-nuclear.svg');
}
.about-subnav-guides a[data-cs-guide="coal"]::before,
.cs-about-datasources-guides a[data-cs-guide="coal"]::before {
    background-image: url('/assets/img/poi-icon-coal.svg');
}
.about-subnav-guides a[data-cs-guide="telecom"]::before,
.cs-about-datasources-guides a[data-cs-guide="telecom"]::before {
    background-image: url('/assets/img/poi-icon-telecom.svg');
}
/* Wind: turbine pictogram (aligns with map + layers panel). */
.about-subnav-guides a[data-cs-guide="wind"]::before,
.cs-about-datasources-guides a[data-cs-guide="wind"]::before {
    background-image: url('/assets/img/poi-icon-wind.svg');
    background-color: transparent;
    border-radius: 0;
    box-shadow: 0 0 1px rgba(0, 0, 0, 0.4);
    filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.45));
}
/* ZOI / NZOI: colour dots (same hues as layers panel). */
.about-subnav-guides a[data-cs-guide="air"]::before,
.cs-about-datasources-guides a[data-cs-guide="air"]::before {
    background-image: none;
    background-color: #6be7a5;
    border-radius: 50%;
    width: 0.68rem;
    height: 0.68rem;
    box-shadow: 0 0 6px rgba(107, 231, 165, 0.35);
}
header.top .cs-about-datasources-guides a[data-cs-guide="air"]::before { width: 0.8rem; height: 0.8rem; }
.about-subnav-guides a[data-cs-guide="noise"]::before,
.cs-about-datasources-guides a[data-cs-guide="noise"]::before {
    background-image: none;
    background-color: #ff9f4a;
    border-radius: 50%;
    width: 0.68rem;
    height: 0.68rem;
    box-shadow: 0 0 6px rgba(255, 159, 74, 0.35);
}
header.top .cs-about-datasources-guides a[data-cs-guide="noise"]::before { width: 0.8rem; height: 0.8rem; }
.about-subnav-guides a[data-cs-guide="pollen"]::before,
.cs-about-datasources-guides a[data-cs-guide="pollen"]::before {
    background-image: none;
    background-color: #f6d36b;
    border-radius: 50%;
    width: 0.68rem;
    height: 0.68rem;
    box-shadow: 0 0 6px rgba(246, 211, 107, 0.35);
}
header.top .cs-about-datasources-guides a[data-cs-guide="pollen"]::before { width: 0.8rem; height: 0.8rem; }
.about-subnav-guides a[data-cs-guide="light"]::before,
.cs-about-datasources-guides a[data-cs-guide="light"]::before {
    background-image: none;
    background-color: #00b4d4;
    border-radius: 50%;
    width: 0.68rem;
    height: 0.68rem;
    box-shadow: 0 0 6px rgba(0, 180, 212, 0.35);
}
header.top .cs-about-datasources-guides a[data-cs-guide="light"]::before { width: 0.8rem; height: 0.8rem; }
.about-subnav-guides a[data-cs-guide="mosquito"]::before,
.cs-about-datasources-guides a[data-cs-guide="mosquito"]::before {
    background-image: none;
    background-color: #f97316;
    border-radius: 50%;
    width: 0.68rem;
    height: 0.68rem;
    box-shadow: 0 0 6px rgba(249, 115, 22, 0.35);
}
header.top .cs-about-datasources-guides a[data-cs-guide="mosquito"]::before { width: 0.8rem; height: 0.8rem; }
/* HVT: same asset as layers panel; gold glow for dark header background. */
.about-subnav-guides a[data-cs-guide="hvt"]::before,
.cs-about-datasources-guides a[data-cs-guide="hvt"]::before {
    background-image: url('/assets/img/icon-hvt.svg');
    background-color: transparent;
    border-radius: 0;
    box-shadow: 0 0 2px rgba(234, 179, 8, 0.45);
    filter: drop-shadow(0 0 2px rgba(15, 10, 0, 0.6))
        drop-shadow(0 0 4px rgba(250, 204, 21, 0.7))
        drop-shadow(0 0 8px rgba(234, 179, 8, 0.35));
}
header.top .cs-about-datasources-guides a[data-cs-guide="hvt"]::before { width: 1.4rem; height: 1.4rem; }
.about-subnav-guides a[data-cs-guide="spatial-layers"]::before,
.cs-about-datasources-guides a[data-cs-guide="spatial-layers"]::before {
    background-image: none;
    background: linear-gradient(135deg, #a855f7 0%, #38bdf8 55%, #6be7a5 100%);
    border-radius: 50%;
    width: 0.68rem;
    height: 0.68rem;
    box-shadow: 0 0 6px rgba(168, 85, 247, 0.35);
}
header.top .cs-about-datasources-guides a[data-cs-guide="spatial-layers"]::before { width: 0.8rem; height: 0.8rem; }

.about-data-guides-list {
    margin: var(--space-3) 0 0 0;
    padding-left: 1.25rem;
    color: var(--fg-1);
}
.about-data-guides-list li { margin: 0.4rem 0; }
.about-data-guides-list a { color: var(--aurora-violet); text-decoration: underline; }

.about-subnav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    margin-bottom: var(--space-5);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--border);
}
.about-subnav a {
    font-size: 0.9rem;
    color: var(--fg-1);
    text-decoration: none;
    padding: 0.35rem 0.65rem;
    border-radius: var(--radius);
    border: 1px solid transparent;
}
.about-subnav a:hover { color: var(--fg-0); background: rgba(124, 92, 255, 0.1); }
.about-subnav a.is-active {
    color: var(--accent-0);
    border-color: rgba(123, 94, 167, 0.4);
    background: rgba(124, 92, 255, 0.12);
}

.cs-lang-switch { position: relative; }
.cs-lang-summary {
    list-style: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: rgba(10, 13, 26, 0.75);
    transition: background var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease);
}
.cs-lang-summary::-webkit-details-marker { display: none; }
.cs-lang-summary:hover { border-color: rgba(123, 94, 167, 0.45); background: rgba(124, 92, 255, 0.15); }
.cs-lang-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 12rem;
    margin: 0;
    padding: var(--space-2);
    list-style: none;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-2);
    z-index: 30;
}
.cs-lang-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem 0.6rem;
    border-radius: var(--radius);
    color: var(--fg-1);
    text-decoration: none;
    font-size: 0.9rem;
}
.cs-lang-item:hover { background: rgba(124, 92, 255, 0.12); color: var(--fg-0); }
.cs-lang-item[aria-current="true"] { background: rgba(0, 255, 178, 0.08); color: var(--aurora-green); }
.cs-lang-flag { font-size: 1.35rem; line-height: 1; }

.auth-page-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(40% 40% at 20% 20%, rgba(123, 94, 167, 0.22), transparent 70%),
        radial-gradient(50% 50% at 80% 80%, rgba(0, 255, 178, 0.10), transparent 70%),
        radial-gradient(35% 35% at 60% 15%, rgba(88, 232, 255, 0.08), transparent 70%),
        var(--bg-0);
}
.auth-page-layout .auth-fill {
    flex: 1;
    display: grid;
    place-items: center;
    padding: var(--space-6);
}

.account-subnav {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    padding: var(--space-2) var(--space-6);
    border-bottom: 1px solid var(--border);
    background: rgba(13, 17, 23, 0.55);
    font-size: 0.88rem;
}
.account-subnav a { color: var(--fg-1); }
.account-subnav a:hover { color: var(--fg-0); }
.account-subnav a[aria-current="page"] { color: var(--aurora-green); font-weight: 600; }

main.stage {
    flex: 1;
    min-height: 0;
    position: relative;
    display: flex;
    flex-direction: column;
}
@media (max-width: 768px) {
    main.stage {
        min-height: min(70dvh, 560px);
    }
    /* While the 2D map is open, lock the document scrollport. Otherwise
     * panning the map on iOS/Android can chain to the page ("rubber
     * band") and the sticky header scrolls away with the viewport. */
    html:has(#map.is-active),
    body:has(#map.is-active) {
        height: 100%;
        max-height: 100dvh;
        overflow: hidden;
        overscroll-behavior: none;
    }
    .app-shell:has(#map.is-active) {
        min-height: 100dvh;
        height: 100dvh;
        max-height: 100dvh;
        overflow: hidden;
    }
    main.stage:has(#map.is-active) {
        min-height: 0;
        flex: 1 1 auto;
    }
}

/* --------------------------------------------------------------- */
/* Globe / Map container                                           */
/* --------------------------------------------------------------- */
#stage-canvas {
    position: relative;
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    background: radial-gradient(60% 60% at 50% 30%, rgba(123, 94, 167, 0.22), transparent 70%),
                radial-gradient(50% 50% at 70% 80%, rgba(88, 232, 255, 0.10), transparent 70%),
                radial-gradient(45% 45% at 30% 85%, rgba(0, 255, 178, 0.08), transparent 70%),
                var(--bg-0);
}
#globe { position: absolute; inset: 0; width: 100%; height: 100%; transition: opacity var(--dur-3) var(--ease); }
#map   { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; transition: opacity var(--dur-3) var(--ease); }
#map.is-active  { opacity: 1; pointer-events: auto; z-index: 2; }
#globe.is-hidden { opacity: 0; pointer-events: none; }

/* --------------------------------------------------------------- */
/* Leaflet + markercluster overrides (Aurora palette)              */
/* --------------------------------------------------------------- */
.cs-popup { font-family: inherit; color: var(--fg-0); min-width: 180px; }
.cs-popup strong { color: var(--fg-0); font-weight: 600; }
.cs-popup-row { margin-top: 4px; font-size: 0.85rem; color: var(--fg-muted); }
.cs-popup-row .mono { font-family: ui-monospace, "SF Mono", monospace; font-size: 0.8rem; }

/* Invisible marker used for aggregated-bin points. The visible
 * circle comes from the parent markercluster badge (see below);
 * individual bins are never rendered on their own because the
 * cluster group's zoom-aware `maxClusterRadius` always merges
 * them into a single pastel circle per country / région /
 * département, matching the colour-coded style the user asked
 * for ("garder les cercles avec les couleurs comme sur le 2e
 * screenshot"). */
.cs-turbine-bin {
    background: transparent;
    border: 0;
    width: 1px !important;
    height: 1px !important;
    opacity: 0;
    pointer-events: none;
}

/* Turbine cluster badge. Inherits the classic markercluster green /
 * yellow / orange palette via .marker-cluster-{small,medium,large},
 * then adds an explicit `huge` tier (hot pink, 1 000+ turbines) that
 * the stock MarkerCluster.Default.css does NOT ship. Without these
 * rules the 1 000+ clusters rendered as bare white numbers with no
 * background disc (bug report: "je vois des 18k blanc sans le
 * rond"). Mirrors the aurora-alert palette used by the pollen /
 * air popups at level 5, so density reads consistently across the
 * product. */
.cs-turbine-cluster {
    font-variant-numeric: tabular-nums;
    /* Always show a disc, even if a future markercluster CSS drop
     * changes the ::before / inner-div pattern. Defensive so the
     * bare-number regression cannot reappear silently. */
    background-clip: padding-box;
}
.cs-turbine-cluster > div {
    font-weight: 700;
}
.cs-turbine-cluster > div > span {
    letter-spacing: 0;
}

/* ≥ 1 000 turbines in the same cluster. Pink outer halo + deeper
 * fuchsia core, white numbers. Larger iconSize (52x52) is set from
 * JS so the label never touches the disc edge. */
.marker-cluster-huge {
    background-color: rgba(255, 94, 156, 0.28);
}
.marker-cluster-huge div {
    width: 44px;
    height: 44px;
    margin-left: 4px;
    margin-top: 4px;
    text-align: center;
    border-radius: 22px;
    background-color: rgba(255, 94, 156, 0.85);
    color: #fff;
}
.marker-cluster-huge div span {
    line-height: 44px;
}

/* The default markercluster's `large` disc background (orange) is
 * translucent; at low zoom with a dark satellite basemap it can
 * look washed out. Bump the alpha so the 100-999 bucket reads as
 * "high density" consistently with the new huge tier. */
.marker-cluster-large { background-color: rgba(253, 156, 115, 0.28); }
.marker-cluster-large div { background-color: rgba(241, 128, 23, 0.9); color: #fff; }

/* --------------------------------------------------------------- */
/* Pollen / air popup (detail LOD)                                 */
/* --------------------------------------------------------------- */
.cs-pollen-popup {
    min-width: 240px;
    background: rgba(10, 14, 26, 0.98);
    color: #e9eef9;
    border-radius: 12px;
    padding: 2px 0 0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}
.cs-pollen-popup__title {
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(233, 238, 249, 0.82);
    margin-bottom: 6px;
}
.cs-pollen-popup__header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.cs-pollen-popup__headline { display: flex; flex-direction: column; line-height: 1.15; }
.cs-pollen-popup__headline strong { font-size: 1rem; color: #f2f6ff; font-weight: 700; }
.cs-pollen-popup__taxon { font-size: 0.82rem; color: rgba(233, 238, 249, 0.78); }
.cs-pollen-popup__list {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--border, rgba(255, 255, 255, 0.08));
}
.cs-pollen-row {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    grid-column-gap: 8px;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.06));
    font-size: 0.84rem;
}
.cs-pollen-row:last-child { border-bottom: none; }
.cs-pollen-row__taxon { color: #f2f6ff; font-weight: 600; }
.cs-pollen-row__val { color: rgba(233, 238, 249, 0.88); font-variant-numeric: tabular-nums; }
.cs-pollen-row__val small { font-size: 0.7rem; color: rgba(233, 238, 249, 0.65); }
.cs-pollen-row__bar {
    grid-column: 1 / span 2;
    position: relative;
    height: 4px;
    margin-top: 3px;
    /* Track + fill live in .cs-pollen-row__bar-track so a threshold tick
     * can sit in the same row without being clipped. */
    background: none;
    overflow: visible;
}
.cs-pollen-row__bar-track {
    display: block;
    width: 100%;
    height: 4px;
    border-radius: 3px;
    background: var(--bg-1, rgba(255, 255, 255, 0.05));
    overflow: hidden;
}
.cs-pollen-row__bar-track > i {
    display: block;
    height: 100%;
    border-radius: inherit;
    transition: width 0.2s ease;
}
/* Legacy popup markup (only <i> as direct child) — keep for safety */
.cs-pollen-row__bar:not(:has(.cs-pollen-row__bar-track)) {
    border-radius: 3px;
    background: var(--bg-1, rgba(255, 255, 255, 0.05));
    overflow: hidden;
}
.cs-pollen-row__bar:not(:has(.cs-pollen-row__bar-track)) > i {
    display: block;
    height: 100%;
    border-radius: inherit;
    transition: width 0.2s ease;
}
.cs-sens-threshold-tick {
    position: absolute;
    top: 50%;
    z-index: 2;
    width: 2px;
    height: 10px;
    margin-top: -5px;
    background: #ff3b3b;
    border-radius: 1px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
    transform: translateX(-50%);
    pointer-events: auto;
}
/* Shared with air header rail (European AQI vs user AQI) */
.cs-air-popup__aqi-rail {
    display: block;
    margin: 0 0 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.06));
}
.cs-air-popup__aqi-rail .cs-pollen-row__bar {
    margin-top: 4px;
}
.cs-air-popup__aqi-rail-caption {
    display: block;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(233, 238, 249, 0.55);
    margin-bottom: 4px;
}
.cs-pollen-popup__footer {
    margin-top: 8px;
    font-size: 0.78rem;
    color: rgba(233, 238, 249, 0.75);
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}
.cs-pollen-popup__link {
    color: #c4b5ff;
    text-decoration: none;
    font-weight: 600;
}
.cs-pollen-popup__link:hover { text-decoration: underline; color: #dcd4ff; }

/* Leaflet: pollen detail popup wrapper (className on bindPopup) */
.leaflet-popup.cs-pollen-leaflet-popup .leaflet-popup-content-wrapper,
.leaflet-container .cs-pollen-leaflet-popup .leaflet-popup-content-wrapper {
    background: rgba(10, 14, 26, 0.98);
    color: #e9eef9;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}
.leaflet-popup.cs-pollen-leaflet-popup .leaflet-popup-tip {
    background: rgba(10, 14, 26, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: none;
}
.leaflet-popup.cs-pollen-leaflet-popup .leaflet-popup-content {
    margin: 12px 14px;
}
.leaflet-popup.cs-composite-leaflet-popup .leaflet-popup-content-wrapper {
    width: min(96vw, 1400px);
    max-width: min(96vw, 1400px);
    max-height: min(90dvh, calc(100dvh - 32px));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
}
.leaflet-popup.cs-composite-leaflet-popup .leaflet-popup-content {
    min-width: 0;
    max-width: 100%;
    width: 100%;
    margin: 12px 14px;
    box-sizing: border-box;
}
.cs-composite-popup .cs-composite-summary,
.cs-composite-popup .cs-composite-worst {
    margin: 0 0 8px;
    font-size: 0.82rem;
    line-height: 1.35;
    color: rgba(233, 238, 249, 0.82);
}
.cs-composite-popup .cs-composite-summary--lead {
    font-size: 0.88rem;
    line-height: 1.48;
    margin: 0 0 12px;
}
.cs-light-popup--placeholder .cs-pollen-popup__intro {
    margin: 6px 0 0;
    font-size: 0.84rem;
    line-height: 1.4;
    color: rgba(233, 238, 249, 0.78);
}
.cs-composite-popup .cs-composite-block {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 8px 10px 10px;
    background: rgba(255, 255, 255, 0.02);
    min-width: 0;
}
.cs-composite-block__fresh {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 10px;
    margin: 0 0 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.72rem;
    line-height: 1.35;
}
.cs-composite-block__fresh-title {
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(233, 238, 249, 0.55);
}
.cs-composite-block__fresh-value {
    color: rgba(233, 238, 249, 0.88);
    font-variant-numeric: tabular-nums;
}
/* Nested popups: drop outer title margin when stacked inside a composite block. */
.cs-composite-block .cs-pollen-popup > .cs-pollen-popup__title {
    margin-top: 0;
}
.cs-composite-block > .cs-popup {
    margin: 0;
    max-width: 100%;
}
/* Composite module carousel: horizontal snap for all viewports when tabs mode is on
 * (desktop used to use a multi-column grid that clipped the fourth module). */
.cs-composite-popup {
    position: relative;
}
/* Composite popup uses custom close only (.cs-composite-fs-close); Leaflet default is disabled in bindPopup. */
.leaflet-popup.cs-composite-leaflet-popup .leaflet-popup-close-button {
    display: none !important;
}

.cs-composite-fs-close {
    position: absolute;
    top: max(4px, env(safe-area-inset-top, 0px));
    right: max(4px, env(safe-area-inset-right, 0px));
    z-index: 6;
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    background: rgba(18, 22, 34, 0.92);
    color: #e9eef9;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}
.cs-composite-fs-close:hover {
    background: rgba(30, 36, 52, 0.98);
    border-color: rgba(255, 255, 255, 0.22);
}
/* Row above carousel: right-aligned × (not position:absolute over .cs-composite-carousel__nav). */
.cs-composite-fs-topbar {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    flex-shrink: 0;
    box-sizing: border-box;
    min-height: 44px;
    padding: 2px 0 6px;
}
.cs-composite-popup[data-composite-carousel-tabs="1"] .cs-composite-fs-topbar .cs-composite-fs-close {
    position: static;
    top: auto;
    right: auto;
}
.cs-composite-popup[data-composite-carousel-tabs="1"] {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.cs-composite-popup .cs-pollen-popup__title {
    padding-right: 48px;
}
.cs-composite-carousel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
}
.cs-composite-carousel__nav {
    display: none;
    flex-shrink: 0;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 4px 2px;
}
.cs-composite-popup[data-composite-carousel-tabs="1"] .cs-composite-carousel:not(.cs-composite-carousel--single) .cs-composite-carousel__nav {
    display: flex;
}
.cs-composite-carousel--single .cs-composite-carousel__nav {
    display: none !important;
}
.cs-composite-carousel__prev,
.cs-composite-carousel__next {
    flex: 0 0 auto;
    min-width: 44px;
    min-height: 44px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: #e9eef9;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    box-sizing: border-box;
}
.cs-composite-carousel__prev:disabled,
.cs-composite-carousel__next:disabled {
    opacity: 0.35;
    cursor: default;
}
.cs-composite-carousel__counter {
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
    color: rgba(233, 238, 249, 0.72);
    flex: 1;
    text-align: center;
}
.cs-composite-popup[data-composite-carousel-tabs="1"] .cs-composite-carousel__track {
    display: flex;
    flex-flow: row nowrap;
    gap: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
    align-items: stretch;
    min-height: 0;
    width: 100%;
    box-sizing: border-box;
}
.cs-composite-popup[data-composite-carousel-tabs="1"] .cs-composite-carousel__slide {
    display: flex;
    flex-direction: column;
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    overflow: hidden;
    min-height: 260px;
}
.cs-composite-popup[data-composite-carousel-tabs="1"] .cs-composite-carousel__slide .cs-composite-block {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
}
.cs-composite-carousel__slide {
    min-width: 0;
}
.cs-composite-carousel__slide-label {
    display: none;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(233, 238, 249, 0.55);
    margin: 0 0 8px;
}
.cs-composite-popup[data-composite-carousel-tabs="1"] .cs-composite-carousel__slide-label {
    display: block;
}
.cs-composite-slide-clearspot {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.04em;
    text-transform: none;
}
.cs-composite-slide-clearspot--clear {
    color: #4ade80;
}
.cs-composite-slide-clearspot--moderate {
    color: #fb923c;
}
.cs-composite-slide-clearspot--critical {
    color: #fb7185;
}
.cs-composite-summary--lead .cs-composite-verdict {
    font-weight: 800;
    letter-spacing: 0.04em;
}
.cs-composite-verdict--clear {
    color: #4ade80;
}
.cs-composite-verdict--moderate {
    color: #fb923c;
}
.cs-composite-verdict--not-clear {
    color: #fb7185;
}
.cs-composite-summary--clearspot {
    font-size: 0.88rem;
    line-height: 1.45;
    margin: 0.35rem 0 0;
    color: rgba(233, 238, 249, 0.88);
}
.cs-composite-summary--clearspot .cs-composite-clearspot-strong {
    font-variant-numeric: tabular-nums;
    margin: 0 0.12em;
}
.cs-composite-summary--clearspot-clear .cs-composite-clearspot-strong {
    color: #4ade80;
}
.cs-composite-summary--clearspot-moderate .cs-composite-clearspot-strong {
    color: #fb923c;
}
.cs-composite-summary--clearspot-critical .cs-composite-clearspot-strong {
    color: #fb7185;
}

/* Desktop composite: constrain carousel height so inner modules scroll instead of clipping. */
body.cs-leaflet-popup-open .leaflet-popup.cs-composite-leaflet-popup .leaflet-popup-content-wrapper:has(.cs-composite-popup[data-composite-carousel-tabs="1"]) {
    overflow: hidden !important;
    display: flex;
    flex-direction: column;
}
body.cs-leaflet-popup-open .leaflet-popup.cs-composite-leaflet-popup .leaflet-popup-content:has(.cs-composite-popup[data-composite-carousel-tabs="1"]) {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
body.cs-leaflet-popup-open .leaflet-popup.cs-composite-leaflet-popup .cs-composite-popup[data-composite-carousel-tabs="1"] {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}
body.cs-leaflet-popup-open .leaflet-popup.cs-composite-leaflet-popup .cs-composite-popup[data-composite-carousel-tabs="1"] .cs-composite-carousel {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}
body.cs-leaflet-popup-open .leaflet-popup.cs-composite-leaflet-popup .cs-composite-popup[data-composite-carousel-tabs="1"] .cs-composite-carousel__track {
    flex: 1;
    min-height: 0;
}
@media (min-width: 901px) {
    body.cs-leaflet-popup-open .leaflet-popup.cs-composite-leaflet-popup .cs-composite-popup[data-composite-carousel-tabs="1"] .cs-composite-carousel__track {
        max-height: min(58dvh, 560px);
    }
}

/* Combined-overlay popup: inline sensitivity (air / pollen / Bortle). */
.cs-composite-sens {
    margin: 0 0 var(--space-4);
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.025);
    box-sizing: border-box;
}
.cs-composite-sens-head {
    font-family: var(--font-ui);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--fg-muted);
    font-weight: 700;
    margin: 0 0 var(--space-2);
}
.cs-composite-sens-lead {
    font-size: 0.78rem;
    color: rgba(233, 238, 249, 0.78);
    line-height: 1.42;
    margin: 0 0 var(--space-3);
}
.cs-composite-sens .cs-sens-row {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: var(--space-3);
    margin-top: var(--space-3);
}
.cs-composite-sens .cs-sens-row:first-of-type {
    border-top: 0;
    padding-top: 0;
    margin-top: 0;
}

/* Force the whole popup pane above any custom label / tooltip pane.
 * Our JS keeps the labelsPane at 650, but this class-level override
 * guarantees the popup stays on top even if a future pane borrows
 * Leaflet's default 700. Sticky site header uses z-index 900, so popups
 * must sit above it or the modal is unreadable. */
.leaflet-pane.leaflet-popup-pane { z-index: 920 !important; }

/* Modal-style hex / noise / turbine popups: center in the viewport, hide the
 * map pin tail, and dim the map so clicks do not hit another feature. */
#map .cs-leaflet-modal-backdrop {
    position: absolute;
    inset: 0;
    z-index: 905;
    background: rgba(10, 14, 26, 0.52);
    pointer-events: auto;
    box-sizing: border-box;
    touch-action: none;
}
/* Viewport units keep the card centred on the real screen. Percent-based
 * fixed offsets can follow a transformed ancestor and appear clipped
 * (e.g. 5G / POI popups stuck on the left edge). */
body.cs-leaflet-popup-open #map.leaflet-container .leaflet-popup {
    position: fixed !important;
    left: 50vw !important;
    top: 50vh !important;
    top: 50dvh !important;
    right: auto !important;
    bottom: auto !important;
    margin: 0 !important;
    transform: translate(-50%, -50%) !important;
    max-height: calc(100vh - 32px);
    max-width: calc(100vw - 24px);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}
body.cs-leaflet-popup-open #map .leaflet-popup-content-wrapper {
    max-height: calc(100vh - 80px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
}
/* Composite H3 modal: tame width/height so viewport-centred card fits
 * phones (Tail was already hidden). Same behaviour on desktop. */
body.cs-leaflet-popup-open .leaflet-popup.cs-composite-leaflet-popup {
    max-width: min(96vw, 1400px);
}
body.cs-leaflet-popup-open .leaflet-popup.cs-composite-leaflet-popup .leaflet-popup-content-wrapper {
    width: min(96vw, 1400px) !important;
    max-width: min(96vw, 1400px) !important;
    max-height: min(90dvh, calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 24px)) !important;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 20px 70px rgba(0, 0, 0, 0.5);
    background: rgba(10, 14, 26, 0.96);
}
body.cs-leaflet-popup-open .leaflet-popup.cs-composite-leaflet-popup .leaflet-popup-content {
    min-width: 0 !important;
    max-width: 100% !important;
    width: 100%;
    margin: var(--space-3) var(--space-4);
    box-sizing: border-box;
}
/* Horizontal tabs: first slide already shows the combined title as slide-label. */
body.cs-leaflet-popup-open .leaflet-popup.cs-composite-leaflet-popup .cs-composite-popup[data-composite-carousel-tabs="1"] > .cs-pollen-popup__title {
    display: none !important;
}
/* Wide screens: viewport units (not %) for left/top — percentage base can collapse to 0 under this
 * fixed + translate(-50%,-50%) stack, so 50%/50% resolved to 0 and anchored the card to the viewport
 * origin. Match generic modal popups: 50vw / 50dvh.
 */
@media (min-width: 901px) {
    body.cs-leaflet-popup-open #map.leaflet-container .leaflet-popup.cs-composite-leaflet-popup {
        left: 50vw !important;
        right: auto !important;
        top: 50vh !important;
        top: 50dvh !important;
        bottom: auto !important;
        margin: 0 !important;
        transform: translate(-50%, -50%) !important;
        width: min(96vw, 1400px) !important;
        max-width: min(96vw, 1400px) !important;
        max-height: min(92dvh, calc(100dvh - 16px)) !important;
    }
}
body.cs-leaflet-popup-open #map .leaflet-popup-tip-container {
    display: none !important;
}

/* While a modal popup is open, pull every map layer below both the dimming
 * backdrop and the popup pane. Leaflet keeps tiles/vectors/markers as
 * siblings inside .leaflet-map-pane; without this, SVG paths (user rings,
 * heat circles) can composite above the card even when popup-pane z-index
 * looks higher on paper. */
body.cs-leaflet-popup-open .leaflet-map-pane > .leaflet-pane:not(.leaflet-popup-pane) {
    z-index: 1 !important;
}
body.cs-leaflet-popup-open .leaflet-map-pane .leaflet-overlay-pane svg,
body.cs-leaflet-popup-open .leaflet-map-pane .leaflet-marker-pane svg {
    z-index: 0 !important;
}
body.cs-leaflet-popup-open .leaflet-pane.leaflet-popup-pane {
    z-index: 12000 !important;
    isolation: isolate;
}
/* Default Leaflet control container (~1000) can still paint above a fixed
 * composite popup in some stacks; force chrome under the popup pane + card. */
body.cs-leaflet-popup-open #map.leaflet-container .leaflet-control-container {
    z-index: 500 !important;
}
/* Sibling of .leaflet-map-pane: lowering .leaflet-control-container is not enough.
 * Popup lives inside .leaflet-map-pane; without a higher z-index here, the control
 * column (.leaflet-top z-index 1000 inside the container) still wins over the map
 * subtree (see Leaflet 1.9 defaults). */
body.cs-leaflet-popup-open #map.leaflet-container .leaflet-map-pane {
    z-index: 800 !important;
}
body.cs-leaflet-popup-open .leaflet-map-pane .cs-leaflet-modal-backdrop {
    z-index: 9000 !important;
}
/* Backdrop was a direct child of .leaflet-container in older builds; keep
 * the rule for safety if a cached script still appends there. */
body.cs-leaflet-popup-open #map .cs-leaflet-modal-backdrop {
    z-index: 9000 !important;
}

/* Fullscreen composite: NDJSON H6 showed mapPaneZ 800 + control Z 500 but popupOpacity ~0.08
 * mid-fade — the card is nearly invisible so map chrome looks painted on top. */
body.cs-map-composite-fs-open #map.leaflet-container .leaflet-control-container,
body.cs-map-composite-fs-open #cs-location-share-fab.cs-location-share-fab {
    visibility: hidden !important;
    pointer-events: none !important;
}
body.cs-leaflet-popup-open .leaflet-container .leaflet-popup-pane .leaflet-popup.cs-composite-leaflet-popup {
    opacity: 1 !important;
}
body.cs-leaflet-popup-open .leaflet-container.leaflet-fade-anim .leaflet-popup-pane .leaflet-popup.cs-composite-leaflet-popup {
    transition: opacity 0s linear !important;
}

/* Narrow viewports (phones / tablets): full-screen composite + horizontal carousel.
 * Breakpoint aligned with .cs-composite-carousel grid (900px) so two-column grids
 * switch to swipe before the card feels cramped. */
@media (max-width: 900px) {
    body.cs-leaflet-popup-open #map.leaflet-container .leaflet-popup.cs-composite-leaflet-popup {
        left: 0 !important;
        top: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        inset: 0 !important;
        transform: none !important;
        /* NDJSON repro: wrap w=4, popupOpacity=0 — min-width:0 on wrapper collapsed width;
         * Leaflet fade left opacity at 0 when open animation did not complete. */
        width: 100vw !important;
        min-width: 100vw !important;
        max-width: none !important;
        height: 100dvh !important;
        min-height: 100dvh !important;
        max-height: none !important;
        margin: 0 !important;
        opacity: 1 !important;
        visibility: visible !important;
        transition: opacity 0s linear, transform 0s linear !important;
    }
    /* Tabs: nudge up into unused top band (fixed popup inside transformed map pane) and extend
     * height so the last lines (e.g. SO2) are not clipped above the home indicator. */
    body.cs-leaflet-popup-open #map.leaflet-container .leaflet-popup.cs-composite-leaflet-popup:has(.cs-composite-popup[data-composite-carousel-tabs="1"]) {
        margin-top: -36px !important;
        height: calc(100dvh + 36px) !important;
        min-height: calc(100dvh + 36px) !important;
    }
    body.cs-leaflet-popup-open .leaflet-popup.cs-composite-leaflet-popup:has(.cs-composite-popup[data-composite-carousel-tabs="1"]) .leaflet-popup-content-wrapper {
        height: calc(100dvh + 36px) !important;
        min-height: calc(100dvh + 36px) !important;
        max-height: calc(100dvh + 36px) !important;
    }
    /* min-width:0 on the *outer* Leaflet wrapper collapsed it to ~4px (H6 logs). Keep 0 only on inner flex items. */
    body.cs-leaflet-popup-open .leaflet-popup.cs-composite-leaflet-popup .leaflet-popup-content,
    body.cs-leaflet-popup-open .leaflet-popup.cs-composite-leaflet-popup .cs-popup,
    body.cs-leaflet-popup-open .leaflet-popup.cs-composite-leaflet-popup .cs-composite-popup {
        min-width: 0 !important;
    }
    body.cs-leaflet-popup-open .leaflet-popup.cs-composite-leaflet-popup .leaflet-popup-content-wrapper {
        width: 100vw !important;
        min-width: 100vw !important;
        max-width: none !important;
        height: 100dvh !important;
        min-height: 100dvh !important;
        max-height: 100dvh !important;
        border-radius: 0;
        overflow-x: hidden;
        overflow-y: hidden;
        display: flex;
        flex-direction: column;
        /* Readability: clearer edge vs map tiles + FAB ghosting (mobile QA). */
        border: 1px solid rgba(255, 255, 255, 0.14);
        box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35) inset, 0 24px 80px rgba(0, 0, 0, 0.55);
        background: rgba(10, 14, 26, 0.97);
    }
    body.cs-leaflet-popup-open .leaflet-popup.cs-composite-leaflet-popup .leaflet-popup-content {
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
        overflow-x: hidden;
        overflow-y: hidden;
        margin: 0;
        padding: max(10px, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px))
            max(10px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
    }
    /* Tabs mode: drop the 10px top gutter so the card + × sit higher (map strip was visible above). */
    body.cs-leaflet-popup-open .leaflet-popup.cs-composite-leaflet-popup .leaflet-popup-content:has(.cs-composite-popup[data-composite-carousel-tabs="1"]) {
        padding-top: max(0px, env(safe-area-inset-top, 0px));
        padding-bottom: max(0px, env(safe-area-inset-bottom, 0px));
    }
    body.cs-leaflet-popup-open .leaflet-popup.cs-composite-leaflet-popup .cs-composite-popup[data-composite-carousel-tabs="1"] .cs-composite-fs-topbar {
        padding-right: max(0px, env(safe-area-inset-right, 0px));
    }
    body.cs-leaflet-popup-open .leaflet-popup.cs-composite-leaflet-popup .cs-composite-popup {
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    body.cs-leaflet-popup-open .leaflet-popup.cs-composite-leaflet-popup .cs-composite-popup > *:not(.cs-composite-carousel) {
        flex-shrink: 0;
    }
    body.cs-leaflet-popup-open .leaflet-popup.cs-composite-leaflet-popup .cs-composite-carousel {
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    body.cs-leaflet-popup-open .leaflet-popup.cs-composite-leaflet-popup .cs-composite-carousel__nav {
        display: flex;
        flex-shrink: 0;
    }
    body.cs-leaflet-popup-open .leaflet-popup.cs-composite-leaflet-popup .cs-composite-popup .cs-composite-carousel__track {
        display: flex;
        flex-wrap: nowrap;
        gap: 0;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-x pan-y;
        flex: 1;
        min-height: 0;
        min-width: 0;
        width: 100%;
        height: 100%;
        align-items: stretch;
    }
    body.cs-leaflet-popup-open .leaflet-popup.cs-composite-leaflet-popup .cs-composite-carousel__slide {
        display: flex;
        flex-direction: column;
        align-self: stretch;
        flex: 0 0 100%;
        width: 100%;
        max-width: 100%;
        height: 100%;
        min-height: 0;
        max-height: 100%;
        box-sizing: border-box;
        scroll-snap-align: start;
        scroll-snap-stop: always;
        overflow: hidden;
        padding-right: 2px;
    }
    body.cs-leaflet-popup-open .leaflet-popup.cs-composite-leaflet-popup .cs-composite-carousel__slide .cs-composite-block {
        flex: 1 1 auto;
        min-height: 0;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
    }
    body.cs-leaflet-popup-open .leaflet-popup.cs-composite-leaflet-popup .cs-composite-carousel__slide-label {
        display: block;
        flex-shrink: 0;
    }
    body.cs-leaflet-popup-open .leaflet-popup.cs-composite-leaflet-popup .cs-composite-carousel--single .cs-composite-carousel__nav {
        display: none !important;
    }
}

/* Map zone modal: beat sticky header (900), mobile drawer (up to 940), FAB rail
 * and search / layers panels (899), Leaflet chrome (~1000), and body-level
 * basemap picker (1001). Without this, #map.is-active stays at z-index 2 and
 * the whole Leaflet subtree paints under stage overlays. */
body.cs-leaflet-popup-open .app-shell {
    position: relative;
    z-index: 11050;
}
body.cs-leaflet-popup-open #map.is-active {
    z-index: 1500;
}
/* Leaflet defaults to overflow:hidden on .leaflet-container; fixed popups are
 * still clipped to that box. Do not set overflow:visible on .app-shell (breaks
 * the flex height chain and prevented globe->map handoff on some mobile layouts). */
body.cs-leaflet-popup-open #map.leaflet-container {
    overflow: visible !important;
}

/* One-shot "pick on map" overlay above hex layers (below site chrome). */
.cs-map-pick-shield {
    position: absolute;
    inset: 0;
    z-index: 12500;
    box-sizing: border-box;
    cursor: crosshair;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: max(12px, env(safe-area-inset-top, 0px)) 12px 12px;
    background: rgba(10, 14, 26, 0.22);
}
.cs-map-pick-hint {
    margin: 0;
    max-width: min(420px, 92vw);
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(10, 14, 26, 0.94);
    color: #e9eef9;
    font-size: 0.84rem;
    line-height: 1.45;
    text-align: center;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
    pointer-events: none;
}
.cs-map-pick-hint__esc {
    display: block;
    margin-top: 4px;
    font-size: 0.76rem;
    color: rgba(233, 238, 249, 0.65);
}

.cs-pollen-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1.05rem;
    color: #0a0d1a;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
}
.cs-pollen-badge--lvl-0 { background: #4a5568; color: #fff; }
.cs-pollen-badge--lvl-1 { background: #6be7a5; }
.cs-pollen-badge--lvl-2 { background: #c6e766; }
.cs-pollen-badge--lvl-3 { background: #ffb454; }
.cs-pollen-badge--lvl-4 { background: #ff7a59; color: #fff; }
.cs-pollen-badge--lvl-5 { background: #ff5e9c; color: #fff; }

/* Air-quality popup: reuses the `.cs-pollen-popup` grammar but the
 * AQI badge shows a 2-3 digit number, so we let its width grow and
 * tighten the font-size so something like "103" still fits nicely. */
.cs-air-popup .cs-pollen-badge {
    width: auto;
    min-width: 40px;
    padding: 0 8px;
    font-size: 0.95rem;
    font-variant-numeric: tabular-nums;
}
/* Per-row WHO guideline hint (e.g. "WHO 25 µg/m³" next to "NO₂").
 * Rendered inline as a discreet subtitle so the user always knows
 * what reference the pollutant is being measured against, even
 * when the live value is missing. */
.cs-air-popup .cs-pollen-row__taxon {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
}
.cs-air-popup .cs-pollen-row__limit {
    font-weight: 500;
    font-size: 0.68rem;
    color: rgba(233, 238, 249, 0.55);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}
/* Missing/zero pollutant: mute the label but keep the grid layout
 * stable so users visually confirm the indicator is tracked. */
.cs-air-popup .cs-pollen-row.is-empty .cs-pollen-row__taxon { color: rgba(242, 246, 255, 0.55); }
.cs-air-popup .cs-pollen-row.is-empty .cs-pollen-row__val   { color: rgba(233, 238, 249, 0.45); }
.cs-pollen-popup__guidance {
    font-size: 0.82rem;
    color: rgba(233, 238, 249, 0.88);
    line-height: 1.35;
    padding: 2px 0 8px;
    border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.06));
    margin-bottom: 6px;
}

/* --------------------------------------------------------------- */
/* Pollen scale explanation page                                   */
/* --------------------------------------------------------------- */
.pollen-scale-page { max-width: 960px; margin: 0 auto; padding: var(--space-6, 32px) var(--space-4, 16px); }
.pollen-scale-page h1 { margin-bottom: var(--space-2, 8px); }
.pollen-scale-page .lead { color: var(--fg-muted); margin-bottom: var(--space-6, 32px); }
.pollen-scale-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: var(--space-6, 32px);
}
.pollen-scale-table th, .pollen-scale-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.08));
    font-size: 0.92rem;
}
.pollen-scale-table th { color: var(--fg-muted); font-weight: 500; }
.pollen-scale-table .pollen-scale-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.pollen-scale-table .pollen-scale-chip i {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 4px;
}
.pollen-scale-taxa {
    display: grid;
    gap: var(--space-3, 12px);
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.pollen-scale-taxon {
    padding: 14px 16px;
    border-radius: 12px;
    background: var(--bg-1, rgba(255, 255, 255, 0.04));
    border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
}
.pollen-scale-taxon h3 { margin: 0 0 4px; font-size: 0.98rem; }
.pollen-scale-taxon p { margin: 0; color: var(--fg-muted); font-size: 0.86rem; }

/* User position: same logo mark + pulse as the header brand */
#map .cs-map-user-marker {
    background: transparent !important;
    border: none !important;
}
#map .cs-map-user-marker .brand-mark {
    width: 26px;
    height: 26px;
    display: block;
    pointer-events: none;
}
@media (max-width: 640px) {
    #map .cs-map-user-marker { width: 26px !important; height: 26px !important; }
    #map .cs-map-user-marker .brand-mark { width: 22px; height: 22px; }
}

.cs-map-loading {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 800;
    pointer-events: none;
}

/* Back-to-globe + basemap: must match Leaflet zoom (+/-). Leaflet's own
 * stylesheet loads after app.css and sets `.leaflet-bar a` to a white
 * tile #fff; we re-assert dark tiles on #map so order never wins. */
.cs-back-to-globe {
    border: none !important;
    box-shadow: var(--shadow-2, 0 4px 20px rgba(0, 0, 0, 0.35));
    border-radius: 10px;
    overflow: hidden;
}
#map .leaflet-bar.cs-back-to-globe a {
    width: 36px;
    height: 36px;
    line-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff !important;
    background: rgba(10, 13, 26, 0.92) !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    border-radius: 10px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-sizing: border-box;
}
#map .leaflet-bar.cs-back-to-globe a:hover,
#map .leaflet-bar.cs-back-to-globe a:focus-visible {
    background: rgba(124, 92, 255, 0.45) !important;
    color: #fff !important;
    outline: none;
}

.cs-basemap-toggle {
    border: none !important;
    box-shadow: var(--shadow-2, 0 4px 20px rgba(0, 0, 0, 0.35));
    border-radius: 10px;
    overflow: hidden;
}
#map .leaflet-bar.cs-basemap-toggle a {
    width: 36px;
    height: 36px;
    line-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff !important;
    background: rgba(10, 13, 26, 0.92) !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    border-radius: 10px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-sizing: border-box;
}
#map .leaflet-bar.cs-basemap-toggle a:hover,
#map .leaflet-bar.cs-basemap-toggle a:focus-visible {
    background: rgba(124, 92, 255, 0.45) !important;
    color: #fff !important;
    outline: none;
}

/* --------------------------------------------------------------- */
/* Basemap picker modal                                            */
/* --------------------------------------------------------------- */
/* Centered overlay listing every configured basemap with an explicit
 * check mark on the active entry. Replaces the old single-tap cycle
 * (which never told the user which basemap they were on). z-index is
 * set well above Leaflet popups (.leaflet-popup ~= 700) and above the
 * back-to-globe / zoom controls, and above body.cs-leaflet-popup-open
 * .app-shell (11050). Still below install splash / admin toasts (1e5). */
.cs-basemap-picker-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(5, 8, 18, 0.55);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: var(--z-modal-app);
    opacity: 0;
    transition: opacity var(--dur-1, 0.18s) var(--ease, ease);
}
.cs-basemap-picker-backdrop.is-open { opacity: 1; }
.cs-basemap-picker-backdrop[hidden] { display: none; }

.cs-basemap-picker {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, calc(-50% + 8px));
    width: min(360px, calc(100vw - 32px));
    max-height: calc(100dvh - 48px);
    overflow: auto;
    z-index: var(--z-modal-app-1);
    /* Two-layer background for mobile compositors that drop alpha. */
    background-color: #141a2a;
    background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-2, 0 14px 44px rgba(0, 0, 0, 0.55));
    color: var(--fg-0);
    font-family: var(--font-ui);
    padding: var(--space-3) 0 var(--space-2);
    opacity: 0;
    transition: opacity var(--dur-1, 0.18s) var(--ease, ease),
                transform var(--dur-1, 0.18s) var(--ease, ease);
}
.cs-basemap-picker.is-open {
    opacity: 1;
    transform: translate(-50%, -50%);
}
.cs-basemap-picker[hidden] { display: none; }

.cs-basemap-picker__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    padding: 0 var(--space-3) var(--space-2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.cs-basemap-picker__title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: var(--fg-0);
}
.cs-basemap-picker__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px; height: 30px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: var(--fg-muted);
    cursor: pointer;
    transition: background var(--dur-1, 0.18s) var(--ease, ease),
                color var(--dur-1, 0.18s) var(--ease, ease);
}
.cs-basemap-picker__close:hover,
.cs-basemap-picker__close:focus-visible {
    background: rgba(255, 255, 255, 0.06);
    color: var(--fg-0);
    outline: none;
}
.cs-basemap-picker__close svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: block;
}

.cs-basemap-picker__list {
    display: flex;
    flex-direction: column;
    padding: var(--space-1, 4px);
}
.cs-basemap-picker__row {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 10px 12px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--fg-0);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background var(--dur-1, 0.18s) var(--ease, ease),
                border-color var(--dur-1, 0.18s) var(--ease, ease);
}
.cs-basemap-picker__row + .cs-basemap-picker__row { margin-top: 2px; }
.cs-basemap-picker__row:hover,
.cs-basemap-picker__row:focus-visible {
    background: rgba(124, 92, 255, 0.12);
    border-color: rgba(124, 92, 255, 0.28);
    outline: none;
}
.cs-basemap-picker__row.is-active {
    background: rgba(124, 92, 255, 0.18);
    border-color: rgba(124, 92, 255, 0.45);
}
.cs-basemap-picker__icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px; height: 32px;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.cs-basemap-picker__text {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.cs-basemap-picker__label {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--fg-0);
}
.cs-basemap-picker__desc {
    font-size: 0.75rem;
    color: var(--fg-muted);
}
.cs-basemap-picker__check {
    flex: 0 0 auto;
    width: 22px; height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--aurora-violet, #7c5cff);
}

/* Touch targets on very small screens: full-height row hits 48px so
 * fat-finger accuracy stays acceptable without ballooning the list
 * on desktop, where 40-ish px is already comfortable. */
@media (max-width: 480px) {
    .cs-basemap-picker { width: min(420px, calc(100vw - 24px)); }
    .cs-basemap-picker__row { padding: 12px 12px; }
    .cs-basemap-picker__icon { width: 36px; height: 36px; }
}

/* --------------------------------------------------------------- */
/* Top-left speed dial: balloon + layers cog + search (globe + map) */
/* --------------------------------------------------------------- */
.cs-stage-fabs {
    position: absolute;
    left: 12px;
    top: 12px;
    z-index: var(--z-stage-fab-rail);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    pointer-events: none;
}
/* Lift the whole rail while any stage dialog is open so fixed children (e.g.
 * .cs-sens-panel) are not trapped under #map.is-active (up to z-index 1500)
 * or under Leaflet controls. Search is a #stage-canvas sibling; bump it too.
 * Do NOT include body.cs-leaflet-popup-open here: the Leaflet popup lives inside
 * #map's stacking context (z-index 1500), so a 20000 FAB rail paints above the
 * fullscreen composite modal (see mobile screenshot: dial over the card). */
body.cs-sens-open #cs-stage-fabs,
#stage-canvas:has(.cs-layers-panel:not([hidden])) #cs-stage-fabs,
#stage-canvas:has(.cs-search-panel:not([hidden])) #cs-stage-fabs {
    z-index: var(--z-modal-app);
}
#stage-canvas > .cs-search-panel:not([hidden]) {
    z-index: var(--z-modal-app-1);
}
.cs-stage-fabs > * {
    pointer-events: auto;
}
/* Layers sheet must paint above the cog FAB (otherwise the button covers row 1). */
#cs-stage-fabs .cs-layers-cog {
    z-index: 1;
}
#cs-stage-fabs .cs-layers-panel:not([hidden]) {
    z-index: 5;
}
#cs-stage-fabs .cs-sens-panel:not([hidden]):not(.cs-sens-panel--account) {
    z-index: 10;
}
.cs-stage-fabs .balloon-trigger,
.cs-stage-fabs .cs-layers-cog,
.cs-stage-fabs .cs-search-fab,
.cs-stage-fabs .cs-stage-hero-help-fab,
.cs-stage-fabs .cs-exposure-save-fab {
    position: static;
    bottom: auto;
    left: auto;
    top: auto;
    right: auto;
    width: 40px;
    height: 40px;
    padding: 0;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    /* Solid base + translucent overlay: identical treatment across the
     * three rail buttons, and robust against any browser that drops
     * alpha on the background shorthand. */
    background-color: #0a0d1a;
    background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0));
    color: var(--fg-0);
    box-shadow: var(--shadow-2);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    font-size: 1rem;
    -webkit-appearance: none;
    appearance: none;
}
.cs-stage-fabs .balloon-trigger:hover,
.cs-stage-fabs .balloon-trigger[aria-expanded="true"] {
    background: rgba(124, 92, 255, 0.35);
    color: #fff;
}
.cs-stage-fabs .balloon-trigger .balloon-icon {
    width: 22px; height: 22px; display: block; pointer-events: none;
}

/* --------------------------------------------------------------- */
/* Floating layers cog (visible on both globe + map)               */
/* --------------------------------------------------------------- */
.cs-layers-cog {
    position: absolute;
    bottom: 16px;
    left: 16px;
    top: auto;
    right: auto;
    z-index: 900;
    width: 40px; height: 40px;
    padding: 0;                 /* reset UA button padding */
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;             /* kill phantom descender space */
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    background: rgba(10, 13, 26, 0.75);
    color: var(--fg-0);
    cursor: pointer;
    box-shadow: var(--shadow-2);
    backdrop-filter: blur(6px);
    transition: background var(--dur-2) var(--ease), transform var(--dur-2) var(--ease);
    -webkit-appearance: none;
    appearance: none;
    font: inherit;
}
.cs-layers-cog:hover,
.cs-layers-cog[aria-expanded="true"] {
    background: rgba(124, 92, 255, 0.35);
    transform: rotate(30deg);
}
.cs-layers-cog svg {
    display: block;
    width: 20px;
    height: 20px;
    pointer-events: none;       /* clicks go to the button, not the svg */
}

.cs-stage-fabs .cs-layers-panel {
    /* Sibling of the rail items; anchor next to the cog rather than the
     * rail so vertical alignment matches the button that opens it. */
    left: calc(44px + 10px);
    right: auto;
    bottom: auto;
    top: 0;
    max-height: min(80vh, 620px);
    overflow-y: auto;
    min-width: 260px;
}
#stage-canvas:has(#map.is-active) .cs-stage-fabs .cs-layers-panel {
    left: calc(44px + 10px);
    bottom: auto;
    top: 0;
}
/* The search panel is appended as a sibling of the fab rail (inside
 * #stage-canvas), not as a child, so flex-rail sizing can never strip
 * its background. It anchors visually next to the rail (rail is at
 * 12 px, rail width ~40 px, 10 px gap -> 62 px). */
#stage-canvas > .cs-search-panel {
    left: calc(12px + 40px + 10px);
    top: 12px;
}
.cs-layers-panel {
    position: absolute;
    bottom: 64px;
    left: 16px;
    top: auto;
    right: auto;
    z-index: 910;
    min-width: 220px;
    padding: var(--space-3) var(--space-4);
    background: rgba(18, 24, 38, 0.96);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-2);
    color: var(--fg-0);
    font-family: var(--font-ui);
    backdrop-filter: blur(8px);
}
.cs-layers-panel[hidden] { display: none; }

.cs-layers-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
}
.cs-layers-head .cs-layers-title {
    margin: 0;
}
.cs-layers-close {
    appearance: none;
    -webkit-appearance: none;
    flex: 0 0 auto;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 10px;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--fg-0);
    cursor: pointer;
    transition: border-color 120ms ease, background-color 120ms ease;
}
.cs-layers-close:hover,
.cs-layers-close:focus-visible {
    border-color: var(--border);
    background: rgba(255, 255, 255, 0.06);
    outline: none;
}

/* Map mode: cog + panel stay bottom-left; Leaflet zoom + back are top-right. */
#stage-canvas:has(#map.is-active) .cs-layers-cog {
    left: 16px;
    bottom: 16px;
    right: auto;
    top: auto;
}
#stage-canvas:has(#map.is-active) .cs-layers-panel {
    left: 16px;
    bottom: 64px;
    right: auto;
    top: auto;
}
.cs-layers-title {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--fg-muted);
    margin-bottom: 0;
}
.cs-layers-section {
    margin: var(--space-2) 0 var(--space-1);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--fg-muted);
}
.cs-layers-section-sub {
    margin: 0 0 var(--space-2);
    font-size: 0.75rem;
    line-height: 1.35;
    color: var(--fg-muted);
}
.cs-layers-tuto-link {
    margin: var(--space-2) 0 var(--space-1);
    font-size: 0.74rem;
    line-height: 1.35;
}
.cs-layers-tuto-link a {
    color: rgba(196, 181, 255, 0.92);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.cs-layers-tuto-link a:hover {
    color: #e4dcff;
}
.cs-layers-list--poi,
.cs-layers-list--nonregroup {
    margin-bottom: var(--space-2);
}
.cs-layers-list--aggregatable,
.cs-layers-list--nzoi,
.cs-layers-list--zoi {
    margin-bottom: var(--space-1);
}
/* Natural hazards: one parent checkbox + expandable per-taxon toggles (cog panel). */
.cs-layers-hazard-parent {
    list-style: none;
    margin: 0;
    padding: 0;
}
.cs-layers-hazard-parent__head {
    padding: 2px 0 4px;
}
.cs-layers-hazard-parent__master {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
    font-size: 0.84rem;
    line-height: 1.35;
    color: var(--fg-1);
}
.cs-layers-hazard-master-glyph {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 3px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12) inset;
    background: conic-gradient(
        #E87B1E,
        #1565C0,
        #C62828,
        #0288D1,
        #6A1B9A,
        #2E7D32,
        #c2410c,
        #E87B1E
    );
}
.cs-layers-hazard-details {
    margin: 0 0 6px;
    padding: 0;
}
.cs-layers-hazard-details > summary {
    list-style: none;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--fg-muted);
    padding: 4px 2px;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.01em;
}
.cs-layers-hazard-details > summary::-webkit-details-marker {
    display: none;
}
.cs-layers-hazard-details > summary::before {
    content: "";
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 5px solid currentColor;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    transform: rotate(0deg);
    transition: transform 120ms ease;
    opacity: 0.7;
    flex-shrink: 0;
}
.cs-layers-hazard-details[open] > summary::before {
    transform: rotate(90deg);
}
.cs-layers-hazard-details[open] > summary {
    color: var(--fg-0);
}
.cs-layers-list--hazard-sub {
    margin: 2px 0 4px 0.35rem;
    padding: 0 0 0 0.5rem;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}
.cs-layers-list--hazard-sub > li {
    padding-left: 4px;
}
.cs-layers-section-hr {
    margin: var(--space-3) 0 var(--space-2);
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.cs-layers-group-toggle {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: var(--space-2);
    padding: 6px 0 0;
    border: none;
    background: transparent;
    border-radius: 0;
    font-size: 0.78rem;
    line-height: 1.35;
    color: var(--fg-1);
    cursor: pointer;
}
.cs-layers-agg-switch .cs-layers-agg-label {
    flex: 1 1 auto;
    min-width: 0;
}
.cs-layers-agg-switch {
    position: relative;
}
.cs-layers-agg-switch input[type="checkbox"] {
    position: absolute;
    left: 0;
    top: 6px;
    width: 44px;
    height: 24px;
    margin: 0;
    opacity: 0.02;
    cursor: pointer;
    z-index: 2;
    flex: 0 0 auto;
}
.cs-layers-agg-switch .cs-switch-track {
    flex: 0 0 40px;
    width: 40px;
    height: 22px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    position: relative;
    margin-top: 1px;
    transition: background 0.15s ease;
    z-index: 1;
}
.cs-layers-agg-switch .cs-switch-thumb {
    position: absolute;
    width: 18px;
    height: 18px;
    left: 2px;
    top: 2px;
    border-radius: 50%;
    background: #f2f6ff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
    transition: transform 0.15s ease;
}
.cs-layers-agg-switch input:checked + .cs-switch-track {
    background: rgba(124, 92, 255, 0.85);
}
.cs-layers-agg-switch input:checked + .cs-switch-track .cs-switch-thumb {
    transform: translateX(18px);
}
.cs-layers-agg-switch input:focus-visible + .cs-switch-track {
    outline: 2px solid rgba(124, 92, 255, 0.75);
    outline-offset: 2px;
}
.cs-sens-between {
    margin: var(--space-2) 0;
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}
.cs-sens-blog-link {
    margin: 0 0 var(--space-2);
    font-size: 0.72rem;
    line-height: 1.35;
}
.cs-sens-blog-link a {
    color: rgba(196, 181, 255, 0.88);
    text-decoration: none;
    font-weight: 500;
}
.cs-sens-blog-link a:hover {
    text-decoration: underline;
    color: #e4dcff;
}
.cs-layers-list {
    list-style: none; margin: 0; padding: 0;
    display: flex; flex-direction: column; gap: 6px;
}
.cs-layers-list label {
    display: flex; align-items: center; gap: 10px;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 4px 2px;
    border-radius: 4px;
}
.cs-layers-list label:hover { background: rgba(255, 255, 255, 0.05); }
.cs-layers-list input[type="checkbox"] {
    accent-color: var(--brand, #7c5cff);
    width: 16px; height: 16px;
    cursor: pointer;
}
.cs-layers-dot {
    width: 10px; height: 10px; border-radius: 50%;
    flex: 0 0 auto;
    box-shadow: 0 0 6px currentColor;
}
.cs-layers-poi-glyph,
.cs-sens-poi-glyph {
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.65));
}
/* HVT: larger gold glyph + warm glow on dark panels (layer list + sensitivity) */
.cs-layers-poi-glyph.cs-layers-poi-glyph--hvt,
.cs-sens-poi-glyph.cs-sens-poi-glyph--hvt {
    width: 30px;
    height: 30px;
    filter:
        drop-shadow(0 0 2px rgba(15, 10, 0, 0.85))
        drop-shadow(0 0 6px rgba(250, 204, 21, 0.9))
        drop-shadow(0 0 10px rgba(234, 179, 8, 0.45));
}
.leaflet-div-icon.cs-poi-map-icon-wrap {
    background: none;
    border: none;
}
img.cs-poi-map-icon {
    display: block;
    width: 24px;
    height: 24px;
    filter: drop-shadow(0 0 1.5px rgba(0, 0, 0, 0.9));
    pointer-events: none;
}
.cs-layers-lbl { flex: 1 1 auto; }
.cs-layers-hint {
    margin-top: var(--space-2);
    padding-top: var(--space-2);
    border-top: 1px solid var(--border);
    font-size: 0.72rem;
    color: var(--fg-muted);
    line-height: 1.35;
}
.cs-layers-help {
    display: block;
    margin-top: 6px;
    font-size: 0.75rem;
    color: var(--brand, #7c5cff);
    text-decoration: none;
}
.cs-layers-help:hover { text-decoration: underline; }
.cs-layers-slider {
    margin-top: var(--space-2);
    padding-top: var(--space-2);
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.cs-layers-slider-head {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 1.4em;
}
.cs-layers-slider-lbl {
    font-size: 0.78rem;
    color: var(--fg-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.cs-layers-slider-info {
    flex: 0 0 auto;
    width: 18px; height: 18px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--fg-muted);
    cursor: pointer;
    transition: color var(--dur-1) var(--ease), background var(--dur-1) var(--ease);
}
.cs-layers-slider-info:hover,
.cs-layers-slider-info:focus-visible {
    color: var(--aurora-green);
    background: rgba(0, 255, 178, 0.08);
    outline: none;
}
.cs-layers-slider input[type="range"] {
    width: 100%;
    accent-color: var(--brand, #7c5cff);
    cursor: pointer;
}
.cs-layers-slider-val {
    font-size: 0.78rem;
    color: var(--fg);
    font-variant-numeric: tabular-nums;
    align-self: flex-end;
}
.cs-layers-dev {
    margin-top: var(--space-2);
    padding-top: var(--space-2);
    border-top: 1px dashed rgba(255, 107, 53, 0.45);
}
.cs-layers-dev-btn {
    width: 100%;
    margin: 0;
    padding: 0.45rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 107, 53, 0.55);
    background: rgba(255, 107, 53, 0.12);
    color: var(--aurora-orange);
}
.cs-layers-dev-btn:hover {
    background: rgba(255, 107, 53, 0.22);
    border-color: var(--aurora-orange);
}

/* --------------------------------------------------------------- */
/* Google-Earth-style globe dock (zoom column + compass)           */
/* --------------------------------------------------------------- */
.cs-globe-controls {
    position: absolute;
    /* Horizontal anchor: safe-area + page gutter + optical nudge (see --cs-globe-controls-right on html). */
    right: var(--cs-globe-controls-right);
    /* Match share FAB top (12px) so row 1 (+ / share) aligns visually. */
    top: 12px;
    z-index: 850;
    display: flex;
    flex-direction: column;
    /* Flush right so the texture column shares an edge with the share FAB;
     * centering a narrower top block left-shifted the layer control. */
    align-items: flex-end;
    gap: 10px;
    pointer-events: none; /* children re-enable it */
}
.cs-globe-controls[hidden] { display: none; }

/* Wrapper so we can hide zoom + compass on small screens behind a toggle */
.cs-globe-dock-inner {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    pointer-events: none;
}
@media (min-width: 769px) {
    .cs-globe-dock-inner {
        display: contents;
    }
}
.cs-gctl-mobile-toggle {
    display: none;
    pointer-events: auto;
    width: 40px;
    height: 40px;
    padding: 0;
    margin: 0;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    background: rgba(10, 13, 26, 0.82);
    color: var(--fg-0);
    cursor: pointer;
    box-shadow: var(--shadow-2);
    backdrop-filter: blur(8px);
    -webkit-appearance: none;
    appearance: none;
    font: inherit;
}
.cs-gctl-mobile-toggle:hover {
    background: rgba(124, 92, 255, 0.38);
    color: #fff;
}
.cs-gctl-mobile-toggle:focus-visible {
    outline: 2px solid var(--brand, #7c5cff);
    outline-offset: 2px;
}
.cs-gctl-mobile-toggle svg {
    display: block;
    pointer-events: none;
}
.cs-globe-controls--mobile .cs-gctl-mobile-toggle {
    display: inline-flex;
}

.cs-gctl-btn {
    pointer-events: auto;
    width: 36px; height: 36px;
    padding: 0;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    background: rgba(10, 13, 26, 0.78);
    color: var(--fg-0);
    cursor: pointer;
    box-shadow: var(--shadow-2);
    backdrop-filter: blur(8px);
    transition: background var(--dur-2) var(--ease), transform 0.08s ease, color var(--dur-2) var(--ease);
    -webkit-appearance: none;
    appearance: none;
    font: inherit;
}
.cs-gctl-btn:hover       { background: rgba(124, 92, 255, 0.38); color: #fff; }
.cs-gctl-btn:focus-visible { outline: 2px solid var(--brand, #7c5cff); outline-offset: 2px; }
.cs-gctl-btn[data-pressed="1"] { transform: scale(0.94); background: rgba(124, 92, 255, 0.55); color: #fff; }
.cs-gctl-btn svg { display: block; pointer-events: none; }

/* Top row: 3×36px + column gaps 4px, no outer pad (desktop + mobile); row gap 8px like share column. */
.cs-gctl-top-cluster {
    --cs-gctl-cell: 36px;
    --cs-gctl-gap: 4px;
    --cs-gctl-pad: 0px;
    box-sizing: border-box;
    width: calc(var(--cs-gctl-pad) * 2 + var(--cs-gctl-cell) * 3 + var(--cs-gctl-gap) * 2);
    padding: var(--cs-gctl-pad) var(--cs-gctl-pad) 0;
    display: grid;
    grid-template-columns: var(--cs-gctl-cell) var(--cs-gctl-cell) var(--cs-gctl-cell);
    grid-template-rows: var(--cs-gctl-cell) var(--cs-gctl-cell);
    column-gap: var(--cs-gctl-gap);
    row-gap: 8px;
    align-items: stretch;
    pointer-events: none;
}
.cs-gctl-top-pad {
    grid-column: 1;
    grid-row: 1 / span 2;
    pointer-events: none;
}
.cs-gctl-top-cluster .cs-gctl-zoom {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: start;
}
.cs-gctl-side-slot {
    grid-column: 3;
    grid-row: 1 / span 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    align-self: stretch;
    width: var(--cs-gctl-cell);
    min-height: 0;
    gap: 8px;
    pointer-events: none;
}
.cs-gctl-top-cluster--zoom-only .cs-gctl-zoom {
    grid-column: 2;
}
.cs-gctl-top-cluster--zoom-only .cs-gctl-top-pad:first-child {
    grid-column: 1;
    grid-row: 1 / span 2;
}
.cs-gctl-top-cluster--zoom-only .cs-gctl-top-pad:last-child {
    grid-column: 3;
    grid-row: 1 / span 2;
}
.cs-gctl-side-spacer {
    flex: 0 0 var(--cs-gctl-cell);
    width: var(--cs-gctl-cell);
    height: var(--cs-gctl-cell);
    pointer-events: none;
}

/* Globe texture picker trigger (side column, bottom row). */
.cs-gctl-texture {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0;
    pointer-events: auto;
}
.cs-gctl-side-slot .cs-gctl-texture {
    margin: 0;
}
.cs-gctl-texture .cs-gctl-btn {
    width: 36px;
    height: 36px;
    pointer-events: auto;
}

/* Zoom column: separate + / − tiles (same 8px rhythm as `.cs-gctl-side-slot` / mobile). */
.cs-gctl-zoom {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow: visible;
    background: transparent;
    border-radius: 0;
    pointer-events: none;
}
.cs-gctl-zoom .cs-gctl-btn {
    border-right-width: 1px;
    border-bottom-width: 1px;
    border-radius: 10px;
}
.cs-gctl-zoom .cs-gctl-btn:first-child {
    border-radius: 10px;
}
.cs-gctl-zoom .cs-gctl-btn:last-child {
    border-radius: 10px;
    border-bottom-width: 1px;
}

/* Compass: 3-column 3-row grid around a centre "recenter" button,
 * Google-Earth style. Outer buttons are square, centre is round. */
.cs-gctl-compass {
    display: grid;
    grid-template-columns: 36px 36px 36px;
    grid-template-rows:    36px 36px 36px;
    gap: 4px;
    pointer-events: none;
    padding: 6px;
    background: rgba(10, 13, 26, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 16px;
    box-shadow: var(--shadow-2);
    backdrop-filter: blur(6px);
}
.cs-gctl-compass .up    { grid-column: 2; grid-row: 1; }
.cs-gctl-compass .left  { grid-column: 1; grid-row: 2; }
.cs-gctl-compass .c     { grid-column: 2; grid-row: 2; border-radius: 50%; color: var(--aurora-green); }
.cs-gctl-compass .right { grid-column: 3; grid-row: 2; }
.cs-gctl-compass .down  { grid-column: 2; grid-row: 3; }
.cs-gctl-compass .c:hover { color: #fff; }

@media (max-width: 768px) {
    /* Globe dock: 2x2 with #cs-location-share-fab (top-right). Share stays at top:12px;
     * `right` matches `var(--cs-globe-controls-right)` (same as desktop + Leaflet column). */
    .cs-globe-controls {
        left: auto;
        top: 12px;
        transform: none;
        flex-direction: column;
        align-items: flex-end;
        gap: 8px;
        max-width: none;
    }
    /* Drop the decorative left pad column; two cells = zoom | side (spacer + texture). */
    .cs-gctl-top-cluster:not(.cs-gctl-top-cluster--zoom-only) {
        --cs-gctl-pad: 0px;
        --cs-gctl-gap: 8px;
        width: calc(var(--cs-gctl-cell) * 2 + var(--cs-gctl-gap));
        padding: 0;
        grid-template-columns: var(--cs-gctl-cell) var(--cs-gctl-cell);
    }
    .cs-gctl-top-cluster:not(.cs-gctl-top-cluster--zoom-only) > .cs-gctl-top-pad {
        display: none;
    }
    .cs-gctl-top-cluster:not(.cs-gctl-top-cluster--zoom-only) > .cs-gctl-zoom {
        grid-column: 1;
        grid-row: 1 / span 2;
    }
    .cs-gctl-top-cluster:not(.cs-gctl-top-cluster--zoom-only) > .cs-gctl-side-slot {
        grid-column: 2;
        grid-row: 1 / span 2;
    }
    /* Zoom-only dock: single column flush against the share-reserved gutter. */
    .cs-gctl-top-cluster--zoom-only {
        --cs-gctl-pad: 0px;
        width: var(--cs-gctl-cell);
        padding: 0;
        grid-template-columns: var(--cs-gctl-cell);
    }
    .cs-gctl-top-cluster--zoom-only > .cs-gctl-top-pad {
        display: none;
    }
    .cs-gctl-top-cluster--zoom-only > .cs-gctl-zoom {
        grid-column: 1;
        grid-row: 1 / span 2;
    }
    .cs-gctl-mobile-toggle { display: none !important; }
    .cs-globe-controls--mobile .cs-gctl-mobile-toggle { display: none !important; }
    .cs-globe-controls--mobile .cs-globe-dock-inner {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 8px;
    }
    .cs-gctl-compass { display: none !important; }
    .cs-gctl-btn { width: 36px; height: 36px; }
    .cs-stage-fabs {
        left: 10px;
        top: 10px;
        gap: 8px;
    }
    .cs-stage-fabs .balloon-trigger,
    .cs-stage-fabs .cs-layers-cog,
    .cs-stage-fabs .cs-search-fab,
    .cs-stage-fabs .cs-stage-hero-help-fab,
    .cs-stage-fabs .cs-exposure-save-fab {
        width: 38px;
        height: 38px;
    }
    .cs-stage-fabs .balloon-trigger .balloon-icon { width: 20px; height: 20px; }
    /* Full-width sheet for layers + search panels */
    .cs-stage-fabs .cs-layers-panel,
    .cs-stage-fabs .cs-search-panel {
        position: fixed;
        inset: auto 0 0 0;
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;
        width: 100vw;
        max-width: 100vw;
        min-width: 0;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        max-height: min(90dvh, 720px);
        padding-bottom: calc(env(safe-area-inset-bottom, 0px) + var(--space-4));
    }
    /* Sticky title row: close stays visible while scrolling long layer lists. */
    .cs-layers-head {
        position: sticky;
        top: 0;
        z-index: 6;
        margin: calc(-1 * var(--space-3)) calc(-1 * var(--space-4)) var(--space-2);
        padding: var(--space-3) var(--space-4) var(--space-2);
        background: rgba(18, 24, 38, 0.98);
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }
    .cs-layers-cog { width: 40px; height: 40px; }
    #stage-canvas:has(#map.is-active) .cs-layers-cog {
        left: 10px;
        top: 10px;
        right: auto;
        bottom: auto;
    }
}

/* --------------------------------------------------------------- */
/* Leaflet top-right: zoom + back (same corner as globe dock).      */
/* Horizontal inset matches header.top padding so the stack lines up
 * with the language flag column (.cs-lang-summary is in .top-end). */
/* --------------------------------------------------------------- */
html {
    --cs-map-control-right: var(--space-6);
    /* Globe dock + map Leaflet top-right: same inset math + pixel nudge vs share FAB edge. */
    --cs-globe-controls-right: calc(max(var(--cs-map-control-right), env(safe-area-inset-right, 0px)) + -7px + 8px);
}
@media (max-width: 768px) {
    html {
        --cs-map-control-right: var(--space-4);
    }
}
/* Vertical spacing between map controls is handled below when #map is active
 * (flex column + gap). Keep a fallback for other Leaflet embeds. */
.leaflet-top.leaflet-right .cs-back-to-globe,
.leaflet-top.leaflet-right .cs-basemap-toggle { margin-top: 10px; }

/* Share marker (globe + map): same tile look as Leaflet top-right controls */
#cs-location-share-fab.cs-location-share-fab {
    position: absolute;
    right: max(var(--cs-map-control-right), env(safe-area-inset-right, 0px));
    top: 12px;
    /* Above globe dock (850) and Leaflet controls (~1000) so share stays tappable. */
    z-index: 1100;
    width: 36px;
    height: 36px;
    padding: 0;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    box-shadow: var(--shadow-2, 0 4px 20px rgba(0, 0, 0, 0.35));
    background: rgba(10, 13, 26, 0.92) !important;
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    cursor: pointer;
    line-height: 0;
    -webkit-appearance: none;
    appearance: none;
}
#cs-location-share-fab.cs-location-share-fab:hover,
#cs-location-share-fab.cs-location-share-fab:focus-visible {
    background: rgba(124, 92, 255, 0.45) !important;
    color: #fff !important;
    outline: none;
}
/* Map mode: share stays top-right. Desktop = Leaflet column under share (flex).
 * Mobile = grid beside share (same inset math as .cs-globe-controls). */
#stage-canvas:has(#map.is-active) .leaflet-top.leaflet-right {
    top: calc(12px + 36px + 10px) !important;
    right: var(--cs-globe-controls-right) !important;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}
#stage-canvas:has(#map.is-active) .leaflet-top.leaflet-right > .leaflet-control {
    float: none !important;
    clear: none !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}
#stage-canvas:has(#map.is-active) .leaflet-top.leaflet-right .cs-back-to-globe,
#stage-canvas:has(#map.is-active) .leaflet-top.leaflet-right .cs-basemap-toggle {
    margin-top: 0;
}
@media (max-width: 768px) {
    /* Leaflet top-right: same anchor as globe dock (#cs-location-share-fab).
     * Grid 2x2 + row3: col1 = zoom (+ / -), col2 row1 = visual gap for share FAB,
     * row2 = basemap, row3 = back-to-globe under basemap (when basemap exists). */
    #stage-canvas:has(#map.is-active) .leaflet-top.leaflet-right {
        top: 12px !important;
        right: var(--cs-globe-controls-right) !important;
        display: grid !important;
        grid-template-columns: 36px 36px;
        grid-template-rows: auto auto;
        gap: 8px;
        align-items: start;
        justify-items: stretch;
    }
    #stage-canvas:has(#map.is-active) .leaflet-top.leaflet-right:has(.cs-basemap-toggle) {
        grid-template-rows: auto auto auto;
    }
    #stage-canvas:has(#map.is-active) .leaflet-top.leaflet-right > .leaflet-control {
        width: auto;
    }
    #map .leaflet-top.leaflet-right .leaflet-control-zoom.leaflet-bar {
        grid-column: 1;
        grid-row: 1 / span 2;
        flex-direction: column !important;
        gap: 4px;
        align-items: stretch;
        align-self: start;
        float: none;
        clear: none;
    }
    #stage-canvas:has(#map.is-active) .leaflet-top.leaflet-right .cs-basemap-toggle {
        grid-column: 2;
        grid-row: 2;
        justify-self: stretch;
    }
    #stage-canvas:has(#map.is-active) .leaflet-top.leaflet-right .cs-back-to-globe {
        grid-column: 2;
        justify-self: stretch;
    }
    #stage-canvas:has(#map.is-active) .leaflet-top.leaflet-right:has(.cs-basemap-toggle) .cs-back-to-globe {
        grid-row: 3;
    }
    #stage-canvas:has(#map.is-active) .leaflet-top.leaflet-right:not(:has(.cs-basemap-toggle)) .cs-back-to-globe {
        grid-row: 2;
    }
    #map .leaflet-top.leaflet-right .leaflet-control-zoom a {
        border-radius: 10px !important;
    }
    #map .leaflet-top.leaflet-right .leaflet-control-zoom a:last-child {
        border-bottom: 1px solid rgba(255, 255, 255, 0.18) !important;
    }
}

/* Location share modal (copy + social) */
body.cs-location-share-open {
    overflow: hidden;
    touch-action: none;
}
.cs-location-share-modal {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal-app);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
    box-sizing: border-box;
}
.cs-location-share-modal[hidden] {
    display: none !important;
}
.cs-location-share-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4, 8, 20, 0.72);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    cursor: pointer;
}
.cs-location-share-modal__card {
    position: relative;
    z-index: 1;
    width: min(420px, 100%);
    max-height: min(88dvh, 720px);
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    background: linear-gradient(180deg, rgba(20, 26, 48, 0.98), rgba(12, 16, 32, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
    color: var(--fg-0);
    padding: var(--space-4);
}
.cs-location-share-modal__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-3);
}
.cs-location-share-modal__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.3;
}
.cs-location-share-modal__close {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: var(--fg-0);
    cursor: pointer;
}
.cs-location-share-modal__close svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    display: block;
}
.cs-location-share-modal__body {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.cs-location-share-copy-hint {
    margin: 0;
    font-size: 0.82rem;
    color: var(--aurora-green);
}
.cs-location-share-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.cs-location-share-action {
    width: 100%;
    justify-content: center;
    text-align: center;
}

/* Sharer intro (signed `by=` link) */
body.cs-share-sharer-open {
    overflow: hidden;
    touch-action: none;
}
.cs-share-sharer-modal {
    position: fixed;
    inset: 0;
    z-index: calc(var(--z-modal-app) + 2);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
    box-sizing: border-box;
}
.cs-share-sharer-modal[hidden] {
    display: none !important;
}
.cs-share-sharer-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4, 8, 20, 0.75);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    cursor: pointer;
}
.cs-share-sharer-modal__card {
    position: relative;
    z-index: 1;
    width: min(400px, 100%);
    padding: var(--space-5);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, rgba(22, 28, 48, 0.99), rgba(12, 16, 32, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
    color: var(--fg-0);
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    align-items: stretch;
}
.cs-share-sharer-modal__hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
    text-align: center;
}
.cs-share-sharer-modal__avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(124, 92, 255, 0.45);
    box-shadow: 0 0 20px rgba(0, 255, 178, 0.12);
}
.cs-share-sharer-modal__msg {
    margin: 0;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--fg-1);
}
.cs-share-sharer-modal__cta {
    width: 100%;
}
/* Zoom − / + on one row (minus left, plus right), under the share FAB. */
#map .leaflet-top.leaflet-right .leaflet-control-zoom.leaflet-bar {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    gap: 5px;
    float: none;
    clear: none;
    border: none;
    box-shadow: none;
    background: transparent;
}
#map .leaflet-top.leaflet-right .leaflet-control-zoom a {
    width: 36px;
    height: 36px;
    line-height: 34px;
    font-size: 1.35rem;
    font-weight: 500;
    background: rgba(10, 13, 26, 0.92) !important;
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    border-radius: 10px !important;
    box-shadow: var(--shadow-2, 0 4px 20px rgba(0, 0, 0, 0.35));
    backdrop-filter: blur(8px);
    box-sizing: border-box;
}
#map .leaflet-top.leaflet-right .leaflet-control-zoom a:hover {
    background: rgba(124, 92, 255, 0.45) !important;
    color: #fff !important;
}
/* Leaflet joins zoom links with border-bottom:none on last; keep full tiles in a row. */
#map .leaflet-top.leaflet-right .leaflet-control-zoom a:last-child {
    border-bottom: 1px solid rgba(255, 255, 255, 0.18) !important;
}

/* Leaflet attribution readable on dark theme */
.leaflet-control-attribution {
    background: rgba(10, 13, 26, 0.75) !important;
    color: var(--fg-muted) !important;
    font-size: 0.7rem;
}
.leaflet-control-attribution a { color: var(--fg-1, #8fa1c7); }

/* --------------------------------------------------------------- */
/* Exposure verdict chip (binary CLEAR / NOT CLEAR)                */
/* --------------------------------------------------------------- */
.exposure-indicator {
    position: fixed;
    bottom: var(--space-4);
    left: 50%;
    transform: translateX(-50%);
    display: flex; align-items: center; gap: var(--space-3);
    padding: var(--space-3) var(--space-5);
    background: rgba(18, 24, 38, 0.94);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-2);
    z-index: 20;
    min-width: min(92vw, 460px);
    justify-content: flex-start;
    font-family: var(--font-ui);
}
.exposure-indicator .verdict-icon {
    display: inline-grid;
    place-items: center;
    width: 32px; height: 32px;
    border-radius: 50%;
    font-size: 1.05rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.05);
    color: currentColor;
    flex: 0 0 auto;
}
.exposure-indicator .verdict-body {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    min-width: 0;
    flex: 1 1 auto;
}
.exposure-indicator .verdict-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-3);
    width: 100%;
    min-width: 0;
    flex-wrap: wrap;
}
.exposure-indicator .verdict-label {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    flex: 1 1 auto;
    min-width: 0;
}
.exposure-indicator .verdict-score {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: baseline;
    gap: 0;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-family: var(--font-ui);
    font-variant-numeric: tabular-nums;
    line-height: 1;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 16px rgba(255, 255, 255, 0.06);
}
.exposure-indicator .verdict-score__value {
    font-size: 1.2rem;
    font-weight: 800;
}
.exposure-indicator .verdict-score__suffix {
    font-size: 0.68rem;
    font-weight: 700;
    opacity: 0.88;
    margin-left: 1px;
}
/* Score badge + optional semi-circular gauge stack (gauge visible only when expanded). */
.exposure-indicator .verdict-score-column {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex: 0 0 auto;
}
.exposure-indicator .verdict-clearspot-gauge {
    width: 100px;
    max-width: min(100px, 30vw);
    line-height: 0;
    pointer-events: none;
}
.exposure-indicator .verdict-clearspot-gauge__svg {
    display: block;
    width: 100%;
    height: auto;
    vertical-align: top;
}
.exposure-indicator[aria-expanded="false"] .verdict-clearspot-gauge,
.exposure-indicator:not([data-has-score="1"]) .verdict-clearspot-gauge {
    display: none !important;
}
.exposure-indicator[data-verdict="clear"] .verdict-score {
    border-color: rgba(0, 255, 178, 0.35);
    background: rgba(0, 255, 178, 0.1);
    box-shadow: 0 0 16px rgba(0, 255, 178, 0.12);
}
.exposure-indicator[data-verdict="moderate"] .verdict-score {
    border-color: rgba(249, 115, 22, 0.38);
    background: rgba(249, 115, 22, 0.11);
    box-shadow: 0 0 16px rgba(249, 115, 22, 0.14);
}
.exposure-indicator[data-verdict="not-clear"] .verdict-score {
    border-color: rgba(239, 68, 68, 0.38);
    background: rgba(239, 68, 68, 0.11);
    box-shadow: 0 0 16px rgba(239, 68, 68, 0.18);
}
.exposure-indicator[data-verdict="pending"] .verdict-score {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.06);
}
.exposure-indicator .verdict-sub {
    font-size: 0.78rem;
    color: var(--fg-muted);
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.exposure-indicator .verdict-location {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.exposure-indicator .verdict-place {
    display: block;
    font-size: 0.70rem;
    color: var(--fg-muted);
    font-family: var(--font-ui);
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    margin-top: 1px;
    opacity: 0.92;
    white-space: normal;
    line-height: 1.35;
}
.exposure-indicator .verdict-place:empty {
    display: none;
}
.exposure-indicator .verdict-coords {
    display: block;
    font-size: 0.70rem;
    color: var(--fg-muted);
    font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    margin-top: 0;
    opacity: 0.85;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.exposure-indicator .verdict-coords:empty { display: none; }
.exposure-indicator .verdict-location[hidden] { display: none !important; }
.exposure-indicator[data-verdict="pending"]   { color: var(--fg-muted); }
.exposure-indicator[data-verdict="clear"]     { color: var(--aurora-green);  border-color: rgba(0, 255, 178, 0.40); }
.exposure-indicator[data-verdict="moderate"]  { color: #fb923c; border-color: rgba(251, 146, 60, 0.42); }
.exposure-indicator[data-verdict="not-clear"] { color: #fb7185; border-color: rgba(251, 113, 133, 0.42); }
.exposure-indicator[data-verdict="clear"] .verdict-icon     { background: rgba(0, 255, 178, 0.12);  box-shadow: 0 0 18px rgba(0, 255, 178, 0.30); }
.exposure-indicator[data-verdict="moderate"] .verdict-icon { background: rgba(251, 146, 60, 0.14); box-shadow: 0 0 18px rgba(251, 146, 60, 0.28); }
.exposure-indicator[data-verdict="not-clear"] .verdict-icon { background: rgba(251, 113, 133, 0.14); box-shadow: 0 0 18px rgba(251, 113, 133, 0.30); }

@media (max-width: 640px) {
    .exposure-indicator {
        left: 0;
        right: 0;
        bottom: 0;
        transform: none;
        width: 100%;
        max-width: none;
        min-width: 0;
        border-radius: 0;
        padding: var(--space-3) var(--space-4);
        box-sizing: border-box;
    }
    .exposure-indicator .verdict-icon { width: 28px; height: 28px; font-size: 0.95rem; }
    .exposure-indicator .verdict-label { font-size: 0.85rem; }
    .exposure-indicator .verdict-score__value { font-size: 1.05rem; }
    .exposure-indicator .verdict-score__suffix { font-size: 0.62rem; }
    .exposure-indicator .verdict-sub { font-size: 0.72rem; }
    .exposure-indicator .verdict-coords { font-size: 0.66rem; }
    .exposure-indicator .verdict-place { font-size: 0.66rem; }
}

/* Chromium "Add to Home Screen" prompt: top-centre banner with dismiss */
.cs-pwa-install {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + var(--space-3));
    left: 50%;
    transform: translateX(-50%);
    z-index: 35;
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    padding: 0.5rem 0.55rem 0.5rem 1rem;
    max-width: calc(100vw - 2rem);
    font-family: var(--font-ui);
    background: rgba(18, 24, 38, 0.94);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-2);
    backdrop-filter: blur(8px);
    color: var(--fg-0);
}
.cs-pwa-install[hidden] { display: none; }

/* Hide the floating top-center banner once the user has added the
 * app to the Home Screen (any "app mode" display). The burger-menu
 * entry follows the same rule via the media query below. */
@media (display-mode: standalone), (display-mode: fullscreen), (display-mode: minimal-ui) {
    .cs-pwa-install { display: none !important; }
}

/* -------------------------------------------------------------
 * Burger-menu "Install app" entry (mobile only).
 *
 * Always available when the app is not yet installed, independent
 * of beforeinstallprompt - Samsung Internet and iOS Safari never
 * fire that event but still let users add to the Home Screen
 * manually, so we expose the entry and tailor the tap flow
 * (native prompt when possible, instructions modal otherwise).
 * ------------------------------------------------------------- */
.cs-nav-install { display: none; }
.cs-nav-install[hidden] { display: none !important; }
@media (max-width: 768px) {
    .cs-nav-install {
        display: inline-flex;
        align-items: center;
        gap: 0.55rem;
        width: 100%;
        padding: var(--space-3) 0;
        background: transparent;
        border: 0;
        border-bottom: 1px solid var(--border);
        color: var(--brand, #7c5cff);
        font-family: inherit;
        font-size: 1rem;
        font-weight: 600;
        text-align: left;
        cursor: pointer;
        -webkit-appearance: none;
        appearance: none;
    }
    .cs-nav-install[hidden] { display: none !important; }
    .cs-nav-install svg {
        flex: 0 0 auto;
        color: var(--brand, #7c5cff);
    }
    .cs-nav-install:focus-visible {
        outline: 2px solid var(--brand, #7c5cff);
        outline-offset: 2px;
        border-radius: 6px;
    }
    .cs-nav-install:hover { color: var(--fg-0); }
    .cs-nav-install:hover svg { color: var(--fg-0); }
}
@media (display-mode: standalone), (display-mode: fullscreen), (display-mode: minimal-ui) {
    .cs-nav-install { display: none !important; }
}

/* -------------------------------------------------------------
 * Manual install-instructions modal (shown when deferredPrompt
 * is unavailable, e.g. Samsung Internet, iOS Safari, Firefox
 * Android).
 * ------------------------------------------------------------- */
.cs-install-help {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal-app);
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
}
.cs-install-help.is-open { display: flex; }
.cs-install-help__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 8, 15, 0.72);
    backdrop-filter: blur(6px);
    cursor: pointer;
}
.cs-install-help__card {
    position: relative;
    width: min(420px, 100%);
    max-height: calc(100dvh - 2 * var(--space-4));
    overflow-y: auto;
    background: var(--bg-1, #111726);
    color: var(--fg-0);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: var(--space-5) var(--space-4) var(--space-4);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45),
                0 0 0 1px rgba(124, 92, 255, 0.18);
    font-family: var(--font-ui);
}
.cs-install-help__close {
    position: absolute;
    top: 10px; right: 10px;
    width: 32px; height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--fg-muted);
    border: 0;
    border-radius: 50%;
    cursor: pointer;
}
.cs-install-help__close:hover {
    color: var(--fg-0);
    background: rgba(255, 255, 255, 0.08);
}
.cs-install-help__close svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    display: block;
}
.cs-install-help__title {
    margin: 0 2.4rem 0.35rem 0;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.25;
}
.cs-install-help__lead {
    margin: 0 0 var(--space-3);
    color: var(--fg-muted);
    font-size: 0.9rem;
    line-height: 1.4;
}
.cs-install-help__steps {
    margin: 0 0 var(--space-4);
    padding-left: 1.25rem;
    color: var(--fg-0);
    font-size: 0.92rem;
    line-height: 1.45;
}
.cs-install-help__steps li { margin-bottom: 0.4rem; }
.cs-install-help__steps li:last-child { margin-bottom: 0; }
.cs-install-help__ok {
    display: block;
    width: 100%;
    padding: 0.7rem 1.1rem;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    background: var(--grad-primary, linear-gradient(135deg, #7c5cff, #4ec8ff));
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full, 999px);
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}
.cs-install-help__ok:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}
body.cs-install-help-open {
    overflow: hidden;
    touch-action: none;
}
.cs-pwa-install-text {
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.cs-pwa-install-btn {
    padding: 0.4rem 0.95rem;
    font-size: 0.8rem;
    font-weight: 700;
    font-family: inherit;
    letter-spacing: 0.02em;
    color: #fff;
    background: var(--grad-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    cursor: pointer;
    white-space: nowrap;
    -webkit-appearance: none;
    appearance: none;
    flex: 0 0 auto;
}
.cs-pwa-install-btn:focus-visible,
.cs-pwa-install-close:focus-visible {
    outline: 2px solid var(--brand, #7c5cff);
    outline-offset: 2px;
}
.cs-pwa-install-close {
    width: 28px; height: 28px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--fg-muted);
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    flex: 0 0 auto;
}
.cs-pwa-install-close:hover { color: var(--fg-0); background: rgba(255, 255, 255, 0.08); }
.cs-pwa-install-close svg { display: block; pointer-events: none; }
@media (max-width: 480px) {
    .cs-pwa-install { gap: var(--space-2); padding: 0.45rem 0.45rem 0.45rem 0.75rem; }
    .cs-pwa-install-text { font-size: 0.78rem; max-width: 45vw; }
    .cs-pwa-install-btn { font-size: 0.74rem; padding: 0.35rem 0.7rem; }
}

/* --------------------------------------------------------------- */
/* Modal / onboarding                                              */
/* --------------------------------------------------------------- */
.modal-backdrop {
    position: fixed; inset: 0; z-index: 40;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    display: grid; place-items: center;
    animation: fade-in var(--dur-2) var(--ease);
}
.modal-card {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-8);
    width: min(480px, 92vw);
    box-shadow: var(--shadow-glow);
}
.modal-card h2 { font-size: 1.5rem; }
.modal-card .steps {
    display: flex; gap: var(--space-2); margin-bottom: var(--space-4);
}
.modal-card .steps span {
    flex: 1; height: 3px; border-radius: var(--radius-full);
    background: var(--border);
}
.modal-card .steps span.active {
    background: var(--grad-primary-h);
}
.modal-card .actions { display: flex; gap: var(--space-3); margin-top: var(--space-6); }

/* --------------------------------------------------------------- */
/* Slider (sensitivity settings)                                   */
/* --------------------------------------------------------------- */
input[type=range] {
    width: 100%;
    appearance: none;
    background: var(--border);
    height: 4px;
    border-radius: var(--radius-full);
}
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px; height: 18px; border-radius: 50%;
    background: var(--grad-primary);
    cursor: pointer;
    box-shadow: var(--shadow-2);
}

/* --------------------------------------------------------------- */
/* CMP banner                                                      */
/* --------------------------------------------------------------- */
.cmp-banner {
    position: fixed; bottom: var(--space-4); left: var(--space-4); right: var(--space-4);
    max-width: 640px; margin: 0 auto;
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-4);
    z-index: 30;
    box-shadow: var(--shadow-2);
    display: flex; align-items: center; gap: var(--space-4);
    flex-wrap: wrap;
}
.cmp-banner p { margin: 0; font-size: 0.85rem; flex: 1; min-width: 240px; }
.cmp-banner .actions { display: flex; gap: var(--space-2); }

/* --------------------------------------------------------------- */
/* Skeleton loader                                                 */
/* --------------------------------------------------------------- */
.skel {
    background: linear-gradient(90deg, var(--bg-1) 0%, var(--bg-2) 50%, var(--bg-1) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite linear;
    border-radius: var(--radius-sm);
}
@keyframes shimmer { 0% { background-position: -150% 0 } 100% { background-position: 150% 0 } }
@keyframes fade-in { from { opacity: 0 } to { opacity: 1 } }

/* --------------------------------------------------------------- */
/* Onboarding modal                                                */
/* --------------------------------------------------------------- */
.onboarding-modal,
.balloon-teaser {
    position: fixed; inset: 0; z-index: var(--z-modal-app);
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    display: grid; place-items: center;
    animation: fade-in var(--dur-2) var(--ease);
}
.onboarding-modal--sheet {
    place-items: end center;
    align-content: end;
    padding: 0;
}
.onboarding-modal .modal-card {
    width: min(1200px, min(96vw, max(80vw, 320px)));
    display: flex;
    flex-direction: column;
    max-height: min(94vh, 980px);
}
.onboarding-modal--sheet .modal-card {
    width: 100%;
    max-width: 100%;
    max-height: min(94dvh, 980px);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    margin: 0;
    padding: var(--space-4) var(--space-4) env(safe-area-inset-bottom, 0);
}
.onboarding-modal .ob-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.onboarding-modal .ob-footer {
    flex-shrink: 0;
    margin-top: var(--space-2);
    padding-top: var(--space-3);
    border-top: 1px solid var(--border);
    background: var(--bg-1);
}
.onboarding-modal--sheet .ob-sec.is-past {
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--border);
    opacity: 0.88;
}
.onboarding-modal .ob-geoloc-note {
    font-size: 0.9rem;
    margin-top: var(--space-3);
}
.onboarding-modal .progress {
    height: 4px; width: 100%; border-radius: var(--radius-full);
    background: var(--border); overflow: hidden; margin-bottom: var(--space-6);
}
.onboarding-modal .progress .bar {
    display: block; height: 100%; width: 0%;
    background: var(--grad-primary-h);
    transition: width var(--dur-2) var(--ease);
}
.onboarding-modal .slider-row {
    display: grid;
    grid-template-columns: 140px 1fr 48px;
    align-items: center;
    gap: var(--space-3);
    margin: var(--space-3) 0;
    font-size: 0.9rem;
}
.onboarding-modal .slider-row .val { text-align: right; color: var(--fg-muted); font-variant-numeric: tabular-nums; }
.onboarding-modal .lead { color: var(--fg-1); }
.onboarding-modal .ob-intro-copy {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin-top: var(--space-2);
}
.onboarding-modal .ob-intro-copy .lead { margin: 0; font-size: 0.92rem; line-height: 1.45; }
.onboarding-modal .checkbox { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-4); font-size: 0.9rem; }

.onboarding-modal .actions,
.balloon-teaser .actions {
    display: flex; gap: var(--space-3); justify-content: flex-end; margin-top: var(--space-6);
}
.btn, .onboarding-modal .btn, .cmp-banner .btn, .balloon-teaser .btn {
    background: var(--grad-primary);
    color: #fff;
    padding: 0.6rem 1.1rem;
    border-radius: var(--radius);
    font-weight: 700;
    letter-spacing: 0.02em;
    border: 0; cursor: pointer;
}
.btn-link {
    background: transparent;
    color: var(--fg-muted);
    border: 0; padding: 0.6rem 0.8rem; cursor: pointer; font-weight: 500;
}
.btn-link:hover { color: var(--fg-0); }

.cmp-banner .cmp-inner { display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: center; width: 100%; }
.cmp-banner .cmp-text { flex: 1; min-width: 220px; }
.cmp-banner .cmp-text p { margin-top: var(--space-1); color: var(--fg-muted); }
.cmp-banner .cmp-actions { display: flex; gap: var(--space-2); }
.cmp-banner .cmp-detail {
    width: 100%;
    padding-top: var(--space-3);
    border-top: 1px solid var(--border);
    margin-top: var(--space-3);
    display: grid; gap: var(--space-2);
}

/* Hot-air balloon trigger */
.balloon-trigger {
    position: fixed;
    bottom: var(--space-4);
    right: var(--space-4);
    width: 52px; height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--aurora-violet), var(--aurora-violet-deep));
    color: #fff;
    font-size: 1.4rem;
    box-shadow: 0 4px 20px rgba(123, 63, 196, 0.40), var(--shadow-2);
    border: 1px solid rgba(123, 94, 167, 0.50);
    z-index: 25;
    padding: 0;
    display: grid; place-items: center;
}

/* --------------------------------------------------------------- */
/* Auth / Account pages                                            */
/* --------------------------------------------------------------- */
.auth-shell {
    min-height: 100vh;
    display: grid; place-items: center;
    padding: var(--space-6);
    background:
        radial-gradient(40% 40% at 20% 20%, rgba(123, 94, 167, 0.22), transparent 70%),
        radial-gradient(50% 50% at 80% 80%, rgba(0, 255, 178, 0.10), transparent 70%),
        radial-gradient(35% 35% at 60% 15%, rgba(88, 232, 255, 0.08), transparent 70%),
        var(--bg-0);
}
.auth-card {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-8);
    width: min(420px, 96vw);
    box-shadow: var(--shadow-2);
}
.auth-card .brand-link {
    font-family: var(--font-ui); font-weight: 800; font-size: 1.05rem;
    display: inline-flex; align-items: baseline; text-decoration: none;
}
.auth-card .brand-link .brand-name { font-size: inherit; }
.auth-card h1 { margin-top: var(--space-4); font-size: 1.5rem; }
.auth-card label { display: block; margin-top: var(--space-4); font-size: 0.85rem; color: var(--fg-1); }
.auth-card label span { display: block; margin-bottom: 4px; }
.auth-card input, .auth-card select, .card input, .card select, .card textarea {
    width: 100%;
    background: var(--bg-2);
    border: 1px solid var(--border);
    color: var(--fg-0);
    border-radius: var(--radius);
    padding: 0.6rem 0.8rem;
    font: inherit;
}
.auth-card .btn, .auth-card .btn-ghost { margin-top: var(--space-5); width: 100%; text-align: center; }
.btn-ghost {
    display: inline-block;
    background: transparent; border: 1px solid var(--border);
    color: var(--fg-0);
    padding: 0.6rem 1.1rem; border-radius: var(--radius); font-weight: 600; cursor: pointer;
}
.btn-wide { width: 100%; text-align: center; }
.divider { text-align: center; margin: var(--space-5) 0; position: relative; color: var(--fg-muted); font-size: 0.8rem; }
.divider::before, .divider::after {
    content: ''; position: absolute; top: 50%; width: 40%; height: 1px; background: var(--border);
}
.divider::before { left: 0; } .divider::after { right: 0; }
.divider span { background: var(--bg-1); padding: 0 var(--space-3); }
.muted { color: var(--fg-muted); }
.center { text-align: center; }
.alert { padding: var(--space-3); border-radius: var(--radius); margin: var(--space-3) 0; font-size: 0.9rem; }
.alert-error   { background: rgba(255, 107, 53, 0.12); color: #ffcbb0; border: 1px solid rgba(255, 107, 53, 0.35); }
.alert-success { background: rgba(0, 255, 178, 0.10);  color: #9bf3d4; border: 1px solid rgba(0, 255, 178, 0.35); }
.alert-info    { background: rgba(88, 232, 255, 0.10); color: #c5edff; border: 1px solid rgba(88, 232, 255, 0.35); }

.account-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: var(--space-6);
    padding: var(--space-6);
    align-items: start;
}
@media (max-width: 900px) {
    .account-grid { grid-template-columns: 1fr; }
}
.card {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    box-shadow: var(--shadow-1);
}
.card.danger { border-color: rgba(255, 107, 53, 0.35); }
.card h2 { font-size: 1.2rem; margin: 0 0 var(--space-3); }
.card h3 { margin-top: var(--space-5); font-size: 0.95rem; color: var(--fg-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.card .actions { margin-top: var(--space-5); display: flex; gap: var(--space-3); justify-content: flex-end; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }

.profile-card { text-align: center; }
.profile-card .avatar-wrap { display: flex; justify-content: center; margin-bottom: var(--space-4); }
.profile-card .avatar.lg { width: 128px; height: 128px; border-radius: 50%; object-fit: cover; box-shadow: var(--shadow-2); }
.profile-card input[type=file] { display: none; }
.profile-card form { margin-top: var(--space-3); }

.btn-danger {
    background: rgba(255, 107, 53, 0.14);
    color: #ffcbb0;
    border: 1px solid rgba(255, 107, 53, 0.35);
    padding: 0.6rem 1.1rem;
    border-radius: var(--radius);
    font-weight: 600;
}
.btn-danger:hover { background: rgba(255, 107, 53, 0.22); }

/* Avatar crop <dialog>: never use class name `cropper-modal` on this host.
 * Cropper.js reuses that class for its internal shade layer; matching it
 * made the whole dialog inherit opacity and looked washed out. */
dialog.cs-avatar-crop-dialog:not([open]) {
    display: none !important;
}

/* Native <dialog> + showModal() uses the top layer (above z-index: 900 header, sliders, etc.). */
dialog.cs-avatar-crop-dialog {
    position: fixed;
    inset: 0;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    min-height: 100dvh;
    max-height: none;
    height: auto;
    margin: 0;
    padding: var(--space-4);
    border: none;
    background: none;
    box-shadow: none;
    box-sizing: border-box;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}
dialog.cs-avatar-crop-dialog[open] {
    display: grid;
    place-items: center;
    align-content: start;
}
dialog.cs-avatar-crop-dialog::backdrop {
    background: rgba(5, 8, 15, 0.88);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.cs-avatar-crop-dialog .modal-card {
    position: relative;
    z-index: 0;
    width: min(560px, 100%);
    max-width: min(560px, 94vw);
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    box-shadow: var(--shadow-2);
    color: var(--fg-0);
    box-sizing: border-box;
}
.cs-avatar-crop-dialog .modal-card h2 {
    margin: 0 0 var(--space-3);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--fg-0);
}
.cs-avatar-crop-dialog .cropper-stage {
    margin-top: var(--space-3);
    width: 100%;
    max-height: min(60vh, 640px);
    min-height: 12rem;
    background: var(--bg-2);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
}
.cs-avatar-crop-dialog .cropper-stage img { max-width: 100%; display: block; }
.cs-avatar-crop-dialog .modal-card .actions {
    margin-top: var(--space-4);
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: var(--space-3);
}
/* Cropper.js panels above the image only inside the card */
.cs-avatar-crop-dialog .cropper-container { z-index: 1; }
.cs-avatar-crop-dialog .cropper-view-box,
.cs-avatar-crop-dialog .cropper-face { border-radius: 0; }

.avatar-save-overlay {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: grid;
    place-items: center;
    background: rgba(5, 8, 15, 0.72);
    backdrop-filter: blur(4px);
}
.avatar-save-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-5);
    color: var(--fg-0);
    font-size: 0.95rem;
    font-weight: 600;
}
.avatar-save-spinner {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--aurora-violet, #9b7fff);
    animation: avatar-spin 0.75s linear infinite;
}
@keyframes avatar-spin {
    to { transform: rotate(360deg); }
}

/* Account profile: Save in header (no scroll) + flex center strip */
.account-header-save {
    flex: 1 1 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 0;
    padding: 0 var(--space-2);
}
.account-header-save__btn {
    padding: 0.45rem 1rem;
    font-size: 0.86rem;
    white-space: nowrap;
}
.account-header-save__btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.account-notify-item .account-notify-subs--muted {
    opacity: 0.55;
}

.account-grid .slider-row {
    display: grid;
    grid-template-columns: 1fr minmax(120px, 2fr) 4rem;
    gap: var(--space-3);
    align-items: center;
    margin-bottom: var(--space-4);
}
.account-grid .slider-row span:first-child { font-size: 0.88rem; color: var(--fg-muted); line-height: 1.35; }
.account-grid .slider-row .val {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-size: 0.85rem;
    color: var(--fg-muted);
}
.cs-heatmap-info {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-2);
    color: var(--aurora-cyan);
    font-size: 0.72rem;
    font-weight: 700;
    font-style: italic;
    font-family: Georgia, "Times New Roman", serif;
    cursor: pointer;
    vertical-align: middle;
    padding: 0;
    line-height: 1;
}
.cs-heatmap-info:hover { border-color: rgba(88, 232, 255, 0.45); }
dialog.cs-help-dialog {
    max-width: min(34rem, 94vw);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-1);
    color: var(--fg-0);
    padding: var(--space-5);
    box-shadow: var(--shadow-2);
}
dialog.cs-help-dialog::backdrop { background: rgba(5, 8, 15, 0.65); }
dialog.cs-help-dialog h2 { margin: 0 0 var(--space-3); font-size: 1.1rem; }
dialog.cs-help-dialog p { margin: 0 0 var(--space-4); line-height: 1.55; font-size: 0.92rem; color: var(--fg-muted); }
dialog.cs-help-dialog button[type="submit"] {
    border: 1px solid var(--border);
    background: var(--bg-2);
    color: var(--fg-0);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
}

/* --------------------------------------------------------------- */
/* Balloon V1.1 overlay                                            */
/* --------------------------------------------------------------- */
.balloon-overlay {
    position: fixed; inset: 0; z-index: 960;
    background: rgba(5, 8, 15, 0.92);
    backdrop-filter: blur(12px);
    animation: fade-in var(--dur-2) var(--ease);
    color: var(--fg-0);
}
.balloon-scene {
    display: grid;
    grid-template-columns: 1fr 360px;
    height: 100%;
}
.balloon-sky {
    position: relative;
    min-height: 0;
    background: var(--bg-0);
    overflow: hidden;
}
.balloon-map-root {
    position: absolute;
    inset: 0;
    z-index: 0;
}
.balloon-map-root .leaflet-container {
    font-family: inherit;
    background: var(--bg-0);
}
.balloon-intro-modal {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 70;
    width: min(94%, 700px);
    min-height: min(68vh, 560px);
    background: rgba(11, 16, 28, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    box-shadow: 0 14px 46px rgba(0, 0, 0, 0.62);
    padding: 1rem 1.1rem;
    backdrop-filter: blur(8px);
    text-align: left;
}
.balloon-intro-modal h3 {
    margin: 0 0 0.7rem;
    font-size: 1.05rem;
}
.balloon-intro-modal p {
    margin: 0.55rem 0;
    color: var(--fg-1);
    line-height: 1.4;
}
.balloon-intro-modal .balloon-board-btn {
    margin-top: 0.8rem;
    width: 100%;
}
.balloon-inflating-modal {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 75;
    width: min(92%, 420px);
    padding: 1.1rem 1.25rem;
    text-align: center;
    background: rgba(11, 16, 28, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
    pointer-events: none;
}
.balloon-inflating-modal .balloon-inflating-msg {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.45;
    color: rgba(248, 250, 255, 0.98);
}
.balloon-exit-cta {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 50;
    max-width: min(92%, 320px);
    padding: 0.65rem 1.25rem;
    font-weight: 700;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55);
    pointer-events: auto;
}
.balloon-sky::before {
    content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
    background:
      radial-gradient(2px 2px at 20% 30%, #fff5 50%, transparent 100%),
      radial-gradient(1.5px 1.5px at 80% 60%, #fff3 50%, transparent 100%);
    opacity: 0.35;
}
.balloon-hud {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    background: linear-gradient(to top, rgba(5, 8, 15, 0.72) 0%, rgba(5, 8, 15, 0.12) 36%, transparent 70%);
}
.balloon-basket {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    bottom: auto;
    transition: transform 0.35s ease;
    color: rgba(255, 255, 255, 0.92);
    filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.6));
    z-index: 21;
}
.balloon-basket .balloon-basket-svg {
    display: block;
    width: 46px; height: 46px;
}
@media (max-width: 720px) {
    .balloon-basket .balloon-basket-svg { width: 38px; height: 38px; }
}
/* Balloon sky HUD: altitude + reverse-geocode (high contrast for readability). */
.balloon-altitude-hud {
    position: absolute;
    left: 50%;
    top: 10px;
    transform: translateX(-50%);
    z-index: 19;
    max-width: min(92vw, 28rem);
    padding: 10px 16px 12px;
    text-align: center;
    border-radius: 12px;
    background: rgba(6, 10, 18, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 4px 28px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}
.balloon-altitude-line {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.25;
    color: rgba(255, 255, 255, 0.98);
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.95), 0 0 14px rgba(0, 0, 0, 0.88);
}
.balloon-alt-prefix {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-right: 0.35em;
}
.balloon-alt-value {
    font-variant-numeric: tabular-nums;
}
.balloon-alt-region {
    margin-top: 6px;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.35;
    color: rgba(232, 238, 248, 0.95);
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.92);
    word-break: break-word;
}
@media (max-width: 720px) {
    .balloon-altitude-hud {
        padding: 8px 12px 10px;
        max-width: min(94vw, 24rem);
    }
    .balloon-altitude-line {
        font-size: 1.05rem;
    }
    .balloon-alt-region {
        font-size: 0.84rem;
    }
}
.balloon-readings {
    background: rgba(18, 24, 38, 0.95);
    border-left: 1px solid var(--border);
    padding: var(--space-6);
    overflow-y: auto;
}
.balloon-panel-grip,
.balloon-panel-toggle { display: none; }
.balloon-readings-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: var(--space-3);
    margin-bottom: var(--space-2);
}
.balloon-readings-head h2 { font-size: 1.1rem; margin: 0; flex: 1 1 auto; }
.balloon-random-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    margin: var(--space-3) 0 var(--space-2);
    text-align: center;
}
.balloon-random-row .balloon-land {
    font-size: 0.9rem;
}
.balloon-random-row .balloon-leave {
    font-size: 0.9rem;
}
.balloon-random-footer {
    margin: var(--space-5) 0 var(--space-2);
    text-align: center;
}
.balloon-random-footer .balloon-random-loc {
    white-space: normal;
    max-width: 100%;
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.4;
    opacity: 0.88;
    padding: 0.4rem 0.5rem;
}
.balloon-random-loc {
    font-size: 0.85rem;
}
.balloon-atmo-collapse {
    margin: var(--space-4) 0 var(--space-2);
    border-top: 1px solid var(--border);
    padding-top: var(--space-3);
}
.balloon-atmo-toggle {
    display: block;
    width: 100%;
    text-align: left;
    font-size: 0.9rem;
    padding: 0.35rem 0;
}
.balloon-atmo-panel {
    padding-top: var(--space-2);
}
.balloon-atmo-dl {
    display: grid;
    gap: var(--space-2);
    margin: 0 0 var(--space-1);
}
.balloon-readings .v-zone {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.35rem 0.5rem;
    align-items: baseline;
}
.balloon-readings .v-zone-score {
    font-variant-numeric: tabular-nums;
}
.balloon-readings .v-zone-verdict {
    font-weight: 700;
    font-size: 0.92rem;
}
.balloon-readings .v-zone-verdict.is-clear {
    color: var(--aurora-green);
}
.balloon-readings .v-zone-verdict.is-not-clear {
    color: var(--aurora-orange);
}
.balloon-place {
    font-size: 0.82rem;
    color: var(--fg-muted);
    letter-spacing: 0.01em;
    min-height: 1.1em; /* reserve space before async fill */
}
.balloon-place:empty::before {
    content: '\2009'; /* thin space keeps row height stable */
    opacity: 0;
}
.balloon-speed-actions {
    display: flex;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}
.balloon-speed-actions .btn-ghost {
    min-width: 2.75rem;
    font-weight: 700;
    font-size: 1.1rem;
    padding: 0.35rem 0.6rem;
}
.balloon-temp-dd { display: flex; align-items: center; justify-content: flex-end; gap: 0.35rem; flex-wrap: wrap; }
.balloon-temp-toggle { font-size: 0.8rem; padding: 0.1rem 0.35rem; }
.balloon-readings h2 { font-size: 1.1rem; margin-top: 0; }
.balloon-readings dl { display: grid; gap: var(--space-3); margin: var(--space-4) 0; }
.balloon-readings dl > div { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); padding: var(--space-2) 0; border-bottom: 1px solid var(--border); }
.balloon-readings dt { color: var(--fg-muted); font-size: 0.85rem; flex: 0 1 auto; }
.balloon-readings dd { margin: 0; font-family: var(--font-ui); font-weight: 600; text-align: right; max-width: 62%; word-break: break-word; }
.balloon-map-dock {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 25;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    pointer-events: none;
}
.balloon-map-dock > * { pointer-events: auto; }
.balloon-ctl-btn {
    pointer-events: auto;
    width: 36px; height: 36px;
    padding: 0;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    background: rgba(10, 13, 26, 0.82);
    color: var(--fg-0);
    cursor: pointer;
    box-shadow: var(--shadow-2);
    backdrop-filter: blur(8px);
    transition: background var(--dur-2) var(--ease), transform 0.08s ease, color var(--dur-2) var(--ease);
    -webkit-appearance: none;
    appearance: none;
    font: inherit;
}
.balloon-ctl-btn:hover { background: rgba(124, 92, 255, 0.38); color: #fff; }
.balloon-ctl-btn:focus-visible { outline: 2px solid var(--brand, #7c5cff); outline-offset: 2px; }
.balloon-ctl-btn[data-pressed="1"] { transform: scale(0.94); background: rgba(124, 92, 255, 0.55); color: #fff; }
.balloon-ctl-btn svg { display: block; pointer-events: none; }
.balloon-ctl-zoom {
    display: flex;
    flex-direction: column;
    border-radius: 10px;
    overflow: hidden;
    pointer-events: none;
}
.balloon-ctl-zoom .balloon-ctl-btn {
    border-radius: 0;
    border-bottom-width: 0;
}
.balloon-ctl-zoom .balloon-ctl-btn:first-child {
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}
.balloon-ctl-zoom .balloon-ctl-btn:last-child {
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
    border-bottom-width: 1px;
}
.balloon-ctl-compass {
    display: grid;
    grid-template-columns: 36px 36px 36px;
    grid-template-rows: 36px 36px 36px;
    gap: 4px;
    pointer-events: none;
    padding: 6px;
    background: rgba(10, 13, 26, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 16px;
    box-shadow: var(--shadow-2);
    backdrop-filter: blur(6px);
}
.balloon-ctl-compass .up { grid-column: 2; grid-row: 1; }
.balloon-ctl-compass .left { grid-column: 1; grid-row: 2; }
.balloon-ctl-compass .c { grid-column: 2; grid-row: 2; border-radius: 50%; color: var(--aurora-green); }
.balloon-ctl-compass .right { grid-column: 3; grid-row: 2; }
.balloon-ctl-compass .down { grid-column: 2; grid-row: 3; }
.balloon-ctl-compass .c:hover { color: #fff; }
.balloon-close {
    position: absolute; top: 16px; right: 16px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--fg-0);
    width: 36px; height: 36px; border-radius: 50%;
    padding: 0; font-size: 1rem;
    cursor: pointer;
    border: 1px solid var(--border);
    z-index: 40;
}
.balloon-readings .slider-row {
    display: grid;
    grid-template-columns: minmax(0, 100px) 1fr minmax(4.25rem, max-content);
    align-items: center;
    gap: var(--space-3);
    margin: var(--space-4) 0;
    font-size: 0.9rem;
}
.balloon-readings .slider-row .val {
    text-align: right;
    color: var(--fg-muted);
    font-variant-numeric: tabular-nums;
    min-width: 0;
    white-space: nowrap;
}
.small { font-size: 0.8rem; }
@media (max-width: 980px) {
    .balloon-scene { grid-template-columns: 1fr; grid-template-rows: 1fr; }
    .balloon-readings {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 35;
        border-left: 0;
        border-top: 1px solid var(--border);
        height: var(--balloon-panel-h, 58vh);
        max-height: 92vh;
        min-height: 56px;
        padding-top: 0.45rem;
        transition: transform 0.26s ease;
        touch-action: pan-y;
    }
    .balloon-readings.is-collapsed {
        transform: translateY(calc(100% - 56px));
    }
    .balloon-panel-grip {
        display: block;
        width: 62px;
        height: 8px;
        border: 0;
        border-radius: 999px;
        margin: 0.15rem auto 0.45rem;
        background: rgba(255, 255, 255, 0.36);
        touch-action: none;
        cursor: ns-resize;
    }
    .balloon-panel-toggle {
        display: inline-block;
        margin-left: auto;
        font-size: 0.78rem;
    }
    .balloon-readings dl {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-2);
    }
    .balloon-readings dl > div.metric-wide {
        grid-column: 1 / -1;
    }
    .balloon-readings dl > div.metric-core {
        grid-column: auto;
    }
    .balloon-readings dl > div {
        gap: var(--space-2);
        padding-top: 0.35rem;
        padding-bottom: 0.35rem;
    }
    .balloon-map-dock { left: 8px; transform: translateY(-46%); }
    .balloon-ctl-btn { width: 32px; height: 32px; }
    .balloon-ctl-compass { grid-template-columns: 32px 32px 32px; grid-template-rows: 32px 32px 32px; padding: 4px; }
}

/* --------------------------------------------------------------- */
/* Guestbook page                                                  */
/* --------------------------------------------------------------- */
.guestbook-page { max-width: 720px; margin: 0 auto; padding: var(--space-6); }
@media (max-width: 640px) {
    .guestbook-page {
        padding-left: var(--space-3);
        padding-right: var(--space-3);
    }
}
.guestbook-map-cta-top { text-align: center; margin: 0 0 var(--space-4); }
.guestbook-flash { margin-top: 0; margin-bottom: var(--space-4); }
.guestbook-loc {
    display: inline-flex; align-items: center; flex-wrap: wrap; gap: 0.2rem 0.5rem;
    font-size: 0.8rem; color: var(--fg-1, #8fa1c7);
    max-width: 100%;
}
.guestbook-place { font-weight: 500; }
.guestbook-when { font-size: 0.82rem; }
.guestbook-loc-hint { font-size: 0.78rem; max-width: 40rem; margin: var(--space-2) 0 var(--space-3); }
.guestbook-map-page {
    max-width: min(1200px, 100%);
    margin: 0 auto;
    padding: var(--space-6) var(--space-4) var(--space-8);
    box-sizing: border-box;
}
.guestbook-map-back { margin: 0 0 var(--space-3); }
.guestbook-map-lead { margin: 0 0 var(--space-3); max-width: 40rem; }
.guestbook-map-canvas {
    width: 100%;
    min-height: min(64dvh, 520px);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--bg-0);
    z-index: 1;
}
.leaflet-popup.cs-gb-leaflet-popup .leaflet-popup-content-wrapper {
    background: rgba(10, 14, 26, 0.98);
    color: #e9eef9;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
}
.leaflet-popup.cs-gb-leaflet-popup .leaflet-popup-tip { background: rgba(10, 14, 26, 0.98); border: 1px solid rgba(255, 255, 255, 0.12); }
.cs-gb-pop .muted { color: rgba(233, 238, 249, 0.7); font-size: 0.82rem; }
.cs-gb-pop-msg { margin: 0.5rem 0 0; font-size: 0.85rem; line-height: 1.35; color: rgba(233, 238, 249, 0.9); }
.guestbook-page .article-head.center { text-align: center; margin-bottom: var(--space-6); }
.guestbook-page textarea {
    width: 100%;
    background: var(--bg-2);
    border: 1px solid var(--border);
    color: var(--fg-0);
    border-radius: var(--radius);
    padding: var(--space-3);
    font: inherit;
    resize: vertical;
    min-height: 120px;
}
.guestbook-page .entries { margin-top: var(--space-6); }
.guestbook-page .entries .cards { grid-template-columns: 1fr; }
.guestbook-card .header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--space-2) var(--space-3);
    margin-bottom: var(--space-2);
}
.guestbook-card .message { white-space: pre-wrap; margin: 0; }

/* --------------------------------------------------------------- */
/* Blog                                                            */
/* --------------------------------------------------------------- */
.blog-list {
    width: 100%;
    max-width: min(1320px, calc(100% - 2 * var(--space-6)));
    margin: 0 auto;
    padding: var(--space-6);
    box-sizing: border-box;
}
@media (max-width: 640px) {
    .blog-list {
        max-width: 100%;
        padding-left: var(--space-3);
        padding-right: var(--space-3);
    }
    .blog-filters { padding: var(--space-3); }
    .blog-cards .post-card { padding: var(--space-4); }
    .blog-cards .post-card img {
        margin: calc(var(--space-4) * -1) calc(var(--space-4) * -1) var(--space-3);
    }
}
.blog-list-head h1 { font-size: 2rem; margin-bottom: var(--space-2); }
.blog-lead { font-size: 1.05rem; max-width: 42rem; margin-bottom: var(--space-6); }
.blog-breadcrumb { margin-bottom: var(--space-4); }
.blog-breadcrumb ol {
    list-style: none; padding: 0; margin: 0;
    display: flex; flex-wrap: wrap; gap: var(--space-2);
    font-size: 0.85rem; color: var(--fg-muted);
}
.blog-breadcrumb li { display: inline-flex; align-items: center; gap: var(--space-2); }
.blog-breadcrumb li:not(:last-child)::after {
    content: '/'; opacity: 0.45; margin-left: var(--space-2); pointer-events: none;
}
.blog-breadcrumb a { color: var(--fg-muted); }
.blog-breadcrumb a:hover { color: var(--fg-0); }
.blog-filters {
    position: sticky; top: 64px; z-index: 4;
    margin-bottom: var(--space-5);
    padding: var(--space-4);
    background: rgba(13, 17, 23, 0.92);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
}
.blog-filters-row {
    display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center;
}
.blog-select, .blog-search-input {
    background: var(--bg-2);
    border: 1px solid var(--border);
    color: var(--fg-0);
    border-radius: var(--radius);
    padding: 0.55rem 0.75rem;
    font: inherit;
    min-width: 10rem;
    transition: border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}
.blog-search-input { flex: 1 1 12rem; min-width: 8rem; }
.blog-select:focus-visible, .blog-search-input:focus-visible {
    outline: none;
    border-color: var(--aurora-violet);
    box-shadow: 0 0 0 2px rgba(123, 94, 167, 0.25);
}
.blog-search-btn { white-space: nowrap; }
.blog-reset { font-size: 0.9rem; }
.blog-results-count { margin-bottom: var(--space-3); font-size: 0.9rem; }
.blog-cards .post-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    background: var(--bg-1);
    transition: transform var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}
.blog-cards .post-card:hover {
    transform: translateY(-2px);
    border-color: rgba(123, 94, 167, 0.35);
    box-shadow: var(--shadow-2);
}
.blog-pagination {
    margin-top: var(--space-8);
    display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--space-4);
}
.cards { list-style: none; padding: 0; margin: 0;
    display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--space-5); }
.post-card { display: flex; flex-direction: column; overflow: hidden; }
.post-card img { width: 100%; height: auto; border-radius: var(--radius); margin: calc(var(--space-6) * -1) calc(var(--space-6) * -1) var(--space-4); display: block; object-fit: cover; }
.post-card .meta { display: flex; gap: var(--space-2); margin-bottom: var(--space-2); }
.chip {
    display: inline-block; padding: 2px 10px; border-radius: var(--radius-full);
    background: rgba(123, 94, 167, 0.18); color: var(--aurora-violet-mid);
    font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600;
}
.chip-badge { background: rgba(0, 255, 178, 0.12); color: var(--aurora-green); }
.chip-muted { background: rgba(255, 255, 255, 0.06); color: var(--fg-muted); text-transform: none; letter-spacing: 0.02em; }
.chip-sm { font-size: 0.65rem; padding: 2px 8px; }
.chip.chip-tag--viz {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    text-transform: none;
    letter-spacing: 0.02em;
}
.chip.chip-tag--viz .blog-tag-chip__txt { line-height: 1.2; }
.blog-tag-chip__img {
    width: 0.95rem;
    height: 0.95rem;
    object-fit: contain;
    flex-shrink: 0;
    display: block;
}
.blog-tag-chip__dot {
    flex-shrink: 0;
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
}
.blog-tag-chip__dot--noise { background: #ff9f4a; box-shadow: 0 0 5px rgba(255, 159, 74, 0.35); }
.blog-tag-chip__dot--air { background: #6be7a5; box-shadow: 0 0 5px rgba(107, 231, 165, 0.3); }
.blog-tag-chip__dot--pollen { background: #f6d36b; box-shadow: 0 0 5px rgba(246, 211, 107, 0.35); }
.blog-tag-chip__dot--light { background: #00b4d4; box-shadow: 0 0 5px rgba(0, 180, 212, 0.35); }
.blog-card-tags,
.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}
.post-card h2 { font-size: 1.1rem; margin: var(--space-2) 0; }
.post-card h2 a { color: var(--fg-0); }
.post-card h2 a:hover { opacity: 0.85; }
.post-card-read {
    margin-top: auto;
    padding-top: var(--space-3);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--aurora-violet-mid);
}
.post-card-read .read-time__icon {
    flex: 0 0 auto;
    display: block;
    opacity: 0.9;
}
.article { max-width: 720px; margin: 0 auto; padding: var(--space-6); }
@media (max-width: 640px) {
    .article {
        padding-left: var(--space-3);
        padding-right: var(--space-3);
    }
}
.article .blog-breadcrumb {
    margin-bottom: var(--space-5);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--border);
}
.article .blog-breadcrumb ol { font-size: 0.9rem; }
.article-head { margin-bottom: var(--space-5); }
.article-badges { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-3); }
.article-byline {
    display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-5);
    align-items: baseline;
}
.article-read-time {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
    color: var(--aurora-violet-mid);
    font-size: 0.9rem;
}
.article-read-time .read-time__icon {
    flex: 0 0 auto;
    display: block;
    opacity: 0.9;
}
.related-articles {
    margin-top: var(--space-8);
    padding-top: var(--space-6);
    border-top: 1px solid var(--border);
}
.related-articles h2 { font-size: 1.25rem; margin-bottom: var(--space-4); }
.related-cards { margin-top: var(--space-4); }
.post-card-compact h3 { font-size: 1rem; margin: var(--space-2) 0; }
.post-card-compact h3 a { color: var(--fg-0); }
.article h1 { font-size: 2rem; margin: var(--space-3) 0 var(--space-2); }
.article .cover { width: 100%; height: auto; border-radius: var(--radius-lg); margin-bottom: var(--space-5); }
.article .content { color: var(--fg-1); line-height: 1.7; }
.article .content h2 { font-size: 1.5rem; margin-top: var(--space-6); }
.article .content h3 { font-size: 1.2rem; margin-top: var(--space-5); }
.article .content p { margin: var(--space-4) 0; }
.article .content a { color: var(--aurora-violet); text-decoration: underline; }
.article .content blockquote {
    border-left: 3px solid var(--aurora-violet);
    padding: var(--space-2) var(--space-4);
    color: var(--fg-muted);
}

/* Blog rich HTML (seeded from data/blog_fr_rich.json, optional EN rich later). */
.article .content .blog-rich {
    font-size: 1.02rem;
    line-height: 1.75;
}
.article .content .blog-rich__figure {
    margin: 0 0 var(--space-5);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    background: rgba(22, 27, 34, 0.55);
}
.article .content .blog-rich__figure svg {
    display: block;
    width: 100%;
    height: auto;
    max-height: 280px;
}
.article .content .blog-rich .stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--space-3);
    margin: var(--space-5) 0;
}
.article .content .blog-rich .stat-card {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-3);
    text-align: center;
}
.article .content .blog-rich .stat-card .value {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--aurora-coral, #e07b39);
}
.article .content .blog-rich .stat-card .label {
    font-size: 0.78rem;
    color: var(--fg-muted);
    margin-top: 0.25rem;
    line-height: 1.35;
}
.article .content .blog-rich .callout {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-4);
    margin: var(--space-5) 0;
}
.article .content .blog-rich .callout h4 {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--fg-muted);
    margin: 0 0 var(--space-2);
}
.article .content .blog-rich .callout-icon {
    font-size: 1.25rem;
    display: block;
    margin-bottom: var(--space-2);
}
.article .content .blog-rich .threshold-table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--space-4) 0;
    font-size: 0.9rem;
}
.article .content .blog-rich .threshold-table th {
    background: var(--bg-2);
    padding: 0.5rem 0.65rem;
    text-align: left;
    color: var(--fg-muted);
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.article .content .blog-rich .threshold-table td {
    padding: 0.55rem 0.65rem;
    border-top: 1px solid var(--border);
}
.article .content .blog-rich .illustration {
    margin: var(--space-5) 0;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    text-align: center;
}
.article .content .blog-rich .illustration figcaption {
    font-size: 0.78rem;
    color: var(--fg-muted);
    padding: var(--space-2) var(--space-3);
    font-style: italic;
}
.article .content .blog-rich .dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}
.article .content .blog-rich .dot-safe { background: #2e7d52; }
.article .content .blog-rich .dot-warn { background: #f9a825; }
.article .content .blog-rich .dot-danger { background: #c0392b; }

.ad-slot { margin-top: var(--space-6); padding: var(--space-2); border: 1px dashed var(--border); border-radius: var(--radius); text-align: center; min-height: 90px; }
.share-row { display: flex; gap: var(--space-2); align-items: center; margin: var(--space-5) 0; flex-wrap: wrap; }
.share-row .btn-link { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.4rem 0.8rem; color: var(--fg-1); font-size: 0.85rem; }
.share-row .btn-link:hover { color: var(--fg-0); }

/* Full-bleed content on large screens: table + chart use viewport width; keep modest gutters */
.history-page {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: var(--space-5) clamp(var(--space-3), 1.5vw, var(--space-5));
}
@media (min-width: 1200px) {
    .history-page {
        padding: var(--space-6) clamp(var(--space-3), 2vw, var(--space-8));
    }
}
.history-page h1 { margin-bottom: var(--space-3); }
.history-chart-card {
    margin-bottom: var(--space-6);
    padding: var(--space-5);
}
.history-chart-card__title {
    font-size: 1.1rem;
    margin: 0 0 var(--space-2);
}
.history-chart-card__subtitle {
    font-size: 0.86rem;
    margin: 0 0 var(--space-4);
    line-height: 1.45;
}
.history-chart-card__canvas-wrap {
    position: relative;
    width: 100%;
    height: min(320px, 55vw);
    min-height: 220px;
}
.history-chart-card__canvas-wrap canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}
.history-chart-card__empty {
    margin: 0 0 var(--space-4);
    font-size: 0.9rem;
}
.history-page__hint {
    font-size: 0.88rem;
    margin: 0 0 var(--space-4);
}

/* Exposure history: data table + toolbar */
.history-table-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3) var(--space-4);
    margin: 0 0 var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--bg-1, rgba(16, 20, 32, 0.92));
    border: 1px solid var(--border);
    border-radius: var(--radius-md, 10px);
    box-sizing: border-box;
}
.history-table-toolbar__label {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.88rem;
    color: var(--fg-muted);
}
.history-table-toolbar__select {
    font: inherit;
    padding: 6px 10px;
    border-radius: var(--radius-sm, 6px);
    border: 1px solid var(--border);
    background: var(--bg-0, #0a0d1a);
    color: var(--fg-0);
}
.history-table-toolbar__page {
    margin: 0;
    flex: 1 1 auto;
    font-size: 0.88rem;
    text-align: center;
}
.history-table-toolbar__nav {
    display: flex;
    gap: var(--space-2);
}
.history-table-empty-msg {
    margin: var(--space-4) 0;
}
.history-table-scroll {
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-md, 10px);
    background: var(--bg-1, rgba(16, 20, 32, 0.92));
}
.history-data-table {
    width: 100%;
    max-width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 0.82rem;
}
.history-data-table thead {
    background: rgba(0, 0, 0, 0.25);
}
.history-data-table th {
    padding: 8px 6px;
    text-align: left;
    font-weight: 600;
    color: var(--fg-muted);
    border-bottom: 1px solid var(--border);
    white-space: normal;
    line-height: 1.25;
    vertical-align: top;
    hyphens: auto;
    word-break: break-word;
    overflow-wrap: anywhere;
    min-width: 0;
}
@media (min-width: 900px) {
    .history-data-table th { padding: 8px 8px; }
}
.history-th-btn {
    margin: 0;
    padding: 0;
    border: none;
    background: none;
    font: inherit;
    font-weight: 600;
    color: inherit;
    cursor: pointer;
    text-align: left;
    display: block;
    width: 100%;
    min-width: 0;
    white-space: normal;
    line-height: 1.25;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: rgba(124, 92, 255, 0.45);
}
.history-th-btn:hover,
.history-th-btn:focus-visible {
    color: var(--fg-0);
    outline: none;
}
.history-th-btn.is-sorted {
    position: relative;
    padding-right: 10px;
}
.history-th-btn.is-sorted::after {
    content: "";
    position: absolute;
    right: 0;
    top: 0.2em;
    display: block;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    margin: 0;
}
.history-th-btn.is-sorted-asc::after {
    border-bottom: 5px solid var(--aurora-violet, #7c5cff);
    border-top: none;
}
.history-th-btn.is-sorted-desc::after {
    border-top: 5px solid var(--aurora-violet, #7c5cff);
    border-bottom: none;
    top: 0.4em;
}
.history-data-table td {
    padding: 8px 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    vertical-align: top;
    min-width: 0;
    word-break: break-word;
    overflow-wrap: anywhere;
    line-height: 1.35;
}
@media (min-width: 900px) {
    .history-data-table td { padding: 8px 8px; }
}
/* Column width hints: keep actions narrow, let long labels wrap */
.history-data-table th:nth-child(1),
.history-data-table td:nth-child(1) { width: 10%; }   /* date */
.history-data-table th:nth-child(2),
.history-data-table td:nth-child(2) { width: 6%; }    /* module */
.history-data-table th:nth-child(3),
.history-data-table td:nth-child(3) { width: 14%; }   /* log type */
.history-data-table th:nth-child(4),
.history-data-table td:nth-child(4) { width: 8%; }   /* score */
.history-data-table th:nth-child(5),
.history-data-table td:nth-child(5) { width: 22%; }   /* place */
.history-data-table th:nth-child(6),
.history-data-table td:nth-child(6) { width: 10%; }  /* nearest */
.history-data-table th:nth-child(7),
.history-data-table td:nth-child(7) { width: 8%; }   /* status */
.history-data-table th:nth-child(8),
.history-data-table td:nth-child(8) { width: 6%; }   /* data count */
.history-data-table th:nth-child(9),
.history-data-table td:nth-child(9) { width: 10%; }  /* delete */
@media (max-width: 700px) {
    .history-data-table th,
    .history-data-table td { font-size: 0.75rem; padding: 6px 4px; }
}
.history-data-row {
    cursor: pointer;
    transition: background var(--dur-1) var(--ease);
}
.history-data-row:hover,
.history-data-row:focus-visible {
    background: rgba(124, 92, 255, 0.08);
    outline: none;
}
.history-data-row .js-history-delete {
    cursor: pointer;
}
.history-place {
    white-space: normal;
    overflow: visible;
    max-width: none;
    word-break: break-word;
    overflow-wrap: anywhere;
}
.history-num {
    font-variant-numeric: tabular-nums;
}
.history-mod {
    font-weight: 600;
    letter-spacing: 0.04em;
}
.history-score-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
}
.history-score-badge--none { color: var(--fg-muted); }
.history-score-badge--safe {
    color: var(--aurora-green);
    border-color: rgba(0, 255, 178, 0.35);
    background: rgba(0, 255, 178, 0.1);
}
.history-score-badge--moderate {
    color: #f6d36b;
    border-color: rgba(246, 211, 107, 0.4);
    background: rgba(246, 211, 107, 0.1);
}
.history-score-badge--high {
    color: #ffb454;
    border-color: rgba(255, 180, 84, 0.45);
    background: rgba(255, 180, 84, 0.1);
}
.history-score-badge--critical {
    color: #ff5e9c;
    border-color: rgba(255, 94, 156, 0.45);
    background: rgba(255, 94, 156, 0.12);
}
.history-verdict {
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
}
.history-verdict--clear {
    color: var(--aurora-green);
}
.history-verdict--pending {
    color: var(--fg-muted);
}
/* NOT CLEAR: same danger accent as map exposure chip */
.history-verdict--not-clear {
    color: var(--aurora-orange);
}

.history-card__chip-wrap {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    text-align: right;
}
.history-card__kind {
    font-size: 0.72rem;
    max-width: 11rem;
    line-height: 1.25;
}

/* Exposure history: stacked cards (replaces wide data table on all viewports). */
.history-card-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin: 0;
    padding: 0;
    list-style: none;
}
.history-card {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto auto;
    column-gap: var(--space-3);
    row-gap: var(--space-2);
    width: 100%;
    margin: 0;
    padding: var(--space-4);
    text-align: left;
    font: inherit;
    color: var(--fg-0);
    background: var(--bg-1, rgba(16, 20, 32, 0.92));
    border: 1px solid var(--border);
    border-radius: var(--radius-lg, 14px);
    cursor: pointer;
    box-sizing: border-box;
    transition: border-color var(--dur-1) var(--ease), background var(--dur-1) var(--ease);
}
.history-card:hover,
.history-card:focus-visible {
    border-color: rgba(124, 92, 255, 0.45);
    outline: none;
}
.history-card:focus-visible {
    box-shadow: 0 0 0 2px rgba(124, 92, 255, 0.35);
}
.history-card__date {
    grid-column: 1;
    grid-row: 1;
    font-size: 0.82rem;
    color: var(--fg-muted);
    font-variant-numeric: tabular-nums;
    word-break: break-word;
}
.history-card__chip {
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
}
.history-card__score {
    grid-column: 1;
    grid-row: 2;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-weight: 700;
    font-size: 1.05rem;
}
.history-card__score-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.88rem;
    font-variant-numeric: tabular-nums;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
}
.history-card__score-badge--none {
    color: var(--fg-muted);
}
.history-card__score-badge--safe {
    color: var(--aurora-green);
    border-color: rgba(0, 255, 178, 0.35);
    background: rgba(0, 255, 178, 0.1);
}
.history-card__score-badge--moderate {
    color: #f6d36b;
    border-color: rgba(246, 211, 107, 0.4);
    background: rgba(246, 211, 107, 0.1);
}
.history-card__score-badge--high {
    color: #ffb454;
    border-color: rgba(255, 180, 84, 0.45);
    background: rgba(255, 180, 84, 0.1);
}
.history-card__score-badge--critical {
    color: #ff5e9c;
    border-color: rgba(255, 94, 156, 0.45);
    background: rgba(255, 94, 156, 0.12);
}
.history-card__loc {
    grid-column: 1 / -1;
    grid-row: 3;
    font-size: 0.8rem;
    font-family: var(--font-mono, ui-monospace, monospace);
    color: var(--fg-muted);
    word-break: break-word;
}
.history-card__near {
    grid-column: 2;
    grid-row: 2;
    align-self: center;
    justify-self: end;
    font-size: 0.78rem;
    max-width: 42%;
    text-align: right;
}
.history-card__chev {
    grid-column: 2;
    grid-row: 3;
    justify-self: end;
    align-self: end;
    opacity: 0.55;
    color: var(--fg-muted);
}
@media (min-width: 720px) {
    .history-card {
        grid-template-columns: minmax(0, 2.2fr) auto minmax(0, 1fr) auto auto;
        grid-template-rows: auto;
        align-items: center;
    }
    .history-card__date { grid-column: 1; grid-row: 1; }
    .history-card__chip { grid-column: 2; grid-row: 1; }
    .history-card__score { grid-column: 3; grid-row: 1; justify-self: end; }
    .history-card__near { grid-column: 4; grid-row: 1; max-width: none; text-align: right; }
    .history-card__loc { grid-column: 1 / -2; grid-row: 2; margin-top: var(--space-2); }
    .history-card__chev { grid-column: 5; grid-row: 1; }
}

/* Bottom sheet: mirror map exposure chip (fixed strip). */
.history-detail {
    position: fixed;
    inset: 0;
    z-index: 12040;
    pointer-events: none;
}
.history-detail[hidden] {
    display: none !important;
}
.history-detail:not([hidden]) {
    pointer-events: auto;
}
body.history-detail-open {
    overflow: hidden;
    touch-action: none;
}
.history-detail__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4, 6, 16, 0.55);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}
.history-detail__sheet {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: min(88dvh, calc(100vh - 48px));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: var(--space-4) var(--space-4) calc(env(safe-area-inset-bottom, 0px) + var(--space-5));
    background: rgba(10, 13, 26, 0.98);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg, 16px) var(--radius-lg, 16px) 0 0;
    box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.55);
    box-sizing: border-box;
}
.history-detail__sheet-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
}
.history-detail__title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: var(--font-ui);
    color: var(--fg-0);
}
.history-detail__close {
    flex: 0 0 auto;
    border: 0;
    background: rgba(255, 255, 255, 0.06);
    color: var(--fg-1);
    border-radius: var(--radius);
    padding: var(--space-2);
    cursor: pointer;
    line-height: 0;
}
.history-detail__close svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    display: block;
}
.history-detail__close:hover {
    color: var(--fg-0);
    background: rgba(255, 255, 255, 0.1);
}
.history-detail__chip.exposure-indicator {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
    width: 100%;
    max-width: none;
    min-width: 0;
    margin: 0 0 var(--space-4);
    border-radius: var(--radius-full);
    z-index: auto;
    box-sizing: border-box;
}
.history-detail .exposure-indicator .verdict-sub {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
}
.history-detail__dl {
    margin: 0 0 var(--space-4);
    padding: 0;
    display: grid;
    gap: var(--space-3);
    font-size: 0.84rem;
}
.history-detail__dl > div {
    display: grid;
    grid-template-columns: minmax(0, 38%) 1fr;
    gap: var(--space-2);
    align-items: baseline;
    padding-bottom: var(--space-2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.history-detail__dl dt {
    margin: 0;
    color: var(--fg-muted);
    font-weight: 600;
}
.history-detail__dl dd {
    margin: 0;
    color: var(--fg-0);
    word-break: break-word;
}
.history-detail__block-title {
    margin: 0 0 var(--space-2);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--fg-muted);
    font-family: var(--font-ui);
}
.history-detail__notes-body {
    margin: 0 0 var(--space-4);
    font-size: 0.88rem;
    line-height: 1.45;
    color: var(--fg-1);
}
.history-detail__sym-body {
    margin: 0 0 var(--space-4);
    padding: var(--space-3);
    font-size: 0.78rem;
    line-height: 1.4;
    background: rgba(0, 0, 0, 0.25);
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--fg-muted);
    font-family: var(--font-mono, ui-monospace, monospace);
}
.history-detail__share {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding-top: var(--space-2);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.history-detail__share-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--fg-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.history-detail__share-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    align-items: center;
}
.history-detail__share .btn-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 var(--space-4);
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--fg-1);
    font-size: 0.85rem;
    text-decoration: none;
    cursor: pointer;
    font-family: inherit;
}
.history-detail__share .btn-link:hover {
    color: var(--fg-0);
}

/* --------------------------------------------------------------- */
/* Utility                                                         */
/* --------------------------------------------------------------- */
.visually-hidden {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* --------------------------------------------------------------- */
/* Logo pulse animation (matches mockups/clearspot-aurora.jsx)     */
/* --------------------------------------------------------------- */
@keyframes brand-mark-pulse {
    0%, 100% { filter: drop-shadow(0 0 6px rgba(0, 255, 178, 0.25));  transform: scale(1); }
    50%      { filter: drop-shadow(0 0 14px rgba(0, 255, 178, 0.55)); transform: scale(1.04); }
}
header.top .brand .brand-mark,
.auth-card .brand-link .brand-mark,
.admin-sidebar .brand .brand-mark,
#map .cs-map-user-marker .brand-mark {
    animation: brand-mark-pulse 2.6s ease-in-out infinite;
    transform-origin: center;
}
@media (prefers-reduced-motion: reduce) {
    header.top .brand .brand-mark,
    .auth-card .brand-link .brand-mark,
    .admin-sidebar .brand .brand-mark,
    #map .cs-map-user-marker .brand-mark {
        animation: none;
    }
}

/* --------------------------------------------------------------- */
/* PWA splash screen                                               */
/* --------------------------------------------------------------- */
/* Visible only when the site runs as an installed PWA (Android,
 * Chromium desktop, iOS Safari's added-to-home-screen). Android
 * shows a native splash first (icon + theme color) then hands the
 * rendering over to us; painting the splash immediately avoids a
 * jarring blank frame while the globe bundle boots, and the pulsing
 * reticle keeps the "targeting lock" brand gimmick alive during that
 * handoff. Dismissed by pwa.js via `body.cs-splash-done`. */
.cs-splash { display: none; }

@media (display-mode: standalone), (display-mode: fullscreen), (display-mode: minimal-ui) {
    body:not(.cs-splash-done) .cs-splash {
        display: flex;
        position: fixed;
        inset: 0;
        z-index: 100000;
        background: radial-gradient(circle at 50% 40%, #12172a 0%, #0A0D1A 60%, #05070f 100%);
        align-items: center;
        justify-content: center;
        /* Defensive: guarantee full viewport on iOS safe-area. */
        padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
    }
    body:not(.cs-splash-done) { overflow: hidden; }
}

.cs-splash-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
    text-align: center;
}
.cs-splash-mark {
    filter: drop-shadow(0 0 22px rgba(0, 255, 178, 0.35));
    animation: brand-mark-pulse 2.6s ease-in-out infinite;
    transform-origin: center;
}
.cs-splash-name {
    font-family: 'Syne', system-ui, sans-serif;
    font-size: clamp(2.25rem, 8vw, 3.5rem);
    font-weight: 800;
    letter-spacing: 0.02em;
    color: #fff;
    line-height: 1;
}
.cs-splash-name span {
    background: linear-gradient(90deg, #00FFB2 0%, #58E8FF 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 22px rgba(0, 255, 178, 0.35);
}
.cs-splash-tag {
    max-width: 28ch;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.72);
    line-height: 1.3;
    text-align: center;
}
.cs-splash-tag em {
    font-style: italic;
}

/* Fade-out triggered by JS once the globe is ready.
 * `clearspot:app:ready` runs in every tab (not only installed PWA). If this
 * state used `display: flex` without `position: fixed`, the splash would sit
 * in normal document flow: invisible (`opacity: 0`) but still as tall as its
 * content, pushing `.app-shell` down until `cs-splash-gone` (900 ms later).
 * Keep it out of flow for the whole fade-out. */
body.cs-splash-done .cs-splash {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 100000;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 450ms ease;
}
/* After the fade, fully remove from the layer tree. */
body.cs-splash-gone .cs-splash {
    display: none;
}

@media (prefers-reduced-motion: reduce) {
    .cs-splash-mark { animation: none; }
}

/* ---- Exposure tri-band: clear / moderate / not-clear — logo mark + wordmark ---- */
/* body[data-exposure] is set from exposure-indicator.js (score bands + fallback rules). */
body[data-exposure="moderate"] .brand-name-accent {
    color: #fb923c;
    text-shadow: 0 0 14px rgba(251, 146, 60, 0.4);
}
body[data-exposure="not-clear"] .brand-name-accent {
    color: #fb7185;
    text-shadow: 0 0 16px rgba(251, 113, 133, 0.45);
}
@keyframes brand-mark-pulse-alert {
    0%, 100% { filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.38));  transform: scale(1); }
    50%      { filter: drop-shadow(0 0 18px rgba(239, 68, 68, 0.62)); transform: scale(1.05); }
}
@keyframes brand-mark-pulse-moderate {
    0%, 100% { filter: drop-shadow(0 0 8px rgba(251, 146, 60, 0.35));  transform: scale(1); }
    50%      { filter: drop-shadow(0 0 16px rgba(251, 146, 60, 0.55)); transform: scale(1.04); }
}
body[data-exposure="moderate"] .brand-mark {
    filter: drop-shadow(0 0 10px rgba(251, 146, 60, 0.45)) hue-rotate(-35deg) saturate(1.2);
    animation-name: brand-mark-pulse-moderate;
    animation-duration: 2.2s;
}
body[data-exposure="not-clear"] .brand-mark {
    filter: drop-shadow(0 0 10px rgba(239, 68, 68, 0.55)) hue-rotate(-110deg) saturate(1.35);
    animation-name: brand-mark-pulse-alert;
    animation-duration: 1.6s;
}

/* --------------------------------------------------------------- */
/* About page                                                      */
/* --------------------------------------------------------------- */
.about-page { max-width: 760px; margin: 0 auto; padding: var(--space-6); }
/* Data sources index: wide table + source bullets need horizontal room. */
.about-page.about-page--data-sources {
    max-width: min(1180px, 96vw);
}

/* About: build / PWA debug strip (top of main) */
.about-build-banner {
    margin-bottom: var(--space-5);
    padding: var(--space-4);
    border-radius: var(--radius-md, 12px);
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
    background: var(--surface-1, rgba(255, 255, 255, 0.03));
}
.about-build-banner--stale {
    border-color: rgba(255, 180, 90, 0.45);
    background: rgba(255, 160, 60, 0.06);
}
.about-build-banner__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
}
.about-build-banner__label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--fg-2, #8b92a8);
}
.about-build-banner__pill {
    font-size: 0.8rem;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background: rgba(120, 220, 160, 0.12);
    color: var(--fg-0, #e8ecff);
}
.about-build-banner__pill.is-warn {
    background: rgba(255, 160, 80, 0.18);
    color: #ffd4a8;
}
.about-build-banner__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    gap: var(--space-3) var(--space-5);
    margin: 0;
}
.about-build-banner__grid > div { margin: 0; }
.about-build-banner__grid dt {
    margin: 0 0 0.15rem;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--fg-2, #8b92a8);
}
.about-build-banner__grid dd {
    margin: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.85rem;
    word-break: break-word;
    color: var(--fg-1, #c5cad8);
}
.about-build-banner__hint {
    margin: var(--space-3) 0 0;
    font-size: 0.85rem;
}
.about-build-banner__btn {
    margin-top: var(--space-3);
}

.about-hero { margin-bottom: var(--space-6); }
.about-hero h1 {
    font-family: var(--font-ui);
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    line-height: 1.15;
    margin: var(--space-3) 0 var(--space-4);
    background: var(--grad-primary);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.about-hero .lead { font-size: 1.1rem; color: var(--fg-1); line-height: 1.6; }
.about-section { margin-top: var(--space-6); }
.about-section h2 {
    font-family: var(--font-ui);
    font-size: 1.4rem;
    margin-bottom: var(--space-3);
    letter-spacing: 0.01em;
}
.about-section h3 {
    font-family: var(--font-ui);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--aurora-green);
    margin: var(--space-5) 0 var(--space-2);
}
.about-section p { color: var(--fg-1); line-height: 1.7; margin: var(--space-3) 0; }

.about-turbine-table-wrap {
    overflow-x: auto;
    margin-top: var(--space-4);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-1);
    -webkit-overflow-scrolling: touch;
}
.about-turbine-table {
    width: 100%;
    min-width: 920px;
    border-collapse: collapse;
    font-size: 0.88rem;
}
.about-turbine-table th,
.about-turbine-table td {
    padding: var(--space-3) var(--space-3);
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
}
.about-turbine-table th { color: var(--fg-2); font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; }
.about-turbine-table tbody tr:last-child td { border-bottom: none; }
.about-turbine-table tfoot td { font-weight: 600; border-bottom: none; }
.about-turbine-table .stat-count { font-variant-numeric: tabular-nums; white-space: nowrap; }
.about-turbine-table .stat-date { font-variant-numeric: tabular-nums; color: var(--fg-2); white-space: nowrap; }
.about-turbine-table .source-desc { display: block; margin-top: 0.35rem; font-size: 0.8rem; color: var(--fg-2); line-height: 1.45; }

/* About data guide — highlighted inventory KPI */
.about-data-guide-datapoints {
    margin-top: var(--space-8);
}
.about-data-guide-datapoints__card {
    padding: var(--space-5) var(--space-6);
    border-radius: 12px;
    border: 1px solid rgba(124, 92, 255, 0.35);
    background: linear-gradient(
        145deg,
        rgba(124, 92, 255, 0.14) 0%,
        rgba(10, 13, 26, 0.92) 55%
    );
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.about-data-guide-datapoints__value {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.65rem;
}
.about-data-guide-datapoints__n {
    font-size: clamp(2.25rem, 6vw, 3.35rem);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.03em;
    line-height: 1;
    color: var(--fg-0);
    text-shadow: 0 0 32px rgba(0, 255, 178, 0.12);
}
.about-data-guide-datapoints__suffix {
    font-size: clamp(1rem, 2.8vw, 1.25rem);
    font-weight: 600;
    color: var(--fg-1);
    text-transform: lowercase;
}
.about-data-guide-datapoints__caption {
    margin: var(--space-3) 0 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--fg-1);
    line-height: 1.45;
    max-width: 38rem;
}
.about-data-guide-datapoints__meta {
    margin: var(--space-3) 0 0;
    font-size: 0.75rem;
    color: var(--fg-muted);
}
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-precision-surveyed { background: #2e7d52; color: #fff; }
.badge-precision-declared { background: #1f5c99; color: #fff; }
.badge-precision-approximate { background: #e07b39; color: #fff; }
.badge-precision-mixed { background: #5c4a7a; color: #fff; }

.about-sources .source-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: var(--space-3);
}
.about-sources .source-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-4);
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.about-sources .source-item__bullet {
    flex: 0 0 auto;
    width: 1.15rem;
    height: 1.15rem;
    margin-top: 0.2rem;
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}
.about-sources .source-item__bullet--svg {
    border-radius: 4px;
    background: transparent;
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    height: 1.35rem;
}
.about-sources .source-item__bullet--svg img {
    width: 1.2rem;
    height: 1.2rem;
    display: block;
    opacity: 0.92;
}
.about-sources .source-item__body {
    flex: 1 1 auto;
    min-width: 0;
}
.about-sources .source-item a { color: var(--fg-0); text-decoration: none; }
.about-sources .source-item a strong { font-size: 1.02rem; }
.about-sources .source-licence {
    display: inline-block;
    margin-left: var(--space-2);
    padding: 2px 8px;
    font-size: 0.7rem;
    color: var(--aurora-violet-mid);
    background: rgba(123, 94, 167, 0.14);
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.about-sources .source-item p { margin: var(--space-2) 0 0; font-size: 0.92rem; }
.about-cta p:last-child { display: flex; gap: var(--space-3); flex-wrap: wrap; }

/* --------------------------------------------------------------- */
/* Onboarding modal (v2: privacy first, checkboxes, geoloc step)   */
/* --------------------------------------------------------------- */
.onboarding-modal .sensitivity-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-3); }
.onboarding-modal .ob-sens-tier {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--fg-muted);
    margin: var(--space-4) 0 var(--space-2);
    font-weight: 700;
}
.onboarding-modal .ob-sens-tier:first-child {
    margin-top: 0;
}
.onboarding-modal .ob-taxonomy-list {
    list-style: disc;
    padding-left: 1.25rem;
    margin: var(--space-3) 0 0;
    color: var(--fg-1);
    line-height: 1.45;
}
.onboarding-modal .ob-taxonomy-list li {
    margin-bottom: var(--space-2);
}
.onboarding-modal .ob-taxonomy-visuals {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-3);
    margin: var(--space-4) 0;
    align-items: start;
}
@media (max-width: 520px) {
    .onboarding-modal .ob-taxonomy-visuals {
        grid-template-columns: 1fr;
    }
}
.onboarding-modal .ob-taxonomy-viz {
    margin: 0;
    text-align: center;
}
.onboarding-modal .ob-taxonomy-viz figcaption {
    margin-top: var(--space-2);
    font-size: 0.72rem;
    color: var(--fg-muted);
    font-weight: 600;
    line-height: 1.35;
}
.onboarding-modal .ob-tax-svg {
    width: 100%;
    max-width: 112px;
    height: auto;
    margin: 0 auto;
    display: block;
    color: var(--fg-1);
}
.onboarding-modal .ob-sens-lead-tiered {
    margin: var(--space-2) 0 var(--space-3);
    font-size: 0.88rem;
    color: var(--fg-muted);
    line-height: 1.45;
}
.onboarding-modal .ob-sens-details {
    margin-bottom: var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-md, 10px);
    padding: 0 var(--space-2) var(--space-2);
    background: rgba(255, 255, 255, 0.02);
}
.onboarding-modal .ob-sens-details__summary {
    cursor: pointer;
    list-style: none;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    color: var(--fg-muted);
    padding: var(--space-3) var(--space-2);
}
.onboarding-modal .ob-sens-details__summary::-webkit-details-marker {
    display: none;
}
.onboarding-modal .ob-sens-details__summary::marker {
    content: '';
}
.onboarding-modal .ob-sens-details__summary::before {
    content: '+ ';
    color: var(--aurora-green, #00ffb2);
    font-weight: 800;
    margin-right: 0.25em;
}
.onboarding-modal .ob-sens-details[open] > .ob-sens-details__summary::before {
    content: '- ';
}
.onboarding-modal .sens-item {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-4);
    background: var(--bg-1);
    transition: border-color var(--dur-2) var(--ease), background var(--dur-2) var(--ease);
}
.onboarding-modal .sens-item.is-checked {
    border-color: rgba(0, 255, 178, 0.45);
    background: rgba(0, 255, 178, 0.06);
}
.onboarding-modal .sens-item > label {
    display: flex; gap: var(--space-2); align-items: flex-start; cursor: pointer;
}
.onboarding-modal .sens-item .sens-li-viz {
    flex: 0 0 auto;
    width: 1.35rem;
    height: 1.35rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.07em;
}
.onboarding-modal .sens-item .sens-li-icon {
    width: 1.28rem;
    height: 1.28rem;
    object-fit: contain;
    display: block;
}
.onboarding-modal .sens-item .sens-li-icon--hvt {
    width: 1.45rem;
    height: 1.45rem;
    filter:
        drop-shadow(0 0 2px rgba(15, 10, 0, 0.85))
        drop-shadow(0 0 5px rgba(250, 204, 21, 0.85));
}
.onboarding-modal .sens-item .sens-li-dot {
    width: 0.62rem;
    height: 0.62rem;
    border-radius: 50%;
    box-sizing: border-box;
    flex-shrink: 0;
}
.onboarding-modal .sens-item .sens-li-dot--noise { background: #ff9f4a; }
.onboarding-modal .sens-item .sens-li-dot--light { background: #00b4d4; }
.onboarding-modal .sens-item .sens-li-dot--air { background: #6be7a5; }
.onboarding-modal .sens-item .sens-li-dot--pollen { background: #f6d36b; }
.onboarding-modal .sens-item .sens-li-dot--mosquito { background: #f97316; }
.onboarding-modal .sens-item .sens-copy {
    flex: 1 1 auto;
    min-width: 0;
}
.onboarding-modal .sens-item input[type="checkbox"] {
    margin-top: 3px;
    width: 18px; height: 18px;
    accent-color: var(--aurora-green);
    flex: 0 0 auto;
}
.onboarding-modal .sens-item .sens-title {
    display: block;
    font-weight: 600;
    font-family: var(--font-ui);
    color: var(--fg-0);
    margin-bottom: 2px;
}
.onboarding-modal .sens-item .sens-hint {
    display: block;
    color: var(--fg-muted);
    font-size: 0.85rem;
    line-height: 1.45;
}
.onboarding-modal .privacy-options { display: grid; gap: var(--space-2); margin-top: var(--space-3); }
.onboarding-modal .privacy-options label {
    display: flex; gap: var(--space-3); align-items: flex-start;
    padding: var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
}
.onboarding-modal .privacy-options input[type="radio"] { margin-top: 3px; accent-color: var(--aurora-green); }
.onboarding-modal .geoloc-illus {
    display: flex; justify-content: center; margin: var(--space-4) 0;
    font-size: 2.5rem; color: var(--aurora-cyan);
}
.onboarding-modal .actions-row { display: flex; gap: var(--space-3); justify-content: flex-end; margin-top: var(--space-5); flex-wrap: wrap; }
.onboarding-modal .actions-row .btn-link { color: var(--fg-muted); }

/* --------------------------------------------------------------- */
/* Exposure indicator: slide-up details                            */
/* --------------------------------------------------------------- */
.exposure-indicator {
    cursor: pointer;
    transition: transform var(--dur-2) var(--ease),
                bottom var(--dur-2) var(--ease),
                border-radius var(--dur-2) var(--ease),
                min-width var(--dur-2) var(--ease),
                max-width var(--dur-2) var(--ease);
}
.exposure-indicator .verdict-chev {
    margin-left: auto;
    flex: 0 0 auto;
    opacity: 0.85;
    transition: transform var(--dur-2) var(--ease);
    color: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
/* Collapsed = chevron UP (from SVG). Expanded = rotated 180deg so it points DOWN. */
.exposure-indicator[aria-expanded="true"] .verdict-chev {
    transform: rotate(180deg);
}
.exposure-indicator .exposure-details {
    display: none;
    flex-basis: 100%;
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid var(--border);
    font-family: var(--font-body);
    text-transform: none;
    letter-spacing: 0;
    color: var(--fg-0);
    font-weight: 500;
    font-size: 0.88rem;
    line-height: 1.5;
    max-height: min(72vh, 720px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    /* subtle reveal */
    animation: exposure-details-in 220ms var(--ease) both;
}
@keyframes exposure-details-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.exposure-indicator[aria-expanded="true"] {
    flex-wrap: wrap;
    /* Expand to a readable card rather than a squashed pill. */
    border-radius: var(--radius-lg, 14px);
    align-items: flex-start;
    background: rgba(10, 13, 26, 0.96);
    box-shadow: 0 24px 60px -22px rgba(0, 0, 0, 0.7), var(--shadow-2);
    padding-top: var(--space-4);
    padding-bottom: var(--space-4);
    min-width: min(94vw, 560px);
    max-width: min(94vw, 560px);
    /* Keep expanded card above map/header action buttons (share, zoom, nav). */
    z-index: 1205;
}
@media (min-width: 720px) {
    .exposure-indicator[aria-expanded="true"] {
        min-width: min(94vw, 720px);
        max-width: min(94vw, 920px);
    }
    .exposure-details .exposure-sources-columns {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
.exposure-indicator[aria-expanded="true"] .exposure-details {
    display: block;
}
.exposure-details h4 {
    font-family: var(--font-ui);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--fg-muted);
    margin: 0 0 var(--space-3);
    font-weight: 700;
}
.exposure-tier-legend {
    margin: 0 0 var(--space-3);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md, 10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
}
.exposure-tier-legend__text {
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.45;
    color: var(--fg-muted);
}
.exposure-tier-legend__link {
    margin: var(--space-2) 0 0;
    font-size: 0.72rem;
    line-height: 1.35;
}
.exposure-tier-legend__link a {
    color: rgba(196, 181, 255, 0.88);
    text-decoration: none;
    font-weight: 500;
}
.exposure-tier-legend__link a:hover {
    text-decoration: underline;
    color: #e4dcff;
}
/* Full-width composite ClearSpot score row: default below other content, or above the tier heading (.--above-tier). */
.exposure-details .exposure-composite-slot {
    margin: 0 0 var(--space-4);
}
.exposure-details .exposure-composite-slot--above-tier {
    margin: 0 0 var(--space-3);
}
.exposure-details .exposure-composite-slot .sources {
    gap: var(--space-2);
}
.exposure-details .src-meta--clearspot-score {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
}
.exposure-details .src-clearspot-score-num {
    font-size: 0.78rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--fg-1);
}
.exposure-details .src-clearspot-score-hint {
    font-size: 0.72rem;
    line-height: 1.45;
    color: var(--fg-muted);
}
.exposure-details .src-clearspot-score-gap {
    display: none;
}
.exposure-details .exposure-sources-columns {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-3);
    margin-top: 0;
}
/* NZOI-style hazard summary below POI/NZOI/ZOI columns (live events + mapped baselines). */
.exposure-details .exposure-hazard-block {
    margin-top: var(--space-4);
    padding-top: var(--space-3);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.exposure-details .exposure-hazard-block h4 {
    margin-bottom: var(--space-2);
}
.exposure-details .exposure-hazard-block .sources {
    margin-top: 0;
}
.exposure-details .exposure-sources-col {
    min-width: 0;
}
.exposure-details .sources-tier {
    font-family: var(--font-ui);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    /* POI / NZOI / ZOI headings: brighter than body muted text for contrast on dark modal. */
    color: rgba(236, 241, 252, 0.92);
    font-weight: 700;
    margin: 0 0 var(--space-2);
}
/* Full postal address block, rendered at the top of the expanded
 * details so users see WHERE the verdict applies before scanning the
 * per-source breakdown. Wraps on narrow screens (no ellipsis here:
 * the chip truncates the coordinates line with `.verdict-coords`;
 * `.verdict-place` can wrap.) */
.exposure-details .place-block {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0 0 var(--space-3);
    padding-bottom: var(--space-2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.exposure-details .place-block[hidden] { display: none; }
.exposure-details .place-label {
    font-family: var(--font-ui);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--fg-muted);
    font-weight: 700;
}
.exposure-details .place-address {
    font-size: 0.82rem;
    line-height: 1.35;
    color: var(--fg-0);
    word-break: break-word;
}
/* Combined heatmap grid freshness (was floating over the map; now in expanded chip). */
.exposure-details .exposure-map-freshness {
    margin: 0 0 var(--space-3);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    font-size: 0.78rem;
    line-height: 1.45;
    color: rgba(233, 238, 249, 0.88);
}
.exposure-details .exposure-map-freshness__title {
    font-family: var(--font-ui);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--fg-muted);
    font-weight: 700;
    margin: 0 0 var(--space-2);
}
.exposure-details .exposure-map-freshness__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.exposure-details .exposure-map-freshness__list strong {
    color: var(--fg-1);
    font-weight: 600;
}
.exposure-details ul.sources {
    list-style: none; margin: 0; padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-2);
}
.exposure-details .src-sep {
    list-style: none;
    margin: 0;
    padding: 0;
}
.exposure-details .src-sep-link {
    margin: 0 0 6px;
    font-size: 0.72rem;
    line-height: 1.35;
}
.exposure-details .src-sep-link a {
    color: rgba(196, 181, 255, 0.88);
    text-decoration: none;
    font-weight: 500;
}
.exposure-details .src-sep-link a:hover {
    text-decoration: underline;
    color: #e4dcff;
}
.exposure-details .src-sep-hr {
    margin: var(--space-2) 0 var(--space-3);
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.exposure-details .src-row--composite {
    cursor: default;
}
.exposure-details .src-row--composite:active {
    transform: none;
}
.exposure-details .src-row {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015));
    transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
    /* Each row is the affordance for "open the thresholds explainer". */
    cursor: pointer;
    user-select: none;
}
.exposure-details .src-row:hover,
.exposure-details .src-row:focus-visible {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.025));
    border-color: rgba(255, 255, 255, 0.14);
    outline: none;
}
.exposure-details .src-row:focus-visible {
    box-shadow: 0 0 0 2px rgba(0, 255, 178, 0.55);
}
.exposure-details .src-row:active {
    transform: translateY(1px);
}
.exposure-details .src-chev {
    flex: 0 0 auto;
    align-self: center;
    color: var(--fg-muted);
    opacity: 0.7;
    transition: opacity var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
}
.exposure-details .src-row:hover .src-chev,
.exposure-details .src-row:focus-visible .src-chev {
    opacity: 1;
    transform: translateX(2px);
}
.exposure-details .src-dot {
    width: 10px; height: 10px; border-radius: 50%;
    flex: 0 0 auto; margin-top: 7px;
    box-shadow: 0 0 10px currentColor;
}
.exposure-details .src-body { flex: 1 1 auto; min-width: 0; }
.exposure-details .src-name {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
    font-weight: 700;
    color: var(--fg-0);
    font-size: 0.92rem;
    line-height: 1.3;
}
.exposure-details .src-meta {
    color: var(--fg-muted);
    font-size: 0.80rem;
    margin-top: 4px;
    line-height: 1.4;
}
.exposure-details .src-alert-hint {
    color: var(--fg-muted);
    font-size: 0.76rem;
    margin-top: 6px;
    line-height: 1.45;
    padding: 6px 8px;
    border-radius: 8px;
    background: rgba(255, 107, 53, 0.06);
    border: 1px solid rgba(255, 107, 53, 0.18);
}
.exposure-details .src-verdict {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1.3;
}
.exposure-details .src-verdict--clear {
    color: var(--aurora-green);
    background: rgba(0, 255, 178, 0.08);
    border: 1px solid rgba(0, 255, 178, 0.35);
}
.exposure-details .src-verdict--moderate {
    color: #fb923c;
    background: rgba(251, 146, 60, 0.1);
    border: 1px solid rgba(251, 146, 60, 0.38);
}
.exposure-details .src-verdict--alert {
    color: #fb7185;
    background: rgba(251, 113, 133, 0.1);
    border: 1px solid rgba(251, 113, 133, 0.38);
}
.exposure-details .src-verdict--nodata {
    color: var(--fg-muted);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
}
@media (max-width: 640px) {
    .exposure-indicator[aria-expanded="true"] {
        /* On mobile the pill is already full-width and bottom-anchored; keep
         * those rules but allow a generous inner padding. */
        min-width: 0; max-width: none;
        border-radius: 16px 16px 0 0;
        padding-bottom: calc(env(safe-area-inset-bottom, 0px) + var(--space-4));
    }
    .exposure-details {
        max-height: 60dvh;
        font-size: 0.85rem;
    }
    .exposure-details .src-row { padding: var(--space-2) var(--space-3); }
    .exposure-details .src-name { font-size: 0.88rem; }
    .exposure-details .src-meta { font-size: 0.76rem; }
    .exposure-details .src-alert-hint { font-size: 0.72rem; }
}

/* --------------------------------------------------------------- */
/* Search FAB + panel                                              */
/* --------------------------------------------------------------- */
/* Defaults that apply everywhere the fab may be mounted. Specificity
 * one class, so the `.cs-stage-fabs .cs-search-fab` rail rule below
 * (two classes) overrides any layout-specific tweak, but the visual
 * treatment (dark bg, aurora icon) is guaranteed even if the rail
 * classes are missing (e.g. during a rail rebuild). */
.cs-search-fab,
.cs-stage-hero-help-fab {
    width: 40px; height: 40px;
    padding: 0; margin: 0;
    display: inline-flex; align-items: center; justify-content: center;
    line-height: 0;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    /* Two-layer background: solid fallback then translucent overlay.
     * Prevents the "white pill" that appeared on some mobile browsers
     * when the rgba layer was the only paint source. */
    background-color: #0a0d1a;
    background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0));
    color: var(--fg-0);
    cursor: pointer;
    box-shadow: var(--shadow-2);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: background var(--dur-2) var(--ease), transform var(--dur-2) var(--ease);
    -webkit-appearance: none;
    appearance: none;
    font: inherit;
}
.cs-search-fab:hover,
.cs-search-fab[aria-expanded="true"],
.cs-stage-hero-help-fab:hover,
.cs-stage-hero-help-fab[aria-expanded="true"] {
    background-color: rgba(124, 92, 255, 0.55);
    background-image: none;
    color: #fff;
}
.cs-search-fab svg,
.cs-stage-hero-help-fab svg {
    display: block;
    width: 18px; height: 18px;
    pointer-events: none;
    /* Force the magnifier stroke to a bright aurora tint even on user
     * stylesheets that remap currentColor. */
    color: #e8ffff;
}
.cs-stage-hero-help-fab svg { width: 20px; height: 20px; }

/* --------------------------------------------------------------- */
/* Refresh FAB (globe + Leaflet)                                   */
/* --------------------------------------------------------------- */
/* Stacks in the left-side FAB rail below the search button.       */
/* Available in both globe and Leaflet modes so the user can       */
/* always recover from a stale / half-loaded state. Uses the same  */
/* visual treatment as the search FAB for a cohesive feel.         */
.cs-refresh-fab {
    width: 40px; height: 40px;
    padding: 0; margin: 0;
    display: inline-flex;
    align-items: center; justify-content: center;
    line-height: 0;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    background-color: #0a0d1a;
    background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0));
    color: var(--fg-0);
    cursor: pointer;
    box-shadow: var(--shadow-2);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: background var(--dur-2) var(--ease), transform var(--dur-2) var(--ease);
    -webkit-appearance: none;
    appearance: none;
    font: inherit;
}
.cs-refresh-fab svg {
    display: block;
    width: 18px; height: 18px;
    pointer-events: none;
    color: #e8ffff;
    transition: transform 160ms ease;
}
.cs-refresh-fab:hover { background-color: rgba(124, 92, 255, 0.55); color: #fff; background-image: none; }
.cs-refresh-fab.is-spinning svg { animation: cs-refresh-spin 800ms linear 1; }
@keyframes cs-refresh-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
/* Keep the rail chrome out of the way while the onboarding modal is
 * active, matching the existing treatment for the search FAB. */
body.cs-onboarding-open .cs-refresh-fab { display: none !important; }
body.cs-onboarding-open .cs-exposure-save-fab { display: none !important; }

/* Save exposure (logged-in): same rail as search / refresh / layers */
.cs-exposure-save-fab {
    width: 40px; height: 40px;
    padding: 0; margin: 0;
    display: inline-flex;
    align-items: center; justify-content: center;
    line-height: 0;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    background-color: #0a0d1a;
    background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0));
    color: var(--fg-0);
    cursor: pointer;
    box-shadow: var(--shadow-2);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: background var(--dur-2) var(--ease), opacity var(--dur-2) var(--ease);
    -webkit-appearance: none;
    appearance: none;
    font: inherit;
}
.cs-exposure-save-fab svg {
    display: block; width: 18px; height: 18px; pointer-events: none;
    color: #e8ffff;
}
.cs-exposure-save-fab:hover:not(:disabled) {
    background-color: rgba(124, 92, 255, 0.55);
    background-image: none; color: #fff;
}
.cs-exposure-save-fab:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}
.cs-exposure-save-fab.is-busy { pointer-events: none; opacity: 0.6; }
.cs-exposure-save-fab.is-saved {
    background-color: rgba(0, 255, 178, 0.32);
    background-image: none;
    color: #b8fff0;
    border-color: rgba(0, 255, 178, 0.45);
}
.cs-search-panel {
    position: absolute;
    z-index: 899;
    left: calc(12px + 40px + 10px);
    top: 12px;
    min-width: 300px;
    max-width: calc(100vw - 40px);
    padding: var(--space-3) var(--space-4);
    /* Solid first (so the surface is always readable even if backdrop
     * filter / rgba compositing fails); translucent overlay layered on
     * top via `background-image`. Using a two-layer background survives
     * every compositor we've seen drop the alpha channel on mobile. */
    background-color: #141a2a;
    background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-2);
    color: var(--fg-0);
    font-family: var(--font-ui);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    max-height: min(92vh, 820px);
    overflow-y: auto;
    box-sizing: border-box;
}
.cs-search-panel[hidden] { display: none; }
.cs-search-panel .search-title {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--fg-muted);
    margin-bottom: var(--space-2);
}
.cs-search-panel .search-row {
    display: flex; gap: var(--space-2); align-items: center;
}
.cs-search-panel .search-row-wrap {
    position: relative;
}
.cs-search-panel .search-suggest {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    z-index: 5;
    margin: 2px 0 0;
    padding: 0.25rem 0;
    max-height: 12rem;
    overflow-y: auto;
    list-style: none;
    background: rgba(10, 13, 26, 0.98);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-2);
}
.cs-search-panel .search-suggest__item {
    padding: 0.45rem 0.65rem;
    font-size: 0.82rem;
    line-height: 1.35;
    cursor: pointer;
    color: var(--fg-0);
}
.cs-search-panel .search-suggest__item:hover,
.cs-search-panel .search-suggest__item--active {
    background: rgba(130, 110, 255, 0.18);
}
.cs-search-panel input[type="text"] {
    flex: 1; min-width: 0;
    padding: 0.5rem 0.7rem;
    background: rgba(10, 13, 26, 0.65);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--fg-0);
    font-family: inherit;
    font-size: 0.9rem;
}
.cs-search-panel input[type="text"]:focus {
    outline: 2px solid var(--aurora-violet);
    outline-offset: 1px;
}
.cs-search-panel .search-submit {
    padding: 0.5rem 0.9rem;
    background: var(--grad-primary);
    color: #fff;
    border-radius: var(--radius-sm);
    border: 0;
    font-weight: 700;
    cursor: pointer;
}
/* Secondary ghost button that grabs the device location via the
 * browser geolocation API. Sits between the address row and the
 * hint text so it reads as an alternative action, not a primary
 * CTA competing with "Go". */
.cs-search-panel .search-geoloc {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-top: var(--space-2);
    padding: 0.45rem 0.8rem;
    background: transparent;
    border: 1px solid rgba(0, 255, 178, 0.35);
    border-radius: var(--radius-sm);
    color: var(--aurora-green);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
}
.cs-search-panel .search-geoloc:hover,
.cs-search-panel .search-geoloc:focus-visible {
    background: rgba(0, 255, 178, 0.08);
    border-color: rgba(0, 255, 178, 0.6);
    outline: none;
}
.cs-search-panel .search-geoloc:active { transform: translateY(1px); }
.cs-search-panel .search-geoloc[disabled] {
    opacity: 0.55;
    cursor: wait;
}
.cs-search-panel .search-geoloc__ico { flex: 0 0 auto; }
/* Leaflet-only: place the user pin with one tap on the 2D map. */
.cs-search-panel .search-pick-map {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-top: var(--space-2);
    margin-left: var(--space-2);
    padding: 0.45rem 0.8rem;
    background: transparent;
    border: 1px solid rgba(196, 181, 255, 0.45);
    border-radius: var(--radius-sm);
    color: #c4b5ff;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
}
.cs-search-panel .search-pick-map:hover,
.cs-search-panel .search-pick-map:focus-visible {
    background: rgba(196, 181, 255, 0.1);
    border-color: rgba(196, 181, 255, 0.75);
    outline: none;
}
.cs-search-panel .search-pick-map:active { transform: translateY(1px); }
.cs-search-panel .search-pick-map__ico { flex: 0 0 auto; }
.cs-search-panel .search-hint {
    margin-top: var(--space-2);
    font-size: 0.72rem;
    color: var(--fg-muted);
}
.cs-search-panel .search-section-divider {
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: var(--space-3) 0;
}
.cs-search-panel .search-clearest-block {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.cs-search-panel .search-clearest-hint {
    margin: 0;
    font-size: 0.72rem;
    line-height: 1.45;
    color: var(--fg-muted);
}
.cs-search-panel .search-clearest-controls {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.cs-search-panel .search-min-score-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--fg-0);
}
.cs-search-panel .search-min-score-output {
    min-width: 2rem;
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
    color: var(--aurora-green);
    transition: color var(--dur-1) var(--ease);
}
.cs-search-panel .search-min-score-output--low {
    color: #ff8a80;
}
.cs-search-panel .search-min-score-output--mid {
    color: #ffd54f;
}
.cs-search-panel .search-min-score-output--high {
    color: var(--aurora-green);
}
.cs-search-panel .search-min-score-wrap {
    position: relative;
    --cs-min-pct: 75%;
    height: 30px;
    display: flex;
    align-items: center;
    margin-top: 2px;
}
.cs-search-panel .search-min-score-rail {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 12px;
    border-radius: 999px;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}
.cs-search-panel .search-min-score-rail__gradient {
    position: absolute;
    inset: 0;
    /* Aligns with map.clearspot_score_band_* : red <40%, orange 40–69%, green ≥70%. */
    background: linear-gradient(
        90deg,
        #c62828 0%,
        #c62828 40%,
        #f97316 40%,
        #f97316 70%,
        #22c55e 70%,
        #22c55e 100%
    );
}
.cs-search-panel .search-min-score-rail__veil {
    position: absolute;
    left: var(--cs-min-pct, 75%);
    right: 0;
    top: 0;
    bottom: 0;
    border-radius: 0 999px 999px 0;
    background: rgba(10, 12, 20, 0.82);
    transition: left var(--dur-1) var(--ease);
}
/* Range thumb above the rail; track stays transparent so the gauge shows through. */
.cs-search-panel .search-min-score-range {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 30px;
    margin: 0;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
}
.cs-search-panel .search-min-score-range:focus {
    outline: none;
}
.cs-search-panel .search-min-score-range:focus-visible::-webkit-slider-thumb {
    box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.55);
}
.cs-search-panel .search-min-score-range::-webkit-slider-runnable-track {
    height: 12px;
    border-radius: 999px;
    background: transparent;
}
.cs-search-panel .search-min-score-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    margin-top: -4px;
    border-radius: 50%;
    background: linear-gradient(180deg, #fafafa, #e0e0e0);
    border: 1px solid rgba(0, 0, 0, 0.35);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}
.cs-search-panel .search-min-score-range::-moz-range-track {
    height: 12px;
    border-radius: 999px;
    background: transparent;
}
.cs-search-panel .search-min-score-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(180deg, #fafafa, #e0e0e0);
    border: 1px solid rgba(0, 0, 0, 0.35);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}
.cs-search-panel .search-min-score-range::-moz-range-progress {
    height: 12px;
    border-radius: 999px 0 0 999px;
    background: transparent;
}
.cs-search-panel .search-clearest-btn {
    margin-top: var(--space-1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.55rem 0.85rem;
    background: rgba(124, 92, 255, 0.22);
    border: 1px solid rgba(196, 181, 255, 0.45);
    border-radius: var(--radius-sm);
    color: #e8e3ff;
    font-family: inherit;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
}
.cs-search-panel .search-clearest-btn:hover,
.cs-search-panel .search-clearest-btn:focus-visible {
    background: rgba(124, 92, 255, 0.35);
    border-color: rgba(196, 181, 255, 0.7);
    outline: none;
}
.cs-search-panel .search-clearest-btn:active { transform: translateY(1px); }
.cs-search-panel .search-clearest-btn[disabled] {
    opacity: 0.55;
    cursor: wait;
}
.cs-search-panel .search-clearest-about {
    margin: 0;
    font-size: 0.68rem;
    line-height: 1.4;
    color: var(--fg-muted);
}
.cs-search-panel .search-clearest-about__link {
    color: var(--fg-1);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.cs-search-panel .search-clearest-about__link:hover,
.cs-search-panel .search-clearest-about__link:focus-visible {
    color: var(--aurora-cyan);
    outline: none;
}
.cs-search-panel .search-status {
    margin-top: var(--space-2);
    font-size: 0.78rem;
    color: var(--fg-muted);
    min-height: 1em;
}
.cs-search-panel .search-status.is-error { color: var(--aurora-orange); }

/* --------------------------------------------------------------- */
/* SEO hero (shown until the globe takes over)                     */
/* --------------------------------------------------------------- */
.cs-seo-hero {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-6);
    pointer-events: none;
    opacity: 1;
    transition: opacity var(--dur-3) var(--ease),
                visibility 0s linear var(--dur-3);
    visibility: visible;
}
/* Once the globe has taken over visually, hide the hero completely.
 * This is SEO-safe because:
 *   - The hero is server-rendered and present in the initial HTML, so
 *     Googlebot sees the full content on first paint (no cloaking).
 *   - Hiding it via JS-added class after the page has hydrated is a
 *     standard UX pattern (same as any SPA route transition); the
 *     Web Rendering Service treats it as legitimate user experience.
 *   - We still expose the H1 / lead paragraph / feature list in the
 *     rendered DOM until the interaction takes over; crawlers that
 *     evaluate JS simply see the faded state, and the text was already
 *     indexed from the initial HTML response. */
.cs-seo-hero.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    /* Snap visibility to `hidden` only AFTER the opacity transition
     * finishes, so the fade itself is still perceptible. */
    transition: opacity var(--dur-3) var(--ease),
                visibility 0s linear var(--dur-3);
}
.cs-seo-hero-inner {
    max-width: min(1160px, 96vw);
    text-align: center;
    color: var(--fg-0);
}
.cs-seo-hero h1,
.cs-seo-hero__title {
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    margin-bottom: var(--space-3);
    background: var(--grad-primary-h, linear-gradient(90deg, #00ffb2, #7c5cff));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.cs-seo-hero__title em {
    font-style: italic;
    /* Keep « all clear » readable: parent uses gradient `color: transparent`. */
    background: none;
    -webkit-text-fill-color: #d8fbf4;
    color: #d8fbf4;
    text-shadow: 0 0 24px rgba(0, 255, 178, 0.35);
}
.cs-seo-hero__grouping {
    /* Same readable width as the main `.lead` (full inner, not a narrower column). */
    color: var(--fg-muted) !important;
    font-size: 0.98rem !important;
    line-height: 1.5;
    max-width: none;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    box-sizing: border-box;
    text-align: center;
}
.cs-hero-tiers {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-3);
    margin: 0 0 var(--space-4);
    text-align: left;
}
@media (min-width: 800px) {
    .cs-hero-tiers {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
.cs-hero-tier {
    padding: var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(18, 24, 38, 0.65);
    backdrop-filter: blur(4px);
    min-height: 0;
}
.cs-hero-tier__label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--fg-muted);
    margin: 0 0 var(--space-2);
    font-weight: 700;
    font-family: var(--font-ui);
    line-height: 1.3;
}
.cs-hero-tier__viz {
    display: flex;
    justify-content: center;
    margin: 0 0 var(--space-2);
}
.cs-hero-tier__svg {
    display: block;
    flex: 0 0 auto;
}
.cs-hero-tier__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    font-size: 0.88rem;
    line-height: 1.4;
    color: var(--fg-1);
}
.cs-hero-tier__list-item {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
}
.cs-hero-tier-li-viz {
    flex: 0 0 auto;
    width: 1.35rem;
    height: 1.35rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.07em;
}
.cs-hero-tier-li-body {
    flex: 1 1 auto;
    min-width: 0;
}
.cs-hero-tier-li-icon {
    width: 1.28rem;
    height: 1.28rem;
    object-fit: contain;
    display: block;
}
.cs-hero-tier-li-icon.cs-hero-tier-li-icon--hvt {
    width: 1.45rem;
    height: 1.45rem;
    filter:
        drop-shadow(0 0 2px rgba(15, 10, 0, 0.85))
        drop-shadow(0 0 5px rgba(250, 204, 21, 0.85));
}
.cs-hero-tier-li-dot {
    width: 0.62rem;
    height: 0.62rem;
    border-radius: 50%;
    box-sizing: border-box;
    flex-shrink: 0;
}
.cs-hero-tier-li-dot--noise {
    background: #ff9f4a;
}
.cs-hero-tier-li-dot--light {
    background: #00b4d4;
}
.cs-hero-tier-li-dot--air {
    background: #6be7a5;
}
.cs-hero-tier-li-dot--pollen {
    background: #f6d36b;
}
.cs-hero-tier-li-dot--mosquito {
    background: #f97316;
}
.cs-hero-tier-li-dot--hazard {
    width: 0.72rem;
    height: 0.72rem;
    background: conic-gradient(
        #E87B1E,
        #1565C0,
        #C62828,
        #0288D1,
        #6A1B9A,
        #2E7D32,
        #c2410c,
        #E87B1E
    );
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12) inset;
}
.onboarding-modal .sens-li-dot--hazard {
    width: 0.72rem;
    height: 0.72rem;
    border-radius: 50%;
    background: conic-gradient(
        #E87B1E,
        #1565C0,
        #C62828,
        #0288D1,
        #6A1B9A,
        #2E7D32,
        #c2410c,
        #E87B1E
    );
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12) inset;
}
.cs-hero-tier__list li strong {
    color: var(--fg-0);
    font-family: var(--font-ui);
}
.cs-seo-hero__footer-lead {
    margin-top: var(--space-2);
}
.cs-seo-hero .lead {
    color: var(--fg-1);
    font-size: 1.05rem;
    line-height: 1.55;
    margin: 0 0 var(--space-4);
}

/* Re-open SEO hero copy from the help FAB: fixed overlay on top of globe/Leaflet */
body.cs-stage-hero-modal-open {
    overflow: hidden;
    touch-action: none;
}
.cs-stage-hero-modal {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal-app);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
    box-sizing: border-box;
    pointer-events: auto;
}
.cs-stage-hero-modal[hidden] {
    display: none !important;
}
.cs-stage-hero-modal__backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    margin: 0;
    padding: 0;
    background: rgba(4, 8, 20, 0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    cursor: pointer;
}
.cs-stage-hero-modal__card {
    position: relative;
    z-index: 1;
    /* At least 80vw when the viewport allows; never wider than the padded viewport. */
    width: min(1400px, max(80vw, calc(100vw - 2 * var(--space-4))));
    max-height: min(92dvh, 980px);
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, rgba(12, 16, 32, 0.98), rgba(8, 11, 24, 0.98));
    border: 1px solid var(--border);
    border-radius: var(--radius-lg, 16px);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.65);
    color: var(--fg-0);
    overflow: hidden;
}
.cs-stage-hero-modal__close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(0, 0, 0, 0.28);
    color: var(--fg-0);
    cursor: pointer;
    transition: background 0.15s ease;
    -webkit-appearance: none;
    appearance: none;
    font: inherit;
}
.cs-stage-hero-modal__close:hover,
.cs-stage-hero-modal__close:focus-visible {
    background: rgba(255, 255, 255, 0.1);
    outline: 2px solid rgba(124, 92, 255, 0.55);
    outline-offset: 0;
}
.cs-stage-hero-modal__close svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    display: block;
}
.cs-stage-hero-modal__body {
    padding: var(--space-5) var(--space-4) var(--space-4);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    text-align: center;
}
/* Mirror `.cs-seo-hero` typography for cloned hero markup inside the modal. */
.cs-stage-hero-modal__body .cs-seo-hero-inner {
    max-width: 100%;
    text-align: center;
    color: var(--fg-0);
}
.cs-stage-hero-modal__body h1,
.cs-stage-hero-modal__body .cs-seo-hero__title {
    font-size: clamp(1.4rem, 3.2vw, 2.1rem);
    margin: 0 0 var(--space-3);
    background: var(--grad-primary-h, linear-gradient(90deg, #00ffb2, #7c5cff));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    padding: 0 2.2rem; /* keep clear of close button on narrow */
}
.cs-stage-hero-modal__body .cs-seo-hero__title em {
    font-style: italic;
    background: none;
    -webkit-text-fill-color: #d8fbf4;
    color: #d8fbf4;
    text-shadow: 0 0 20px rgba(0, 255, 178, 0.3);
}
.cs-stage-hero-modal__body .cs-seo-hero__grouping {
    color: var(--fg-muted) !important;
    max-width: none;
    width: 100%;
    padding: 0;
}
.cs-stage-hero-modal__body .lead {
    color: var(--fg-1);
    font-size: 1.02rem;
    line-height: 1.55;
    margin: 0 0 var(--space-3);
    text-align: center;
}
.cs-stage-hero-modal__body .cs-hero-tiers {
    margin: 0 0 var(--space-3);
}
@media (min-width: 800px) {
    .cs-stage-hero-modal__body .cs-hero-tiers {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
.cs-stage-hero-modal__fallback {
    margin: 0;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--fg-1);
    text-align: left;
}

/* --------------------------------------------------------------- */
/* Heatmap progress indicator                                      */
/* --------------------------------------------------------------- */
.cs-map-loading {
    /* Richer "loading with percent" version */
    display: none;
    min-width: 200px;
    padding: 8px 14px;
    background: rgba(10, 13, 26, 0.88);
    color: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.78rem;
    font-family: var(--font-ui);
    box-shadow: var(--shadow-2);
    backdrop-filter: blur(6px);
}
.cs-map-loading.is-visible { display: block; }
.cs-map-loading .cs-loading-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}
.cs-map-loading .cs-loading-pct {
    font-variant-numeric: tabular-nums;
    color: var(--aurora-green);
    font-weight: 700;
}
.cs-map-loading .cs-loading-bar {
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}
.cs-map-loading .cs-loading-bar > span {
    display: block; height: 100%;
    width: 0%;
    background: var(--grad-primary-h, linear-gradient(90deg, #00ffb2, #7c5cff));
    transition: width 180ms ease;
}

/* Globe heatmap loading badge (outside Leaflet) */
.cs-globe-loading {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 28;
    min-width: 200px;
    padding: 8px 14px;
    background: rgba(10, 13, 26, 0.88);
    color: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.78rem;
    font-family: var(--font-ui);
    box-shadow: var(--shadow-2);
    backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 220ms ease, visibility 0s linear 220ms;
}
.cs-globe-loading.is-visible {
    opacity: 1;
    visibility: visible;
    transition: opacity 220ms ease, visibility 0s linear 0s;
}

/* Globe canvas fades in once the BMNG texture has decoded so the user
 * never sees the flat blue fallback material or the first half-painted
 * frame. Paired with `.cs-stage-loading` while the progress bar rules
 * the viewport. */
#globe {
    transition: opacity 420ms ease;
}
#globe.is-loading {
    opacity: 0;
}

/* Initial stage (globe texture + first paint) progress. Same styling
 * language as the heatmap badge but slightly larger minimum width so
 * the label "Loading globe..." reads comfortably. Fades cleanly in/out
 * so fast devices never see it blink. */
.cs-stage-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 29;
    min-width: 240px;
    padding: 10px 16px;
    background: rgba(10, 13, 26, 0.92);
    color: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.82rem;
    font-family: var(--font-ui);
    box-shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.8), var(--shadow-2);
    backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    /* Delay the fade-in so a quick load never flashes. */
    transition: opacity 260ms ease 120ms, visibility 0s linear 380ms;
    pointer-events: none;
}
.cs-stage-loading.is-visible {
    opacity: 1;
    visibility: visible;
    transition: opacity 260ms ease 120ms, visibility 0s linear 0s;
}
.cs-stage-loading .cs-loading-label {
    display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px;
}
.cs-stage-loading .cs-loading-pct {
    font-variant-numeric: tabular-nums; color: var(--aurora-green); font-weight: 700;
}
.cs-stage-loading .cs-loading-bar {
    height: 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden;
}
.cs-stage-loading .cs-loading-bar > span {
    display: block; height: 100%; width: 0%;
    background: var(--grad-primary-h, linear-gradient(90deg, #00ffb2, #7c5cff));
    transition: width 200ms ease;
}
.cs-globe-loading .cs-loading-label {
    display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px;
}
.cs-globe-loading .cs-loading-pct {
    font-variant-numeric: tabular-nums; color: var(--aurora-green); font-weight: 700;
}
.cs-globe-loading .cs-loading-bar {
    height: 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden;
}
.cs-globe-loading .cs-loading-bar > span {
    display: block; height: 100%; width: 0%;
    background: var(--grad-primary-h, linear-gradient(90deg, #00ffb2, #7c5cff));
    transition: width 180ms ease;
}

/* Cog panel: replay first-visit action row */
.cs-layers-replay {
    margin-top: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px solid var(--border);
}
.cs-layers-replay-btn {
    width: 100%;
    padding: 0.55rem 0.7rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--fg-0);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
}
.cs-layers-replay-btn:hover {
    border-color: var(--aurora-violet);
    color: var(--aurora-violet);
}

/* =============================================================== */
/* Sensitivity panel                                               */
/* -----------                                                     */
/* Dedicated dialog accessed from the cog panel ("Adjust           */
/* sensitivity"). Edits the per-source thresholds that flip the    */
/* exposure chip to "Not clear". Shares the cog panel's visual     */
/* grammar (dark card, aurora accent) but floats above siblings    */
/* so users can tweak without losing the underlying list.          */
/* =============================================================== */
.cs-layers-actions {
    margin-top: var(--space-3);
}
.cs-layers-sens-btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.6rem 0.8rem;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(124, 92, 255, 0.45);
    background: rgba(124, 92, 255, 0.12);
    color: var(--fg-0);
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 150ms ease, background-color 150ms ease, transform 120ms ease;
}
.cs-layers-sens-btn:hover,
.cs-layers-sens-btn:focus-visible {
    border-color: var(--aurora-violet, #9b7fff);
    background: rgba(124, 92, 255, 0.20);
    outline: none;
}
.cs-layers-sens-btn svg { opacity: 0.9; }

.cs-sens-panel {
    /* Fixed to the viewport, not to `.cs-stage-fabs` (its DOM parent).
     * The rail is only ~40 px tall and anchored at the top-left, so
     * an absolute `bottom: 64px` used to push the panel *above* the
     * viewport whenever the content exceeded the rail's computed
     * height. Fixed positioning removes any dependency on the rail
     * and makes the dialog behave identically on globe + map. */
    position: fixed;
    left: 12px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 140px);
    right: auto;
    top: auto;
    z-index: 1200;
    width: min(360px, calc(100vw - 24px));
    max-height: min(72dvh, calc(100dvh - 200px));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: var(--space-4) var(--space-4) var(--space-3);
    background: rgba(14, 18, 30, 0.98);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-2), 0 0 0 1px rgba(124, 92, 255, 0.15);
    color: var(--fg-0);
    font-family: var(--font-ui);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.cs-sens-panel[hidden] { display: none !important; }

/* Inline on account page: not fixed, full width, matches map cog styling */
.cs-sens-panel--account {
    position: static;
    left: auto;
    right: auto;
    top: auto;
    bottom: auto;
    z-index: auto;
    width: 100%;
    max-width: none;
    max-height: none;
    min-height: 0;
    margin: 0 0 var(--space-4);
    overflow: visible;
    box-sizing: border-box;
}
main.account-grid .cs-sens-panel--account {
    border-radius: var(--radius-lg);
    padding: var(--space-4) var(--space-4) var(--space-3);
    box-shadow: var(--shadow-2), 0 0 0 1px rgba(124, 92, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    /* Never inherit map-dialog max-height (narrow / mobile map rules). */
    max-height: none !important;
}
.cs-sens-head--account {
    margin-bottom: var(--space-1);
    justify-content: flex-start;
}
main.account-grid .cs-sens-panel--account .cs-sens-lead {
    margin-top: 0;
}
main.account-grid .cs-sens-panel--account .cs-sens-foot {
    position: static;
    margin-top: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    justify-content: flex-start;
}
.account-web-push {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-4);
    margin-bottom: var(--space-4);
    background: var(--bg-2);
}
.account-web-push__title {
    margin: 0 0 var(--space-2);
    font-size: var(--text-base);
    font-family: var(--font-ui);
}
.account-web-push__lead {
    margin: 0 0 var(--space-3);
    font-size: 0.88rem;
    line-height: 1.45;
}
.account-web-push__status {
    margin: 0 0 var(--space-2);
    font-size: 0.9rem;
    line-height: 1.45;
}
.account-web-push__status--subscribed {
    color: var(--fg-muted);
}
.account-web-push__status--promptable {
    color: var(--fg-muted);
}
.account-web-push__status--denied,
.account-web-push__status--unconfigured {
    color: var(--color-warn, #b45309);
}
.account-web-push__status--unsupported,
.account-web-push__status--no_sw {
    color: var(--fg-muted);
}
.account-web-push__help {
    margin: 0 0 var(--space-3);
    font-size: 0.82rem;
    line-height: 1.45;
}
.account-web-push__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    align-items: center;
}
.account-web-push__flash {
    margin: 0 0 var(--space-2);
    font-size: 0.88rem;
}
.account-web-push__flash--ok {
    color: var(--color-ok, #0d6b36);
}
.account-web-push__flash--err {
    color: var(--color-danger, #b91c1c);
}

.account-sens-primer {
    font-size: 0.86rem;
    line-height: 1.45;
    color: var(--fg-muted);
    margin: 0 0 var(--space-3);
}
.account-notify-hint {
    font-size: 0.86rem;
    line-height: 1.45;
    color: var(--fg-muted);
    margin: 0 0 var(--space-4);
}
/* Notification toggles: same row grammar as the map cog layer list (dot + label + aligned checkbox). */
.account-notify-list {
    list-style: none;
    margin: var(--space-2) 0 0;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: rgba(14, 18, 30, 0.72);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}
.account-notify-item {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.account-notify-item:first-child {
    border-top: 0;
}
.account-notify-main {
    display: grid;
    grid-template-columns: 1.125rem 12px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: var(--space-3) var(--space-4);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--fg-0);
    font-family: var(--font-ui);
}
.account-notify-main:hover {
    background: rgba(255, 255, 255, 0.04);
}
.account-notify-cb {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--brand, #7c5cff);
    cursor: pointer;
    flex-shrink: 0;
}
.account-notify-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 6px currentColor;
}
.account-notify-lbl {
    min-width: 0;
    line-height: 1.35;
}
.account-notify-item .account-notify-subs {
    margin: 0;
    padding: 0 var(--space-4) var(--space-3);
    padding-left: calc(var(--space-4) + 1.125rem + 10px + 12px);
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    font-size: 0.84rem;
    color: var(--fg-muted);
}
.account-notify-item .account-notify-subs li label {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-weight: 500;
    color: var(--fg-1);
    cursor: pointer;
}
.account-notify-item .account-notify-subs li input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--brand, #7c5cff);
    flex-shrink: 0;
}
.account-notify-item .account-notify-subs[hidden] { display: none !important; }

.cs-sens-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-2);
}
.cs-sens-title {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--fg-muted);
    font-weight: 700;
}
.cs-sens-close {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 10px;
    width: 32px; height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--fg-0);
    cursor: pointer;
    transition: border-color 120ms ease, background-color 120ms ease;
}
.cs-sens-close:hover,
.cs-sens-close:focus-visible {
    border-color: var(--border);
    background: rgba(255, 255, 255, 0.06);
    outline: none;
}

.cs-sens-lead {
    margin: 0 0 var(--space-3);
    font-size: 0.84rem;
    color: var(--fg-muted);
    line-height: 1.4;
}

.cs-sens-tier-title {
    margin: var(--space-4) 0 var(--space-1);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--fg-muted);
    font-weight: 700;
}
.cs-sens-lead + .cs-sens-tier-title {
    margin-top: var(--space-2);
}
.cs-sens-tier-sub {
    margin: 0 0 var(--space-2);
    font-size: 0.78rem;
    line-height: 1.35;
    color: var(--fg-muted);
}

.cs-sens-row {
    padding: var(--space-3) 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.cs-sens-row:first-of-type { border-top: 0; padding-top: var(--space-2); }

.cs-sens-row-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 0.9rem;
}
.cs-sens-row-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}
.cs-sens-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    flex: 0 0 auto;
    box-shadow: 0 0 6px currentColor;
}
.cs-sens-val {
    font-size: 0.8rem;
    color: var(--fg-muted);
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.cs-sens-row input[type="range"] {
    width: 100%;
    accent-color: var(--brand, #7c5cff);
    margin: 2px 0 6px;
}

.cs-sens-num-stepper {
    display: flex;
    align-items: stretch;
    gap: 8px;
    margin: 4px 0 6px;
}
.cs-sens-step-btn {
    appearance: none;
    -webkit-appearance: none;
    flex: 0 0 auto;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: var(--fg-0);
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: border-color 120ms ease, background-color 120ms ease;
}
.cs-sens-step-btn:hover {
    border-color: rgba(124, 92, 255, 0.55);
    background: rgba(255, 255, 255, 0.09);
}
.cs-sens-num-input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.25);
    color: var(--fg-0);
    font-family: inherit;
    font-size: 1rem;
    font-variant-numeric: tabular-nums;
}
.cs-sens-num-input:focus {
    outline: none;
    border-color: rgba(124, 92, 255, 0.65);
    box-shadow: 0 0 0 2px rgba(124, 92, 255, 0.2);
}

.cs-sens-seg {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 4px 0 6px;
}
.cs-sens-seg-btn {
    appearance: none;
    -webkit-appearance: none;
    flex: 1 1 auto;
    min-width: 0;
    padding: 0.45rem 0.55rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(255, 255, 255, 0.04);
    color: var(--fg-0);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.1;
    cursor: pointer;
    transition: border-color 120ms ease, background-color 120ms ease, color 120ms ease;
}
.cs-sens-seg-btn:hover { border-color: rgba(124, 92, 255, 0.55); }
.cs-sens-seg-btn.is-on {
    border-color: var(--aurora-violet, #9b7fff);
    background: rgba(124, 92, 255, 0.22);
    color: #fff;
    box-shadow: 0 0 0 1px rgba(124, 92, 255, 0.25) inset;
}

.cs-sens-hint {
    font-size: 0.78rem;
    color: var(--fg-muted);
    line-height: 1.35;
}
.cs-sens-hint--secondary {
    margin-top: 6px;
    font-size: 0.74rem;
    opacity: 0.92;
}

/* Collapsible advanced subsection: one per data source whose raw
 * payload has multiple sub-indicators we want to tune individually
 * (air pollutants, pollen taxa). Stays closed by default so the
 * main level pickers remain the primary knobs. */
.cs-sens-adv {
    margin-top: 8px;
    border-top: 1px dashed rgba(255, 255, 255, 0.08);
    padding-top: 6px;
}
.cs-sens-adv > summary {
    list-style: none;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--fg-muted);
    padding: 4px 2px;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.01em;
}
.cs-sens-adv > summary::-webkit-details-marker { display: none; }
.cs-sens-adv > summary::before {
    content: "";
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 5px solid currentColor;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    transform: rotate(0deg);
    transition: transform 120ms ease;
    opacity: 0.7;
}
.cs-sens-adv[open] > summary::before { transform: rotate(90deg); }
.cs-sens-adv[open] > summary { color: var(--fg-0); }

.cs-sens-adv-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 6px 2px 4px;
}
.cs-sens-subrow-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 4px;
    gap: 8px;
}
.cs-sens-subrow-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--fg-0);
}
.cs-sens-subval {
    font-size: 0.72rem;
    color: var(--fg-muted);
    font-variant-numeric: tabular-nums;
}

/* Compact variant of the main segmented control for sub-rows, so
 * six taxon rows (or five pollutant rows) fit without the panel
 * overflowing on mobile. */
.cs-sens-seg--mini { gap: 4px; margin: 0; }
.cs-sens-seg-btn--mini {
    padding: 0.32rem 0.25rem;
    font-size: 0.78rem;
    border-radius: 8px;
    min-width: 0;
}

/* Sensitivity: discrete "gauge" (5+ clickable dashes), inspired by the
 * pollen / air modals' horizontal bar readouts. Left = permissive
 * (green HSL in --tick-fill), right = stricter (red). Filled dashes
 * from the start through the active band show the chosen position. */
.cs-sens-gauge {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 7px;
    width: 100%;
    min-width: 0;
    margin: 6px 0 6px;
    box-sizing: border-box;
}
.cs-sens-gauge--mini {
    gap: 5px;
    margin: 4px 0 2px;
}
.cs-sens-gauge--9 {
    gap: 4px;
}
@media (max-width: 400px) {
    .cs-sens-gauge--9 { gap: 3px; }
}
.cs-sens-gauge-tick {
    flex: 1 1 0;
    min-width: 0;
    height: 10px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.05);
    padding: 0;
    margin: 0;
    cursor: pointer;
    transition:
        background-color 120ms ease,
        border-color 120ms ease,
        box-shadow 120ms ease,
        opacity 120ms ease,
        transform 120ms ease;
}
.cs-sens-gauge--mini .cs-sens-gauge-tick {
    height: 7px;
    border-radius: 3px;
}
.cs-sens-gauge-tick:hover {
    border-color: rgba(255, 255, 255, 0.32);
    filter: brightness(1.12);
}
.cs-sens-gauge-tick:focus {
    outline: none;
}
.cs-sens-gauge-tick:focus-visible {
    box-shadow: 0 0 0 2px rgba(0, 255, 178, 0.5);
    border-color: rgba(0, 255, 178, 0.55);
}
.cs-sens-gauge-tick.is-filled {
    background: var(--tick-fill, hsl(120, 65%, 42%));
    border-color: rgba(255, 255, 255, 0.3);
    opacity: 1;
}
.cs-sens-gauge-tick:not(.is-filled) {
    opacity: 0.42;
}
.cs-sens-gauge-tick.is-active {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.5) inset, 0 0 0 1px rgba(0, 0, 0, 0.3);
    transform: scaleY(1.2);
    z-index: 1;
    opacity: 1 !important;
}
.cs-sens-gauge-tick.is-filled:not(.is-active) {
    opacity: 0.92;
}

.cs-sens-foot {
    display: flex;
    gap: 8px;
    justify-content: space-between;
    margin-top: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.cs-sens-reset,
.cs-sens-done {
    flex: 1 1 auto;
    padding: 0.55rem 0.8rem;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 120ms ease, border-color 120ms ease, transform 120ms ease;
}
.cs-sens-reset {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--fg-0);
}
.cs-sens-reset:hover {
    border-color: var(--aurora-violet, #9b7fff);
    color: var(--aurora-violet, #9b7fff);
}
.cs-sens-done {
    background: var(--aurora-violet, #7c5cff);
    border: 1px solid var(--aurora-violet, #7c5cff);
    color: #fff;
}
.cs-sens-done:hover { transform: translateY(-1px); }

/* Map mode (Leaflet) — keep the sensitivity dialog bottom-left like
 * the cog panel instead of drifting with zoom controls. The bottom
 * offset must clear the exposure indicator (collapsed ~90 px). */
#stage-canvas:has(#map.is-active) .cs-sens-panel {
    left: 12px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 140px);
    right: auto;
    top: auto;
}

/* Mobile / narrow: stretch full width and behave like a bottom sheet
 * docked above the exposure bar. Using dvh (dynamic viewport) so it
 * stays usable when the mobile URL bar collapses/expands. */
@media (max-width: 560px) {
    .cs-sens-panel {
        left: 8px;
        right: 8px;
        bottom: calc(env(safe-area-inset-bottom, 0px) + 108px);
        width: auto;
        max-width: none;
        min-width: 0;
        max-height: min(72dvh, calc(100dvh - 180px));
        border-radius: var(--radius-lg);
    }
    #stage-canvas:has(#map.is-active) .cs-sens-panel {
        left: 8px;
        right: 8px;
        bottom: calc(env(safe-area-inset-bottom, 0px) + 108px);
    }
    /* Keep the close control visible when the sheet scrolls (little backdrop to tap). */
    .cs-sens-panel:not(.cs-sens-panel--account) .cs-sens-head {
        position: sticky;
        top: 0;
        z-index: 6;
        margin: calc(-1 * var(--space-4)) calc(-1 * var(--space-4)) var(--space-2);
        padding: var(--space-4) var(--space-4) var(--space-2);
        background: rgba(14, 18, 30, 0.98);
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
    .cs-sens-panel:not(.cs-sens-panel--account) .cs-sens-close {
        width: 44px;
        height: 44px;
    }
    /* Account profile: inline sensitivity is NOT the map bottom-sheet. The map
     * rule above re-applies max-height to every .cs-sens-panel; with
     * overflow: visible on --account, long content painted over Notifications. */
    main.account-grid .cs-sens-panel.cs-sens-panel--account {
        position: static !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        top: auto !important;
        width: 100% !important;
        max-width: none !important;
        max-height: none !important;
        min-height: 0;
        overflow-y: visible !important;
        border-radius: var(--radius-lg) !important;
    }
}

body.cs-sens-open {
    /* Prevent background scroll while the dialog is open on mobile. */
    overflow: hidden;
    touch-action: none;
}

/* When the onboarding is up, the sensitivity panel must disappear
 * along with the rest of the stage chrome. Mirrors the handling
 * already in place for .cs-layers-panel. */
body.cs-onboarding-open .cs-sens-panel { display: none !important; }

/* =============================================================== */
/* Per-source explainer modal                                      */
/* -----------                                                     */
/* Opened when the user taps a row in "Exposition par source". It  */
/* summarises the thresholds for that source and links to its      */
/* "Tuto ClearSpot" article. Built as a plain centred dialog on    */
/* desktop, and as a native bottom-sheet on mobile so it matches   */
/* the onboarding and exposure-pill behaviour.                     */
/* =============================================================== */
.cs-source-modal {
    position: fixed;
    inset: 0;
    /* Same modal tier as onboarding / basemap so the explainer stays above
     * body.cs-leaflet-popup-open .app-shell and the sticky header. */
    z-index: var(--z-modal-app);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
    animation: cs-source-modal-fade var(--dur-1) var(--ease);
}
@keyframes cs-source-modal-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.cs-source-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4, 6, 16, 0.72);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.cs-source-modal__card {
    position: relative;
    z-index: 1;
    max-width: 460px;
    width: 100%;
    max-height: calc(100vh - var(--space-6));
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, rgba(20, 26, 48, 0.98), rgba(12, 16, 32, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
    color: var(--fg-0);
    overflow: hidden;
    animation: cs-source-modal-rise var(--dur-2) var(--ease);
}
.cs-source-modal__head,
.cs-source-modal__foot { flex: 0 0 auto; }
.cs-source-modal__body { flex: 1 1 auto; }
@keyframes cs-source-modal-rise {
    from { transform: translateY(16px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}
.cs-source-modal__head {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.cs-source-modal__dot {
    width: 12px; height: 12px; border-radius: 50%;
    flex: 0 0 auto;
    box-shadow: 0 0 12px currentColor;
}
.cs-source-modal__head h2 {
    flex: 1 1 auto;
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.3;
}
.cs-source-modal__close {
    flex: 0 0 auto;
    width: 32px; height: 32px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.03);
    color: var(--fg-0);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
}
.cs-source-modal__close:hover,
.cs-source-modal__close:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.22);
    outline: none;
}
.cs-source-modal__body {
    padding: var(--space-4);
    font-size: 0.95rem;
    line-height: 1.55;
    color: var(--fg-1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.cs-source-modal__subtitle {
    margin: var(--space-4) 0 var(--space-2);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--fg-muted);
}
.cs-source-modal__body > .cs-source-modal__subtitle:first-child { margin-top: 0; }
.cs-source-modal__body p {
    margin: 0;
}
/* Live data card embedded at the top of the modal body. Re-uses the
 * exact same `.cs-pollen-popup` markup the Leaflet popup renders, so
 * the numbers stay pixel-identical between the map-click and the
 * bottom-row-click paths. We just strip the outer chrome (border /
 * shadow / background) because the modal already provides them. */
.cs-source-modal__data {
    margin: 0 0 var(--space-2);
}
.cs-source-modal__data .cs-popup,
.cs-source-modal__data .cs-pollen-popup {
    min-width: 0;
    width: 100%;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    color: inherit;
}
.cs-source-modal__data .cs-pollen-popup__title { margin-top: 0; }
.cs-source-modal__data .cs-pollen-popup__footer {
    /* Hide the "Understand the scale" link here: the modal already
     * surfaces the same tuto link in its footer CTA, and the period
     * is already implied by the headline. Keeping both would be
     * visual clutter. */
    display: none;
}
.cs-source-modal__status {
    margin: 0;
    padding: var(--space-3) var(--space-4);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: var(--fg-muted);
    font-size: 0.9rem;
}
.cs-source-modal__foot {
    padding: 0 var(--space-4) var(--space-4);
}
.cs-source-modal__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    width: 100%;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--aurora-green), #4cc9a0);
    color: #061818;
    font-weight: 700;
    font-size: 0.92rem;
    text-decoration: none;
    letter-spacing: 0.01em;
    box-shadow: 0 8px 24px rgba(0, 255, 178, 0.18);
    transition: transform var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}
.cs-source-modal__cta:hover,
.cs-source-modal__cta:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 10px 28px rgba(0, 255, 178, 0.28);
    outline: none;
}
.cs-source-modal__cta svg { flex: 0 0 auto; }

/* Prevent background scroll when the modal is open (esp. iOS). */
body.cs-source-modal-open { overflow: hidden; }

/* Hide the PWA install banner while the explainer is open so it does
 * not compete for attention. We intentionally DO NOT hide the stage
 * FAB rail any more: the cog panel lives inside that rail and users
 * may open the explainer from the wind-ring "i" button - hiding the
 * rail would unmount the panel context underneath the modal. */
body.cs-source-modal-open .cs-pwa-install { display: none !important; }

/* ClearSpot score breakdown modal (optional; same shell as source modal). */
.cs-score-explain-modal .cs-source-modal__card {
    max-width: min(36rem, calc(100vw - var(--space-6)));
}
.cs-score-explain-modal__body {
    padding-top: var(--space-3);
}
.cs-score-explain-intro {
    margin: 0 0 var(--space-3);
    font-size: 0.9rem;
    color: var(--fg-1);
}
.cs-score-explain-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 0 var(--space-3);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.cs-score-explain-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}
.cs-score-explain-table th,
.cs-score-explain-table td {
    padding: 0.45rem 0.55rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    vertical-align: top;
}
.cs-score-explain-table th {
    font-weight: 700;
    color: var(--fg-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.68rem;
    white-space: nowrap;
}
.cs-score-explain-table td:nth-child(2),
.cs-score-explain-table td:nth-child(3) {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.cs-score-explain-table--kv td:first-child { width: 42%; }
.cs-score-explain-tr--max td {
    background: rgba(155, 124, 255, 0.12);
}
.cs-score-explain-steps {
    margin: 0;
    padding-left: 1.25rem;
    font-size: 0.88rem;
    color: var(--fg-1);
}
.cs-score-explain-steps li { margin-bottom: 0.35rem; }
.cs-score-explain-steps code {
    font-size: 0.85em;
    background: rgba(255, 255, 255, 0.06);
    padding: 0.08rem 0.28rem;
    border-radius: 4px;
}
.cs-score-explain-equation {
    margin: 0 0 var(--space-2);
    padding: var(--space-3);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.28);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.78rem;
    line-height: 1.45;
    color: var(--fg-1);
    white-space: pre-wrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.cs-score-explain-equation-note {
    margin: 0 0 var(--space-3);
    font-size: 0.78rem;
    line-height: 1.45;
    color: var(--fg-muted);
}
.exposure-details .src-row--score-explain {
    cursor: pointer;
}
.exposure-details .src-score-tap-hint {
    margin: 0.35rem 0 0;
    font-size: 0.72rem;
    line-height: 1.4;
    color: var(--fg-muted);
}

/* Mobile tuning: centred card (NOT a bottom sheet) so it is always
 * fully visible above any heatmap progress bar, exposure pill or
 * other stage overlay. Uses a gentle rise-in so it feels responsive
 * without the full bottom-sheet travel that previously let taps on
 * the empty upper half dismiss it by accident. */
@media (max-width: 640px) {
    .cs-source-modal {
        padding: var(--space-3);
    }
    .cs-source-modal__card {
        max-width: none;
        width: 100%;
    }
    .cs-source-modal__head h2 { font-size: 1.05rem; }
    .cs-source-modal__body    { font-size: 0.9rem; }
}

/* --- Public places / ClearSpot rankings (033) --- */
.places-shell .places-page {
    max-width: 56rem;
    margin: 0 auto;
    padding: var(--space-4) var(--space-3) var(--space-6);
}
.places-page .article-head h1 { font-size: clamp(1.35rem, 3vw, 1.75rem); }
.places-nav-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0 0 var(--space-4);
}
.places-week-badge { font-size: 0.88rem; }
.places-ranking-block { margin-bottom: var(--space-4); }
.places-ranking-block h2 { font-size: 1.05rem; margin-bottom: var(--space-2); }
.places-country-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.places-country-card {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.65rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    text-decoration: none;
    color: var(--fg-1);
    background: var(--bg-1);
}
.places-country-card:hover {
    color: var(--fg-0);
    border-color: rgba(123, 94, 167, 0.45);
    background: rgba(124, 92, 255, 0.08);
}
.places-country-flag { font-size: 1.15rem; line-height: 1; }
.places-country-name { font-size: 0.82rem; color: var(--fg-2); max-width: 9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.places-country-code { font-weight: 600; letter-spacing: 0.04em; }
.places-filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    align-items: flex-end;
    margin-bottom: var(--space-3);
}
.places-filter-form label span { display: block; font-size: 0.82rem; color: var(--fg-2); margin-bottom: 0.2rem; }
.places-filter-form input,
.places-filter-form select {
    min-width: 12rem;
    padding: 0.45rem 0.55rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-1);
    color: var(--fg-0);
}
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.places-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}
.places-table th,
.places-table td {
    padding: 0.5rem 0.65rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
}
.places-table th { color: var(--fg-2); font-weight: 600; font-size: 0.82rem; }
.places-table .btn { padding: 0.28rem 0.55rem; font-size: 0.82rem; }
.places-pager {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: var(--space-3);
}
.places-pager a {
    display: inline-block;
    min-width: 2rem;
    text-align: center;
    padding: 0.28rem 0.45rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    text-decoration: none;
    color: var(--fg-1);
    font-size: 0.88rem;
}
.places-pager a:hover { color: var(--fg-0); background: rgba(124, 92, 255, 0.1); }
.places-pager a.is-active {
    border-color: rgba(123, 94, 167, 0.5);
    background: rgba(124, 92, 255, 0.15);
    font-weight: 600;
    color: var(--accent-0);
}
.places-city-score {
    font-size: clamp(2rem, 6vw, 3rem);
    font-weight: 800;
    margin: 0.25rem 0;
    letter-spacing: -0.02em;
}
.places-city-score--live {
    color: var(--accent-0);
}
.places-city-subh {
    font-size: 1rem;
    font-weight: 600;
    margin: var(--space-3) 0 var(--space-2);
}
.places-city-footnote {
    font-size: 0.84rem;
    max-width: 40rem;
}
.places-city-guide-list {
    margin: 0.5rem 0 0;
    padding-left: 1.25rem;
}
.places-city-guide-list li { margin: 0.35rem 0; }
.places-table th.places-table-sort__th {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 1.35rem;
}
.places-table th.places-table-sort__th:hover { color: var(--fg-0); }
.places-table th.places-table-sort__th:focus-visible {
    outline: 2px solid rgba(123, 94, 167, 0.55);
    outline-offset: 2px;
}
.places-table th.places-table-sort__th.is-sort-asc::after,
.places-table th.places-table-sort__th.is-sort-desc::after {
    content: '';
    position: absolute;
    right: 0.25rem;
    top: 50%;
    margin-top: -5px;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
}
.places-table th.places-table-sort__th.is-sort-asc::after {
    border-bottom: 6px solid var(--fg-2);
}
.places-table th.places-table-sort__th.is-sort-desc::after {
    border-top: 6px solid var(--fg-2);
}
