.spr-map-layout .spr-sidebar {
    position: sticky;
    top: 110px;
}

.spr-live-map-wrap {
    position: relative;
}

.spr-live-map {
    height: var(--spr-map-height-desktop, 520px);
    min-height: 320px;
    border: 1px solid #d8e2ef;
    border-radius: 18px;
    overflow: hidden;
    background: #dff3ef;
    box-shadow: 0 20px 45px rgba(15, 23, 42, .08);
}

.spr-map-loading,
.spr-map-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 24px;
    color: #0f3459;
    font-weight: 800;
}

.spr-map-empty {
    margin-top: 12px;
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
    padding: 14px 16px;
    background: #fff;
    color: #42526b;
    font-weight: 700;
}

.spr-map-marker-icon {
    background: transparent;
    border: 0;
}

.spr-map-marker-icon span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: var(--spr-marker-color, #ed0016);
    color: #fff;
    border: 3px solid #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .3);
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
}

.spr-map-popup {
    width: 220px;
}

.spr-map-popup img {
    width: 100%;
    height: 88px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 8px;
}

.spr-map-popup strong {
    display: block;
    color: #001b38;
    font-size: 15px;
    line-height: 1.25;
}

.spr-map-popup p {
    margin: 6px 0 8px;
    color: #475569;
    font-size: 13px;
}

.spr-map-popup a {
    display: inline-flex;
    margin-top: 10px;
    color: #ed0016;
    font-weight: 900;
    text-decoration: none;
}

.spr-map-popup-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: #f1f5f9;
    color: #0f172a;
    font-size: 11px;
    font-weight: 900;
    padding: 4px 8px;
    margin-right: 5px;
}

.spr-map-popup-precision{font-size:12px!important;font-weight:800;color:#334155!important;margin:0 0 8px!important}
.spr-map-marker-precision-comune span{outline:2px dashed rgba(15,23,42,.72);outline-offset:3px}
.spr-map-marker-precision-manuale span{box-shadow:0 0 0 4px rgba(255,255,255,.92),0 10px 24px rgba(15,23,42,.3)}


.spr-map-partner-marker-icon span {
    width: 38px;
    height: 38px;
    background: #0b5cad;
    font-size: 14px;
    letter-spacing: -.02em;
}

.spr-map-partner-marker-partner_pro_beta span {
    background: #6d28d9;
}

.spr-map-partner-marker-partner_territorio_beta span {
    background: #047857;
}

.spr-map-popup-partner {
    width: 235px;
}

.spr-map-popup-partner-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.spr-map-popup-partner-head > img.spr-map-popup-partner-logo,
.spr-map-popup-partner-initials {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    border: 1px solid #d8e2ef;
    background: #fff;
    object-fit: contain;
    margin: 0;
}

.spr-map-popup-partner-initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #0b5cad;
    font-size: 16px;
    font-weight: 900;
}

.spr-map-popup-partner-head span:not(.spr-map-popup-partner-initials) {
    display: block;
    margin-top: 3px;
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
}

.spr-map-popup-partner p{margin:0 0 12px;color:#475569;line-height:1.45}
.spr-map-popup-partner a{display:inline-block;color:#0073aa;font-weight:800;text-decoration:none}

.leaflet-container {
    font-family: inherit;
}

.leaflet-popup-content-wrapper {
    border-radius: 16px;
}

.leaflet-popup-content {
    margin: 12px;
}


/* Step mobile chirurgico - protezione marker Leaflet
   Evita che regole mobile/globali su immagini/card deformino marker e cluster. */
.leaflet-container .leaflet-marker-icon,
.leaflet-container .leaflet-marker-shadow,
.leaflet-container .leaflet-div-icon{
    max-width:none!important;
    max-height:none!important;
    min-width:0!important;
    min-height:0!important;
    object-fit:initial!important;
    border-radius:0!important;
    box-shadow:none;
}

.leaflet-container img.leaflet-marker-icon,
.leaflet-container img.leaflet-marker-shadow{
    width:auto;
    height:auto;
}

.leaflet-container .spr-map-marker-icon,
.leaflet-container .spr-map-cluster-icon,
.leaflet-container .spr-map-partner-marker-icon{
    background:transparent!important;
    border:0!important;
    overflow:visible!important;
}

.leaflet-container .spr-map-marker-icon span,
.leaflet-container .spr-map-cluster-icon span,
.leaflet-container .spr-map-partner-marker-icon span{
    box-sizing:border-box;
    max-width:none!important;
    max-height:none!important;
}

@media (max-width: 760px) {
    .spr-live-map {
        height: var(--spr-map-height-mobile, 360px);
    }

    .spr-map-layout .spr-sidebar {
        position: static;
    }
}

.spr-map-cluster-icon {
    background: transparent;
    border: 0;
}

.spr-map-cluster-icon span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    background: #22145f;
    color: #fff;
    border: 4px solid #fff;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .35);
    font-size: 15px;
    font-weight: 900;
    line-height: 1;
}

.spr-map-cluster-icon span::after {
    content: '';
    position: absolute;
    inset: -7px;
    border-radius: inherit;
    border: 2px solid rgba(34, 20, 95, .22);
}

.spr-map-spider-leg {
    stroke: #22145f;
    stroke-dasharray: 4 5;
}

/* Step 43.3.3 - fullscreen mappa frontend */
.spr-map-actions,
.spr-map-page-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.spr-map-page-actions {
    margin-bottom: 14px;
}

.spr-live-map-wrap-can-fullscreen .spr-map-fullscreen-close {
    display: none;
}

.spr-live-map-wrap-can-fullscreen.is-fullscreen {
    position: fixed;
    inset: 18px;
    z-index: 99999;
    background: #fff;
    border-radius: 18px;
    padding: 58px 16px 16px;
    box-shadow: 0 24px 90px rgba(0, 0, 0, .35);
}

.spr-live-map-wrap-can-fullscreen.is-fullscreen .spr-live-map {
    height: calc(100vh - 92px) !important;
    min-height: 0;
}

.spr-live-map-wrap-can-fullscreen.is-fullscreen .spr-map-fullscreen-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 14px;
    right: 16px;
    min-height: 38px;
    border: 1px solid #d8e2ef;
    border-radius: 10px;
    padding: 9px 14px;
    background: #fff;
    color: #071523;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 10px 26px rgba(15, 23, 42, .12);
}

body.spr-map-fullscreen-open {
    overflow: hidden;
}

@media (max-width: 760px) {
    .spr-map-actions,
    .spr-map-page-actions {
        justify-content: stretch;
    }

    .spr-map-actions .spr-btn,
    .spr-map-page-actions .spr-btn {
        width: 100%;
    }

    .spr-live-map-wrap-can-fullscreen.is-fullscreen {
        inset: 8px;
        border-radius: 14px;
        padding: 56px 10px 10px;
    }

    .spr-live-map-wrap-can-fullscreen.is-fullscreen .spr-live-map {
        height: calc(100vh - 74px) !important;
    }
}

/* Step 72 - marker partner separati dai cluster segnalazioni */
.spr-map-partner-marker-icon {
    z-index: 650 !important;
}

.spr-map-partner-marker-icon span {
    position: relative;
    border-width: 4px;
    box-shadow: 0 14px 30px rgba(15, 23, 42, .38);
}

.spr-map-partner-marker-icon span::after {
    content: '';
    position: absolute;
    inset: -7px;
    border-radius: inherit;
    border: 2px solid rgba(11, 92, 173, .22);
}

.spr-map-partner-marker-partner_pro_beta span::after {
    border-color: rgba(109, 40, 217, .24);
}

.spr-map-partner-marker-partner_territorio_beta span::after {
    border-color: rgba(4, 120, 87, .24);
}

/* Marker comunali aggregati: evita sovrapposizioni quando molte segnalazioni hanno solo coordinate del Comune. */
.spr-map-marker-icon-group span {
    width: 44px;
    height: 44px;
    background: #22145f;
    font-size: 14px;
}

.spr-map-popup-group {
    width: 260px;
}

.spr-map-popup-report-list {
    margin: 8px 0 0;
    padding-left: 18px;
    max-height: 150px;
    overflow: auto;
}

.spr-map-popup-report-list li {
    margin: 0 0 6px;
}

.spr-map-popup-report-list a {
    display: inline;
    margin: 0;
    color: #0f3459;
    font-weight: 800;
}

.spr-map-popup-muted {
    color: #64748b;
    font-size: 12px;
}


/* Step mobile chirurgico - Mappa contenuta */
@media(max-width:900px){
    .spr-live-map-wrap{
        max-width:100%!important;
        overflow:hidden!important;
    }

    .spr-live-map{
        max-width:100%!important;
        border-radius:14px!important;
    }

    .spr-map-popup,
    .spr-map-popup-partner,
    .spr-map-popup-group{
        width:min(240px, calc(100vw - 64px))!important;
    }

    .leaflet-popup-content{
        max-width:calc(100vw - 72px)!important;
    }

    .spr-map-actions,
    .spr-map-page-actions{
        display:grid!important;
        grid-template-columns:1fr!important;
        justify-content:stretch!important;
        gap:8px!important;
        width:100%!important;
    }

    .spr-map-actions .spr-btn,
    .spr-map-page-actions .spr-btn{
        width:100%!important;
        min-height:42px!important;
        padding:10px 12px!important;
        font-size:13px!important;
        border-radius:10px!important;
        white-space:normal!important;
    }
}


/* Step mobile chirurgico - rifinitura finale popup mappa */
@media(max-width:900px){
    .leaflet-popup-content-wrapper{
        max-width:calc(100vw - 44px)!important;
        border-radius:12px!important;
    }

    .leaflet-popup-content{
        margin:10px 12px!important;
        font-size:13px!important;
        line-height:1.35!important;
    }

    .spr-map-popup img,
    .spr-map-popup-partner-head > img.spr-map-popup-partner-logo{
        max-width:100%!important;
    }
}

/* Step 92 - fullscreen reale mappa con filtri interni */
.spr-map-fullscreen-panel {
    display: none;
}

.spr-live-map-wrap-can-fullscreen.is-fullscreen,
.spr-live-map-wrap-can-fullscreen:fullscreen {
    position: fixed;
    inset: 0;
    z-index: 999999;
    width: 100vw;
    height: 100vh;
    background: #fff;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

.spr-live-map-wrap-can-fullscreen.is-fullscreen .spr-live-map,
.spr-live-map-wrap-can-fullscreen:fullscreen .spr-live-map {
    width: 100vw;
    height: 100vh !important;
    min-height: 100vh;
    border-radius: 0;
}

/* La vista estesa via pulsante resta sotto l'header del sito. */
.spr-live-map-wrap-can-fullscreen.is-fullscreen:not(:fullscreen) {
    inset: var(--spr-header-height, 78px) 0 0;
    z-index: 80;
}

.spr-live-map-wrap-can-fullscreen.is-fullscreen:not(:fullscreen) .spr-live-map {
    height: calc(100vh - var(--spr-header-height, 78px)) !important;
    min-height: 0;
}

.spr-live-map-wrap-can-fullscreen.is-fullscreen .spr-map-fullscreen-panel,
.spr-live-map-wrap-can-fullscreen:fullscreen .spr-map-fullscreen-panel {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 1200;
    pointer-events: none;
}

.spr-live-map-wrap-can-fullscreen.is-fullscreen .spr-map-fullscreen-close,
.spr-live-map-wrap-can-fullscreen:fullscreen .spr-map-fullscreen-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 18px;
    right: 18px;
    min-height: 42px;
    border: 1px solid rgba(216, 226, 239, .92);
    border-radius: 9px;
    padding: 10px 16px;
    background: #fff;
    color: #071523;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .22);
    pointer-events: auto;
}

.spr-live-map-wrap-can-fullscreen.is-fullscreen .spr-map-fullscreen-filter-bar,
.spr-live-map-wrap-can-fullscreen:fullscreen .spr-map-fullscreen-filter-bar {
    position: absolute;
    top: 18px;
    left: 50%;
    right: auto;
    width: min(1100px, calc(100vw - 380px));
    max-width: 1100px;
    transform: translateX(-50%);
    pointer-events: auto;
}

.spr-live-map-wrap-can-fullscreen.is-fullscreen .spr-map-fullscreen-filter-bar .spr-filter-box,
.spr-live-map-wrap-can-fullscreen:fullscreen .spr-map-fullscreen-filter-bar .spr-filter-box {
    display: grid;
    grid-template-columns: repeat(4, minmax(140px, 1fr)) auto;
    gap: 10px;
    align-items: end;
    padding: 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 14px 38px rgba(15, 23, 42, .22);
}

.spr-live-map-wrap-can-fullscreen.is-fullscreen .spr-map-fullscreen-filter-bar .spr-filter-box label:first-child,
.spr-live-map-wrap-can-fullscreen:fullscreen .spr-map-fullscreen-filter-bar .spr-filter-box label:first-child {
    display: none;
}

.spr-live-map-wrap-can-fullscreen.is-fullscreen .spr-map-fullscreen-filter-bar .spr-filter-box input,
.spr-live-map-wrap-can-fullscreen.is-fullscreen .spr-map-fullscreen-filter-bar .spr-filter-box select,
.spr-live-map-wrap-can-fullscreen:fullscreen .spr-map-fullscreen-filter-bar .spr-filter-box input,
.spr-live-map-wrap-can-fullscreen:fullscreen .spr-map-fullscreen-filter-bar .spr-filter-box select {
    min-height: 40px;
    padding: 9px 11px;
}

.spr-live-map-wrap-can-fullscreen.is-fullscreen .leaflet-top,
.spr-live-map-wrap-can-fullscreen:fullscreen .leaflet-top {
    top: 84px;
}

@media (max-width: 980px) {
    .spr-live-map-wrap-can-fullscreen.is-fullscreen .spr-map-fullscreen-filter-bar,
    .spr-live-map-wrap-can-fullscreen:fullscreen .spr-map-fullscreen-filter-bar {
        top: 70px;
        left: 10px;
        right: 10px;
        width: auto;
        max-width: none;
        transform: none;
        max-height: calc(100vh - 90px);
        overflow: auto;
    }

    .spr-live-map-wrap-can-fullscreen.is-fullscreen .spr-map-fullscreen-filter-bar .spr-filter-box,
    .spr-live-map-wrap-can-fullscreen:fullscreen .spr-map-fullscreen-filter-bar .spr-filter-box {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .spr-live-map-wrap-can-fullscreen.is-fullscreen .spr-map-fullscreen-close,
    .spr-live-map-wrap-can-fullscreen:fullscreen .spr-map-fullscreen-close {
        top: 10px;
        right: 10px;
        left: 10px;
        width: auto;
    }

    .spr-live-map-wrap-can-fullscreen.is-fullscreen .leaflet-top,
    .spr-live-map-wrap-can-fullscreen:fullscreen .leaflet-top {
        top: 120px;
    }
}
