/* Visual master: focused radar and model workspaces */
.map-product-shell {
    background:
        radial-gradient(circle at 76% -8%, color-mix(in srgb, var(--sky) 10%, transparent), transparent 32rem),
        linear-gradient(180deg, var(--page-deep), var(--page) 54rem, var(--page-deep));
}

.map-product-header {
    width: min(1480px, 100%);
    min-height: 72px;
    margin: 0 auto;
    padding: 10px clamp(12px, 2vw, 28px);
    grid-template-columns: 48px minmax(0, 1fr) 48px;
    gap: 12px;
    border-bottom-color: var(--line-soft);
    background: color-mix(in srgb, var(--page-deep) 86%, transparent);
    box-shadow: none;
}

.map-back {
    display: inline-grid;
    width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    place-items: center;
    border-color: var(--line-soft);
    border-radius: 50%;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
}

.map-product-nav {
    min-width: min(330px, 100%);
    justify-self: center;
    justify-content: stretch;
    padding: 4px;
    border-color: var(--line-soft);
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    box-shadow: inset 0 1px 0 color-mix(in srgb, var(--text-strong) 5%, transparent);
}

.map-product-nav a {
    min-width: 0;
    min-height: 40px;
    flex: 1;
    justify-content: center;
    font-size: .82rem;
}

.map-product-nav a[aria-current="page"] {
    background: var(--accent);
    box-shadow: 0 5px 18px color-mix(in srgb, var(--accent) 20%, transparent);
    color: var(--warning-badge-ink);
}

.map-product-header > .theme-toggle {
    grid-column: 3;
}

.map-workspace {
    width: min(1480px, 100%);
    padding: 18px clamp(12px, 2vw, 28px) calc(28px + env(safe-area-inset-bottom));
}

.map-toolbar {
    margin: 4px 0 18px;
    align-items: center;
    gap: 8px 20px;
}

.map-heading .eyebrow {
    color: var(--accent-ink);
}

.map-heading h1 {
    margin-top: 5px;
    font-size: clamp(1.9rem, 4vw, 3.25rem);
    font-weight: 790;
    letter-spacing: -.055em;
}

.map-heading > p:last-child {
    margin-top: 8px;
    color: var(--text-muted);
}

.map-toolbar-actions .map-action {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 14px;
    border-color: var(--line-soft);
    border-radius: var(--radius-control);
    background: color-mix(in srgb, var(--surface) 90%, transparent);
    color: var(--text-strong);
    box-shadow: none;
}

.map-toolbar .location-status {
    min-height: 1.2em;
    color: var(--text-faint);
    font-size: .7rem;
}

.map-layout-grid {
    grid-template-columns: minmax(0, 1fr) minmax(310px, 350px);
    gap: 16px;
}

.map-canvas-panel,
.map-inspector > section,
.map-details,
.model-selectors {
    border-color: var(--line-soft);
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    box-shadow: none;
}

.map-canvas-panel {
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .2);
}

.weather-map {
    min-height: clamp(520px, 65vh, 760px);
    border-bottom-color: var(--line-soft);
    background:
        radial-gradient(circle at 54% 45%, color-mix(in srgb, var(--sky) 10%, transparent), transparent 42%),
        var(--surface-soft);
}

html:not([data-theme="light"]) .weather-map .map-basemap,
html:not([data-theme="light"]) .radar-preview-map .map-basemap {
    filter: saturate(.72) brightness(.5) contrast(1.22) hue-rotate(5deg);
    opacity: .92;
}

html[data-theme="light"] .weather-map .map-basemap,
html[data-theme="light"] .radar-preview-map .map-basemap {
    filter: saturate(.58) brightness(.94) contrast(.92);
    opacity: .82;
}

.map-city-layer span {
    padding: 0;
    background: transparent;
    color: var(--text-strong);
    font-size: clamp(.59rem, .8vw, .7rem);
    font-weight: 760;
    text-shadow: 0 1px 3px var(--page-deep), 0 0 9px var(--page-deep);
}

.map-location-marker {
    width: 20px;
    height: 20px;
    border-width: 2px;
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 24%, transparent), 0 7px 20px rgba(0, 0, 0, .36);
}

.map-loader,
.map-error {
    border-radius: var(--radius-inner);
    background: color-mix(in srgb, var(--surface) 92%, transparent);
}

.map-zoom-controls {
    top: 16px;
    right: 16px;
    gap: 6px;
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
}

.map-zoom-controls button {
    display: grid;
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    place-items: center;
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    background: color-mix(in srgb, var(--surface) 90%, transparent);
    box-shadow: 0 7px 24px rgba(0, 0, 0, .16);
    backdrop-filter: blur(12px);
}

.map-zoom-controls button:last-child {
    border-bottom: 1px solid var(--line-soft);
}

.map-attribution {
    right: 9px;
    bottom: 7px;
    border: 1px solid var(--line-soft);
    background: color-mix(in srgb, var(--surface) 78%, transparent);
    backdrop-filter: blur(8px);
}

.radar-timeline {
    padding: 16px clamp(14px, 2vw, 22px) 18px;
    gap: 11px;
    background: color-mix(in srgb, var(--surface) 96%, transparent);
}

.radar-timeline input[type="range"] {
    accent-color: var(--accent);
}

.timeline-actions button,
.timeline-actions select {
    border-color: var(--line-soft);
    background: var(--surface-soft);
}

.timeline-actions button[data-frame-play] {
    background: var(--accent);
    color: var(--warning-badge-ink);
}

.map-inspector {
    gap: 12px;
}

.map-inspector > section,
.map-details {
    border-radius: var(--radius-inner);
}

.map-status-card,
.map-summary-card,
.map-legend-card,
.model-professional {
    padding: 18px;
}

.map-status-card {
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent-soft) 70%, var(--surface)), var(--surface));
}

.map-summary-card h2,
.map-legend-card h2,
.model-professional h2 {
    font-size: 1.22rem;
}

.map-facts {
    border-color: var(--line-soft);
    background: var(--line-soft);
}

.map-facts div {
    background: var(--surface-soft);
}

.model-selectors {
    margin-bottom: 16px;
    padding: 12px;
    grid-template-columns: minmax(160px, .7fr) minmax(230px, 1fr) auto auto;
    gap: 10px;
    border-radius: var(--radius-inner);
}

.model-selectors select {
    min-height: 46px;
    border-color: var(--line-soft);
    border-radius: 12px;
    background: var(--surface-soft);
}

.parameter-favorite[aria-pressed="true"] {
    border-color: var(--sun);
    background: var(--sun-soft);
    color: var(--sun);
}

.model-mode {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border-color: var(--line-soft);
    border-radius: 12px;
    background: var(--surface-soft);
    color: var(--text-strong);
}

@media (max-width: 1080px) {
    .map-layout-grid {
        grid-template-columns: 1fr;
    }

    .map-inspector {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .map-details,
    .model-professional {
        grid-column: 1 / -1;
    }
}

@media (max-width: 720px) {
    .map-product-header {
        min-height: 68px;
        padding: 10px 12px;
        grid-template-columns: 44px minmax(0, 1fr) 44px;
        gap: 8px;
    }

    .map-product-nav {
        min-width: 0;
        width: min(250px, 100%);
    }

    .map-product-nav a {
        min-height: 44px;
        padding: 0 8px;
        font-size: .76rem;
    }

    .map-workspace {
        padding: 14px 12px calc(24px + env(safe-area-inset-bottom));
    }

    .map-toolbar {
        margin-bottom: 14px;
    }

    .map-heading h1 {
        font-size: 2rem;
    }

    .map-heading > p:last-child {
        font-size: .76rem;
    }

    .map-toolbar-actions {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 100%;
    }

    .map-toolbar-actions .map-action {
        width: 100%;
        min-width: 0;
        padding: 0 8px;
        font-size: .7rem;
    }

    .map-toolbar .location-status {
        font-size: .64rem;
        line-height: 1.35;
    }

    .map-canvas-panel {
        border-radius: 18px;
    }

    .weather-map {
        min-height: clamp(400px, 57vh, 535px);
    }

    .map-zoom-controls {
        top: 12px;
        right: 12px;
        gap: 5px;
    }

    .map-inspector {
        grid-template-columns: 1fr;
    }

    .map-details,
    .model-professional {
        grid-column: 1;
    }

    .model-selectors {
        grid-template-columns: minmax(0, 1fr) auto;
        margin-bottom: 12px;
        padding: 10px;
    }

    .model-selectors label:first-child,
    .model-selectors label:nth-child(2) {
        grid-column: 1;
    }

    .model-selectors label:first-child {
        grid-row: 1;
    }

    .model-selectors label:nth-child(2) {
        grid-row: 2;
    }

    .model-mode {
        grid-column: 2;
        grid-row: 1;
        padding: 0 10px;
    }

    .parameter-favorite {
        grid-column: 2;
        grid-row: 2;
    }
}

@media (max-width: 431px) {
    .map-heading h1 {
        font-size: 2.45rem;
    }

    .map-toolbar-actions .map-action {
        min-height: 50px;
        gap: 5px;
        padding: 0 5px;
        font-size: .66rem;
    }

    .map-toolbar-actions .ui-icon {
        width: 16px;
        height: 16px;
    }

    .weather-map {
        min-height: 520px;
    }

    .timeline-actions label {
        width: 100%;
    }

    .model-selectors {
        grid-template-columns: minmax(88px, .68fr) minmax(128px, 1fr) 44px 44px;
        gap: 7px;
    }

    .model-selectors label:first-child {
        grid-column: 1;
        grid-row: 1;
    }

    .model-selectors label:nth-child(2) {
        grid-column: 2;
        grid-row: 1;
    }

    .model-mode {
        grid-column: 4;
        grid-row: 1;
        width: 44px;
        padding: 0;
    }

    .parameter-favorite {
        grid-column: 3;
        grid-row: 1;
    }

    .model-mode [data-model-mode-label] {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
    }
}

/* Radar + model premium completion: aspect-correct camera, layered map and compact product controls */
.map-workspace {
    --weather-opacity: .9;
}

.map-workspace .map-toolbar {
    grid-template-columns: minmax(0, 1fr);
    margin-bottom: 12px;
}

.map-workspace .map-heading h1 {
    font-size: clamp(1.85rem, 3.2vw, 2.75rem);
}

.map-workspace .map-toolbar .location-status {
    max-width: 58rem;
}

.weather-map {
    min-height: clamp(540px, 66vh, 760px);
    cursor: grab;
    touch-action: none;
    overscroll-behavior: contain;
}

.weather-map[data-dragging="true"] {
    cursor: grabbing;
}

.weather-map[data-zoomed="true"] {
    cursor: grab;
}

.map-transform-layer {
    inset: auto;
    transform-origin: 50% 50%;
    transition: none;
    contain: layout paint;
}

.map-transform-layer.is-camera-animated {
    transition:
        left 180ms cubic-bezier(.2, .75, .25, 1),
        top 180ms cubic-bezier(.2, .75, .25, 1),
        width 180ms cubic-bezier(.2, .75, .25, 1),
        height 180ms cubic-bezier(.2, .75, .25, 1);
}

.map-relief,
.map-basemap,
.map-context-layer,
.map-weather-layer,
.map-city-layer {
    position: absolute;
}

.map-relief,
.map-basemap,
.map-context-layer {
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: fill;
    user-select: none;
    pointer-events: none;
}

.map-relief {
    z-index: 0;
    opacity: .74;
}

.map-basemap {
    z-index: 1;
    opacity: .9;
}

.map-context-layer {
    z-index: 5;
    opacity: .74;
}

.map-weather-layer {
    z-index: 3;
    opacity: var(--weather-opacity);
}

.model-weather-layer {
    opacity: var(--weather-opacity);
}

html:not([data-theme="light"]) .weather-map .map-basemap,
html[data-theme="light"] .weather-map .map-basemap,
html:not([data-theme="light"]) .weather-map .map-context-layer,
html[data-theme="light"] .weather-map .map-context-layer {
    filter: none;
}

html[data-theme="light"] .map-relief {
    filter: brightness(1.26) saturate(.65);
    opacity: .66;
}

.map-layer-weather-hidden .map-weather-layer,
.map-layer-context-hidden .map-context-layer,
.map-layer-labels-hidden .map-city-layer,
.map-layer-labels-hidden .map-location-label {
    opacity: 0 !important;
}

.map-city-layer {
    z-index: 6;
}

.map-city-layer span,
.map-location-label {
    display: block;
    transform: translate(-50%, -50%) scale(var(--map-inverse-scale, 1));
    transform-origin: 50% 50%;
    white-space: nowrap;
}

.map-city-layer span::before {
    display: inline-block;
    width: 3px;
    height: 3px;
    margin: 0 4px 2px 0;
    border-radius: 50%;
    background: currentColor;
    content: "";
    opacity: .72;
}

.map-city-layer span.is-colliding {
    visibility: hidden;
}

.weather-map[data-zoom-tier="overview"] .map-city-layer span[data-rank="2"],
.weather-map[data-zoom-tier="overview"] .map-city-layer span[data-rank="3"],
.weather-map[data-zoom-tier="region"] .map-city-layer span[data-rank="3"] {
    display: none;
}

.map-location-marker,
.model-map-probe {
    transform: translate(-50%, -50%) scale(var(--map-inverse-scale, 1));
    transform-origin: 50% 50%;
}

.map-location-label {
    position: absolute;
    z-index: 9;
    max-width: 190px;
    margin-top: calc(-24px * var(--map-inverse-scale, 1));
    padding: 5px 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 999px;
    background: rgba(5, 21, 28, .82);
    box-shadow: 0 5px 18px rgba(0, 0, 0, .24);
    color: #f6fffc;
    font-size: .66rem;
    font-weight: 780;
    text-overflow: ellipsis;
    pointer-events: none;
    backdrop-filter: blur(9px);
}

.map-stage-actions {
    position: absolute;
    z-index: 34;
    top: 14px;
    right: 68px;
    display: flex;
    gap: 7px;
}

.map-stage-actions button,
.map-floating-heading button {
    display: grid;
    width: 44px;
    height: 44px;
    padding: 0;
    place-items: center;
    border: 1px solid rgba(223, 246, 240, .16);
    border-radius: 12px;
    background: rgba(6, 23, 31, .79);
    box-shadow: 0 8px 22px rgba(0, 0, 0, .18);
    color: #eefbf7;
    cursor: pointer;
    backdrop-filter: blur(12px);
}

.map-view-badge {
    position: absolute;
    z-index: 31;
    top: 14px;
    left: 14px;
    display: grid;
    padding: 8px 11px;
    gap: 1px;
    border: 1px solid rgba(223, 246, 240, .15);
    border-radius: 11px;
    background: rgba(6, 23, 31, .76);
    color: #effbf8;
    font-size: .68rem;
    line-height: 1.25;
    pointer-events: none;
    backdrop-filter: blur(12px);
}

.map-view-badge strong {
    font-size: .74rem;
}

.map-view-badge span {
    color: rgba(235, 250, 246, .68);
}

.map-zoom-controls {
    top: 68px;
    right: 14px;
    gap: 6px;
}

.map-zoom-controls button:disabled {
    cursor: not-allowed;
    opacity: .42;
}

.map-layer-panel {
    position: absolute;
    z-index: 42;
    top: 14px;
    right: 68px;
    display: grid;
    width: min(286px, calc(100% - 92px));
    padding: 13px;
    gap: 9px;
    border: 1px solid rgba(223, 246, 240, .17);
    border-radius: 15px;
    background: rgba(5, 21, 29, .94);
    box-shadow: 0 18px 50px rgba(0, 0, 0, .32);
    color: #eefbf7;
    font-size: .74rem;
    backdrop-filter: blur(18px);
}

.map-layer-panel[hidden] {
    display: none;
}

.map-layer-panel > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.map-layer-panel > div button {
    min-height: 44px;
    padding: 5px 8px;
    border: 1px solid rgba(223, 246, 240, .16);
    border-radius: 999px;
    background: transparent;
    color: #9ee9d8;
    cursor: pointer;
    font-size: .64rem;
    font-weight: 750;
}

.map-layer-panel > label:not(.map-opacity) {
    display: flex;
    min-height: 44px;
    align-items: center;
    gap: 9px;
}

.map-layer-panel input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

.map-layer-panel .map-opacity {
    display: grid;
    padding-top: 7px;
    gap: 4px;
    border-top: 1px solid rgba(223, 246, 240, .12);
    color: rgba(235, 250, 246, .72);
    font-size: .66rem;
}

.map-opacity input {
    width: 100%;
    accent-color: var(--accent);
}

.map-layer-panel .map-location-action {
    min-height: 44px;
    justify-content: center;
    gap: 7px;
    border-color: rgba(223, 246, 240, .15);
    background: rgba(255, 255, 255, .06);
    color: #f3fcfa;
    font-size: .7rem;
}

.map-floating-legend {
    position: absolute;
    z-index: 32;
    bottom: 37px;
    left: 14px;
    width: min(365px, calc(100% - 100px));
    padding: 10px 11px;
    border: 1px solid rgba(223, 246, 240, .15);
    border-radius: 13px;
    background: rgba(5, 21, 29, .82);
    box-shadow: 0 10px 34px rgba(0, 0, 0, .22);
    color: #eefbf7;
    backdrop-filter: blur(15px);
}

.map-floating-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.map-floating-heading > span {
    display: flex;
    min-width: 0;
    align-items: baseline;
    gap: 7px;
}

.map-floating-heading strong {
    overflow: hidden;
    font-size: .7rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.map-floating-heading small {
    flex: 0 0 auto;
    color: rgba(235, 250, 246, .65);
    font-size: .6rem;
}

.map-floating-heading button {
    width: 44px;
    height: 44px;
    border-radius: 9px;
    box-shadow: none;
}

.map-floating-legend .radar-legend {
    display: flex;
    margin-top: 8px;
    gap: 7px;
    overflow-x: auto;
    scrollbar-width: none;
}

.map-floating-legend .radar-legend span {
    flex: 0 0 auto;
    font-size: .58rem;
    white-space: nowrap;
}

.radar-legend-scale {
    display: grid;
    width: 100%;
    gap: 4px;
}

.radar-legend-scale > i {
    display: block;
    width: 100%;
    height: 12px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 999px;
}

.radar-legend-scale > div {
    display: flex;
    justify-content: space-between;
    gap: 5px;
}

.radar-legend-scale span {
    min-width: 0;
    overflow: hidden;
    color: rgba(239, 251, 248, .68);
    font-size: .51rem !important;
    text-overflow: ellipsis;
}

.map-scale-bar {
    --scale-width: 70px;
    position: absolute;
    z-index: 30;
    right: 14px;
    bottom: 34px;
    width: var(--scale-width);
    padding-top: 4px;
    border-top: 2px solid rgba(244, 255, 252, .86);
    color: rgba(244, 255, 252, .86);
    font-size: .58rem;
    font-weight: 750;
    text-align: center;
    text-shadow: 0 1px 3px #061820;
    pointer-events: none;
}

.map-attribution {
    min-height: 20px;
    padding: 4px 7px;
    font-size: .64rem;
}

.timeline-ticks {
    position: relative;
    height: 18px;
    margin: 0 5px -8px;
    color: var(--text-faint);
    font-size: .58rem;
    pointer-events: none;
}

.timeline-ticks span {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    white-space: nowrap;
}

.timeline-ticks span:first-child {
    transform: none;
}

.timeline-ticks span:last-child {
    transform: translateX(-100%);
}

.timeline-ticks span.is-now {
    color: var(--accent-ink);
    font-weight: 850;
}

.timeline-ticks span.is-nowcast {
    color: color-mix(in srgb, #8bd3ff 78%, var(--text-muted));
}

.timeline-ticks span.is-run {
    color: color-mix(in srgb, var(--caution) 72%, var(--text-strong));
    font-weight: 780;
}

.radar-timeline {
    position: relative;
}

.radar-workspace .radar-timeline input[type="range"] {
    --timeline-now: 50%;
    height: 44px;
    margin: -8px 0 0;
    appearance: none;
    background: transparent;
}

.radar-workspace .radar-timeline input[type="range"]::-webkit-slider-runnable-track {
    height: 7px;
    border: 1px solid color-mix(in srgb, var(--line) 76%, transparent);
    border-radius: 999px;
    background:
        linear-gradient(90deg,
            color-mix(in srgb, var(--accent) 68%, var(--surface-soft)) 0 var(--timeline-now),
            color-mix(in srgb, #66b9e8 72%, var(--surface-soft)) var(--timeline-now) 100%);
}

.radar-workspace .radar-timeline input[type="range"]::-webkit-slider-thumb {
    width: 20px;
    height: 20px;
    margin-top: -7px;
    appearance: none;
    border: 3px solid var(--surface);
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 1px var(--accent), 0 4px 10px rgba(0, 0, 0, .22);
}

.radar-workspace .radar-timeline input[type="range"]::-moz-range-track {
    height: 7px;
    border: 1px solid color-mix(in srgb, var(--line) 76%, transparent);
    border-radius: 999px;
    background:
        linear-gradient(90deg,
            color-mix(in srgb, var(--accent) 68%, var(--surface-soft)) 0 var(--timeline-now),
            color-mix(in srgb, #66b9e8 72%, var(--surface-soft)) var(--timeline-now) 100%);
}

.radar-workspace .radar-timeline input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border: 3px solid var(--surface);
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 1px var(--accent), 0 4px 10px rgba(0, 0, 0, .22);
}

.radar-workspace .timeline-selected {
    --timeline-selected: 50%;
    position: relative;
    z-index: 2;
    left: clamp(42px, var(--timeline-selected), calc(100% - 42px));
    width: max-content;
    max-width: 90px;
    margin: -7px 0 -7px;
    padding: 4px 7px;
    transform: translateX(-50%);
    border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line));
    border-radius: 999px;
    background: var(--surface-strong);
    color: var(--text-strong);
    font-size: .61rem;
    font-weight: 820;
    pointer-events: none;
}

.map-timeline-note {
    min-height: 0;
    padding: 10px clamp(14px, 2vw, 22px) 12px;
    border-top: 1px solid var(--line-soft);
    background: color-mix(in srgb, var(--surface-soft) 68%, var(--surface));
    color: var(--text-muted);
    line-height: 1.45;
    text-align: left;
}

.timeline-mode {
    padding: 7px 10px;
    border: 1px solid var(--line-soft);
    border-radius: 999px;
    color: var(--text-muted);
    font-size: .66rem;
    font-weight: 720;
}

.timeline-mode[data-state="available"],
.timeline-mode[data-state="fresh"] {
    border-color: color-mix(in srgb, #66b9e8 46%, var(--line));
    color: color-mix(in srgb, #a8dcf5 80%, var(--text-strong));
}

.timeline-mode[data-state="delayed"],
.timeline-mode[data-state="stale"] {
    border-color: color-mix(in srgb, var(--caution) 48%, var(--line));
    color: color-mix(in srgb, var(--caution) 72%, var(--text-strong));
}

.map-inline-summary {
    display: grid;
    padding: 14px clamp(14px, 2vw, 22px) 16px;
    grid-template-columns: minmax(190px, .45fr) minmax(0, 1fr);
    align-items: center;
    gap: 14px 20px;
    border-top: 1px solid var(--line-soft);
    background: linear-gradient(120deg, color-mix(in srgb, var(--accent-soft) 28%, var(--surface)), var(--surface));
}

.map-inline-summary > div {
    display: flex;
    align-items: center;
    gap: 10px;
}

.map-inline-summary > div p {
    display: grid;
    margin: 0;
    gap: 2px;
}

.map-inline-summary strong {
    color: var(--text-strong);
    font-size: .94rem;
}

.map-inline-summary small {
    color: var(--accent-ink);
    font-size: .72rem;
    font-weight: 760;
}

.map-inline-summary > p {
    margin: 0;
    color: var(--text-muted);
    font-size: .76rem;
    line-height: 1.45;
}

.map-data-card h2 {
    margin-bottom: 12px;
}

/* Decision-first radar: the local answer and common time jumps precede the map. */
.radar-workspace .map-canvas-panel {
    overflow: hidden;
    border-radius: 26px;
    background:
        linear-gradient(145deg, color-mix(in srgb, var(--accent-soft) 18%, var(--surface)), var(--surface));
    box-shadow: 0 24px 72px rgba(0, 0, 0, .24);
}

.radar-quicklook {
    border-top: 0;
    border-bottom: 1px solid var(--line-soft);
    background:
        radial-gradient(circle at 8% 20%, color-mix(in srgb, var(--accent) 13%, transparent), transparent 38%),
        linear-gradient(120deg, color-mix(in srgb, var(--accent-soft) 48%, var(--surface)), var(--surface));
}

.radar-quicklook > div {
    min-width: 0;
}

.radar-quicklook strong {
    font-size: clamp(1rem, 1.8vw, 1.24rem);
}

.radar-quicklook small {
    display: inline-flex;
    width: max-content;
    margin-top: 3px;
    padding: 3px 8px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent-soft) 72%, transparent);
}

.radar-shortcuts {
    display: grid;
    padding: 10px clamp(12px, 2vw, 18px);
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
    border-bottom: 1px solid var(--line-soft);
    background: color-mix(in srgb, var(--surface) 97%, transparent);
}

.radar-shortcuts button {
    display: grid;
    min-width: 0;
    min-height: 52px;
    padding: 7px 10px;
    gap: 2px;
    border: 1px solid var(--line-soft);
    border-radius: 13px;
    background: var(--surface-soft);
    color: var(--text-muted);
    cursor: pointer;
    text-align: left;
}

.radar-shortcuts button span {
    font-size: .62rem;
    font-weight: 760;
    letter-spacing: .035em;
}

.radar-shortcuts button strong {
    overflow: hidden;
    color: var(--text-strong);
    font-size: .78rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.radar-shortcuts button[aria-pressed="true"] {
    border-color: color-mix(in srgb, var(--accent) 72%, var(--line));
    background: linear-gradient(135deg, var(--accent-soft), color-mix(in srgb, var(--accent) 22%, var(--surface)));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent);
    color: var(--accent-ink);
}

.radar-shortcuts button[data-radar-jump]:not([data-radar-jump="observation"])[aria-pressed="true"] {
    border-color: color-mix(in srgb, #66b9e8 72%, var(--line));
    background: linear-gradient(135deg, color-mix(in srgb, #66b9e8 24%, var(--surface)), var(--surface-soft));
    color: color-mix(in srgb, #8fd7ff 78%, var(--text-strong));
}

.radar-shortcuts button:disabled {
    cursor: not-allowed;
    opacity: .45;
}

.radar-workspace .weather-map {
    min-height: clamp(620px, 70vh, 840px);
    isolation: isolate;
    border-bottom: 1px solid var(--line-soft);
    background: #071820;
    box-shadow: inset 0 0 0 1px rgba(225, 248, 242, .06);
}

.radar-workspace .map-relief {
    opacity: .9;
}

.radar-workspace .map-basemap,
.radar-workspace .map-context-layer {
    opacity: .96;
}

.radar-workspace .map-weather-layer {
    image-rendering: auto;
    filter: none;
    backface-visibility: hidden;
}

.radar-workspace .weather-map[data-frame-kind="nowcast"] {
    box-shadow: inset 0 0 0 2px color-mix(in srgb, #66b9e8 38%, transparent);
}

.radar-timeline-key {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    color: var(--text-muted);
    font-size: .64rem;
    font-weight: 720;
}

.radar-timeline-key span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.radar-timeline-key i {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}

.radar-timeline-key .is-nowcast i {
    background: #66b9e8;
    box-shadow: 0 0 0 3px color-mix(in srgb, #66b9e8 16%, transparent);
}

.map-canvas-panel:fullscreen {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    overflow-y: auto;
    border: 0;
    border-radius: 0;
    background: var(--page-deep);
}

.map-canvas-panel:fullscreen > * { flex-shrink: 0; }

.map-canvas-panel:fullscreen .weather-map {
    flex: 1 0 260px;
    min-height: 260px;
    height: auto;
}

.model-selectors {
    display: grid;
    padding: 9px;
    grid-template-columns: minmax(170px, .25fr) minmax(0, 1fr) 46px auto;
    align-items: stretch;
    gap: 8px;
}

.model-identity {
    display: flex;
    min-width: 0;
    min-height: 52px;
    padding: 7px 10px;
    align-items: center;
    gap: 9px;
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    background: var(--surface-soft);
}

.model-provider {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 9px;
    background: var(--accent-soft);
    color: var(--accent-ink);
    font-size: .58rem;
    font-weight: 850;
    letter-spacing: .06em;
}

.model-identity > span:nth-child(2) {
    display: grid;
    min-width: 0;
    gap: 1px;
}

.model-identity strong {
    color: var(--text-strong);
    font-size: .78rem;
    white-space: nowrap;
}

.model-identity small {
    overflow: hidden;
    color: var(--text-muted);
    font-size: .58rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.model-parameter-select {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.model-parameter-rail {
    display: flex;
    min-width: 0;
    gap: 7px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
}

.model-parameter-rail::-webkit-scrollbar {
    display: none;
}

.model-parameter-rail button {
    display: grid;
    min-width: 134px;
    min-height: 52px;
    padding: 7px 10px;
    grid-template-columns: 29px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    background: var(--surface-soft);
    color: var(--text);
    cursor: pointer;
    scroll-snap-align: start;
    text-align: left;
}

.model-parameter-rail button > i {
    display: block;
    width: 28px;
    height: 28px;
    border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
    border-radius: 9px;
    background: radial-gradient(circle, color-mix(in srgb, var(--accent) 64%, transparent) 0 26%, transparent 28%), var(--surface);
}

.model-parameter-rail button[data-parameter-kind="precipitation"] > i {
    background: linear-gradient(135deg, #79d6dc, #3d73c9 55%, #7352c8);
}

.model-parameter-rail button[data-parameter-kind="wind"] > i {
    background: repeating-linear-gradient(165deg, transparent 0 5px, #8bd4c7 6px 8px), var(--surface);
}

.model-parameter-rail button[data-parameter-kind="cape"] > i {
    background: conic-gradient(from 210deg, #e6cf5c, #ef8343, #a53688, #e6cf5c);
}

.model-parameter-rail button[data-parameter-kind="weather"] > i {
    background: linear-gradient(135deg, #b8d5db, #6587ba 48%, #9c55a7);
}

.model-parameter-rail button > span {
    display: grid;
    min-width: 0;
    gap: 1px;
}

.model-parameter-rail strong {
    overflow: hidden;
    color: var(--text-strong);
    font-size: .7rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.model-parameter-rail small {
    overflow: hidden;
    color: var(--text-muted);
    font-size: .55rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.model-parameter-rail button.is-active {
    border-color: color-mix(in srgb, var(--accent) 72%, var(--line));
    background: var(--accent-soft);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent);
}

.model-parameter-rail button.is-favorite::after {
    position: absolute;
    content: "";
}

.model-selectors .parameter-favorite,
.model-selectors .model-mode {
    min-height: 52px;
    align-self: stretch;
}

.model-floating-legend {
    width: min(390px, calc(100% - 100px));
}

.model-legend-gradient {
    display: grid;
    margin-top: 8px;
    gap: 4px;
}

.model-legend-gradient > i {
    display: block;
    height: 13px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 999px;
}

.model-legend-gradient > div {
    position: relative;
    height: 19px;
}

.model-legend-gradient span {
    position: absolute;
    transform: translateX(-50%);
    color: rgba(239, 251, 248, .7);
    font-size: .52rem;
    white-space: nowrap;
}

.model-legend-gradient span[data-edge="start"] {
    transform: none;
}

.model-legend-gradient span[data-edge="end"] {
    transform: translateX(-100%);
}

.model-legend-gradient span.is-colliding {
    display: none;
}

.model-legend-categories {
    display: grid;
    max-height: 120px;
    margin-top: 8px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px 9px;
    overflow: auto;
}

.model-legend-categories span {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 5px;
}

.model-legend-categories i {
    width: 12px;
    height: 12px;
    flex: 0 0 auto;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 4px;
}

.model-legend-categories small {
    overflow: hidden;
    font-size: .55rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 1080px) {
    .model-selectors {
        grid-template-columns: minmax(160px, .28fr) minmax(0, 1fr) 46px 52px;
    }
}

@media (max-width: 720px) {
    .map-workspace {
        padding-top: 10px;
    }

    .map-workspace .map-toolbar {
        margin: 0 0 9px;
        gap: 4px;
    }

    .map-workspace .map-heading h1 {
        margin-top: 2px;
        font-size: 2rem;
    }

    .map-workspace .map-heading > p:last-child {
        margin-top: 4px;
    }

    .map-workspace .map-toolbar .location-status {
        font-size: .6rem;
    }

    .weather-map {
        min-height: clamp(420px, 52dvh, 500px);
    }

    .radar-workspace .map-canvas-panel {
        border-radius: 20px;
    }

    .radar-quicklook {
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
    }

    .radar-shortcuts {
        padding: 8px;
        gap: 5px;
    }

    .radar-shortcuts button {
        min-height: 50px;
        padding: 6px;
        text-align: center;
    }

    .radar-shortcuts button span {
        font-size: .56rem;
    }

    .radar-shortcuts button strong {
        font-size: .68rem;
    }

    .radar-workspace .weather-map {
        min-height: clamp(500px, 61dvh, 590px);
    }

    .map-view-badge {
        top: 11px;
        left: 11px;
        padding: 7px 9px;
    }

    .map-stage-actions {
        top: 11px;
        right: 62px;
        gap: 5px;
    }

    .map-stage-actions button {
        width: 44px;
        height: 44px;
    }

    .map-zoom-controls {
        top: 61px;
        right: 11px;
    }

    .map-zoom-controls button {
        width: 44px;
        min-width: 44px;
        height: 44px;
        min-height: 44px;
    }

    .map-layer-panel {
        top: 11px;
        right: 61px;
    }

    .map-floating-legend {
        bottom: 34px;
        left: 11px;
        width: min(330px, calc(100% - 72px));
    }

    .map-scale-bar {
        right: 11px;
    }

    .radar-timeline {
        padding: 12px 12px 14px;
        gap: 8px;
    }

    .radar-timeline-key {
        justify-content: space-between;
        gap: 6px;
    }

    .timeline-actions {
        gap: 6px;
    }

    .timeline-actions button,
    .timeline-actions select {
        min-height: 44px;
        padding: 0 10px;
    }

    .timeline-mode {
        order: 5;
    }

    .map-inline-summary {
        padding: 12px;
        grid-template-columns: 1fr;
        gap: 7px;
    }

    .model-selectors {
        grid-template-columns: 104px minmax(0, 1fr) 44px 44px;
        padding: 8px;
    }

    .model-identity {
        grid-column: 1;
        grid-row: 1;
        min-height: 46px;
        padding: 6px 8px;
    }

    .model-identity small {
        display: none;
    }

    .model-provider {
        width: 28px;
        height: 28px;
        font-size: .5rem;
    }

    .model-selectors .parameter-favorite {
        grid-column: 3;
        grid-row: 1;
        min-height: 46px;
    }

    .model-selectors .model-mode {
        grid-column: 4;
        grid-row: 1;
        min-height: 46px;
        padding: 0;
    }

    .model-selectors .model-mode [data-model-mode-label] {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
    }

    .model-parameter-rail {
        grid-column: 2;
        grid-row: 1;
    }

    .model-parameter-rail button {
        min-width: 118px;
        min-height: 46px;
        padding: 6px 8px;
    }
}

@media (max-width: 350px) {
    .map-workspace {
        padding-right: 8px;
        padding-left: 8px;
    }

    .map-product-header {
        padding-right: 8px;
        padding-left: 8px;
        grid-template-columns: 40px minmax(0, 1fr) 40px;
    }

    .map-product-nav a {
        padding: 0 5px;
        font-size: .7rem;
    }

    .map-view-badge span {
        display: none;
    }

    .map-stage-actions button:first-child {
        display: grid;
    }

    .map-floating-legend {
        width: calc(100% - 67px);
        padding: 8px;
    }

    .map-floating-legend .radar-legend span {
        font-size: .53rem;
    }

    .model-selectors {
        grid-template-columns: 88px minmax(0, 1fr) 40px 40px;
        gap: 6px;
    }

    .model-identity {
        padding: 6px 8px;
    }

    .model-provider {
        width: 30px;
        height: 30px;
    }

    .model-parameter-rail button {
        min-width: 108px;
        padding: 6px 8px;
    }

    .timeline-actions label {
        min-width: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .map-transform-layer.is-camera-animated {
        transition: none;
    }
}

/* Map exploration: direct views, readable controls and a visible local answer. */
.map-view-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 4px 12px;
    padding: 6px 12px;
    border-bottom: 1px solid var(--line-soft);
    background: var(--surface);
}
.map-view-controls > div { display: flex; gap: 3px; }
.map-view-controls button, .map-place-search {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 44px;
    padding: 0 12px;
    border: 0;
    border-radius: 10px;
    color: var(--text-muted);
    background: transparent;
    font: inherit;
    font-size: .8rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
}
.map-view-controls button[aria-pressed="true"] {
    color: var(--accent-ink);
    background: var(--accent-soft);
}
.model-quicklook {
    border-top: 0;
    background: linear-gradient(110deg, var(--accent-soft), var(--surface));
}
.model-quicklook strong { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.model-time-shortcuts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.model-time-shortcuts button {
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-soft);
    color: var(--text-strong);
    font: inherit;
    font-size: .8rem;
    font-weight: 700;
    cursor: pointer;
}
.model-time-shortcuts button[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); }
.model-time-shortcuts button:disabled { opacity: .45; cursor: not-allowed; }
.model-time-picker { display: flex; align-items: center; gap: 12px; color: var(--text-muted); font-size: .8rem; }
.model-time-picker select { min-width: 0; min-height: 44px; flex: 1; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text-strong); padding: 0 10px; font: inherit; }
.model-parameter-select { display: none; }
.model-parameter-rail { scrollbar-width: thin; }
.map-product-shell button:focus-visible, .map-product-shell a:focus-visible, .map-product-shell select:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
}
@media (max-width: 720px) {
    .model-selectors { grid-template-columns: minmax(0, 1fr) 44px auto; gap: 8px; }
    .model-identity { grid-column: 1; grid-row: 1; }
    .model-identity small { display: block; }
    .model-selectors .parameter-favorite { grid-column: 2; grid-row: 1; }
    .model-selectors .model-mode { grid-column: 3; grid-row: 1; width: auto; padding: 0 10px; }
    .model-selectors .model-mode [data-model-mode-label] { position: static; width: auto; height: auto; clip: auto; flex-shrink: 0; font-size: .7rem; }
    .model-parameter-rail { grid-column: 1 / -1; grid-row: 2; padding-bottom: 4px; }
    .model-parameter-rail button { min-width: 122px; min-height: 52px; }
    .map-view-controls { padding: 4px 8px; }
    .map-view-controls button, .map-place-search { padding: 0 9px; font-size: .74rem; }
    .radar-workspace .weather-map, .model-workspace .weather-map { min-height: clamp(350px, 48dvh, 480px); }
    .map-canvas-panel:fullscreen .weather-map { min-height: 240px; }
    .map-view-badge { max-width: calc(100% - 165px); }
    .map-view-badge strong, .map-view-badge span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .model-time-heading { flex-wrap: wrap; }
}
@media (max-width: 380px) {
    .map-place-search { width: 100%; border-top: 1px solid var(--line-soft); border-radius: 0; }
    .map-view-controls > div { flex: 1; justify-content: space-between; }
    .model-identity small { font-size: .56rem; }
    .model-selectors .model-mode { padding: 0 6px; }
}

/* Readable map controls in both themes; data stays foregrounded on phones. */
.map-workspace .map-facts dt,
.map-workspace .map-timeline-note,
.map-workspace .model-identity small,
.map-workspace .model-parameter-rail small,
.map-workspace .radar-shortcuts button span { color: var(--text-muted); }
.map-workspace .radar-shortcuts button[aria-pressed="true"] span { color: var(--accent-ink); }
.map-workspace .radar-shortcuts button[data-radar-jump]:not([data-radar-jump="observation"])[aria-pressed="true"] span { color: var(--text-strong); }
.map-workspace .map-toolbar .location-status { font-size: .8125rem; line-height: 1.5; }
.map-workspace .map-facts dt, .map-workspace .map-facts dd { font-size: .875rem; }
.map-workspace .model-identity small, .map-workspace .model-parameter-rail small { font-size: .75rem; }
.radar-quicklook { padding: 24px; border-bottom: 0; background: linear-gradient(115deg, var(--accent-soft), var(--surface)); }
.radar-quicklook strong { font-size: 1.65rem; letter-spacing: -.03em; }
.radar-quicklook > p { font-size: .9375rem; line-height: 1.55; }
.radar-shortcuts button { border-radius: 14px; min-height: 56px; }
.radar-shortcuts button span { font-size: .75rem; }
.radar-shortcuts button strong { font-size: .9375rem; }
.radar-workspace .map-floating-legend { right: 72px; left: 16px; width: auto; max-width: 440px; }
.radar-workspace .map-floating-heading strong { font-size: .875rem; }
.radar-workspace .radar-legend-scale span { font-size: .75rem !important; color: #e8f5f1; white-space: normal; }
.radar-workspace .radar-legend-scale > div { gap: 8px; }
.timeline-actions button { min-height: 44px; min-width: 44px; }
@media (max-width: 600px) {
    .radar-quicklook { padding: 20px; }
    .radar-workspace .weather-map { min-height: clamp(390px, 53dvh, 540px); }
    .radar-shortcuts { gap: 6px; }
    .radar-shortcuts button strong { font-size: .875rem; }
    .radar-workspace .map-floating-legend { left: 10px; right: 62px; padding: 8px 12px; }
    .radar-workspace .radar-legend-scale span { font-size: .75rem !important; }
}
@media (orientation: landscape) and (max-height: 500px) {
    .radar-workspace .weather-map { min-height: 65dvh; }
}

.map-workspace .map-facts dt { color: var(--text); }
@media (min-width: 721px) and (max-width: 1080px) {
    .map-inspector { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .model-selectors { grid-template-columns: minmax(0, 1fr) 46px auto; }
    .model-identity { grid-column: 1; grid-row: 1; }
    .model-selectors .parameter-favorite { grid-column: 2; grid-row: 1; }
    .model-selectors .model-mode { grid-column: 3; grid-row: 1; width: auto; }
    .model-parameter-rail { grid-column: 1 / -1; grid-row: 2; }
}
