.risk-sidebar{
    position:absolute;
    top:0;
    left:0;
    width:310px;
    max-width:calc(100vw - 10px);
    height:80vh;
    max-height:80vh;
    background:#e6dfd8;
    border-radius:0 0 10px 0;
    box-shadow:0 10px 28px rgba(0,0,0,.18);
    z-index:1200;
    overflow:hidden;
    font-family:'Inter', sans-serif;
    display:flex;
    flex-direction:column;
}

.risk-sidebar.hidden{
    display:none;
}

.risk-sidebar-scroll{
    flex:1 1 auto;
    overflow-y:auto;
    overflow-x:hidden;
    -webkit-overflow-scrolling:touch;
}

.risk-sidebar-scroll::-webkit-scrollbar{
    width:8px;
}

.risk-sidebar-scroll::-webkit-scrollbar-track{
    background:rgba(0,0,0,.05);
}

.risk-sidebar-scroll::-webkit-scrollbar-thumb{
    background:#b68d96;
    border-radius:10px;
}

.risk-sidebar-header{
    padding:20px 12px 10px 12px;
    border-bottom:1px solid rgba(120,70,80,.12);
    min-height:62px;
    display:flex;
    align-items:center;
    gap:14px;
    flex:0 0 auto;
}

.risk-sidebar-header h3{
    margin:0;
    font-size:17px;
    font-weight:800;
    color:#923d55;
    letter-spacing:.2px;
    line-height:1.2;
}

.risk-close-btn{
    position:static;
    border:none;
    background:transparent;
    color:#923d55;
    font-size:40px;
    line-height:1;
    cursor:pointer;
    padding:0;
    flex:0 0 auto;
}

.risk-section{
    border-top:1px solid rgba(120,70,80,.12);
}

.risk-section-btn{
    width:100%;
    border:none;
    background:#e6dfd8;
    color:#923d55;
    padding:16px 16px 16px 10px;
    text-align:left;
    cursor:pointer;
    font-size:16px;
    transition:background-color .25s ease, color .25s ease;
}

.risk-section.active .risk-section-btn,
.risk-section-btn.active{
    background:#963d56;
    color:#fff;
}

.risk-section-row{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    width:100%;
}

.risk-section-left{
    display:flex;
    align-items:center;
    gap:12px;
    min-width:0;
}

.risk-section-left img{
    width:34px;
    height:34px;
    object-fit:contain;
    flex:0 0 34px;
}

.risk-section-left span:last-child{
    font-size:18px;
    line-height:1.2;
    font-weight:500;
}

.risk-collapse-indicator{
    font-size:18px;
    font-weight:700;
    line-height:1;
    flex:0 0 auto;
    transition:transform .28s ease;
    transform-origin:center;
}

.risk-section-btn.active .risk-collapse-indicator{
    transform:rotate(180deg);
}

.risk-group-body{
    background:#963d56;
    color:#fff;
    max-height:0;
    opacity:0;
    overflow:hidden;
    padding:0;
    transition:
        max-height .35s ease,
        opacity .25s ease,
        padding .35s ease;
    will-change:max-height, opacity, padding;
}

.risk-group-body.show{
    max-height:1000px; /* suficiente para tus contenidos */
    opacity:1;
    padding:0 0 8px 0;
}

.risk-item{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding:10px 16px 10px 10px;
    border-top:1px solid rgba(255,255,255,.12);
}

.risk-item-left{
    display:flex;
    align-items:flex-start;
    gap:8px;
    color:#fff;
    font-size:15px;
    line-height:1.15;
    padding-right:10px;
}

.risk-info-mini{
    width:16px;
    height:16px;
    min-width:16px;
    border:1.5px solid #d9bb80;
    color:#d9bb80;
    border-radius:50%;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    font-size:10px;
    font-weight:700;
    cursor:pointer;
    transform:translateY(2px);
    background:transparent;
}

.risk-info-mini span{
    line-height:1;
}

.switch{
    position:relative;
    display:inline-block;
    width:38px;
    height:20px;
    flex:0 0 auto;
}

.switch input{
    opacity:0;
    width:0;
    height:0;
}

.slider{
    position:absolute;
    inset:0;
    background:#d8d0c8;
    border-radius:999px;
    transition:.25s;
}

.slider:before{
    content:"";
    position:absolute;
    width:14px;
    height:14px;
    left:3px;
    top:3px;
    background:#f4efe9;
    border-radius:50%;
    transition:.25s;
}

.switch input:checked + .slider{
    background:#d0a04f;
}

.switch input:checked + .slider:before{
    transform:translateX(18px);
}

.risk-download-btn{
    width:100%;
    border:none;
    background:#c99a4d;
    color:#fff;
    padding:12px 18px;
    font-size:18px;
    font-weight:500;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:10px;
    cursor:pointer;
    flex:0 0 auto;
}

.open-risk-sidebar-btn{
    position:absolute;
    top:14px;
    left:14px;
    z-index:1190;
    border:none;
    border-radius:10px;
    background:#963d56;
    color:#fff;
    padding:12px 16px;
    font-weight:700;
    box-shadow:0 6px 18px rgba(0,0,0,.16);
    cursor:pointer;
    display:none;
}

.risk-info-tooltip{
    position:fixed;
    z-index:2000;
    display:none;
    max-width:220px;
    background:#fff;
    color:#5b3040;
    border-radius:10px;
    box-shadow:0 10px 22px rgba(0,0,0,.16);
    padding:10px 12px;
    font-size:13px;
    line-height:1.35;
    border:1px solid rgba(146,61,85,.12);
}

@media (max-width: 768px){
    .risk-sidebar{
        width:310px;
        max-width:calc(100vw - 10px);
        height:80vh;
        max-height:80vh;
    }

    .open-risk-sidebar-btn{
        top:12px;
        left:12px;
    }
}

/* =========================
   SEMÁFORO DESKTOP
   ========================= */
.risk-legend-bar-desktop{
    position:absolute;
    top:14px;
    left:50%;
    transform:translateX(-50%);
    z-index:1100;
    width:min(78vw, 1450px);
    pointer-events:none;
    display:flex;
    justify-content:center;
    align-items:center;
}

.risk-legend-bar-desktop img{
    display:block;
    width:35%;
    height:auto;
    max-height:92px;
    object-fit:contain;
    filter:drop-shadow(0 6px 14px rgba(0,0,0,.22));
}

/* =========================
   SEMÁFORO MÓVIL
   ========================= */
.risk-legend-bar-mobile{
    position:absolute;
    z-index:1101;
    pointer-events:none;
    display:none;
    right:20px;
    bottom:270px; /* arriba de switchBaseMap */
    width:88px;
}

.risk-legend-bar-mobile img{
    display:block;
    width:100%;
    height:auto;
    object-fit:contain;
    filter:drop-shadow(0 6px 14px rgba(0,0,0,.22));
}

/* =========================
   DESKTOP
   ========================= */


/* =========================
   TABLET / MÓVIL
   ========================= */
@media (max-width: 1000px){
    .risk-legend-bar-desktop{
        display:none !important;
    }

    .risk-legend-bar-mobile{
        display:block;
        right:20px;
        bottom:270px;
        width:88px;
    }
}

/* tamaños intermedios */
@media (min-width: 700px) and (max-width: 768px){
    .risk-legend-bar-mobile{
        right:10px;
        bottom:265px;
        width:82px;
    }
}

/* móvil grande */
@media (min-width: 600px) and (max-width: 699px){
    .risk-legend-bar-mobile{
        right:10px;
        bottom:265px;
        width:78px;
    }
}

/* móvil medio */
@media (min-width: 480px) and (max-width: 599px){
    .risk-legend-bar-mobile{
        right:10px;
        bottom:255px;
        width:70px;
    }
}

/* móvil pequeño */
@media (max-width: 479px){
    .risk-legend-bar-mobile{
        right:10px;
        bottom:248px;
        width:62px;
    }
}



.pm-examples-select-wrap{
    background:#fff;
    border:1.5px solid #e5e7eb;
    border-radius:12px;
    padding:14px;
    box-shadow:0 4px 14px rgba(15,23,42,.06);
}

.pm-otro-wrap{
    margin-top:14px;
}