* { box-sizing: border-box; }

[hidden] {
    display: none !important;
}

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family: Inter, Arial, sans-serif;
    background: #0b0f14;
    color: white;
}

body {
    overflow-x: hidden;
}

.maintenanceBody {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: #0b0f14;
}

#maintenanceOverlay {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: grid;
    place-items: center;
    padding: 24px;
    background: #0b0f14;
}

.maintenancePage {
    width: min(720px, 100%);
    padding: 28px;
    text-align: center;
}

.maintenancePage h1 {
    margin: 0 0 12px 0;
    color: #f4f7fb;
    font-size: clamp(28px, 5vw, 48px);
    line-height: 1.12;
    letter-spacing: 0;
}

.maintenancePage p {
    margin: 0;
    color: #aeb7c2;
    font-size: 18px;
}

#map,
.chartBox,
#liveBox {
    transform: translateZ(0);
    backface-visibility: hidden;
    contain: layout paint style;
}

header {
    padding: 12px;
    background: #11161d;
    text-align: center;
    font-weight: 700;
}

#status {
    text-align: center;
    color: #aeb7c2;
    padding: 8px 10px;
}

#sourceStatus {
    text-align: center;
    color: #c4d0dc;
    padding: 0 10px 8px 10px;
    font-size: 13px;
    line-height: 1.4;
}

#sourceStatus.warning {
    color: #ffcc80;
}

#sourceStatus.critical {
    color: #ff8a80;
}

#freshnessStrip {
    text-align: center;
    color: #9fb0c0;
    padding: 0 10px 8px 10px;
    font-size: 12px;
    line-height: 1.35;
}

#freshnessStrip.warning {
    color: #ffcc80;
}

#freshnessStrip.critical {
    color: #ff8a80;
}

#app {
    display: block;
}

.modalOverlay {
    position: fixed;
    inset: 0;
    z-index: 6000;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(4, 8, 12, 0.78);
}

.feedbackDialog {
    width: min(520px, 100%);
    max-height: calc(100vh - 36px);
    overflow: auto;
    padding: 18px;
    border: 1px solid #263544;
    border-radius: 8px;
    background: #11161d;
    color: #f4f7fb;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
}

.feedbackHeader,
.feedbackActions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.feedbackHeader h2 {
    margin: 0;
    font-size: 20px;
    letter-spacing: 0;
}

#feedbackForm {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

#feedbackForm label {
    color: #c4d0dc;
    font-size: 13px;
}

#feedbackForm input,
#feedbackForm textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #33485d;
    border-radius: 6px;
    background: #0b0f14;
    color: #f4f7fb;
    font: inherit;
}

#feedbackForm textarea {
    min-height: 150px;
    resize: vertical;
}

#feedbackWebsite {
    position: absolute;
    left: -10000px;
    width: 1px !important;
    height: 1px;
    opacity: 0;
}

#feedbackStatus {
    min-height: 20px;
    color: #aeb7c2;
    font-size: 13px;
}

#feedbackStatus.success {
    color: #9ee6a8;
}

#feedbackStatus.error {
    color: #ff8a80;
}

#topbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    gap: 8px;
    padding: 10px;
}

.toolbarGroup {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 5px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 8px;
    background: rgba(17, 24, 39, 0.72);
}

.toolbarGroupLabel {
    display: inline-flex;
    align-items: center;
    align-self: stretch;
    padding: 0 8px;
    border-right: 1px solid rgba(148, 163, 184, 0.20);
    color: #aeb7c2;
    font-size: 12px;
    font-weight: 700;
}

.primaryLayers {
    border-color: rgba(56, 189, 248, 0.38);
    background: rgba(8, 47, 73, 0.42);
}

.primaryLayers .toolbarGroupLabel {
    color: #bae6fd;
}

.primaryLayers button {
    background: #123244;
    color: #e0f7ff;
}

.primaryLayers button.active {
    background: #38bdf8;
    color: #03131c;
}

.forecastLayers {
    background: rgba(31, 41, 55, 0.70);
}

.debugLayers {
    opacity: 0.86;
    background: rgba(24, 24, 27, 0.62);
}

.debugLayers button {
    background: #252a33;
    color: #d8e0ea;
}

#mainWorkspace {
    width: min(1600px, calc(100% - 20px));
    margin: 0 auto;
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}

body.opsPanelCollapsed #mainWorkspace {
    grid-template-columns: minmax(0, 1fr);
}

.mapArea {
    min-width: 0;
}

#opsPanel {
    position: sticky;
    top: 10px;
    max-height: calc(100vh - 20px);
    overflow: auto;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 8px;
    padding: 10px;
    color: #c9d4df;
    background: rgba(17, 22, 29, 0.88);
}

body.opsPanelCollapsed #opsPanel {
    display: none;
}

#opsPanelToggle.active {
    background: #263544;
    color: #f4f7fb;
}

.opsHeader {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 12px;
    align-items: flex-start;
    font-size: 13px;
    margin-bottom: 8px;
}

#opsStatus.warning {
    color: #ffcc80;
}

#opsStatus.critical {
    color: #ff8a80;
}

.opsGrid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.opsTabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin: 0 0 10px 0;
}

.opsTab {
    min-height: 30px;
    padding: 5px 8px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 6px;
    background: rgba(30, 41, 59, 0.74);
    color: #c9d4df;
}

.opsTab.active {
    border-color: rgba(56, 189, 248, 0.55);
    background: rgba(14, 116, 144, 0.36);
    color: #e0f2fe;
}

.opsTabPanel {
    min-width: 0;
}

.opsGrid h3 {
    margin: 0 0 6px 0;
    font-size: 12px;
    font-weight: 700;
    color: #d9e2ec;
}

.opsTable {
    display: grid;
    gap: 4px;
    font-size: 12px;
}

.opsRow {
    display: grid;
    grid-template-columns: minmax(84px, 1fr) minmax(58px, auto) minmax(70px, 0.9fr);
    gap: 6px;
    align-items: center;
    min-height: 24px;
    padding: 3px 0;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.opsRow > span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.opsBadge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 54px;
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(76, 175, 80, 0.16);
    color: #b9f6ca;
}

.opsBadge.warning {
    background: rgba(255, 193, 7, 0.16);
    color: #ffe082;
}

.opsBadge.critical {
    background: rgba(244, 67, 54, 0.16);
    color: #ffab91;
}

button, select, input {
    height: 40px;
    border-radius: 8px;
    border: none;
    padding: 0 12px;
    background: #2a2f38;
    color: white;
    font-size: 14px;
}

button {
    cursor: pointer;
}

button.active {
    background: #00c853;
    color: #06110a;
}

#btn_live_front.active {
    background: #ffd54f;
    color: #141005;
    box-shadow: 0 0 0 2px rgba(255, 213, 79, 0.28), 0 0 22px rgba(255, 213, 79, 0.24);
}

.liveFrontStatus {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    padding: 0 10px;
    border-radius: 8px;
    background: #1e2630;
    color: #d8e0ea;
    font-size: 13px;
}

.liveFrontStatus.active {
    background: #2d2a16;
    color: #ffe082;
}

.liveFrontStatus.error {
    background: #3a1e22;
    color: #ffb4bd;
}

.toolbarControl {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 8px;
    border-radius: 8px;
    background: #1e2630;
    color: #cdd7e2;
    font-size: 12px;
}

.toolbarControl select {
    height: 30px;
    padding: 0 8px;
}

#mapWrap {
    padding: 10px;
    display: grid;
    grid-template-rows: auto minmax(670px, 78vh) auto;
    gap: 12px;
}

body.mapHeightCompact #mapWrap {
    grid-template-rows: auto minmax(540px, 62vh) auto;
}

body.mapHeightLarge #mapWrap {
    grid-template-rows: auto minmax(810px, 86vh) auto;
}

#mapStatusRail {
    display: grid;
    grid-template-columns: repeat(2, minmax(150px, 1fr)) auto auto;
    gap: 8px;
    align-items: center;
    min-height: 42px;
    padding: 8px 10px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 10px;
    background: rgba(11, 15, 20, 0.78);
}

.mapFreshness {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #9fb0c2;
    font-size: 12px;
}

.mapFreshness strong {
    color: #e0ebf5;
    font-size: 12px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.radarAnimBadge {
    min-width: 86px;
    text-align: center;
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.16);
    color: #cbd5e1;
    font-size: 12px;
    font-weight: 700;
}

.radarAnimBadge.live {
    background: rgba(76, 175, 80, 0.18);
    color: #b9f6ca;
}

.radarAnimBadge.updating {
    background: rgba(79, 195, 247, 0.18);
    color: #b3e5fc;
}

.radarAnimBadge.stale {
    background: rgba(255, 193, 7, 0.18);
    color: #ffe082;
}

.radarAnimBadge.stopped {
    background: rgba(244, 67, 54, 0.16);
    color: #ffab91;
}

.radarPlaybackControls {
    display: inline-flex;
    gap: 6px;
}

.radarPlaybackControls button {
    height: 30px;
    padding: 0 10px;
    font-size: 12px;
}

#map {
    width: 100%;
    height: 100%;
    min-height: 670px;
    border-radius: 12px;
    overflow: hidden;
    background: #1a1f27;
}

body.mapHeightCompact #map {
    min-height: 540px;
}

body.mapHeightLarge #map {
    min-height: 810px;
}

#mapInfoRail {
    display: grid;
    grid-template-columns: minmax(360px, 1.15fr) minmax(260px, 0.85fr);
    gap: 12px;
    align-items: stretch;
}

#mapLegend,
#nowcastPanel {
    background: rgba(11, 15, 20, 0.86);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 12px;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(8px);
}

#mapLegend {
    padding: 10px 12px;
}

.legendHeader {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

#mapLegend h4,
#nowcastPanel h4 {
    margin: 0;
    font-size: 13px;
    color: #dbe7f3;
}

#mapLegendToggle {
    display: none;
    height: 30px;
    padding: 0 9px;
    font-size: 12px;
}

.legendRow {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #c3ced9;
    margin-top: 6px;
}

.legendSwatch {
    width: 22px;
    height: 10px;
    border-radius: 999px;
    flex: 0 0 auto;
}

.legendSwatch.radarEcho {
    background: #b3e5fc;
}

.legendSwatch.lightRain {
    background: #4fc3f7;
}

.legendSwatch.rainArea {
    background: #0288d1;
}

.legendSwatch.windFlow {
    background: #81c784;
}

.legendSwatch.aiForecast {
    background: #dce775;
}

.legendSwatch.weatherRegime {
    background: #26c6da;
}

.legendSwatch.stormRisk {
    background: #ff7043;
}

.legendSwatch.lightningRadar {
    background: #ffd54f;
}

.legendSwatch.stormCells {
    background: #ffb74d;
}

.legendLine {
    width: 24px;
    height: 0;
    border-top: 3px solid #fff;
    position: relative;
    color: #f4f7fb;
}

.servedDecisionPanel {
    margin-top: 12px;
    padding: 12px 14px;
    border: 1px solid rgba(160, 174, 192, 0.22);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.72);
}

.servedDecisionRows {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 8px;
}

.servedDecisionRow {
    min-height: 78px;
    padding: 9px 10px;
    border: 1px solid rgba(148, 163, 184, 0.20);
    border-radius: 7px;
    background: rgba(30, 41, 59, 0.72);
    font-size: 12px;
}

.servedDecisionRow.warning {
    border-color: rgba(251, 191, 36, 0.45);
}

.servedDecisionRow strong {
    display: block;
    font-size: 13px;
    margin-bottom: 4px;
}

.servedDecisionRow span {
    display: block;
    color: #cbd5e1;
    line-height: 1.35;
}

.legendLine::after {
    content: "";
    position: absolute;
    right: -2px;
    top: -5px;
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 8px solid currentColor;
}

#nowcastPanel {
    padding: 12px 14px;
}

.nowcastMeta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}

.nowcastMetric {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    padding: 8px;
}

.nowcastMetric span {
    display: block;
    font-size: 11px;
    color: #9fb0c2;
    margin-bottom: 4px;
}

.nowcastMetric strong {
    font-size: 15px;
    color: #f3f7fb;
}

#nowcastApproach {
    font-size: 12px;
    color: #d6e2ee;
    line-height: 1.45;
    margin-bottom: 10px;
}

#lightningAlert {
    display: none;
    margin-bottom: 10px;
    padding: 9px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 213, 79, 0.32);
    background: rgba(255, 213, 79, 0.10);
    color: #ffe082;
    font-size: 12px;
    line-height: 1.4;
}

#lightningAlert.nearby,
#lightningAlert.approaching {
    display: block;
    border-color: rgba(255, 152, 0, 0.46);
    background: rgba(255, 152, 0, 0.14);
    color: #ffcc80;
}

#lightningAlert.observed {
    display: block;
    border-color: rgba(239, 83, 80, 0.62);
    background: rgba(239, 83, 80, 0.18);
    color: #ffcdd2;
}

.lightningMarker {
    display: block;
    position: relative;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: rgba(11, 15, 20, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.72);
    box-shadow: 0 0 0 3px rgba(255, 213, 79, 0.25), 0 0 18px rgba(255, 193, 7, 0.70);
}

.lightningMarker::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 3px;
    width: 9px;
    height: 18px;
    background: #fff176;
    clip-path: polygon(48% 0, 100% 0, 68% 40%, 100% 40%, 28% 100%, 43% 55%, 0 55%);
}

.lightningMarker.old {
    opacity: 0.72;
    box-shadow: 0 0 0 2px rgba(255, 179, 0, 0.18), 0 0 10px rgba(255, 179, 0, 0.45);
}

.lightningFresh0 { opacity: 0.55; }
.lightningFresh1 { opacity: 0.60; }
.lightningFresh2 { opacity: 0.64; }
.lightningFresh3 { opacity: 0.69; }
.lightningFresh4 { opacity: 0.73; }
.lightningFresh5 { opacity: 0.78; }
.lightningFresh6 { opacity: 0.82; }
.lightningFresh7 { opacity: 0.87; }
.lightningFresh8 { opacity: 0.91; }
.lightningFresh9 { opacity: 0.96; }
.lightningFresh10 { opacity: 1.00; }

.stormAreaLabel {
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
}

.weatherPulse {
    --pulse-color: #4fc3f7;
    --pulse-size: 28px;
    --pulse-intensity: 0.35;
    --pulse-delay: 0ms;
    position: relative;
    display: grid;
    place-items: center;
    width: var(--pulse-size);
    height: var(--pulse-size);
    border-radius: 999px;
    color: #f8fbff;
    background: color-mix(in srgb, var(--pulse-color) 72%, transparent);
    border: 2px solid color-mix(in srgb, var(--pulse-color) 92%, white 8%);
    box-shadow:
        0 0 18px color-mix(in srgb, var(--pulse-color) 70%, transparent),
        0 0 calc(16px + var(--pulse-size) * var(--pulse-intensity)) color-mix(in srgb, var(--pulse-color) 48%, transparent);
    animation: weatherPulse 1600ms ease-out infinite;
    animation-delay: var(--pulse-delay);
}

.selectedCityPulse {
    --pulse-color: #00c2ff;
    position: relative;
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 999px;
    color: #f8fbff;
    background: rgba(0, 128, 196, 0.76);
    border: 3px solid rgba(234, 250, 255, 0.94);
    box-shadow:
        0 0 20px rgba(0, 194, 255, 0.72),
        0 0 44px rgba(0, 194, 255, 0.42);
    animation: selectedCityPulse 1450ms ease-out infinite;
}

.selectedCityPulse::after {
    content: "";
    position: absolute;
    inset: -9px;
    border-radius: inherit;
    border: 2px solid rgba(0, 194, 255, 0.78);
    animation: selectedCityRing 1450ms ease-out infinite;
}

.selectedCityPulse b,
.selectedCityPulse em {
    position: relative;
    z-index: 1;
    display: block;
    max-width: 88px;
    padding: 1px 5px;
    border-radius: 999px;
    background: rgba(8, 14, 20, 0.72);
    font-style: normal;
    line-height: 1.1;
    text-align: center;
    white-space: nowrap;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.88);
}

.selectedCityPulse b {
    font-size: 11px;
    font-weight: 800;
}

.selectedCityPulse em {
    margin-top: 2px;
    font-size: 10px;
    font-weight: 700;
}

.weatherPulse b {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    padding: 2px 5px;
    border-radius: 999px;
    background: rgba(11, 15, 20, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.18);
    font-size: 10px;
    line-height: 1.1;
    white-space: nowrap;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}

.weatherIntensityMeter {
    position: absolute;
    left: 50%;
    bottom: -9px;
    width: 42px;
    height: 6px;
    transform: translateX(-50%);
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.22);
    border: 1px solid rgba(11, 15, 20, 0.72);
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
}

.weatherIntensityMeter::after {
    content: "";
    display: block;
    width: calc(12% + var(--pulse-intensity) * 88%);
    height: 100%;
    background: var(--pulse-color);
}

.weatherPulse.storm {
    animation-duration: 1150ms;
    box-shadow:
        0 0 20px color-mix(in srgb, var(--pulse-color) 78%, transparent),
        0 0 calc(22px + var(--pulse-size) * var(--pulse-intensity)) rgba(255, 112, 67, 0.58);
}

.stormMotionArrowLine {
    filter: drop-shadow(0 0 7px rgba(255, 213, 79, 0.55));
    stroke-linecap: round;
}

.stormMotionArrow {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    width: 58px;
    height: 30px;
    color: #141005;
    transform: rotate(var(--storm-arrow-rotate, 0deg));
    transform-origin: center;
}

.stormMotionArrow::before {
    position: absolute;
    left: 2px;
    top: 12px;
    width: 34px;
    height: 6px;
    border-radius: 999px;
    content: "";
    background: #ffd54f;
    box-shadow: 0 0 16px rgba(255, 213, 79, 0.72);
}

.stormMotionArrow::after {
    position: absolute;
    left: 30px;
    top: 6px;
    width: 0;
    height: 0;
    content: "";
    border-top: 9px solid transparent;
    border-bottom: 9px solid transparent;
    border-left: 14px solid #ffd54f;
    filter: drop-shadow(0 0 8px rgba(255, 213, 79, 0.68));
}

.stormMotionArrow b {
    position: relative;
    z-index: 1;
    min-width: 42px;
    padding: 2px 5px;
    border-radius: 999px;
    background: rgba(255, 245, 157, 0.92);
    color: #141005;
    font-size: 10px;
    line-height: 1;
    text-align: center;
    transform: rotate(calc(-1 * var(--storm-arrow-rotate, 0deg)));
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}

.rainIntensity0 { --pulse-color: #b3e5fc; --pulse-size: 20px; --pulse-intensity: 0.05; }
.rainIntensity1 { --pulse-color: #b3e5fc; --pulse-size: 22px; --pulse-intensity: 0.10; }
.rainIntensity2 { --pulse-color: #4fc3f7; --pulse-size: 24px; --pulse-intensity: 0.20; }
.rainIntensity3 { --pulse-color: #4fc3f7; --pulse-size: 27px; --pulse-intensity: 0.30; }
.rainIntensity4 { --pulse-color: #29b6f6; --pulse-size: 30px; --pulse-intensity: 0.40; }
.rainIntensity5 { --pulse-color: #0288d1; --pulse-size: 33px; --pulse-intensity: 0.50; }
.rainIntensity6 { --pulse-color: #0277bd; --pulse-size: 36px; --pulse-intensity: 0.60; }
.rainIntensity7 { --pulse-color: #1565c0; --pulse-size: 39px; --pulse-intensity: 0.70; }
.rainIntensity8 { --pulse-color: #0d47a1; --pulse-size: 42px; --pulse-intensity: 0.80; }
.rainIntensity9 { --pulse-color: #0d47a1; --pulse-size: 45px; --pulse-intensity: 0.90; }
.rainIntensity10 { --pulse-color: #0b3d91; --pulse-size: 48px; --pulse-intensity: 1.00; }

.stormIntensity0 { --pulse-color: #ffe082; --pulse-size: 20px; --pulse-intensity: 0.05; }
.stormIntensity1 { --pulse-color: #ffe082; --pulse-size: 22px; --pulse-intensity: 0.10; }
.stormIntensity2 { --pulse-color: #ffca28; --pulse-size: 24px; --pulse-intensity: 0.20; }
.stormIntensity3 { --pulse-color: #ffca28; --pulse-size: 27px; --pulse-intensity: 0.30; }
.stormIntensity4 { --pulse-color: #ffb74d; --pulse-size: 30px; --pulse-intensity: 0.40; }
.stormIntensity5 { --pulse-color: #ff8a65; --pulse-size: 33px; --pulse-intensity: 0.50; }
.stormIntensity6 { --pulse-color: #ff7043; --pulse-size: 36px; --pulse-intensity: 0.60; }
.stormIntensity7 { --pulse-color: #ef5350; --pulse-size: 39px; --pulse-intensity: 0.70; }
.stormIntensity8 { --pulse-color: #e53935; --pulse-size: 42px; --pulse-intensity: 0.80; }
.stormIntensity9 { --pulse-color: #d32f2f; --pulse-size: 45px; --pulse-intensity: 0.90; }
.stormIntensity10 { --pulse-color: #b71c1c; --pulse-size: 48px; --pulse-intensity: 1.00; }

.weatherDelay0, .motionDelay0 { --pulse-delay: 0ms; --motion-delay: 0ms; }
.weatherDelay1, .motionDelay1 { --pulse-delay: -160ms; --motion-delay: -110ms; }
.weatherDelay2, .motionDelay2 { --pulse-delay: -320ms; --motion-delay: -220ms; }
.weatherDelay3, .motionDelay3 { --pulse-delay: -480ms; --motion-delay: -330ms; }
.weatherDelay4, .motionDelay4 { --pulse-delay: -640ms; --motion-delay: -440ms; }
.weatherDelay5, .motionDelay5 { --pulse-delay: -800ms; --motion-delay: -550ms; }
.weatherDelay6, .motionDelay6 { --pulse-delay: -960ms; --motion-delay: -660ms; }
.weatherDelay7, .motionDelay7 { --pulse-delay: -1120ms; --motion-delay: -770ms; }
.weatherDelay8, .motionDelay8 { --pulse-delay: -1280ms; --motion-delay: -880ms; }
.weatherDelay9, .motionDelay9 { --pulse-delay: -1440ms; --motion-delay: -990ms; }

.weatherPulse::after {
    content: "";
    position: absolute;
    inset: -7px;
    border-radius: inherit;
    border: 2px solid var(--pulse-color);
    opacity: 0.38;
    animation: weatherRing 1600ms ease-out infinite;
    animation-delay: var(--pulse-delay);
}

.motionDot {
    --pulse-color: #4fc3f7;
    --motion-delay: 0ms;
    display: block;
    width: 11px;
    height: 11px;
    border-radius: 999px;
    background: var(--pulse-color);
    box-shadow: 0 0 12px var(--pulse-color);
    animation: motionDot 1100ms ease-in-out infinite;
    animation-delay: var(--motion-delay);
}

.motionDot.storm {
    width: 13px;
    height: 13px;
}

.radarFrameOverlay {
    mix-blend-mode: screen;
    filter: saturate(1.35) contrast(1.18) brightness(1.08);
    transition: opacity 700ms ease, transform 900ms ease;
}

.radarRainFrameOverlay {
    mix-blend-mode: normal;
    filter: saturate(1.55) contrast(1.30) brightness(1.08);
    transition: opacity 700ms ease;
}

.radarStatusBadge {
    min-width: 178px;
    padding: 8px 10px;
    border: 1px solid rgba(79, 195, 247, 0.35);
    border-radius: 8px;
    background: rgba(9, 14, 20, 0.88);
    color: #dff4ff;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.30);
    font-size: 11px;
    line-height: 1.35;
}

.radarStatusBadge strong,
.radarStatusBadge span {
    display: block;
}

.radarStatusBadge strong {
    color: #7dd3fc;
    font-size: 12px;
}

.radarIntensityMeter {
    --radar-intensity: 0;
    height: 7px;
    margin: 6px 0;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(125, 211, 252, 0.28);
}

.radarIntensityMeter span {
    display: block;
    width: 10%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #4fc3f7, #0288d1 45%, #ffca28 72%, #ef5350);
    box-shadow: 0 0 14px rgba(79, 195, 247, 0.42);
}

.radarIntensity0 span { width: 10%; }
.radarIntensity1 span { width: 19%; }
.radarIntensity2 span { width: 28%; }
.radarIntensity3 span { width: 37%; }
.radarIntensity4 span { width: 46%; }
.radarIntensity5 span { width: 55%; }
.radarIntensity6 span { width: 64%; }
.radarIntensity7 span { width: 73%; }
.radarIntensity8 span { width: 82%; }
.radarIntensity9 span { width: 91%; }
.radarIntensity10 span { width: 100%; }

.radarStatusBadge.stale {
    border-color: rgba(255, 183, 77, 0.55);
    color: #ffe0b2;
}

.tileStatusBadge {
    max-width: 260px;
    padding: 8px 10px;
    border: 1px solid rgba(255, 183, 77, 0.62);
    border-radius: 8px;
    background: rgba(9, 14, 20, 0.92);
    color: #ffe0b2;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.30);
    font-size: 11px;
    line-height: 1.35;
}

.tileStatusBadge.error {
    border-color: rgba(255, 112, 67, 0.70);
    color: #ffd7c2;
}

@keyframes weatherPulse {
    0%, 100% {
        transform: scale(0.96);
        opacity: 0.82;
    }
    50% {
        transform: scale(1.08);
        opacity: 1;
    }
}

@keyframes weatherRing {
    0% {
        transform: scale(0.72);
        opacity: 0.44;
    }
    100% {
        transform: scale(1.7);
        opacity: 0;
    }
}

@keyframes selectedCityPulse {
    0% {
        transform: scale(0.96);
        opacity: 0.86;
    }
    48% {
        transform: scale(1.06);
        opacity: 1;
    }
    100% {
        transform: scale(0.96);
        opacity: 0.86;
    }
}

@keyframes selectedCityRing {
    0% {
        transform: scale(0.68);
        opacity: 0.58;
    }
    72% {
        transform: scale(1.35);
        opacity: 0;
    }
    100% {
        transform: scale(1.35);
        opacity: 0;
    }
}

@keyframes motionDot {
    0%, 100% {
        transform: scale(0.8);
        opacity: 0.42;
    }
    50% {
        transform: scale(1.25);
        opacity: 0.96;
    }
}

.nowcastGrid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.nowcastSlot {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    padding: 8px;
}

.nowcastSlot strong {
    display: block;
    font-size: 13px;
    color: #f4f7fb;
    margin-bottom: 4px;
}

.nowcastSlot div {
    font-size: 11px;
    color: #c4d0dc;
    margin-top: 3px;
}

#summaryRow {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 10px;
    padding-top: 0;
}

.summaryCard {
    background: #1a1f27;
    border-radius: 10px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.summaryCard.warning {
    border-color: rgba(255, 204, 128, 0.32);
}

.summaryCard h3 {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #aeb7c2;
    font-weight: 600;
}

.summaryMain {
    display: flex;
    gap: 10px;
    align-items: baseline;
}

.summaryAi {
    font-size: 28px;
    font-weight: 700;
    color: #dce775;
}

.summaryProvider {
    font-size: 18px;
    color: #4fc3f7;
}

.summaryDelta {
    margin-top: 6px;
    color: #ffcc80;
    font-size: 13px;
}

.summaryValidation {
    margin-top: 5px;
    color: #9fb0c0;
    font-size: 12px;
}

.summaryCard.warning .summaryValidation {
    color: #ffcc80;
}

#bottom {
    display: flex;
    gap: 10px;
    padding: 10px;
    align-items: stretch;
}

.chartBox {
    flex: 1;
    min-width: 0;
    background: #1a1f27;
    padding: 10px;
    border-radius: 10px;
    height: 260px;
}

.chartBox canvas,
#liveBox canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

#liveSection {
    padding: 10px;
    padding-top: 0;
}

.sectionHead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.sectionHead h3 {
    margin: 0;
}

#sourceFooter {
    padding: 0 10px 16px 10px;
    color: #aeb7c2;
    font-size: 12px;
    line-height: 1.5;
}

#sourceFooter a {
    color: #9bd1ff;
}

.mapLabel {
    background: transparent;
    border: none;
}

.mapLabel span {
    display: inline-block;
    padding: 3px 7px;
    border-radius: 999px;
    background: rgba(11, 15, 20, 0.82);
    color: #f4f7fb;
    border: 1px solid rgba(255, 255, 255, 0.14);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
}

#liveBox {
    background: #1a1f27;
    border-radius: 10px;
    padding: 10px;
    height: 140px;
    position: relative;
}

#liveEmpty {
    position: absolute;
    inset: 10px;
    display: none;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #aeb7c2;
    font-size: 13px;
    line-height: 1.4;
    pointer-events: none;
}

#authShell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

#authCard {
    width: min(420px, 100%);
    background: #11161d;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

#authCard h1 {
    margin: 0 0 8px 0;
    font-size: 28px;
}

#authCard p {
    margin: 0 0 16px 0;
    color: #aeb7c2;
}

#authRow {
    display: flex;
    gap: 8px;
}

#authMessage {
    min-height: 20px;
    margin-top: 12px;
    color: #ff8a80;
}

.srOnly {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

@media (max-width: 1100px) {
    #mainWorkspace {
        display: block;
        width: calc(100% - 20px);
    }

    #opsPanel {
        position: static;
        max-height: none;
        margin-bottom: 12px;
    }

    body.opsPanelCollapsed #opsPanel {
        display: none;
    }

    .opsHeader {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

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

    #summaryRow {
        grid-template-columns: 1fr;
    }

    #bottom {
        flex-direction: column;
    }

    .chartBox {
        height: 220px;
    }

    #mapWrap {
        grid-template-rows: auto minmax(610px, calc(100vh - 230px)) auto;
    }

    body.mapHeightCompact #mapWrap {
        grid-template-rows: auto minmax(500px, calc(100vh - 300px)) auto;
    }

    body.mapHeightLarge #mapWrap {
        grid-template-rows: auto minmax(720px, calc(100vh - 170px)) auto;
    }

    #map {
        min-height: 610px;
    }

    body.mapHeightCompact #map {
        min-height: 500px;
    }

    body.mapHeightLarge #map {
        min-height: 720px;
    }

    #mapInfoRail {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .opsHeader {
        flex-direction: column;
        align-items: flex-start;
    }

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

    #topbar {
        justify-content: flex-start;
    }

    button,
    select,
    input {
        min-width: 0;
        max-width: 100%;
    }

    #mapWrap {
        grid-template-rows: auto minmax(500px, calc(100vh - 260px)) auto;
        gap: 10px;
    }

    body.mapHeightCompact #mapWrap {
        grid-template-rows: auto minmax(400px, calc(100vh - 340px)) auto;
    }

    body.mapHeightLarge #mapWrap {
        grid-template-rows: auto minmax(630px, calc(100vh - 190px)) auto;
    }

    #mapStatusRail {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .mapFreshness,
    .radarPlaybackControls {
        justify-content: space-between;
    }

    .radarPlaybackControls button {
        flex: 1 1 auto;
    }

    #map {
        min-height: 500px;
        border-radius: 10px;
    }

    body.mapHeightCompact #map {
        min-height: 400px;
    }

    body.mapHeightLarge #map {
        min-height: 630px;
    }

    #nowcastPanel,
    #mapLegend {
        width: 100%;
        border-radius: 10px;
    }

    .nowcastMeta,
    .nowcastGrid {
        grid-template-columns: 1fr;
    }

    #mapLegendToggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    #mapLegend.legendCollapsed .legendContent {
        display: none;
    }

    .summaryMain {
        flex-wrap: wrap;
    }

    .summaryAi {
        font-size: 24px;
    }
}
