:root {
    --yellow: #FFC800;
    --red: #ff6b6b;
    --orange: #F2994A;
    --darkred: #9c2626;

    --bg-color: #0d0d0f;
    --text-color: #f2f2f2;
    --text-muted: #8a8a92;

    --legend-bg: rgba(20, 20, 24, 0.82);
    --legend-border: rgba(255, 255, 255, 0.10);
    --legend-title-color: #aaaab3;
    --legend-item-color: #ececf0;

    --popup-bg: rgba(17, 17, 19, .94);
    --popup-border: rgba(255, 255, 255, .08);
    --popup-text: #f2f2f2;
    --about-bg: #111114;
    --about-border: rgba(255, 255, 255, .08);
    --about-text: #b0b0b6;
    --about-title-color: #ffffff;
    --label-color: rgba(255, 255, 255, .85);
    --fab-about-bg: #3a3a40;
    --fab-icon-color: #ffffff;
    --fab-size: 46px;
    --ui-radius-sm: 10px;
    --ui-radius-md: 14px;
    --ui-radius-lg: 18px;
    --ui-accent: #45b9f0;
    --ui-link: #62c6f4;
    --ui-surface: rgba(22, 24, 30, .96);
    --ui-control: #30343e;
    --ui-shadow: 0 8px 28px rgba(0, 0, 0, .28);
    --ui-focus: #79d2ff;
}

body.theme-light {
    --bg-color: #fafbfd;
    --text-color: #1a1a1e;
    --text-muted: #5a5a62;

    --legend-bg: rgba(255, 255, 255, 0.90);
    --legend-border: rgba(0, 0, 0, 0.12);
    --legend-title-color: #505058;
    --legend-item-color: #2a2a30;

    --popup-bg: rgba(255, 255, 255, .98);
    --popup-border: rgba(0, 0, 0, .12);
    --popup-text: #1a1a1e;
    --about-bg: #ffffff;
    --about-border: rgba(0, 0, 0, .12);
    --about-text: #4a4a52;
    --about-title-color: #0a0a0e;
    --label-color: rgba(30, 30, 35, .9);
    --fab-about-bg: #eef2f6;
    --fab-icon-color: #1a1a1e;
    --ui-accent: #0878aa;
    --ui-link: #086d9e;
    --ui-surface: rgba(255, 255, 255, .98);
    --ui-control: #f3f7fa;
    --ui-shadow: 0 8px 28px rgba(25, 43, 64, .14);
    --ui-focus: #0878aa;
}

.icon-masked {
    display: inline-block;
    background-color: currentColor;
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    flex: 0 0 auto;
}

.icon-sun      { -webkit-mask-image: url('assets/sun.svg');      mask-image: url('assets/sun.svg'); }
.icon-moon     { -webkit-mask-image: url('assets/moon.svg');     mask-image: url('assets/moon.svg'); }
.icon-info     { -webkit-mask-image: url('assets/info.svg');     mask-image: url('assets/info.svg'); }
.icon-heart    { -webkit-mask-image: url('assets/heart.svg');    mask-image: url('assets/heart.svg'); }
.icon-menu     { -webkit-mask-image: url('assets/menu.svg');     mask-image: url('assets/menu.svg'); }
.icon-ruler    { -webkit-mask-image: url('assets/ruler.svg');    mask-image: url('assets/ruler.svg'); }
.icon-undo     { -webkit-mask-image: url('assets/undo.svg');     mask-image: url('assets/undo.svg'); }
.icon-done     { -webkit-mask-image: url('assets/done.svg');     mask-image: url('assets/done.svg'); }
.icon-cancel   { -webkit-mask-image: url('assets/cancel.svg');   mask-image: url('assets/cancel.svg'); }

* { box-sizing: border-box; }
html, body, #map { width: 100%; height: 100%; margin: 0; padding: 0; }
body { overflow: hidden; background: var(--bg-color); font-family: 'Montserrat', sans-serif; transition: background-color .2s; }
.leaflet-container { background: var(--bg-color) !important; transition: background-color .2s; }

.leaflet-tile { filter: none; }

.leaflet-control-attribution { font-size: 9px; background: rgba(0,0,0,.5) !important; color: #888 !important; }
.leaflet-control-attribution a { color: #888 !important; }
.leaflet-control-zoom { display: none; }

.leaflet-interactive {
    stroke-linejoin: round !important;
    stroke-linecap: round !important;
    shape-rendering: geometricPrecision;
}

.popup-plane-icon {
    width: 1em;
    height: 1em;
    flex: 0 0 auto;
    display: inline-block;
    vertical-align: -0.1em;
    color: inherit;
}

.leaflet-popup-content-wrapper {
    background: var(--popup-bg);
    color: var(--popup-text);
    border-radius: 10px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .5);
    border: 1px solid var(--popup-border);
    padding: 0;
    overflow: hidden;
    transition: background-color .2s, color .2s;
}
.leaflet-popup-content {
    margin: 0;
    padding: 0;
    font-family: 'Montserrat', sans-serif;
    line-height: 1.3;
    min-width: 180px;
}
.leaflet-popup-tip {
    background: var(--popup-bg);
    border: 1px solid var(--popup-border);
    box-shadow: none;
}
.leaflet-popup-close-button {
    color: var(--text-muted) !important;
    font-size: 16px !important;
    width: 24px !important;
    height: 24px !important;
    top: 5px !important;
    right: 5px !important;
    line-height: 22px !important;
}
.leaflet-popup-close-button:hover {
    color: var(--text-color) !important;
    background: transparent !important;
}

.leaflet-popup.region-popup .leaflet-popup-content { width: 380px; }
.leaflet-popup.region-popup .popup {
    padding: 16px 18px 15px;
}
.leaflet-popup.region-popup .popup-name {
    font-size: 18px;
}
.leaflet-popup.region-popup .popup-status {
    font-size: 15px;
    padding: 6px 13px;
    gap: 8px;
}
.leaflet-popup.region-popup .popup-status .p-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
}

.leaflet-popup.airport-popup .leaflet-popup-content {
    width: max-content;
    min-width: 180px;
    max-width: 240px;
}
.leaflet-popup.airport-popup .popup {
    padding: 12px 14px 11px;
}
.leaflet-popup.airport-popup .popup-airport-name {
    font-size: 13px;
    margin-bottom: 6px;
    padding-right: 16px;
}

.popup {
    font-family: 'Montserrat', sans-serif;
    padding: 14px 17px 13px;
}

.popup-head {
    margin: 0 0 10px 0;
    padding: 0 34px 0 0;
}
.popup-name {
    font-size: 17px;
    font-weight: 700;
    color: var(--popup-text);
    letter-spacing: -.1px;
    line-height: 1.2;
}
.popup-region {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: .3px;
    margin-top: 3px;
    line-height: 1.2;
}

.popup-statuses {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0 0 10px 0;
}
.popup-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
}
.popup-status {
    --c: #6a6e72;
    --bg: rgba(255, 255, 255, .06);
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--bg);
    color: var(--c);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: .2px;
    line-height: 1;
    width: fit-content;
}
body.theme-light .popup-status { --bg: rgba(0, 0, 0, .05); }
.popup-status .p-dot {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: 50%;
    background: var(--c);
    display: block;
}
.popup-status.s0    { --c: #22c55e; --bg: rgba(34, 197, 94, .14); }
.popup-status.s1    { --c: #b8860b; --bg: rgba(245, 210, 74, .22); }
.popup-status.s2    { --c: #e53935; --bg: rgba(229, 57, 53, .18); }
.popup-status.s3    { --c: #8b1a1a; --bg: rgba(122, 30, 30, .18); }
.popup-status.s4    { --c: #d2691e; --bg: rgba(242, 160, 74, .22); }
.popup-status.s-none{ --c: var(--text-muted); --bg: rgba(128, 128, 128, .12); }

.popup-status-time {
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    letter-spacing: .3px;
    color: var(--text-muted);
    white-space: nowrap;
}

.leaflet-popup.district-popup .leaflet-popup-content {
    width: max-content;
    min-width: 280px;
    max-width: 320px;
}
.leaflet-popup.district-popup .popup {
    padding: 14px 16px 13px;
}
.leaflet-popup.district-popup .popup-head {
    margin-bottom: 12px;
    padding-right: 28px;
}
.leaflet-popup.district-popup .popup-name {
    font-size: 15px;
    line-height: 1.25;
}
.leaflet-popup.district-popup .popup-region {
    margin-top: 5px;
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: .3px;
    line-height: 1.3;
}
.leaflet-popup.district-popup .popup-statuses {
    gap: 8px;
    margin-bottom: 0;
}
.leaflet-popup.district-popup .popup-status-row {
    gap: 14px;
}
.leaflet-popup.district-popup .popup-status {
    font-size: 13px;
    padding: 5px 11px;
    gap: 7px;
}
.leaflet-popup.district-popup .popup-status .p-dot {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
}
.leaflet-popup.district-popup .popup-status-time {
    font-size: 12px;
}

.popup-bpla {
    margin-top: 0;
    display: grid !important;
    grid-template-columns: max-content 1fr !important;
    align-items: center !important;
    column-gap: 14px !important;
    padding: 12px 17px !important;
    border-radius: 12px;
    background: rgba(229, 72, 77, .08);
    border-left: 4px solid #e5484d;
    min-height: 50px;
}
.popup-bpla .bpla-count {
    font-size: 26px;
    font-weight: 800;
    line-height: 1;
    color: #ff7a7e;
    letter-spacing: -1px;
    text-align: center;
    white-space: nowrap;
    min-width: 0;
    padding: 0;
    margin: 0;
}
body.theme-light .popup-bpla .bpla-count { color: #d32f2f; }
.popup-bpla .bpla-count--md { font-size: 21px; letter-spacing: -.5px; }
.popup-bpla .bpla-count--sm { font-size: 18px; letter-spacing: -.5px; }

.popup-bpla .bpla-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    min-width: 0;
}
.popup-bpla .bpla-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 1.2px;
    text-transform: uppercase;
}
.popup-bpla .bpla-hint {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: .2px;
}

.popup-airports {
    margin-top: 10px;
    padding-top: 12px;
    border-top: 1px solid var(--popup-border);
}
.popup-airports-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.1px;
    margin-bottom: 7px;
}
.popup-airport-row {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 5px 7px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    color: var(--popup-text);
    margin-bottom: 2px;
}
.popup-airport-row:last-child { margin-bottom: 0; }
.popup-airport-row .ap-name {
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.popup-airport-row .ap-code {
    flex: 0 0 48px;
    width: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: .5px;
    padding: 2px 0;
    background: rgba(128, 128, 128, .12);
    border-radius: 4px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.popup-airport-row .ap-closed {
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 800;
    color: #ff7a7e;
    letter-spacing: .5px;
    text-transform: uppercase;
    text-align: right;
}
body.theme-light .popup-airport-row .ap-closed { color: #d32f2f; }

.popup-hint {
    margin-top: 10px;
    padding-top: 12px;
    border-top: 1px solid var(--popup-border);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: .8px;
    text-transform: uppercase;
}

.popup-airport-name {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--popup-text);
    letter-spacing: .1px;
    margin-bottom: 7px;
    padding-right: 18px;
    white-space: nowrap;
}
.popup-airport-code-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}
.popup-airport-code {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 46px;
    width: 46px;
    font-size: 12px;
    font-weight: 500;
    color: var(--popup-text);
    background: rgba(128, 128, 128, .14);
    padding: 2px 0;
    border-radius: 4px;
    letter-spacing: .5px;
    white-space: nowrap;
    box-sizing: border-box;
    font-variant-numeric: tabular-nums;
}
.popup-airport-closed {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 500;
    color: #ff7a7e;
    background: rgba(229, 72, 77, .12);
    border-left: 3px solid #e5484d;
    padding: 4px 8px;
    border-radius: 5px;
    letter-spacing: .4px;
    text-transform: uppercase;
    flex: 0 0 auto;
    white-space: nowrap;
}
body.theme-light .popup-airport-closed {
    color: #d32f2f;
    background: rgba(229, 72, 77, .08);
}

.top-right-stack {
    position: absolute;
    z-index: 2500;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    pointer-events: none;
}
.top-right-stack > * { pointer-events: auto; }

.top-left-stack {
    position: absolute;
    z-index: 2500;
    top: 20px;
    left: 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    pointer-events: none;
}
.top-left-stack > * { pointer-events: auto; }
.map-data-error {
    max-width: 260px;
    padding: 9px 12px;
    border: 1px solid var(--legend-border);
    border-radius: 12px;
    background: var(--legend-bg);
    color: var(--text-color);
    font: 600 11px/1.4 'Montserrat', sans-serif;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
}
.map-data-error[hidden] { display: none; }

.fab-stack-top {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
}

.fab-stack-bottom {
    position: absolute;
    z-index: 2500;
    bottom: 20px;
    right: 20px;
}
.online-viewer-count {
    position: absolute;
    top: 0;
    right: calc(var(--fab-size) + 10px);
    height: var(--fab-size);
    min-width: 64px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 12px;
    box-sizing: border-box;
    border: 1px solid var(--legend-border);
    border-radius: 999px;
    background: var(--fab-about-bg);
    color: var(--fab-icon-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .3);
    font: 700 14px/1 'Montserrat', sans-serif;
    pointer-events: none;
}
.legend:not(.is-collapsed) + .online-viewer-count { display: none; }
.online-viewer-count strong { font-weight: 800; font-variant-numeric: tabular-nums; }
.online-viewer-dot {
    position: relative;
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, .65);
}
.online-viewer-dot::after {
    content: '';
    position: absolute;
    inset: -5px;
    border: 1px solid rgba(34, 197, 94, .52);
    border-radius: 50%;
    animation: online-sonar 1.7s ease-out infinite;
}
@keyframes online-sonar {
    0% { opacity: .9; transform: scale(.55); }
    80%, 100% { opacity: 0; transform: scale(1.75); }
}
@media (prefers-reduced-motion: reduce) {
    .online-viewer-dot::after { animation: none; opacity: 0; }
}

.legend {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    padding: 12px 14px;
    border-radius: 14px;
    background: var(--legend-bg);
    backdrop-filter: blur(18px) saturate(1.6);
    -webkit-backdrop-filter: blur(18px) saturate(1.6);
    color: var(--text-color);
    font-family: 'Montserrat', sans-serif;
    border: 1px solid var(--legend-border);
    overflow: hidden;
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 40px);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transition:
        width .38s cubic-bezier(.4, 0, .2, 1),
        height .38s cubic-bezier(.4, 0, .2, 1),
        border-radius .38s cubic-bezier(.4, 0, .2, 1),
        background-color .25s ease,
        border-color .25s ease,
        box-shadow .25s ease,
        transform .15s ease,
        filter .15s ease;
}
body.theme-light .legend {
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.10),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.legend.is-collapsed,
body.theme-light .legend.is-collapsed {
    width: var(--fab-size);
    height: var(--fab-size);
    border-radius: 50%;
    border-color: transparent;
    background: var(--fab-about-bg);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .3);
    transform: none;
}
.legend.is-collapsed:hover {
    transform: translateY(-1px);
    filter: brightness(1.08);
}
.legend.is-collapsed:active {
    transform: translateY(0);
}

.legend-body {
    flex: 0 0 auto;
    opacity: 1;
    transition: opacity .22s ease;
}
.legend.is-collapsed .legend-body {
    opacity: 0;
    pointer-events: none;
}

.legend-toggle {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--legend-title-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: .6;
    z-index: 2;
    transition:
        top .38s cubic-bezier(.4, 0, .2, 1),
        right .38s cubic-bezier(.4, 0, .2, 1),
        width .38s cubic-bezier(.4, 0, .2, 1),
        height .38s cubic-bezier(.4, 0, .2, 1),
        opacity .2s ease,
        background-color .15s ease,
        color .2s ease;
}
.legend-toggle:hover { opacity: 1; background: rgba(128, 128, 128, .15); }

.legend-icon {
    display: block;
    width: 100%;
    height: 100%;
}
.legend-icon--expanded { width: 16px; height: 16px; }
.legend-icon--collapsed { display: none; width: 22px; height: 22px; }

.legend.is-collapsed .legend-toggle {
    top: 0;
    right: 0;
    width: var(--fab-size);
    height: var(--fab-size);
    opacity: 1;
    color: var(--fab-icon-color);
    background: transparent;
}
.legend.is-collapsed .legend-toggle:hover {
    background: transparent;
}

.legend.is-collapsed .legend-icon--expanded { display: none; }
.legend.is-collapsed .legend-icon--collapsed { display: inline-block; }

.legend-title {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.3px;
    text-transform: uppercase;
    color: var(--legend-title-color);
    margin: 0 0 14px 0;
    padding: 0 40px 0 0;
}
.legend-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: start;
    justify-items: stretch;
    gap: 9px 20px;
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 500;
    color: var(--legend-item-color);
    white-space: normal;
    min-height: 18px;
    min-width: 0;
    line-height: 1.35;
}
.legend-item > span:last-child {
    overflow-wrap: break-word;
    min-width: 0;
}
.legend-item .dot,
.legend-item .airport-svg-small {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    display: block;
}
.legend-item .dot {
    position: relative;
    border-radius: 0;
    background: transparent;
}
.legend-item .dot::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 11px;
    height: 11px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: var(--dot-color, #fff);
}
.dot.yellow  { --dot-color: var(--yellow); }
.dot.red     { --dot-color: #ff6b6b; }
.dot.orange  { --dot-color: var(--orange); }
.dot.darkred { --dot-color: #9c2626; }
.legend-item .airport-svg-small {
    color: #16a8cf;
}

.legend-item .district-fix-swatch {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    border-radius: 50%;
    background: #FFC800;
    border: 2px solid #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .5);
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}
body.theme-light .legend-item .district-fix-swatch {
    border-color: #2a2a2e;
}
.legend-item .district-fix-swatch svg {
    width: 10px;
    height: 10px;
    fill: #111111;
    transform: rotate(-90deg);
    display: block;
}

.legend-item .district-safety-swatch {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    border-radius: 50%;
    background: #ff6848;
    border: 2px solid #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .5);
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}
body.theme-light .legend-item .district-safety-swatch { border-color: #2a2a2e; }
.legend-item .district-safety-swatch svg {
    width: 11px;
    height: 11px;
    fill: #111111;
    display: block;
}

.district-fix-marker {
    position: relative;
    width: 30px;
    height: 30px;
    pointer-events: none;
}
.district-fix-marker .halo {
    position: absolute;
    left: 50%; top: 50%;
    width: 50px; height: 50px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle at center,
        rgba(255, 200, 0, .55) 0%,
        rgba(255, 200, 0, .16) 45%,
        rgba(255, 200, 0, 0) 72%);
    pointer-events: none;
}
.district-fix-marker .circle {
    position: absolute;
    left: 50%; top: 50%;
    width: 26px; height: 26px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: #FFC800;
    border: 2px solid #ffffff;
    box-shadow: 0 1px 5px rgba(0, 0, 0, .6);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    cursor: pointer;
}
body.theme-light .district-fix-marker .circle {
    border-color: #2a2a2e;
}
.district-fix-marker .circle svg {
    width: 17px;
    height: 17px;
    fill: #111111;
    transform: rotate(-90deg);
    display: block;
}

.district-safety-marker {
    position: relative;
    width: 30px;
    height: 30px;
    pointer-events: none;
}
.district-safety-marker .halo {
    position: absolute;
    left: 50%; top: 50%;
    width: 50px; height: 50px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle at center,
        rgba(255, 104, 72, .6) 0%,
        rgba(255, 104, 72, .17) 45%,
        rgba(255, 104, 72, 0) 72%);
    pointer-events: none;
}
.district-safety-marker .circle {
    position: absolute;
    left: 50%; top: 50%;
    width: 26px; height: 26px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: #ff6848;
    border: 2px solid #ffffff;
    box-shadow: 0 1px 5px rgba(0, 0, 0, .6);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    cursor: pointer;
}
body.theme-light .district-safety-marker .circle { border-color: #2a2a2e; }
.district-safety-marker .circle svg {
    width: 17px;
    height: 17px;
    fill: #111111;
    display: block;
}

.airport-marker {
    position: relative;
    width: 100%;
    height: 100%;
    pointer-events: auto;
    cursor: pointer;
}
.airport-marker .airport-svg-big {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 28px;
    height: 28px;
    display: block;
}
.airport-svg-small { width: 18px; height: 18px; display: block; }

.region-label-marker {
    background: transparent !important;
    border: none !important;
    pointer-events: none !important;
    overflow: visible !important;
}
.region-label {
    position: absolute;
    left: 0;
    top: 0;
    transform: translate(-50%, -50%);
    display: inline-block;
    font-family: 'Montserrat', sans-serif;
    font-size: var(--label-size, 13px);
    font-weight: 600;
    letter-spacing: .4px;
    line-height: 1.3;
    color: var(--label-color);
    white-space: nowrap;
    pointer-events: none;
    user-select: none;
    text-align: center;
    opacity: 0;
    transition: opacity .28s cubic-bezier(.22,.72,.24,1);
    will-change: opacity;
}
.region-label.is-visible { opacity: 1; }

.city-label-marker {
    background: transparent !important;
    border: 0 !important;
    pointer-events: none !important;
    overflow: visible !important;
}
.city-label {
    position: absolute;
    left: 0;
    top: 0;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    width: max-content;
    max-width: 180px;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    text-align: center;
    line-height: 1.15;
    white-space: nowrap;
    user-select: none;
    pointer-events: none;
    opacity: 0;
}
.city-label.is-visible { opacity: 1; }
.city-label-name { font-size: 11px; font-weight: 700; }
body.theme-light .city-label {
    color: var(--label-color);
}

.city-data-attribution {
    margin: 0 6px 5px 0 !important;
    padding: 2px 5px !important;
    border-radius: 4px;
    background: rgba(11, 20, 28, .78) !important;
    color: #b8c9d5 !important;
    font: 9px/1.25 'Montserrat', sans-serif !important;
}
.city-data-attribution a { color: #a9d9f6 !important; }
body.theme-light .city-data-attribution {
    background: rgba(255, 255, 255, .82) !important;
    color: #455b69 !important;
}
body.theme-light .city-data-attribution a { color: #27698e !important; }

#map::after {
    --wm-tile-w:   280px;
    --wm-tile-h:   180px;
    content: "";
    position: absolute;
    inset: 0;
    z-index: 480;
    pointer-events: none;
    user-select: none;

    opacity: 0.18;
    mix-blend-mode: screen;
    background-repeat: repeat;
    background-size: var(--wm-tile-w) var(--wm-tile-h);
    background-position: 0 0;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='280' height='180' viewBox='0 0 280 180'%3E%3Cg transform='translate(140 90) rotate(-24)'%3E%3Ctext x='0' y='0' text-anchor='middle' font-family='Montserrat, Arial, sans-serif' font-size='19' font-weight='800' letter-spacing='1.6' fill='%23e5edf7' fill-opacity='0.42'%3E@URAL_RADAR%3C/text%3E%3C/g%3E%3C/svg%3E");
}

#map.has-canvas-watermark::after {
    display: none;
}

body.theme-light #map::after {
    mix-blend-mode: multiply;
    opacity: 0.14;
    filter: invert(1);
}

#map > .map-watermark-canvas {
    position: absolute;
    inset: 0;
    z-index: 479;
    width: 100%;
    height: 100%;
    pointer-events: none;
    user-select: none;
}

.fab-btn {
    width: var(--fab-size);
    height: var(--fab-size);
    min-width: var(--fab-size);
    min-height: var(--fab-size);
    border-radius: 50%;
    border: 1px solid var(--legend-border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .3);
    transition: transform .15s ease, filter .15s ease, background-color .2s, color .2s;
    padding: 0;
    margin: 0;
    font-family: inherit;
    color: #fff;
}
.fab-btn svg {
    width: 22px;
    height: 22px;
    display: block;
    flex: 0 0 auto;
}
.fab-btn .icon-masked {
    width: 22px;
    height: 22px;
}
.fab-btn:hover { transform: translateY(-1px); filter: brightness(1.08); }
.fab-btn:active { transform: translateY(0); }

:where(.fab-btn, .fab-tg, .fab-coffee-btn, .legend-toggle, .ruler-action,
       .weapon-panel-close, .weapon-remove, .about-close, .heart-close):focus-visible {
    outline: 2px solid #2aabee;
    outline-offset: 3px;
}

.fab-about,
.fab-theme,
.fab-heart,
.fab-ruler,
.fab-weapon,
.online-viewer-count {
    background-color: var(--fab-about-bg);
    color: var(--fab-icon-color);
}

.fab-ruler.is-active,
.fab-weapon.is-active {
    background-color: #2AABEE !important;
    color: #ffffff !important;
    box-shadow: 0 2px 12px rgba(42, 171, 238, .55);
}

.fab-tg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: transform .15s ease, filter .15s ease;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .35));
}
.fab-tg img {
    width: var(--fab-size);
    height: var(--fab-size);
    display: block;
    pointer-events: none;
}
.fab-tg:hover { transform: translateY(-1px); filter: brightness(1.08) drop-shadow(0 3px 8px rgba(0, 0, 0, .4)); }
.fab-tg:active { transform: translateY(0); }

.fab-coffee-btn,
.fab-coffee-btn:link,
.fab-coffee-btn:visited,
.fab-coffee-btn:hover,
.fab-coffee-btn:active,
.fab-coffee-btn:focus {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    height: var(--fab-size);
    padding: 0 18px 0 14px;
    border-radius: 999px;
    background: var(--fab-about-bg);
    color: var(--fab-icon-color) !important;
    border: 1px solid rgba(255, 255, 255, 0.10);
    text-decoration: none;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .2px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .3);
    backdrop-filter: blur(18px) saturate(1.6);
    -webkit-backdrop-filter: blur(18px) saturate(1.6);
    transition:
        transform .15s ease,
        filter .15s ease,
        background-color .25s ease,
        color .25s ease,
        border-color .25s ease,
        box-shadow .25s ease;
    user-select: none;
    white-space: nowrap;
}

.fab-coffee-btn::after {
    content: "";
    position: absolute;
    top: -50%;
    left: -60%;
    width: 40%;
    height: 200%;
    background: linear-gradient(
        115deg,
        rgba(255, 255, 255, 0)    0%,
        rgba(255, 255, 255, 0.08) 42%,
        rgba(255, 255, 255, 0.22) 50%,
        rgba(255, 255, 255, 0.08) 58%,
        rgba(255, 255, 255, 0)    100%
    );
    transform: skewX(-18deg);
    animation: coffee-shine 6s ease-in-out infinite;
    pointer-events: none;
    border-radius: inherit;
}

@keyframes coffee-shine {
    0%, 55% {
        left: -60%;
        opacity: 0;
    }
    60% {
        opacity: 1;
    }
    88%, 100% {
        left: 140%;
        opacity: 0;
    }
}

.fab-coffee-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.14);
    box-shadow:
        0 3px 12px rgba(0, 0, 0, .38),
        0 0 22px rgba(255, 255, 255, 0.05);
}
.fab-coffee-btn:active {
    transform: translateY(0);
}

body.theme-light .fab-coffee-btn,
body.theme-light .fab-coffee-btn:link,
body.theme-light .fab-coffee-btn:visited,
body.theme-light .fab-coffee-btn:hover,
body.theme-light .fab-coffee-btn:active,
body.theme-light .fab-coffee-btn:focus {
    background: var(--fab-about-bg);
    color: var(--fab-icon-color) !important;
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
}
body.theme-light .fab-coffee-btn:hover {
    box-shadow:
        0 3px 12px rgba(0, 0, 0, .16),
        0 0 22px rgba(255, 255, 255, 0.15);
}

.fab-coffee-icon {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    display: block;
    color: currentColor !important;
    stroke: currentColor !important;
    overflow: visible;
}

.fab-coffee-icon .steam {
    transform-box: view-box;
    animation: coffee-steam 2.4s ease-in-out infinite;
}
.fab-coffee-icon .steam-1 { animation-delay: 0s; }
.fab-coffee-icon .steam-2 { animation-delay: .35s; }
.fab-coffee-icon .steam-3 { animation-delay: .7s; }

@keyframes coffee-steam {
    0%   { transform: translateY(0);     opacity: 0;   }
    25%  { transform: translateY(-1.6px); opacity: 1;   }
    70%  { transform: translateY(-3.6px); opacity: .55; }
    100% { transform: translateY(-5px);   opacity: 0;   }
}

.fab-coffee-text {
    color: inherit !important;
    line-height: 1;
}

.fab-theme .icon-moon { display: none; }
body.theme-light .fab-theme .icon-sun { display: none; }
body.theme-light .fab-theme .icon-moon { display: inline-block; }

.ruler-panel {
    position: absolute;
    z-index: 2600;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 14px 14px 12px;
    border-radius: 16px;
    background: var(--legend-bg);
    backdrop-filter: blur(18px) saturate(1.6);
    -webkit-backdrop-filter: blur(18px) saturate(1.6);
    border: 1px solid var(--legend-border);
    color: var(--text-color);
    font-family: 'Montserrat', sans-serif;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
body.theme-light .ruler-panel {
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.10),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.ruler-panel[hidden] { display: none; }

.ruler-panel-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.3px;
    text-transform: uppercase;
    color: var(--legend-title-color);
    text-align: center;
    margin-bottom: -6px;
}

.ruler-panel-value {
    font-size: 26px;
    font-weight: 600;
    line-height: 1;
    color: #2AABEE;
    letter-spacing: -.4px;
    text-align: center;
    font-variant-numeric: tabular-nums;
    padding: 0;
    width: 160px;
    white-space: nowrap;
    overflow: hidden;
    margin: 0 auto;
}

.ruler-panel-actions {
    display: flex;
    gap: 6px;
    justify-content: center;
}
.ruler-action {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 10px;
    border: 1px solid var(--legend-border);
    background: rgba(128, 128, 128, .12);
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color .15s, border-color .15s, opacity .15s;
}
.ruler-action .icon-masked {
    width: 20px;
    height: 20px;
}
.ruler-action:hover:not(:disabled) {
    background: rgba(128, 128, 128, .22);
}
.ruler-action:disabled {
    opacity: .35;
    cursor: default;
}
.ruler-action.is-resume {
    background: #2AABEE;
    color: #ffffff;
    border-color: transparent;
}
.ruler-action.is-resume:hover:not(:disabled) {
    background: #1a95d8;
}

.ruler-seg-label {
    background: var(--popup-bg) !important;
    color: var(--popup-text) !important;
    border: 1px solid var(--popup-border) !important;
    border-radius: 12px !important;
    padding: 8px 8px 9px !important;
    font-family: 'Montserrat', sans-serif !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    font-variant-numeric: tabular-nums;
    letter-spacing: .2px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .34) !important;
    width: max-content;
    min-width: min(292px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
    white-space: normal;
}
.ruler-seg-label::before { display: none !important; }
body.theme-light .ruler-seg-label {
    box-shadow: 0 8px 28px rgba(0, 0, 0, .14) !important;
}

.ruler-label-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 22px;
    color: var(--popup-text);
    margin: 0 1px 6px;
    padding: 0 0 6px;
    border-bottom: 1px solid var(--popup-border);
}
.ruler-label-caption {
    color: var(--text-muted);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .55px;
    text-transform: uppercase;
}
.ruler-label-main strong {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -.25px;
}
.ruler-label-head,
.ruler-label-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 6px;
}
.ruler-label-head {
    padding: 0 4px;
    margin-bottom: 4px;
    color: var(--text-muted);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .35px;
    text-transform: uppercase;
}
.ruler-label-head > span:nth-child(2) {
    text-align: right;
}
.ruler-label-row {
    min-height: 0;
    padding: 4px 5px;
    border-radius: 6px;
    background: rgba(255, 255, 255, .045);
    font-size: 10.5px;
    font-weight: 600;
    line-height: 1.35;
    margin-top: 3px;
}
body.theme-light .ruler-label-row {
    background: rgba(0, 0, 0, .04);
}

.ruler-label-name {
    min-width: 0;
    white-space: normal;
    font-weight: 600;
    color: var(--popup-text);
    letter-spacing: 0;
    text-align: left;
}

.ruler-label-time {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 5px;
    border-radius: 4px;
    background: rgba(42, 171, 238, .14);
    font-weight: 700;
    color: #58c4f3;
    font-variant-numeric: tabular-nums;
    letter-spacing: .2px;
    white-space: nowrap;
    justify-self: end;
}
body.theme-light .ruler-label-time {
    background: rgba(42, 171, 238, .12);
    color: #0879ad;
}

.ruler-label-time--out {
    background: rgba(128, 128, 128, .10) !important;
    color: var(--text-muted) !important;
}
body.theme-light .ruler-label-time--out {
    background: rgba(0, 0, 0, .05) !important;
    color: var(--text-muted) !important;
}

body.ruler-active .leaflet-overlay-pane,
body.ruler-active .leaflet-marker-pane,
body.ruler-active .leaflet-shadow-pane,
body.ruler-active .leaflet-tooltip-pane,
body.ruler-active .leaflet-popup-pane {
    pointer-events: none !important;
}

.weapon-panel {
    position: absolute;
    z-index: 2600;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(320px, calc(100vw - 40px));
    padding: 14px 14px 12px;
    border-radius: 16px;
    background: var(--legend-bg);
    backdrop-filter: blur(18px) saturate(1.6);
    -webkit-backdrop-filter: blur(18px) saturate(1.6);
    border: 1px solid var(--legend-border);
    color: var(--text-color);
    font-family: 'Montserrat', sans-serif;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
body.theme-light .weapon-panel {
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.10),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.weapon-panel[hidden] { display: none; }

.weapon-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.weapon-panel-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.3px;
    text-transform: uppercase;
    color: var(--legend-title-color);
}
.weapon-panel-close {
    width: 26px;
    height: 26px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--text-muted);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color .15s, color .15s;
}
.weapon-panel-close:hover {
    background: rgba(128, 128, 128, .15);
    color: var(--text-color);
}

.weapon-panel-hint {
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    color: var(--text-muted);
    line-height: 1.35;
    padding: 0 4px 8px;
    border-bottom: 1px dashed var(--legend-border);
}

.weapon-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 116px;
    overflow-y: auto;
    margin: 0 -4px;
    padding: 0 4px;
}
.weapon-list::-webkit-scrollbar { width: 6px; }
.weapon-list::-webkit-scrollbar-track { background: transparent; }
.weapon-list::-webkit-scrollbar-thumb {
    background: rgba(128, 128, 128, .3);
    border-radius: 3px;
}

.weapon-item {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 12px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: rgba(128, 128, 128, .10);
    color: var(--text-color);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: background-color .15s, border-color .15s, color .15s;
}
.weapon-item:hover {
    background: rgba(128, 128, 128, .20);
}
.weapon-item.is-active {
    background: #2AABEE;
    border-color: #2AABEE;
    color: #ffffff;
}
.weapon-item-name {
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.weapon-item-range {
    flex: 0 0 auto;
    font-variant-numeric: tabular-nums;
    font-size: 12px;
    font-weight: 700;
    opacity: .85;
}

.weapon-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px 12px;
    margin-top: 2px;
    border-radius: 10px;
    border: 1px solid rgba(229, 72, 77, .35);
    background: rgba(229, 72, 77, .10);
    color: #ff7a7e;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color .15s, border-color .15s, color .15s;
}
.weapon-remove:hover {
    background: rgba(229, 72, 77, .20);
    border-color: rgba(229, 72, 77, .55);
}
body.theme-light .weapon-remove {
    color: #d32f2f;
    background: rgba(229, 72, 77, .08);
    border-color: rgba(229, 72, 77, .30);
}
body.theme-light .weapon-remove:hover {
    background: rgba(229, 72, 77, .14);
}
.weapon-remove .icon-masked {
    width: 16px;
    height: 16px;
}
.weapon-remove[hidden] { display: none; }

.weapon-label {
    background: var(--popup-bg) !important;
    color: var(--popup-text) !important;
    border: 1px solid var(--popup-border) !important;
    border-radius: 10px !important;
    padding: 9px 11px !important;
    font-family: 'Montserrat', sans-serif !important;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .4) !important;
    width: max-content;
    max-width: calc(100vw - 24px);
    white-space: normal;
}
.weapon-label::before { border-top-color: var(--popup-bg) !important; }
.weapon-label-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    line-height: 1.25;
}
.weapon-label-name {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: -.1px;
    white-space: nowrap;
}
.weapon-label-range {
    flex: 0 0 auto;
    padding: 4px 7px;
    border-radius: 6px;
    background: rgba(42, 171, 238, .14);
    color: #58c4f3;
    font-size: 11px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
body.theme-light .weapon-label {
    box-shadow: 0 2px 8px rgba(0, 0, 0, .18) !important;
}
body.theme-light .weapon-label-range {
    background: rgba(42, 171, 238, .12);
    color: #0879ad;
}

body.weapon-active .leaflet-overlay-pane,
body.weapon-active .leaflet-marker-pane,
body.weapon-active .leaflet-shadow-pane,
body.weapon-active .leaflet-tooltip-pane,
body.weapon-active .leaflet-popup-pane {
    pointer-events: none !important;
}

body.weapon-active.weapon-placed .leaflet-overlay-pane,
body.weapon-active.weapon-placed .leaflet-marker-pane,
body.weapon-active.weapon-placed .leaflet-shadow-pane,
body.weapon-active.weapon-placed .leaflet-tooltip-pane,
body.weapon-active.weapon-placed .leaflet-popup-pane {
    pointer-events: auto !important;
}

.about-overlay {
    position: absolute;
    z-index: 4000;
    inset: 0;
    background: rgba(0, 0, 0, .6);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
body.theme-light .about-overlay { background: rgba(255, 255, 255, .55); }
.about-overlay[hidden] { display: none; }

.about-modal {
    position: relative;
    background: var(--about-bg);
    color: var(--text-color);
    font-family: 'Montserrat', sans-serif;
    width: 100%;
    max-width: 460px;
    max-height: 88vh;
    overflow-y: auto;
    border-radius: 14px;
    border: 1px solid var(--about-border);
    padding: 22px 22px 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .6);
    line-height: 1.5;
    transition: background-color .2s, color .2s;

    -webkit-user-select: text;
    user-select: text;
}
.about-modal::-webkit-scrollbar { width: 6px; }
.about-modal::-webkit-scrollbar-track { background: transparent; }
.about-modal::-webkit-scrollbar-thumb { background: rgba(128, 128, 128, .3); border-radius: 3px; }

.about-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--about-border);
    background: transparent;
    color: var(--text-muted);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: color .15s, border-color .15s;
}
.about-close:hover { color: var(--text-color); border-color: var(--text-muted); }

.about-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--about-title-color);
    margin: 0 0 14px;
    letter-spacing: -.2px;
    padding-right: 30px;
}

.about-text {
    font-size: 13.5px;
    color: var(--about-text);
    margin: 0 0 12px;
    line-height: 1.6;
}
.about-text b { color: var(--about-title-color); font-weight: 700; }
.about-text:last-child { margin-bottom: 0; }

.about-list {
    margin: 0 0 12px;
    padding-left: 22px;
    font-size: 13.5px;
    color: var(--about-text);
    line-height: 1.7;
}
.about-list li {
    margin: 0;
    padding: 0;
}
.about-list li::marker {
    color: var(--text-muted);
}

.about-links {
    margin: 14px 0 0;
    padding-top: 12px;
    border-top: 1px solid var(--about-border);
}
.about-links a {
    color: #2AABEE;
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
}
.about-links a:hover { text-decoration: underline; }

.heart-overlay {
    position: absolute;
    z-index: 4000;
    inset: 0;
    background: rgba(0, 0, 0, .6);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
body.theme-light .heart-overlay { background: rgba(255, 255, 255, .55); }
.heart-overlay[hidden] { display: none; }

.heart-modal {
    position: relative;
    background: var(--about-bg);
    color: var(--text-color);
    font-family: 'Montserrat', sans-serif;
    width: 100%;
    max-width: 460px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    border-radius: 14px;
    border: 1px solid var(--about-border);
    padding: 22px 22px 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .6);
    line-height: 1.5;
    transition: background-color .2s, color .2s;
}
.heart-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--about-border);
    background: transparent;
    color: var(--text-muted);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: color .15s, border-color .15s;
}
.heart-close:hover { color: var(--text-color); border-color: var(--text-muted); }

.heart-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--about-title-color);
    margin: 0 0 14px;
    letter-spacing: -.2px;
    padding-right: 30px;
}

.heart-text {
    font-size: 13.5px;
    color: var(--about-text);
    margin: 0 0 12px;
    line-height: 1.6;
    flex: 0 0 auto;
}
.heart-text:last-of-type {
    margin-bottom: 16px;
}

.heart-list {
    list-style: none;
    margin: 0;
    padding: 4px 4px 4px 0;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
}
.heart-list li {
    display: flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--about-text);
    letter-spacing: .1px;
}
.heart-list::-webkit-scrollbar { width: 6px; }
.heart-list::-webkit-scrollbar-track { background: transparent; }
.heart-list::-webkit-scrollbar-thumb {
    background: rgba(128, 128, 128, .3);
    border-radius: 3px;
}
.heart-list::-webkit-scrollbar-thumb:hover {
    background: rgba(128, 128, 128, .5);
}

@media(max-width:700px) {
    :root {
        --fab-size: 42px;
    }

    .top-right-stack {
        top: 10px;
        right: 10px;
        left: 10px;
        align-items: flex-end;
        gap: 8px;
    }
    .top-left-stack {
        top: 10px;
        left: 10px;
        gap: 8px;
    }
    .fab-coffee-btn,
    .fab-coffee-btn:link,
    .fab-coffee-btn:visited,
    .fab-coffee-btn:hover,
    .fab-coffee-btn:active,
    .fab-coffee-btn:focus {
        gap: 7px;
        padding: 0 14px 0 11px;
        font-size: 13px;
    }
    .fab-coffee-icon {
        width: 18px;
        height: 18px;
        flex: 0 0 18px;
    }
    .fab-stack-top { gap: 8px; }
    .online-viewer-count {
        right: calc(var(--fab-size) + 8px);
        min-width: 60px;
        padding: 0 10px;
        font-size: 13px;
    }

    .legend {
        max-width: 100%;
        padding: 11px 12px;
    }
    .legend:not(.is-collapsed) {
        margin-top: calc(var(--fab-size) + 8px);
    }
    .legend-title {
        font-size: 10px;
        margin-bottom: 11px;
        padding-right: 36px;
    }
    .legend-toggle {
        top: 2px;
        right: 2px;
        width: 24px;
        height: 24px;
    }
    .legend-icon--expanded { width: 14px; height: 14px; }
    .legend-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px 12px;
    }
    .legend-item {
        font-size: 11px;
        gap: 6px;
        min-width: 0;
        white-space: normal;
        align-items: center;
    }
    .legend-item > span:last-child {
        overflow-wrap: anywhere;
        line-height: 1.2;
    }

    .legend-item .dot,
    .legend-item .airport-svg-small {
        width: 18px;
        height: 18px;
        flex: 0 0 18px;
    }
    .legend-item .dot::before {
        width: 11px;
        height: 11px;
    }

    .legend-item .district-fix-swatch {
        width: 18px;
        height: 18px;
        flex: 0 0 18px;
    }
    .legend-item .district-fix-swatch svg {
        width: 10px;
        height: 10px;
    }

    .airport-marker .airport-svg-big { width: 22px; height: 22px; }

    #map::after {
        --wm-tile-w: 220px;
        --wm-tile-h: 150px;
    }

    .leaflet-popup.region-popup .leaflet-popup-content {
        width: max-content;
        min-width: 260px;
        max-width: 92vw;
    }
    .leaflet-popup.region-popup .popup {
        padding: 13px 14px 12px;
    }
    .leaflet-popup.region-popup .popup-name {
        font-size: 15px;
    }
    .leaflet-popup.region-popup .popup-status {
        font-size: 13px;
        padding: 5px 11px;
    }
    .leaflet-popup.region-popup .popup-status .p-dot {
        width: 7px;
        height: 7px;
        flex: 0 0 7px;
    }

    .leaflet-popup.airport-popup .leaflet-popup-content {
        width: max-content;
        min-width: 170px;
        max-width: 88vw;
    }
    .leaflet-popup.airport-popup .popup {
        padding: 11px 12px 10px;
    }
    .leaflet-popup.airport-popup .popup-airport-name {
        font-size: 12.5px;
    }

    .leaflet-popup.district-popup .leaflet-popup-content {
        width: max-content;
        min-width: 220px;
        max-width: 90vw;
    }
    .leaflet-popup.district-popup .popup {
        padding: 12px 13px 11px;
    }
    .leaflet-popup.district-popup .popup-head {
        margin-bottom: 10px;
        padding-right: 24px;
    }
    .leaflet-popup.district-popup .popup-name {
        font-size: 14px;
        line-height: 1.25;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }
    .leaflet-popup.district-popup .popup-region {
        margin-top: 4px;
        font-size: 11.5px;
        line-height: 1.3;
    }
    .leaflet-popup.district-popup .popup-statuses {
        gap: 6px;
        margin-bottom: 0;
    }
    .leaflet-popup.district-popup .popup-status-row {
        gap: 10px;
    }
    .leaflet-popup.district-popup .popup-status {
        font-size: 12px;
        padding: 4px 10px;
        gap: 6px;
    }
    .leaflet-popup.district-popup .popup-status .p-dot {
        width: 6px;
        height: 6px;
        flex: 0 0 6px;
    }
    .leaflet-popup.district-popup .popup-status-time {
        font-size: 11px;
    }

    .popup-name {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        font-size: 14px;
    }
    .popup { padding: 10px 12px 9px; }
    .popup-head { margin-bottom: 8px; }

    .popup-statuses { gap: 5px; }
    .popup-status {
        font-size: 12px;
        padding: 3px 9px;
    }
    .popup-status .p-dot { width: 5px; height: 5px; flex: 0 0 5px; }
    .popup-status-time { font-size: 11px; }

    .popup-bpla { column-gap: 8px !important; padding: 8px 10px !important; }
    .popup-bpla .bpla-count { font-size: 20px; }
    .popup-bpla .bpla-count--md { font-size: 16px; }
    .popup-bpla .bpla-count--sm { font-size: 13px; }

    .popup-airports { margin-top: 8px; }

    .popup-airport-row { font-size: 12px; padding: 4px 5px; }
    .popup-airport-row .ap-code {
        flex: 0 0 42px;
        width: 42px;
        font-size: 11px;
    }
    .popup-airport-name { font-size: 12px; font-weight: 600; }
    .popup-airport-code-row { flex-wrap: wrap; }
    .popup-airport-code {
        flex: 0 0 40px;
        width: 40px;
        font-size: 11px;
    }
    .popup-airport-closed { font-size: 10px; }
    .region-label { letter-spacing: .2px; }

    .fab-stack-bottom {
        bottom: 24px;
        right: 10px;
    }
    .fab-btn svg {
        width: 20px;
        height: 20px;
    }
    .fab-btn .icon-masked {
        width: 20px;
        height: 20px;
    }

    .ruler-panel {
        bottom: 20px;
        padding: 12px 12px 10px;
        gap: 12px;
    }
    .ruler-panel-label { font-size: 9px; }
    .ruler-panel-value { font-size: 22px; width: 140px; }
    .ruler-panel-actions { gap: 5px; }
    .ruler-action { width: 36px; height: 36px; border-radius: 9px; }
    .ruler-action .icon-masked { width: 18px; height: 18px; }

    .ruler-seg-label {
        min-width: min(292px, calc(100vw - 24px));
        padding: 8px 9px !important;
    }
    .ruler-label-main { margin-bottom: 5px; padding-bottom: 5px; }
    .ruler-label-main strong { font-size: 14px; }
    .ruler-label-head { font-size: 9px; column-gap: 6px; }
    .ruler-label-row { font-size: 10px; column-gap: 6px; margin-top: 2px; }

    .weapon-panel {
        bottom: 20px;
        width: min(300px, calc(100vw - 24px));
        padding: 12px 12px 10px;
        gap: 8px;
    }
    .weapon-panel-title { font-size: 10px; }
    .weapon-panel-hint { font-size: 11px; padding-bottom: 6px; }
    .weapon-item { padding: 8px 10px; font-size: 12px; gap: 8px; }
    .weapon-item-range { font-size: 11px; }
    .weapon-list { max-height: 104px; }
    .weapon-label { padding: 8px 10px !important; }
    .weapon-label-name { font-size: 11px; }
    .weapon-label-range { font-size: 10px; }
    .weapon-remove { padding: 9px 10px; font-size: 12px; }

    .about-overlay { padding: 12px; }
    .about-modal {
        max-height: 92vh;
        padding: 18px 16px 16px;
        border-radius: 12px;
    }
    .about-title { font-size: 17px; }
    .about-text { font-size: 12.5px; }

    .heart-overlay { padding: 12px; }
    .heart-modal {
        max-height: 92vh;
        padding: 18px 16px 16px;
        border-radius: 12px;
    }
    .heart-title { font-size: 17px; }
    .heart-text {
        font-size: 12.5px;
        margin-bottom: 12px;
        line-height: 1.55;
    }
    .heart-text:last-of-type {
        margin-bottom: 14px;
    }
    .heart-list li { font-size: 13px; padding: 3px 10px; }
}

.legend, .ruler-panel, .weapon-panel {
    border-radius: var(--ui-radius-md);
    background: var(--ui-surface);
    box-shadow: var(--ui-shadow);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}
.leaflet-popup-content-wrapper, .about-modal, .heart-modal {
    border-radius: var(--ui-radius-lg);
    box-shadow: var(--ui-shadow);
}
.fab-btn, .online-viewer-count, .fab-coffee-btn,
.fab-coffee-btn:link, .fab-coffee-btn:visited {
    background: var(--ui-control);
    box-shadow: var(--ui-shadow);
}
.fab-coffee-btn, .fab-coffee-btn:link, .fab-coffee-btn:visited {
    border-color: var(--legend-border);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}
body.theme-light .fab-coffee-btn, body.theme-light .fab-coffee-btn:link,
body.theme-light .fab-coffee-btn:visited { background: var(--ui-control); border-color: var(--legend-border); }
.about-links a, .ruler-panel-value { color: var(--ui-link); }
.fab-ruler.is-active, .fab-weapon.is-active, .ruler-action.is-resume {
    background: var(--ui-accent) !important;
    color: #fff !important;
}
:where(.fab-btn, .fab-tg, .fab-coffee-btn, .legend-toggle, .ruler-action,
       .weapon-panel-close, .weapon-remove, .about-close, .heart-close,
       .leaflet-popup-close-button, .region-history-btn):focus-visible {
    outline: 2px solid var(--ui-focus) !important;
    outline-offset: 3px;
}
.leaflet-popup-close-button {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 44px !important;
    height: 44px !important;
    top: 0 !important;
    right: 0 !important;
    line-height: 1 !important;
    font-size: 18px !important;
}
.popup-head { padding-right: 30px; }
.legend:not(.is-collapsed) .legend-toggle {
    width: 44px;
    height: 44px;
    top: 0;
    right: 0;
    opacity: 1;
}
.weapon-panel-close, .about-close, .heart-close {
    width: 44px;
    height: 44px;
    font-size: 18px;
}
.about-title, .heart-title { padding-right: 48px; }
.ruler-action { width: 44px; height: 44px; }
.weapon-panel-title, .ruler-panel-label { font-size: 12px; letter-spacing: .6px; }
.weapon-panel-hint { font-size: 13px; line-height: 1.45; }
.legend-item { font-size: 13px; }
.about-text, .heart-text, .about-list { font-size: 14px; }
.about-links a { font-size: 14px; }
.top-right-stack { max-height: calc(100dvh - 24px); }
.fab-stack-bottom { bottom: max(20px, env(safe-area-inset-bottom)); }
.ruler-panel, .weapon-panel { bottom: max(24px, env(safe-area-inset-bottom)); }
@media (prefers-reduced-motion: reduce) {
    .legend, .legend-body, .legend-toggle, .fab-btn, .fab-tg {
        transition-duration: .01ms !important;
    }
}
@media (max-width: 700px) {
    :root { --fab-size: 44px; }
    .top-right-stack { top: max(10px, env(safe-area-inset-top)); left: auto; right: 10px; }
    .top-left-stack { top: max(10px, env(safe-area-inset-top)); max-width: calc(100vw - 146px); }
    .fab-coffee-btn, .fab-coffee-btn:link, .fab-coffee-btn:visited { max-width: 100%; }
    .fab-coffee-text { overflow: hidden; text-overflow: ellipsis; }
    .fab-stack-bottom { right: 10px; bottom: max(12px, env(safe-area-inset-bottom)); }
    .ruler-panel, .weapon-panel { bottom: calc(max(12px, env(safe-area-inset-bottom)) + 56px); }
    .ruler-panel { max-width: calc(100vw - 24px); }
    .ruler-action { width: 44px; height: 44px; }
    .weapon-panel-hint { font-size: 13px; }
    .weapon-item { min-height: 44px; font-size: 13px; }
    .weapon-item-range, .weapon-remove { font-size: 12px; }
    .legend-item { font-size: 12px; line-height: 1.35; }
    .legend-title { font-size: 11px; }
    .popup-name { font-size: 15px; }
    .popup-status, .leaflet-popup.district-popup .popup-status { font-size: 13px; }
    .popup-status-time, .leaflet-popup.district-popup .popup-status-time { font-size: 12px; }
    .popup-airport-row, .popup-airport-name { font-size: 13px; }
    .about-modal, .heart-modal { border-radius: var(--ui-radius-lg); max-height: 88dvh; }
    .about-text, .heart-text, .about-list { font-size: 14px; }
}
@media (max-width: 360px) {
    .top-left-stack { max-width: calc(100vw - 142px); }
    .fab-coffee-btn, .fab-coffee-btn:link, .fab-coffee-btn:visited { padding-right: 10px; font-size: 12px; }
}
body.theme-light .about-overlay,
body.theme-light .heart-overlay { background: rgba(30, 47, 64, .32); }

 
.drone-plane-marker {
    background: transparent;
    border: 0;
}
.drone-plane-wrap {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.drone-plane-img {
    width: 32px;
    height: 22px;
    display: block;
    transform-origin: 50% 50%;
    transform: rotate(0deg);
    will-change: transform, opacity;
    user-select: none;
    -webkit-user-drag: none;
    filter: invert(1) drop-shadow(0 0 0.8px rgba(233, 238, 247, .95)) drop-shadow(0 2px 4px rgba(0, 0, 0, .55));
}
body.theme-light .drone-plane-img {
    filter: drop-shadow(0 0 0.8px rgba(11, 14, 20, .9)) drop-shadow(0 2px 4px rgba(0, 0, 0, .35));
}

.drone-point {
    position: relative;
    width: 24px;
    height: 24px;
    pointer-events: auto;
    cursor: pointer;
}
.drone-point-dot {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 9px;
    height: 9px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: var(--drone-accent, #e53935);
    border: 1.5px solid #ffffff;
    box-shadow: 0 0 0 4px var(--drone-accent-soft, rgba(229, 57, 53, .13)), 0 1px 4px rgba(0, 0, 0, .55);
}
.drone-point--start .drone-point-dot {
    width: 10px;
    height: 10px;
}
.drone-point--source {
    width: 42px;
    height: 42px;
    color: var(--drone-accent, #45b9f0);
}
.drone-source-media {
    width: 42px;
    height: 42px;
    box-sizing: border-box;
    display: block;
    overflow: hidden;
    border-radius: 50%;
    border: 2px solid currentColor;
    background: #0b1824;
    box-shadow: 0 0 0 3px var(--drone-accent-soft, rgba(69, 185, 240, .16)), 0 2px 6px rgba(0, 0, 0, .55);
}
.drone-source-media img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    pointer-events: none;
}
body.theme-light .drone-source-media {
    background: #fff;
    box-shadow: 0 0 0 3px var(--drone-accent-soft, rgba(69, 185, 240, .16)), 0 2px 6px rgba(25, 43, 64, .35);
}
.drone-point:focus-visible {
    outline: 2px solid #45b9f0;
    outline-offset: 2px;
    border-radius: 50%;
}

.leaflet-popup.route-popup-wrap .leaflet-popup-content {
    width: 280px;
    min-width: 0;
    max-width: calc(100vw - 48px);
}
.leaflet-popup.drone-point-popup-wrap .leaflet-popup-content {
    width: max-content;
    min-width: 160px;
    max-width: min(260px, calc(100vw - 48px));
}
.leaflet-popup.route-popup-wrap .popup {
    display: grid;
    gap: 12px;
    padding: 16px;
}
.route-popup .popup-head {
    margin: 0;
    padding-right: 24px;
}
.route-popup.drone-point-popup .popup-head { padding-right: 0; }
.leaflet-popup.route-popup-wrap .popup-name {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    overflow-wrap: anywhere;
}
.route-popup .popup-region {
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.4;
    letter-spacing: 0;
}
.route-popup .popup-statuses { margin: 0; }
.leaflet-popup.route-popup-wrap .popup-status {
    gap: 8px;
    padding: 6px 10px;
    font-size: 13px;
    line-height: 1.3;
    letter-spacing: 0;
}
.leaflet-popup.route-popup-wrap .popup-status .p-dot {
    width: 7px;
    height: 7px;
    flex-basis: 7px;
}

@media (max-width: 700px) {
    .drone-plane-img { width: 26px; height: 18px; }
    .drone-plane-wrap { width: 36px; height: 36px; }
}



 
.legend-directions {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--legend-border);
}
.legend-directions-title {
    margin: 0 0 10px;
    color: var(--legend-title-color);
    font: 700 10px/1.4 Montserrat, sans-serif;
    letter-spacing: 1px;
    text-transform: uppercase;
}
.legend-directions-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 20px;
}
.legend-direction-item {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    color: var(--legend-item-color);
    font: 500 12px/1.4 Montserrat, sans-serif;
}
.legend-direction-line {
    display: block;
    width: 40px;
    height: 16px;
    flex: 0 0 40px;
}
.legend-directions-note {
    max-width: 420px;
    margin: 10px 0 0;
    color: var(--legend-title-color);
    font: 500 12px/1.5 Montserrat, sans-serif;
}
@media (max-width: 600px) {
    .legend-directions-grid { grid-template-columns: minmax(0, 1fr); }
    .legend-directions-title { font-size: 11px; }
}
