:root {
    color-scheme: light;
    --ink: #10232d;
    --muted: #657780;
    --paper: #f7faf9;
    --panel: rgba(255, 255, 255, .96);
    --night: #0a1a24;
    --night-soft: #132b37;
    --cyan: #44c0cf;
    --border: rgba(15, 43, 54, .14);
    --shadow: 0 18px 50px rgba(4, 22, 29, .18);
}

* { box-sizing: border-box; }

html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
}

body {
    background: var(--night);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-feature-settings: "tnum" 1, "ss01" 1;
}

.embed-denied-notice { display: none; }
body.is-embed-denied .app-shell { display: none; }
body.is-embed-denied .embed-denied-notice {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100svh;
    padding: clamp(24px, 7vw, 80px);
    background:
        radial-gradient(circle at 20% 15%, rgba(68, 192, 207, .16), transparent 35%),
        linear-gradient(145deg, #0a1a24, #173743);
    text-align: center;
}
.embed-denied-notice a {
    max-width: 1120px;
    color: #fff;
    font-size: clamp(24px, 4.2vw, 56px);
    font-weight: 800;
    line-height: 1.15;
    text-decoration: none;
    overflow-wrap: anywhere;
}
.embed-denied-notice a span,
.embed-denied-notice a strong { display: block; }
.embed-denied-notice a strong {
    margin-top: .18em;
    color: #85e2eb;
    font: inherit;
    text-decoration: underline;
    text-decoration-color: #44c0cf;
    text-decoration-thickness: .08em;
    text-underline-offset: .16em;
}
.embed-denied-notice a:hover { color: #85e2eb; }
.embed-denied-notice a:focus-visible { outline: 4px solid #44c0cf; outline-offset: 8px; border-radius: 4px; }

button, input { font: inherit; }

.app-shell {
    display: grid;
    grid-template-rows: 76px minmax(0, 1fr);
    width: 100%;
    height: 100svh;
}

body.is-embedded .topbar { display: none; }
body.is-embedded .app-shell { grid-template-rows: minmax(0, 1fr); }

.topbar {
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 clamp(18px, 3.5vw, 58px);
    color: #fff;
    background: var(--night);
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.brand { display: flex; align-items: center; gap: 13px; }

.brand-mark {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 13px;
    background: linear-gradient(145deg, #3dc8d4, #2b8eab);
    box-shadow: inset 0 1px rgba(255,255,255,.28), 0 8px 22px rgba(45, 181, 202, .22);
}

.brand-mark svg { width: 26px; fill: #fff; }
.brand-mark .shine { fill: none; stroke: rgba(10, 26, 36, .24); stroke-width: 2.5; stroke-linecap: round; }

.brand h1 { margin: 0; font-size: 18px; line-height: 1.1; letter-spacing: -.02em; }
.brand p { margin: 4px 0 0; color: #9eb0b9; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }

.topbar-meta { display: flex; align-items: center; gap: 10px; color: #bed0d7; font-size: 12px; font-weight: 600; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #62d6a5; box-shadow: 0 0 0 4px rgba(98,214,165,.12); }
.divider { width: 1px; height: 18px; margin: 0 4px; background: rgba(255,255,255,.15); }

.map-stage { position: relative; min-height: 0; isolation: isolate; }
#map { position: absolute; inset: 0; z-index: 0; background: #dce7e8; }

.leaflet-control-zoom {
    overflow: hidden;
    border: 0 !important;
    border-radius: 13px !important;
    box-shadow: 0 8px 28px rgba(15,35,45,.2) !important;
}
.leaflet-control-zoom a { width: 38px !important; height: 38px !important; line-height: 36px !important; color: var(--ink) !important; border-color: #e8efef !important; }
.leaflet-control-attribution { color: #708087; background: rgba(255,255,255,.82) !important; }
.leaflet-popup-content-wrapper { border-radius: 14px; box-shadow: var(--shadow); }
.leaflet-popup-content { margin: 14px 16px; line-height: 1.45; }
.station-popup { min-width: 170px; }
.station-popup strong { display: block; color: var(--ink); font-size: 14px; }
.station-popup-meta { display: flex; justify-content: space-between; gap: 14px; margin-top: 3px; }
.station-popup-meta span { color: var(--muted); font-size: 11px; white-space: nowrap; }
.station-popup b {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding-top: 7px;
    border-top: 1px solid var(--border);
    color: #126c78;
    font-size: 17px;
    line-height: 1.15;
}
.station-popup-color {
    flex: 0 0 auto;
    width: 14px;
    height: 14px;
    border: 1px solid rgba(16,35,45,.38);
    border-radius: 3px;
    background: var(--station-color);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.3);
}
.station-analysis-popup .leaflet-popup-content { width: min(350px, calc(100vw - 76px)) !important; margin: 13px 15px 14px; }
.station-analysis-popup .leaflet-popup-content-wrapper { overflow: hidden; }
.station-popup { width: 100%; }
.station-chart-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 11px; }
.station-chart-heading strong { color: var(--ink); font-size: 12px; }
.station-chart-heading span { color: var(--muted); font-size: 9px; }
.station-series-status {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 50px;
    margin-top: 10px;
    padding: 9px;
    border: 1px solid rgba(16,35,45,.12);
    border-radius: 10px;
    color: var(--muted);
    background: rgba(255,255,255,.82);
    font-size: 10px;
}
.station-series-status .point-analysis-spinner { width: 20px; height: 20px; }
.station-series-error { align-items: flex-start; flex-direction: column; gap: 2px; }
.station-series-error strong { color: var(--ink); font-size: 11px; }

.point-analysis-popup .leaflet-popup-content { width: min(350px, calc(100vw - 76px)) !important; margin: 13px 15px 14px; }
.point-analysis-popup .leaflet-popup-content-wrapper { overflow: hidden; }
.leaflet-container .point-analysis-popup a.leaflet-popup-close-button,
.leaflet-container .station-analysis-popup a.leaflet-popup-close-button {
    top: 3px;
    right: 3px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 24px;
    line-height: 34px;
}
.point-analysis { width: 100%; color: var(--ink); }
.point-analysis-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-right: 30px; }
.point-analysis-heading strong { font-size: 15px; letter-spacing: -.01em; }
.point-analysis-heading span { color: var(--muted); font-size: 9px; white-space: nowrap; }
.point-analysis-meta {
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.35fr);
    gap: 12px;
    margin-top: 10px;
    padding: 9px 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(247,250,249,.82);
}
.point-analysis-meta div,
.point-nearest-station { display: flex; flex-direction: column; min-width: 0; }
.point-nearest-station {
    width: 100%;
    margin: -5px;
    padding: 5px;
    border: 0;
    border-radius: 7px;
    color: inherit;
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: color .15s ease, background-color .15s ease;
}
.point-nearest-station:hover { color: #126c78; background: rgba(18,108,120,.09); }
.point-nearest-station:focus-visible {
    outline: 2px solid #126c78;
    outline-offset: 1px;
    background: rgba(18,108,120,.09);
}
.point-nearest-station b { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.point-analysis-meta span { color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.point-analysis-meta b { margin-top: 3px; overflow: hidden; font-size: 11px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.point-analysis-meta small { margin-top: 2px; color: var(--muted); font-size: 9px; line-height: 1.2; }
.point-chart { margin-top: 9px; border: 1px solid rgba(16,35,45,.12); border-radius: 10px; overflow: hidden; background: rgba(255,255,255,.82); }
.point-chart svg { display: block; width: 100%; height: auto; }
.point-chart-background { stroke: rgba(16,35,45,.1); stroke-width: 1; }
.point-chart-grid { fill: none; stroke: rgba(16,35,45,.17); stroke-width: .75; stroke-dasharray: 2 3; }
.point-chart-axis, .point-chart-date, .point-chart-unit { fill: #60747c; font-family: inherit; font-size: 8px; }
.point-chart-unit { font-size: 7px; font-weight: 700; }
.point-chart-line-underlay { fill: none; stroke: rgba(255,255,255,.82); stroke-width: 4.4; stroke-linejoin: round; stroke-linecap: round; }
.point-chart-line { fill: none; stroke: #123b48; stroke-width: 2.25; stroke-linejoin: round; stroke-linecap: round; }
.point-chart circle { stroke: rgba(255,255,255,.95); stroke-width: .75; }
.point-chart-slider-marker {
    stroke: #0f6575;
    stroke-width: 1.15;
    stroke-dasharray: 3 3;
    opacity: .9;
    pointer-events: none;
    vector-effect: non-scaling-stroke;
}
.point-chart-slider-start { stroke: #8a4f18; }
.point-analysis-loading { display: flex; align-items: center; gap: 11px; min-height: 68px; }
.point-analysis-loading div, .point-analysis-error { display: flex; flex-direction: column; }
.point-analysis-loading strong, .point-analysis-error strong { font-size: 13px; }
.point-analysis-loading span:not(.point-analysis-spinner), .point-analysis-error span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.point-analysis-spinner { flex: 0 0 auto; width: 25px; height: 25px; border: 3px solid rgba(20,127,145,.18); border-top-color: #147f91; border-radius: 50%; animation: spin .8s linear infinite; }
.point-analysis-error { min-height: 55px; justify-content: center; }

.map-summary,
.map-options,
.control-panel,
.loading-state,
.error-state { z-index: 500; }

.map-logo {
    position: absolute;
    z-index: 450;
    bottom: 10px;
    left: 10px;
    width: clamp(130px, 14vw, 200px);
    height: auto;
    opacity: .96;
    filter: drop-shadow(0 1px 1px rgba(255,255,255,.9)) drop-shadow(0 5px 14px rgba(4,22,29,.28));
    pointer-events: none;
    user-select: none;
}

.map-summary {
    position: absolute;
    top: 24px;
    left: 24px;
    min-width: 260px;
    padding: 17px 19px;
    border: 1px solid rgba(255,255,255,.7);
    border-radius: 18px;
    background: var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

.eyebrow { color: #51717b; font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.summary-date-row { display: flex; align-items: center; gap: 8px; margin-top: 3px; }
.summary-date { min-width: 0; color: var(--ink); font-size: clamp(17px, 2vw, 22px); font-weight: 760; letter-spacing: -.035em; }
.summary-help {
    display: inline-grid;
    flex: 0 0 auto;
    place-items: center;
    width: 21px;
    height: 21px;
    padding: 0;
    border: 1.5px solid #55717b;
    border-radius: 50%;
    color: #395963;
    background: rgba(255,255,255,.65);
    cursor: pointer;
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    transition: color .15s ease, border-color .15s ease, background .15s ease, transform .15s ease;
}
.summary-help:hover { color: #fff; border-color: #147f91; background: #147f91; transform: scale(1.06); }
.summary-help:focus-visible { outline: 3px solid rgba(31,148,166,.3); outline-offset: 2px; }
.summary-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--border); }
.summary-metrics div { display: flex; flex-direction: column; min-width: 0; }
.summary-metrics strong { font-size: 17px; line-height: 1; }
.summary-metrics span { margin-top: 5px; color: var(--muted); font-size: 10px; white-space: nowrap; }

.map-options {
    position: absolute;
    top: 24px;
    right: 24px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
.location-control { position: relative; }
.location-button {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid rgba(255,255,255,.7);
    border-radius: 13px;
    color: #354d57;
    background: var(--panel);
    box-shadow: 0 8px 30px rgba(10,30,40,.15);
    cursor: pointer;
    transition: color .18s ease, background .18s ease, transform .18s ease;
}
.location-button:hover { color: #147f91; transform: translateY(-1px); }
.location-button:focus-visible { outline: 3px solid rgba(31,148,166,.25); outline-offset: 2px; }
.location-button:disabled { cursor: wait; opacity: .65; }
.location-button.is-locating svg { animation: location-pulse 1s ease-in-out infinite; }
.location-button.has-location { color: #fff; background: #1f94a6; }
.location-button svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; }
@keyframes location-pulse { 50% { opacity: .42; transform: scale(.86); } }
.location-feedback {
    position: absolute;
    z-index: 30;
    top: calc(100% + 9px);
    right: 0;
    width: max-content;
    max-width: min(260px, calc(100vw - 30px));
    padding: 8px 10px;
    border-radius: 9px;
    color: #fff;
    background: rgba(10,26,36,.96);
    box-shadow: 0 8px 24px rgba(4,22,29,.25);
    font-size: 10px;
    font-weight: 600;
    line-height: 1.35;
}
.location-feedback[hidden] { display: none; }
.map-toggle {
    position: relative;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 13px;
    border: 1px solid rgba(255,255,255,.7);
    border-radius: 13px;
    background: var(--panel);
    box-shadow: 0 8px 30px rgba(10,30,40,.15);
    color: #354d57;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
}
.map-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-track { position: relative; width: 31px; height: 18px; border-radius: 10px; background: #c7d2d5; transition: .2s ease; }
.toggle-track span { position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.2); transition: .2s ease; }
.map-toggle input:checked + .toggle-track { background: #1f94a6; }
.map-toggle input:checked + .toggle-track span { transform: translateX(13px); }
.map-toggle input:focus-visible + .toggle-track { outline: 3px solid rgba(31,148,166,.25); outline-offset: 2px; }
.map-toggle input:disabled + .toggle-track { opacity: .55; }
.toggle-label { position: relative; }
.cumulative-tooltip-trigger { border-bottom: 1px dotted #6f848d; outline: none; }
.cumulative-tooltip-trigger:focus-visible { border-radius: 3px; outline: 3px solid rgba(31,148,166,.22); outline-offset: 2px; }
.cumulative-help {
    position: absolute;
    top: calc(100% + 16px);
    right: -12px;
    width: 265px;
    padding: 10px 12px;
    border-radius: 10px;
    color: #fff;
    background: rgba(10, 26, 36, .97);
    box-shadow: 0 10px 28px rgba(4, 22, 29, .28);
    font-size: 10px;
    font-weight: 550;
    line-height: 1.45;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-4px);
    transition: opacity .16s ease, transform .16s ease, visibility .16s;
    visibility: hidden;
}
.cumulative-help::before {
    position: absolute;
    top: -5px;
    right: 26px;
    width: 10px;
    height: 10px;
    background: #0a1a24;
    content: "";
    transform: rotate(45deg);
}
.cumulative-tooltip-trigger:hover + .cumulative-help,
.cumulative-tooltip-trigger:focus-visible + .cumulative-help,
.cumulative-help.is-visible {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

.loading-state,
.error-state {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 1px solid rgba(255,255,255,.75);
    border-radius: 16px;
    background: rgba(10, 26, 36, .9);
    box-shadow: var(--shadow);
    color: #fff;
    backdrop-filter: blur(12px);
}
.loading-state { z-index: 900; display: flex; align-items: center; gap: 12px; padding: 14px 18px; font-size: 12px; font-weight: 650; pointer-events: none; }
.loading-state[hidden], .error-state[hidden] { display: none; }
.spinner { flex: 0 0 auto; width: 24px; height: 24px; border: 3px solid rgba(255,255,255,.28); border-top-color: #5ed5dd; border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-state { display: flex; flex-direction: column; align-items: center; min-width: min(350px, calc(100vw - 36px)); padding: 20px; text-align: center; }
.error-state span { margin: 5px 0 14px; color: #bbcad0; font-size: 12px; }
.error-state button { border: 0; border-radius: 9px; padding: 9px 13px; color: #fff; background: #258f9f; cursor: pointer; }

.control-panel {
    position: absolute;
    right: 60px;
    bottom: 10px;
    left: calc(clamp(130px, 14vw, 200px) + 20px);
    max-width: 1120px;
    margin-inline: auto;
    padding: 15px 20px 11px;
    border: 1px solid rgba(255,255,255,.8);
    border-radius: 20px;
    background: var(--panel);
    box-shadow: 0 20px 55px rgba(5, 24, 32, .22);
    backdrop-filter: blur(16px);
}

.control-row { display: flex; align-items: center; gap: 17px; }
.play-button { flex: 0 0 auto; display: grid; place-items: center; width: 43px; height: 43px; padding: 0; border: 0; border-radius: 50%; color: #fff; background: var(--night-soft); box-shadow: 0 6px 16px rgba(10,26,36,.2); cursor: pointer; transition: transform .15s ease, background .15s ease; }
.play-button:hover { transform: scale(1.04); background: #1c4b5b; }
.play-button:focus-visible { outline: 3px solid rgba(31,148,166,.3); outline-offset: 3px; }
.play-button svg { width: 19px; height: 19px; fill: currentColor; }
.play-button .icon-play { margin-left: 2px; }
.play-button .icon-pause, .play-button.is-playing .icon-play { display: none; }
.play-button.is-playing .icon-pause { display: block; }

.slider-wrap { flex: 1; min-width: 0; }
.slider-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.slider-heading label { color: #536871; font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.slider-heading output { font-size: 14px; font-weight: 780; letter-spacing: -.01em; white-space: nowrap; }
.slider-track-wrap {
    --selection-start: 0%;
    --selection-end: 100%;
    position: relative;
    height: 26px;
}
.slider-track-wrap::before,
.slider-track-wrap::after {
    position: absolute;
    top: 12.5px;
    right: 0;
    left: 0;
    height: 5px;
    border-radius: 4px;
    content: "";
    pointer-events: none;
}
.slider-track-wrap::before { background: #d4dfe1; }
.slider-track-wrap::after {
    right: auto;
    left: var(--selection-start);
    width: calc(var(--selection-end) - var(--selection-start));
    background: #278fa2;
}

.slider-tooltip {
    position: absolute;
    z-index: 20;
    bottom: 35px;
    left: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 186px;
    padding: 9px 12px 8px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 11px;
    color: #fff;
    background: rgba(10, 26, 36, .96);
    box-shadow: 0 9px 26px rgba(4, 22, 29, .28);
    pointer-events: none;
    transform: translateX(-50%);
    white-space: nowrap;
}
.slider-tooltip[hidden] { display: none; }
.slider-tooltip::after {
    position: absolute;
    bottom: -6px;
    left: 50%;
    width: 11px;
    height: 11px;
    background: #0a1a24;
    content: "";
    transform: translateX(-50%) rotate(45deg);
}
.slider-tooltip strong { position: relative; z-index: 1; font-size: 12px; line-height: 1.2; }
.slider-tooltip span { position: relative; z-index: 1; margin-top: 3px; color: #a9c2ca; font-size: 9px; font-weight: 650; }

#date-slider,
#start-date-slider {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 22px;
    margin: 4px 0 0;
    appearance: none;
    background: transparent;
    cursor: pointer;
    touch-action: pan-y;
}
#start-date-slider { position: absolute; inset: 0; z-index: 3; }
#start-date-slider[hidden] { display: none; }
#date-slider::-webkit-slider-runnable-track,
#start-date-slider::-webkit-slider-runnable-track { height: 5px; border-radius: 4px; background: transparent; }
#date-slider::-moz-range-track,
#start-date-slider::-moz-range-track { height: 5px; border-radius: 4px; background: transparent; }
#date-slider::-moz-range-progress,
#start-date-slider::-moz-range-progress { background: transparent; }
#date-slider::-webkit-slider-thumb,
#start-date-slider::-webkit-slider-thumb { width: 22px; height: 22px; margin-top: -8.5px; appearance: none; border: 4px solid #fff; border-radius: 50%; background: #17879a; box-shadow: 0 2px 9px rgba(13,93,106,.45); pointer-events: auto; }
#date-slider::-moz-range-thumb,
#start-date-slider::-moz-range-thumb { width: 14px; height: 14px; border: 4px solid #fff; border-radius: 50%; background: #17879a; box-shadow: 0 2px 9px rgba(13,93,106,.45); pointer-events: auto; }
#start-date-slider::-webkit-slider-thumb { background: #0e6272; }
#start-date-slider::-moz-range-thumb { background: #0e6272; }
.slider-track-wrap.is-cumulative input { pointer-events: none; }
#date-slider:focus-visible,
#start-date-slider:focus-visible { z-index: 4; outline: none; }
#date-slider:focus-visible::-webkit-slider-thumb,
#start-date-slider:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(23,135,154,.22), 0 2px 9px rgba(13,93,106,.45); }
#date-slider:disabled,
#start-date-slider:disabled { cursor: wait; opacity: .55; }
.range-labels { display: flex; justify-content: space-between; margin-top: -1px; color: #85949a; font-size: 9px; }

.legend { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: end; gap: 10px; margin-top: 9px; padding-top: 9px; border-top: 1px solid var(--border); }
.legend-title { display: flex; flex-direction: column; gap: 2px; color: #4d626b; font-size: 10px; font-weight: 800; white-space: nowrap; }
.legend-title small, .legend-high { color: #88969b; font-size: 8px; font-weight: 600; }
.legend-scale { display: grid; grid-template-columns: repeat(30, 1fr); height: 20px; min-width: 0; }
.legend-stop { position: relative; min-width: 0; border-top: 1px solid rgba(15,35,45,.35); border-bottom: 1px solid rgba(15,35,45,.35); border-left: 1px solid rgba(15,35,45,.35); }
.legend-stop:last-child { border-right: 1px solid rgba(15,35,45,.35); }
.legend-stop span { position: absolute; top: 21px; left: 50%; transform: translateX(-50%); color: #65777d; font-size: 7px; white-space: nowrap; }
@media (max-width: 700px) {
    .app-shell { grid-template-rows: 64px minmax(0, 1fr); }
    .topbar { padding: 0 15px; }
    .brand-mark { width: 36px; height: 36px; border-radius: 11px; }
    .brand-mark svg { width: 23px; }
    .brand h1 { font-size: 16px; }
    .brand p { font-size: 9px; }
    .topbar-meta > :not(#header-date) { display: none; }
    .topbar-meta { font-size: 10px; }
    .map-summary {
        top: 12px;
        right: auto;
        left: 12px;
        width: clamp(160px, calc(100vw - 160px), 220px);
        min-width: 0;
        padding: 12px 14px;
        border-radius: 15px;
    }
    .summary-date-row { gap: 6px; }
    .summary-date {
        overflow: hidden;
        font-size: clamp(12px, 3.5vw, 14px);
        line-height: 1.1;
        white-space: nowrap;
    }
    .summary-help { width: 19px; height: 19px; font-size: 12px; }
    .summary-metrics { gap: 7px; margin-top: 9px; padding-top: 9px; }
    .summary-metrics strong { font-size: 14px; }
    .point-analysis-popup .leaflet-popup-content,
    .station-analysis-popup .leaflet-popup-content { width: min(290px, calc(100vw - 64px)) !important; margin: 11px 12px 12px; }
    .point-analysis-heading { align-items: flex-start; flex-direction: column; gap: 1px; }
    .point-analysis-meta { grid-template-columns: 1fr; gap: 7px; padding: 8px 9px; }
    .point-analysis-meta b { white-space: normal; }
    .point-chart { margin-top: 7px; }
    .map-options { top: 12px; right: 12px; flex-direction: column; align-items: flex-end; }
    .map-toggle { gap: 7px; padding: 8px 9px; font-size: 11px; }
    .station-toggle-label { display: inline; }
    .map-logo {
        bottom: 10px;
        left: 10px;
        width: min(115px, 29vw);
    }
    .cumulative-help { right: -8px; width: min(265px, calc(100vw - 32px)); }
    .control-panel { right: 9px; bottom: max(42px, env(safe-area-inset-bottom)); left: 9px; padding: 12px 13px 9px; border-radius: 17px; }
    .control-row { gap: 12px; }
    .play-button { width: 40px; height: 40px; }
    .slider-heading output { font-size: 12px; }
    .slider-wrap.is-cumulative .slider-heading label { display: none; }
    .slider-wrap.is-cumulative .slider-heading output { width: 100%; font-size: 11px; text-align: right; }
    #date-slider, #start-date-slider { height: 28px; margin-top: 1px; }
    #date-slider::-webkit-slider-thumb,
    #start-date-slider::-webkit-slider-thumb { width: 25px; height: 25px; margin-top: -10px; }
    .slider-tooltip { bottom: 40px; min-width: 174px; padding: 8px 10px 7px; }
    .legend { gap: 7px; margin-top: 5px; padding-top: 7px; }
    .legend-scale { height: 20px; overflow: visible; align-items: start; }
    .legend-stop { height: 8px; }
    .legend-stop span { display: none; }
    .legend-stop:nth-child(1) span,
    .legend-stop:nth-child(5) span,
    .legend-stop:nth-child(10) span,
    .legend-stop:nth-child(14) span,
    .legend-stop:nth-child(17) span,
    .legend-stop:nth-child(24) span,
    .legend-stop:nth-child(30) span { display: block; top: 10px; font-size: 7px; }
    .legend-stop:nth-child(1) span { left: 0; transform: none; }
    .legend-stop:nth-child(30) span { right: 0; left: auto; transform: none; }
    .leaflet-control-attribution { max-width: 210px; overflow: hidden; white-space: nowrap; font-size: 8px; }
}

@media (max-width: 430px) {
    .map-summary { right: auto; min-width: 0; }
    .summary-metrics div:nth-child(1) { display: none; }
    .summary-metrics { grid-template-columns: repeat(2, 1fr); }
    .legend-title small, .legend-high { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
