.leaflet-control-layers-toggle.leaflet-layerstree-named-toggle {
    margin: 2px 5px;
    width: auto;
    height: auto;
    background-image: none;
}

.leaflet-layerstree-node {
}

.leaflet-layerstree-header input{
    margin-left: 0px;
}


.leaflet-layerstree-header {
    display: flex;
    align-items: center;
    gap: 2px;
    width: max-content;
    min-width: 100%;
}

.leaflet-layerstree-header-pointer {
    flex: 0 0 auto;
    cursor: pointer;
}

.leaflet-layerstree-header label {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    width: max-content;
    min-width: max-content;
    cursor: pointer;
}

.leaflet-layerstree-header-label {
}

.leaflet-layerstree-header-name {
}

.leaflet-layerstree-header-space {
}

/* Espaçador invisível pra alinhar em coluna com o checkbox extra de addSubzonaSelectAllCheckboxes
   (layer-control-enhancements.js). Largura definida via JS, igual ao checkbox real. */
.leaflet-layerstree-checkbox-spacer {
    display: inline-block;
    flex: 0 0 auto;
}

.leaflet-layerstree-children {
    padding-left: 10px;
}

.leaflet-layerstree-children-nopad {
    padding-left: 0px;
}

.leaflet-layerstree-closed {
}

.leaflet-layerstree-opened {
}

.leaflet-layerstree-hide {
    display: none;
}

.leaflet-layerstree-nevershow {
    display: none;
}

.leaflet-layerstree-expand-collapse {
    cursor: pointer;
}

.leaflet-layerstree-expand-collapse {
    display: none !important;
}

.leaflet-control-layers {
    position: relative;
    --layer-panel-width: 236px;
    --layer-panel-height: 440px;
    width: var(--layer-panel-width) !important;
    min-width: 220px !important;
    height: var(--layer-panel-height) !important;
    min-height: 220px !important;
    resize: none;
    overflow: hidden !important;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.leaflet-control-layers.leaflet-control-layers-expanded {
    resize: none;
}

.leaflet-control-layers .leaflet-control-layers-list {
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto !important;
    overflow-x: auto !important;
    padding-right: 2px;
    box-sizing: border-box;
}

.leaflet-control-layers .leaflet-control-layers-list::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.leaflet-control-layers .leaflet-control-layers-list::-webkit-scrollbar-thumb {
    background: #a9a9a9;
    border-radius: 6px;
}

.leaflet-control-layers .leaflet-control-layers-list {
    scrollbar-width: auto;
}

.leaflet-layerstree-xscroll {
    display: none !important;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 14px;
    overflow-x: scroll;
    overflow-y: hidden;
    border-top: 1px solid #d6d6d6;
    background: #f2f2f2;
    z-index: 3;
}

.leaflet-layerstree-xscroll-inner {
    height: 1px;
}

.leaflet-layerstree-xscroll::-webkit-scrollbar {
    height: 10px;
}

.leaflet-layerstree-xscroll::-webkit-scrollbar-thumb {
    background: #9a9a9a;
    border-radius: 8px;
}

.leaflet-layerstree-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2px;
    padding: 3px 5px;
    border-bottom: 1px solid #d6d6d6;
    background: #f5f5f5;
}

.leaflet-layerstree-panel-title {
    font-weight: 700;
    color: #3b3b3b;
    font-size: 13px;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.leaflet-layerstree-panel-actions {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    flex: 0 0 auto;
}

.leaflet-layerstree-minimize-btn {
    width: 18px;
    height: 18px;
    border: 1px solid #bfbfbf;
    border-radius: 4px;
    background: #ffffff;
    color: #333333;
    font-size: 12px;
    line-height: 14px;
    cursor: pointer;
    padding: 0;
}

/* Switch Online/Offline: ON (verde, "Online") baixa sempre atualizado a cada carregamento da
   página; OFF (cinza, "Offline") mantém os mapas já baixados salvos localmente. */
.leaflet-layerstree-cache-switch {
    position: relative;
    display: inline-block;
    width: 56px;
    height: 17px;
    flex: 0 0 auto;
    cursor: pointer;
}

.leaflet-layerstree-cache-switch input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
    z-index: 1;
}

.leaflet-layerstree-cache-switch-slider {
    position: absolute;
    inset: 0;
    background: #b0b0b0;
    border-radius: 17px;
    overflow: hidden;
    transition: background-color 0.15s ease;
    pointer-events: none;
}

.leaflet-layerstree-cache-switch-slider::before {
    content: '';
    position: absolute;
    left: 2px;
    top: 2px;
    width: 13px;
    height: 13px;
    background: #ffffff;
    border-radius: 50%;
    z-index: 1;
    transition: transform 0.15s ease;
}

.leaflet-layerstree-cache-switch-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 4px;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.2px;
    line-height: 1;
    color: #ffffff;
    white-space: nowrap;
}

.leaflet-layerstree-cache-switch input:checked + .leaflet-layerstree-cache-switch-slider {
    background: #2ecc71;
}

.leaflet-layerstree-cache-switch input:checked + .leaflet-layerstree-cache-switch-slider::before {
    transform: translateX(39px);
}

.leaflet-layerstree-cache-switch input:checked + .leaflet-layerstree-cache-switch-slider .leaflet-layerstree-cache-switch-text {
    justify-content: flex-start;
}

.leaflet-layerstree-cache-switch input:disabled + .leaflet-layerstree-cache-switch-slider {
    opacity: 0.6;
}

.leaflet-layerstree-section-title {
    margin: 6px 0 3px;
    color: #4a4a4a;
    font-weight: 700;
    font-size: 13px;
}

.leaflet-layerstree-base-title {
    margin-top: 1px;
}

/* Botão "x" ao lado do título de um grupo (addClearGroupButton em layer-control-enhancements.js)
   — desmarca de uma vez todas as camadas ativas daquele grupo. */
.leaflet-layerstree-clear-group-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    margin-left: 6px;
    vertical-align: middle;
    border: 1px solid #bfbfbf;
    border-radius: 2px;
    background: #ffffff;
    color: #8a8a8a;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    padding: 0;
    cursor: pointer;
}

.leaflet-layerstree-clear-group-btn:hover {
    border-color: #b0413e;
    color: #b0413e;
}

.leaflet-control-layers .leaflet-control-layers-base,
.leaflet-control-layers .leaflet-control-layers-overlays {
    margin: 0;
    width: max-content;
    min-width: 100%;
}

.leaflet-layerstree-header-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    width: max-content;
    min-width: max-content;
}

.leaflet-layerstree-header-label input {
    flex: 0 0 auto;
    margin-right: 0;
    vertical-align: middle;
}

.leaflet-layerstree-header-name {
    display: inline-block;
    flex: 0 0 auto;
    min-width: max-content;
    max-width: none;
    overflow: visible;
    white-space: nowrap;
}

.leaflet-layerstree-header-name br {
    display: none;
}

/* Camada com GeoJSON já em cache local (offline-layers.js) — sinaliza que ela abre offline pela
   cor do checkbox, só enquanto desmarcado; marcado mantém a aparência nativa padrão (a regra
   para de valer com :checked, então o navegador volta a desenhar o controle normal).
   accent-color e background-color/border-color sozinhos não pintam a caixa vazia de forma
   confiável (checkbox nativo com appearance padrão ignora essas propriedades em vários
   navegadores/temas) — appearance:none força um desenho 100% custom só nesse estado. */
.leaflet-layerstree-checkbox--offline-ready:not(:checked) {
    -webkit-appearance: none;
    appearance: none;
    width: 13px;
    height: 13px;
    border: 1px solid #6fa886;
    border-radius: 2px;
    background-color: #6fa886;
    cursor: pointer;
}

/* Enquanto o geojson da camada está baixando (offline-layers.js escuta zeer-layer-loading /
   zeer-layer-loaded), o checkbox "enche" de baixo pra cima em loop — feedback de progresso sem
   precisar saber o percentual real do download. */
.leaflet-layerstree-checkbox--loading {
    -webkit-appearance: none;
    appearance: none;
    width: 13px;
    height: 13px;
    border: 1px solid #6fa886;
    border-radius: 2px;
    background-color: transparent;
    background-image: linear-gradient(#6fa886, #6fa886);
    background-repeat: no-repeat;
    background-position: bottom;
    background-size: 100% 6%;
    animation: leafletLayerstreeCheckboxFill 0.9s ease-in-out infinite alternate;
    cursor: pointer;
}

@keyframes leafletLayerstreeCheckboxFill {
    from {
        background-size: 100% 6%;
    }
    to {
        background-size: 100% 100%;
    }
}

.leaflet-layer-label-marquee {
    overflow: visible;
    white-space: nowrap;
    text-overflow: clip;
}

.leaflet-layer-label-marquee-track {
    display: inline-flex;
    align-items: center;
    transform: none;
    will-change: auto;
}

.leaflet-layer-label-overflow {
    cursor: pointer;
}

.leaflet-layer-label-marquee:hover .leaflet-layer-label-marquee-track,
.leaflet-layer-label-marquee.leaflet-layer-label-marquee-active .leaflet-layer-label-marquee-track {
    animation: leafletLayerLabelMarquee var(--layer-marquee-duration, 8s) linear infinite alternate;
}

@keyframes leafletLayerLabelMarquee {
    0%,
    12% {
        transform: translateX(0);
    }
    88%,
    100% {
        transform: translateX(calc(-1 * var(--layer-marquee-distance, 0px)));
    }
}

@media (max-width: 640px) {
    .leaflet-control-layers {
        --layer-panel-width: min(236px, calc(100vw - 24px));
        --layer-panel-height: min(360px, 62vh);
        resize: none;
    }
}

.leaflet-layerstree-minimize-btn:hover {
    background: #f1f1f1;
}

.leaflet-control-layers.leaflet-layerstree-minimized .leaflet-control-layers-list {
    display: none;
}

.leaflet-control-layers.leaflet-layerstree-minimized .leaflet-layerstree-xscroll {
    display: none;
}

.leaflet-control-layers.leaflet-layerstree-minimized .leaflet-layerstree-panel-header {
    border-bottom: 0;
}

.leaflet-control-layers.leaflet-layerstree-minimized .leaflet-layerstree-panel-title,
.leaflet-control-layers.leaflet-layerstree-minimized .leaflet-layerstree-cache-switch {
    display: none;
}

.leaflet-control-layers.leaflet-layerstree-minimized {
    min-width: 40px;
    max-width: 40px;
    min-height: 34px;
    height: 34px !important;
    padding: 0;
}