/* Radar Nieba 0.1.39 — panel Warstwy */

#rnLayersUi {
    position: fixed;
    z-index: 1320;
    top: 8px;
    right: 8px;
    font-family: Arial, sans-serif;
    color: #eef6ff;
}

#rnLayersToggle {
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 0 13px;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 12px;
    background: rgba(8,17,26,.94);
    color: #e8f2fb;
    box-shadow: 0 8px 24px rgba(0,0,0,.26);
    backdrop-filter: none;
    font: 700 12px/1 Arial, sans-serif;
    cursor: pointer;
    transition: background .16s ease, border-color .16s ease, transform .16s ease;
}

#rnLayersToggle:hover,
#rnLayersUi.is-open #rnLayersToggle {
    background: rgba(15,31,46,.97);
    border-color: rgba(92,178,235,.35);
}

#rnLayersToggle:active {
    transform: translateY(1px);
}

.rn-layers-stack {
    position: relative;
    width: 19px;
    height: 17px;
    flex: 0 0 19px;
}

.rn-layers-stack::before,
.rn-layers-stack::after,
.rn-layers-stack span {
    content: "";
    position: absolute;
    left: 2px;
    width: 15px;
    height: 9px;
    border: 1.5px solid currentColor;
    border-radius: 2px;
    transform: rotate(0deg) skewY(-24deg);
    opacity: .9;
}

.rn-layers-stack::before { top: 0; }
.rn-layers-stack span { top: 4px; opacity: .72; }
.rn-layers-stack::after { top: 8px; opacity: .48; }

#rnLayersPanel {
    position: absolute;
    top: 50px;
    right: 0;
    width: 320px;
    max-height: min(68vh, 610px);
    overflow: auto;
    overscroll-behavior: contain;
    padding: 10px;
    border: 1px solid rgba(255,255,255,.13);
    border-radius: 16px;
    background: rgba(7,16,25,.975);
    box-shadow: 0 20px 54px rgba(0,0,0,.42);
    backdrop-filter: none;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-6px) scale(.985);
    transform-origin: top right;
    transition: opacity .16s ease, transform .16s ease, visibility .16s ease;
}

#rnLayersUi.is-open #rnLayersPanel {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.rn-layers-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 5px 10px;
    border-bottom: 1px solid rgba(148,163,184,.13);
}

.rn-layers-title {
    font-size: 14px;
    font-weight: 800;
    color: #f8fbff;
}

.rn-layers-subtitle {
    margin-top: 3px;
    color: #7f94a8;
    font-size: 9.5px;
    line-height: 1.3;
}

.rn-layers-close {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    border: 0;
    border-radius: 9px;
    background: rgba(148,163,184,.09);
    color: #9fb1c2;
    font: 700 18px/1 Arial, sans-serif;
    cursor: pointer;
}

.rn-layers-close:hover {
    background: rgba(148,163,184,.16);
    color: #fff;
}

.rn-layers-group {
    padding: 10px 4px 4px;
}

.rn-layers-group + .rn-layers-group {
    margin-top: 3px;
    border-top: 1px solid rgba(148,163,184,.10);
}

.rn-layers-group-title {
    margin: 0 4px 5px;
    color: #71869a;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.rn-layer-row {
    min-height: 43px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 8px;
    border-radius: 10px;
    cursor: pointer;
    user-select: none;
    transition: background .14s ease;
}

.rn-layer-row:hover {
    background: rgba(148,163,184,.075);
}

.rn-layer-row.is-disabled {
    opacity: .45;
    cursor: default;
}

.rn-layer-copy {
    min-width: 0;
    flex: 1;
}

.rn-layer-name {
    display: block;
    color: #dfe9f3;
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1.25;
}

.rn-layer-desc {
    display: block;
    margin-top: 2px;
    color: #71869a;
    font-size: 9px;
    line-height: 1.25;
}

.rn-layer-switch {
    position: relative;
    width: 35px;
    height: 20px;
    flex: 0 0 35px;
}

.rn-layer-switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.rn-layer-switch-track {
    position: absolute;
    inset: 0;
    border: 1px solid rgba(148,163,184,.20);
    border-radius: 99px;
    background: rgba(71,85,105,.35);
    transition: background .16s ease, border-color .16s ease;
}

.rn-layer-switch-track::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #9aabba;
    box-shadow: 0 2px 6px rgba(0,0,0,.28);
    transition: transform .16s ease, background .16s ease;
}

.rn-layer-switch input:checked + .rn-layer-switch-track {
    border-color: rgba(52,211,153,.46);
    background: rgba(16,185,129,.28);
}

.rn-layer-switch input:checked + .rn-layer-switch-track::after {
    transform: translateX(15px);
    background: #48e0a3;
}

.rn-layers-foot {
    margin: 7px 4px 2px;
    padding: 9px 8px 3px;
    border-top: 1px solid rgba(148,163,184,.12);
    color: #64778a;
    font-size: 8.5px;
    line-height: 1.35;
}

#rnLayersBackdrop {
    display: none;
}

/* Stara kontrolka Leaflet nie powinna się pojawić nawet z cache starego HTML. */
.leaflet-control-layers {
    display: none !important;
}

@media (min-width: 901px) {
    body.rn-right-open #rnLayersUi {
        right: 390px;
    }
}

@media (max-width: 900px) {
    body.rn-mobile-ui #rnLayersUi {
        position: fixed;
        z-index: 1280;
        top: calc(6px + var(--rn-mobile-safe-top, 0px)) !important;
        right: 6px !important;
        left: auto !important;
        bottom: auto;
        width: 42px;
        margin: 0;
    }


    body.rn-mobile-ui.rn-legend-open #rnLayersUi {
        opacity: 0;
        pointer-events: none;
    }

    body.rn-mobile-ui #rnLayersToggle {
        width: 42px;
        height: 42px;
        padding: 0;
        gap: 0;
        border-radius: 13px;
        background: #08111a;
        box-shadow: 0 7px 22px rgba(0,0,0,.30);
        font-size: 0;
    }

    body.rn-mobile-ui #rnLayersToggle > span:last-child {
        display: none;
    }

    body.rn-mobile-ui #rnLayersToggle .rn-layers-stack {
        width: 20px;
        height: 18px;
        flex-basis: 20px;
    }

    body.rn-mobile-ui #rnLayersPanel {
        position: fixed;
        z-index: 1295;
        left: 8px;
        right: 8px;
        top: auto;
        bottom: calc(var(--rn-mobile-bar-h, 58px) + var(--rn-mobile-safe-bottom, 0px) + 7px);
        width: auto;
        max-height: min(70dvh, 650px);
        padding: 10px 10px 12px;
        border-radius: 20px;
        background: #071019;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        transform: translateY(24px);
        transform-origin: bottom center;
    }

    body.rn-mobile-ui #rnLayersUi.is-open #rnLayersPanel {
        transform: translateY(0);
    }

    body.rn-mobile-ui #rnLayersUi.is-open #rnLayersToggle {
        opacity: 0;
        pointer-events: none;
    }

    body.rn-mobile-ui #rnLayersBackdrop {
        display: block;
        position: fixed;
        z-index: 1270;
        inset: 0;
        background: rgba(2,8,15,.30);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        opacity: 0;
        pointer-events: none;
        transition: opacity .16s ease;
    }

    body.rn-mobile-ui #rnLayersBackdrop.visible {
        opacity: 1;
        pointer-events: auto;
    }

    body.rn-mobile-ui .rn-layers-head {
        padding: 5px 5px 11px;
    }

    body.rn-mobile-ui .rn-layers-title {
        font-size: 15px;
    }

    body.rn-mobile-ui .rn-layers-subtitle {
        font-size: 10px;
    }

    body.rn-mobile-ui .rn-layer-row {
        min-height: 49px;
        padding: 8px 9px;
    }

    body.rn-mobile-ui .rn-layer-name {
        font-size: 12px;
    }

    body.rn-mobile-ui .rn-layer-desc {
        font-size: 9.5px;
    }

    body.rn-mobile-ui .rn-layer-switch {
        width: 40px;
        height: 23px;
        flex-basis: 40px;
    }

    body.rn-mobile-ui .rn-layer-switch-track::after {
        width: 17px;
        height: 17px;
    }

    body.rn-mobile-ui .rn-layer-switch input:checked + .rn-layer-switch-track::after {
        transform: translateX(17px);
    }
}
