.leaflet-control-layers-overlays .livello-categoria {
    margin: 0.85rem 0.25rem 0.35rem;
    padding-top: 0.65rem;
    border-top: 1px solid rgba(var(--ink-rgb), 0.18);
    color: var(--ink);
    font-family: var(--font-serif);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.leaflet-control-layers-overlays label {
    max-width: 285px;
    white-space: normal;
}

.percorso-livello-riga {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    column-gap: 0.35rem;
}

.percorso-livello-riga > label {
    min-width: 0;
}

.percorso-livello-menu {
    position: relative;
}

.percorso-livello-pulsante {
    display: grid;
    width: 1.65rem;
    height: 1.65rem;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font-family: inherit;
    font-size: 1.4rem;
    line-height: 1;
}

.percorso-livello-pulsante:hover,
.percorso-livello-pulsante:focus-visible {
    background: rgba(var(--ink-rgb), 0.09);
}

.percorso-livello-pannello {
    position: absolute;
    z-index: 1001;
    top: calc(100% + 0.25rem);
    right: 0;
    width: max-content;
    max-width: min(15rem, calc(100vw - 3rem));
    padding: 0.8rem;
    border: 1px solid rgba(var(--ink-rgb), 0.18);
    border-radius: 0.35rem;
    background: var(--surface);
    box-shadow: 0 0.35rem 1rem rgba(var(--ink-rgb), 0.12);
    font-family: var(--font-serif);
    font-size: 0.85rem;
}

.percorso-livello-pannello .popup-percorso-azioni {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.leaflet-control-layers-overlays label.livello-sottolivello {
    margin-left: 1.15rem;
    font-size: 0.92em;
}

.leaflet-control-layers-overlays label.livello-sottolivello span {
    opacity: 0.82;
}

.popup-percorso,
.popup-luogo-rilevante,
.popup-fiume {
    font-family: var(--font-serif);
    font-size: 0.92rem;
    line-height: 1.45;
}

.popup-luogo-rilevante {
    width: min(15rem, 68vw);
    max-width: 100%;
}

.popup-percorso strong,
.popup-luogo-rilevante strong,
.popup-fiume strong {
    display: block;
    margin-bottom: 0.55rem;
}

.popup-percorso p {
    margin: 0;
}

.popup-percorso p + p,
.popup-percorso p + strong {
    margin-top: 0.65rem;
}

.popup-percorso-azioni {
    display: grid;
    gap: 0.45rem;
    margin-top: 0.85rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(var(--ink-rgb), 0.16);
}

.popup-percorso-esporta {
    width: fit-content;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    cursor: pointer;
    font: inherit;
    text-align: left;
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.popup-luogo-rilevante p {
    margin: 0 0 0.65rem;
}

.popup-luogo-descrizione {
    max-height: min(11rem, 28vh);
    padding-right: 0.55rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-color: rgba(var(--ink-rgb), 0.58) rgba(var(--ink-rgb), 0.12);
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    touch-action: pan-y;
}

.popup-luogo-descrizione::-webkit-scrollbar {
    width: 0.5rem;
}

.popup-luogo-descrizione::-webkit-scrollbar-track {
    background: rgba(var(--ink-rgb), 0.12);
}

.popup-luogo-descrizione::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: rgba(var(--ink-rgb), 0.58);
    background-clip: padding-box;
}

.popup-luogo-fonte-geometria {
    font-size: 0.78rem;
    opacity: 0.66;
}

.popup-luogo-links {
    display: grid;
    gap: 0.4rem;
    margin-top: 0.8rem;
    padding-top: 0.7rem;
    border-top: 1px solid rgba(var(--ink-rgb), 0.16);
}

.popup-luogo-links a,
.popup-percorso a,
.percorso-livello-pannello a,
.popup-fiume a {
    width: fit-content;
    max-width: 100%;
    color: inherit;
    line-height: 1.35;
    overflow-wrap: anywhere;
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.popup-fiume a {
    display: block;
    margin-top: 0.2rem;
}

.popup-luogo-links a:hover,
.popup-luogo-links a:focus-visible,
.popup-percorso a:hover,
.popup-percorso a:focus-visible,
.percorso-livello-pannello a:hover,
.percorso-livello-pannello a:focus-visible,
.popup-percorso-esporta:hover,
.popup-percorso-esporta:focus-visible,
.popup-fiume a:hover,
.popup-fiume a:focus-visible {
    opacity: 0.6;
}
