/* Shared optical grid for radar, help and settings; no font-based glyphs. */
.mapControlButton {
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
    display: grid;
    place-items: center;
    flex: 0 0 44px;
    width: 44px;
    min-width: 44px;
    max-width: 44px;
    height: 44px;
    min-height: 44px;
    max-height: 44px;
    padding: 0;
    margin: 0;
    color: #c9ced6;
    background: #2a2d31;
    border: 1px solid #3f4246;
    border-radius: 8px;
    cursor: pointer;
    touch-action: manipulation;
}
.mapControlButton > svg.mapControlIcon {
    position: static;
    display: block;
    flex: none;
    width: 26px;
    height: 26px;
}
.mapControlButton:hover { color: #f7f6f4; }
.mapControlButton[aria-expanded="true"],
.mapControlButton[aria-pressed="true"] { color: #91b8ff; border-color: #78a2ed; }
.mapControlButton:focus-visible {
    outline: 2px solid #78a2ed !important;
    outline-offset: 3px;
}
.heatMapHelpTrigger {
    position: fixed;
    z-index: 30;
    left: max(16px, env(safe-area-inset-left));
    bottom: calc(max(16px, env(safe-area-inset-bottom)) + 32px);
}
.heatMapHelp__close:focus-visible {
    outline: 2px solid #78a2ed !important;
    outline-offset: -2px;
    border-radius: 4px;
}

body.heat-map-help-open {
    overflow: hidden;
}

.heatMapHelp {
    --help-text: #f7f6f4;
    --help-secondary: #b9bdc3;
    --help-count: #ff9696;
    --help-line: #45484d;
    --help-surface: #2a2d31;
    width: min(480px, calc(100% - 32px));
    max-width: none;
    max-height: calc(100vh - 40px);
    max-height: calc(100dvh - 40px);
    margin: auto;
    padding: 24px 28px;
    overflow-y: auto;
    overscroll-behavior: contain;
    color: var(--help-text);
    background: var(--help-surface);
    border: 1px solid var(--help-line);
    border-radius: 8px;
    box-shadow: 0 20px 64px rgba(0, 0, 0, 0.32);
    font-family: inherit;
    text-align: left;
}

.heatMapHelp[open] {
    animation: heatMapHelpAppear 160ms ease-out;
}

.heatMapHelp::backdrop {
    background: rgba(7, 12, 19, 0.72);
}

.heatMapHelp__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 22px;
}

.heatMapHelp__header h2 {
    color: inherit;
    font-size: 22px;
    font-weight: 400;
    line-height: 1.3;
}

.heatMapHelp__close {
    display: grid;
    place-items: center;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    margin: -6px -10px -6px 0;
    color: var(--help-secondary);
    cursor: pointer;
    touch-action: manipulation;
}

.heatMapHelp__close:hover {
    color: var(--help-text);
}

.heatMapHelp__close svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
}

.heatMapHelp h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    color: inherit;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.5;
}

.heatMapHelp__alerts {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--help-line);
}

.heatMapHelp__alertLevels {
    display: grid;
    gap: 12px;
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
}

.heatMapHelp__alertLevels li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    font-weight: 300;
    line-height: 1.5;
}

.heatMapHelp__swatch {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    border-radius: 3px;
}

.heatMapHelp__swatch--red {
    background: #d55b50;
}

.heatMapHelp__swatch--yellow {
    background: #ffc200bd;
}

.heatMapHelp__cloud {
    flex: 0 0 26px;
    width: 26px;
    height: 26px;
    background: radial-gradient(ellipse, #f94435 8%, rgba(249, 68, 53, 0.5) 40%, transparent 72%);
}

.heatMapHelp__danger p {
    margin-top: 10px;
    color: var(--help-secondary);
    font-size: 13px;
    font-weight: 300;
    line-height: 1.65;
}

.heatMapHelp__legend {
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid var(--help-line);
}

.heatMapHelp__targets {
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
}

.heatMapHelp__targets li {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 54px;
    font-size: 14px;
    line-height: 1.5;
}

.heatMapHelp__targets [data-map-target-count] {
    color: var(--help-count);
}

.heatMapHelp__targets [data-map-target-count].is-empty {
    color: var(--help-secondary);
}

.heatMapHelp__icon {
    display: grid;
    place-items: center;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border-radius: 4px;
}

.heatMapHelp__icon img {
    position: static;
    display: block;
    width: var(--help-icon-size, 40px);
    height: var(--help-icon-size, 40px);
    object-fit: contain;
}

/* The shared map stylesheet absolutely positions every image inside .map. */
.content .map .heatMapHelp__icon img {
    position: static;
    width: var(--help-icon-size, 40px);
    height: var(--help-icon-size, 40px);
}

.heatMapHelp__icon--banderol {
    --help-icon-size: 32px;
}

.heatMapHelp__note {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--help-line);
    color: var(--help-secondary);
    font-size: 12px;
    font-weight: 300;
    line-height: 1.6;
}

html.light .mapControlButton {
    color: #575c65;
    background: #f7f6f4;
    border-color: #d4d7dc;
}

html.light .mapControlButton:hover {
    color: #1f252d;
}
html.light .mapControlButton[aria-expanded="true"],
html.light .mapControlButton[aria-pressed="true"] { color: #285eaa; border-color: #78a2ed; }

html.light .heatMapHelp {
    --help-text: #252b34;
    --help-secondary: #555d68;
    --help-count: #b42332;
    --help-line: #d4d7dc;
    --help-surface: #f7f6f4;
}

html.light .heatMapHelp__icon {
    background: #45484d;
}

@keyframes heatMapHelpAppear {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 600px) {
    .heatMapHelp {
        width: calc(100% - 24px);
        max-height: calc(100vh - 24px);
        max-height: calc(100dvh - 24px);
        padding: 20px;
    }

    .heatMapHelp__header h2 {
        font-size: 20px;
    }

    .heatMapHelp__header {
        margin-bottom: 18px;
    }
}

/* Touch devices keep the scrollbar hidden in landscape as well. */
@media (max-width: 600px), (hover: none) and (pointer: coarse) {
    .heatMapHelp {
        scrollbar-width: none;
    }

    .heatMapHelp::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .heatMapHelp[open] {
        animation: none;
    }
}

/* Index keeps its banner clear: the unified help button follows the switch panel's
   height, rather than relying on a fixed offset from the viewport bottom. */
.content > .mainMapControls {
    position: absolute;
    right: max(12px, env(safe-area-inset-right));
    bottom: max(16px, env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column-reverse;
    align-items: flex-end;
    gap: 12px;
}

.content > .mainMapControls > .toolbar {
    position: static;
}

.mainMapHelpControls {
    position: relative;
    display: flex;
    gap: 8px;
}

.mainMapHelpControls > .heatMapHelpTrigger {
    position: relative;
    inset: auto;
}

/* The map-only help control belongs to the settings cluster, not the legend. */
.only-map .onlyMapSettings > .heatMapHelpTrigger {
    position: absolute;
    top: -56px;
    right: 0;
    bottom: auto;
    left: auto;
}

@media (max-width: 992px) {
    .only-map .onlyMapSettings > .heatMapHelpTrigger {
        top: 0;
        right: calc(100% + 8px);
        box-sizing: border-box;
        width: var(--only-map-control-size);
        height: var(--only-map-control-size);
    }
}
.mapRadarTrigger[aria-busy="true"] { opacity: .6; cursor: progress; }
.mapRadarTrigger:focus-visible,
.mapRadar :is(button, input, select):focus-visible,
.mapRadarLocationPicker button:focus-visible,
.mapRadarLocationPin:focus-visible {
    outline: 2px solid #78a2ed !important;
    outline-offset: 3px;
}
.mapRadarTrigger__sweep { transform-origin: 12px 12px; animation: mapRadarSweep 3s linear infinite; }
@keyframes mapRadarSweep { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
    .mapRadarTrigger__sweep { animation-duration: 12s; }
}
.only-map .onlyMapSettings > .mapRadarTrigger {
    position: absolute;
    right: 56px;
    top: -56px;
}
@media (max-width: 992px) {
    .only-map .onlyMapSettings > .mapRadarTrigger {
        top: 0;
        right: calc(100% + var(--only-map-control-size) + 16px);
    }
}
.mapRadar { font-family: inherit; }
.mapRadar[data-radar-location-method] { box-sizing: border-box; }
.mapRadar[open] { display: block; }
.mapRadar [hidden] { display: none !important; }
.mapRadar .heatMapHelp__header h2 { margin: 0; }
.mapRadar .heatMapHelp__close { font-size: 30px; background: none; border: 0; }
.mapRadar__radius { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 14px; }
.mapRadar__radius output { color: var(--help-text); font-size: 28px; white-space: nowrap; }
.mapRadar input[type="range"] { display: block; width: 100%; height: 36px; margin: 12px 0 0; accent-color: #78a2ed; cursor: pointer; }
.mapRadar__rangeEnds { display: flex; justify-content: space-between; color: var(--help-secondary); font-size: 12px; }
.mapRadar__label { display: block; margin: 24px 0 10px; font-size: 14px; }
.mapRadar select {
    box-sizing: border-box;
    width: 100%;
    min-height: 46px;
    height: 46px;
    padding: 10px 12px;
    font: inherit;
    font-size: 14px;
    color: var(--help-text);
    background: var(--help-surface);
    border: 1px solid var(--help-line);
    border-radius: 6px;
}
.mapRadar__sound { margin-top: 14px; padding: 8px 0; font: inherit; font-size: 13px; color: #91b8ff; background: none; border: 0; cursor: pointer; }
@media (max-width: 700px) { .mapRadar select { font-size: 16px; } }
.mapRadar__note, .mapRadar__status { margin: 18px 0; font-size: 12px; line-height: 1.65; color: var(--help-secondary); }
.mapRadar__status { color: var(--help-text); padding-left: 12px; border-left: 2px solid #78a2ed; }
.mapRadar__location {
    display: grid;
    gap: 14px;
    margin: 0 0 22px;
    padding: 14px;
    border: 1px solid var(--help-line);
    border-radius: 8px;
    background: rgba(120, 162, 237, .07);
}
.mapRadar__location > div { display: grid; gap: 4px; min-width: 0; }
.mapRadar__location strong { font-size: 13px; font-weight: 500; }
.mapRadar__location span { color: var(--help-secondary); font-size: 12px; line-height: 1.45; }
.mapRadar__location > .mapRadar__locationActions {
    display: flex;
    gap: 10px;
}
.mapRadar__location button {
    -webkit-appearance: none;
    appearance: none;
    flex: 1 1 0;
    min-height: 40px;
    padding: 8px 12px;
    color: #91b8ff;
    background: transparent;
    border: 1px solid #5f7eae;
    border-radius: 6px;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    touch-action: manipulation;
}
.mapRadar__location [data-radar-use-location] {
    color: #102039;
    background: #78a2ed;
    border-color: #78a2ed;
}
.mapRadar__location button:disabled { opacity: .6; cursor: progress; }
@media (max-width: 520px) {
    .mapRadar__location > .mapRadar__locationActions { flex-direction: column; }
}
.mapRadar__actions { display: flex; gap: 12px; margin-top: 24px; }
.mapRadar__actions button { flex: 1; min-height: 46px; padding: 10px; font: inherit; font-size: 14px; cursor: pointer; border: 1px solid var(--help-line); border-radius: 6px; background: transparent; color: var(--help-text); }
.mapRadar__actions [type="submit"] { background: #78a2ed; border-color: #78a2ed; color: #102039; }
.mapRadarOverlay { position: absolute; inset: 0; z-index: 3; width: 100%; height: 100%; overflow: hidden; pointer-events: none; }
.mapRadarOverlay__circle { fill: rgba(120,162,237,.05); stroke: #91b8ff; stroke-width: 1.5; stroke-dasharray: 7 6; }
.mapRadarOverlay__line { stroke: #4ade80; stroke-width: 1.5; stroke-dasharray: 5 5; }
.mapRadarOverlay__pin { fill: #78a2ed; stroke: white; stroke-width: 2.5; }
.mapRadarOverlay__labelBackground { fill: rgba(42,45,49,.96); stroke: #45484d; stroke-width: 1; }
.mapRadarOverlay__label { fill: #f7f6f4; stroke: none; font: 13px sans-serif; text-anchor: middle; }
.mapRadarLocationPicker {
    position: fixed;
    z-index: 46;
    left: 50%;
    bottom: max(24px, env(safe-area-inset-bottom, 0px));
    display: flex;
    align-items: center;
    gap: 24px;
    box-sizing: border-box;
    width: min(680px, calc(100vw - 32px));
    padding: 16px;
    color: #f7f6f4;
    background: rgba(30, 34, 40, .96);
    border: 1px solid #51565e;
    border-radius: 10px;
    box-shadow: 0 18px 54px rgba(0, 0, 0, .38);
    transform: translateX(-50%);
    font-family: inherit;
}
.mapRadarLocationPicker[hidden] { display: none !important; }
.mapRadarLocationPicker__copy { display: grid; flex: 1; gap: 4px; min-width: 0; }
.mapRadarLocationPicker__copy strong { font-size: 15px; font-weight: 500; }
.mapRadarLocationPicker__copy span { color: #b9bdc3; font-size: 12px; line-height: 1.45; }
.mapRadarLocationPicker__actions { display: flex; gap: 10px; }
.mapRadarLocationPicker__actions button {
    -webkit-appearance: none;
    appearance: none;
    min-width: 104px;
    min-height: 44px;
    padding: 10px 16px;
    color: #f7f6f4;
    background: transparent;
    border: 1px solid #5d626a;
    border-radius: 6px;
    font: inherit;
    font-size: 14px;
    cursor: pointer;
    touch-action: manipulation;
}
.mapRadarLocationPicker__actions [data-radar-location-save] {
    color: #102039;
    background: #78a2ed;
    border-color: #78a2ed;
}
.mapRadarLocationPin {
    -webkit-appearance: none;
    appearance: none;
    position: absolute;
    z-index: 45;
    display: grid;
    place-items: end center;
    width: 48px;
    height: 56px;
    padding: 0;
    color: #102039;
    background: transparent;
    border: 0;
    border-radius: 50%;
    filter: drop-shadow(0 5px 8px rgba(0, 0, 0, .48));
    transform: translate(-50%, -100%);
    cursor: grab;
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}
.mapRadarLocationPin__icon {
    display: block;
    width: 40px;
    height: 51px;
    overflow: visible;
    pointer-events: none;
    transform-origin: 50% 100%;
}
.mapRadarLocationPin__shape { fill: #78a2ed; stroke: #f7f6f4; stroke-width: 2.5; }
.mapRadarLocationPin__dot { fill: #102039; stroke: #f7f6f4; stroke-width: 1.5; }
.mapRadarLocationPin:active { cursor: grabbing; }
.mapRadarLocationPin:active .mapRadarLocationPin__icon { transform: scale(1.04); }
.mapRadarLocationPin:focus-visible { outline-offset: 5px; }
.mapRadarLocationPin > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
html.map-radar-location-picking .mapRadarOverlay { opacity: .3; }
html.map-radar-location-picking :is(.mainMapControls, .onlyMapSettings, .detailMapExit) {
    opacity: .35;
    pointer-events: none;
}
html.light .mapRadar__sound { color: #285eaa; }
html.light .mapRadar__location button { color: #285eaa; border-color: #7595bf; }
html.light .mapRadarOverlay__circle { stroke: #285eaa; }
html.light .mapRadarOverlay__line { stroke: #16824a; }
html.light .mapRadarOverlay__labelBackground { fill: rgba(247,246,244,.96); stroke: #c4cbd4; }
html.light .mapRadarOverlay__label { fill: #15263b; }
html.light .mapRadarLocationPicker {
    color: #252b34;
    background: rgba(247, 246, 244, .97);
    border-color: #c7ccd3;
}
html.light .mapRadarLocationPicker__copy span { color: #555d68; }
html.light .mapRadarLocationPicker__actions button { color: #252b34; border-color: #b8bec7; }
html.light .mapRadarLocationPicker__actions [data-radar-location-save] { color: #102039; border-color: #78a2ed; }

@media (max-width: 700px) {
    .mapRadar__location { align-items: stretch; flex-direction: column; gap: 12px; }
    .mapRadar__location button { width: 100%; min-height: 44px; }
    .mapRadarLocationPicker {
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
        bottom: max(16px, env(safe-area-inset-bottom, 0px));
        width: calc(100vw - 24px);
        padding: 14px;
    }
    .mapRadarLocationPicker__actions button { flex: 1; min-width: 0; }
}

@media (max-width: 992px) {
    .only-map .mapRadarLocationPicker {
        bottom: calc(var(--only-map-host-banner-height) + var(--only-map-host-banner-bottom)
            + var(--only-map-host-banner-gap) + env(safe-area-inset-bottom, 0px));
    }
}

/* Cache refresh.                                    */
