.df-delegations-card--interactive{
    background:#fff;
    border-radius:28px;
    border:1px solid rgba(30,74,112,.08);
    box-shadow:0 28px 60px rgba(17,42,67,.09);
    padding:34px;
}

.df-delegations-card--interactive .df-delegations-card-head{
    display:flex;
    justify-content:space-between;
    gap:24px;
    align-items:flex-start;
    margin-bottom:26px;
}

.df-delegations-card--interactive .df-delegations-card-head h2{
    margin:8px 0 8px;
}

.df-delegations-card--interactive .df-delegations-card-head p{
    max-width:720px;
    margin:0;
    color:#5d7084;
}

.df-delegations-layout{
    display:grid;
    grid-template-columns:minmax(0,1.55fr) minmax(270px,.82fr);
    gap:clamp(14px,1.7vw,26px);
    align-items:start;
}

.df-delegations-map-panel,
.df-delegations-info{
    border-radius:24px;
    border:1px solid rgba(39,96,140,.12);
    background:linear-gradient(180deg,#ffffff 0%,#f8fbff 100%);
    box-shadow:0 18px 38px rgba(19,53,85,.08);
}

.df-delegations-map-panel{ padding:18px 18px 16px; min-width:0; }
.df-delegations-info{ padding:22px; position:sticky; top:112px; min-width:0; }
/* Control visible solo cuando la ficha se transforma en panel flotante. */
.df-delegations-sheet-toggle{ display:none; }
.df-delegations-sheet-content{min-width:0;}

.df-delegations-map-toolbar{
    display:flex;
    justify-content:flex-start;
    margin-bottom:10px;
}

.df-delegations-map-hint{
    display:inline-flex;
    align-items:center;
    gap:10px;
    font-size:.92rem;
    color:#476175;
    background:#eef6fd;
    border:1px solid rgba(57,146,197,.16);
    padding:9px 14px;
    border-radius:999px;
}

.df-delegations-map-hint-dot{
    width:10px;
    height:10px;
    border-radius:50%;
    background:#f1b634;
    box-shadow:0 0 0 4px rgba(241,182,52,.18);
    flex:0 0 auto;
}

.df-delegations-map-stage{
    position:relative;
    border-radius:22px;
    overflow:hidden;
    min-height:680px;
    background:radial-gradient(circle at top left,#f8fcff 0%,#eef5fb 52%,#e8f0f7 100%);
    border:1px solid rgba(42,103,149,.10);
}

.df-delegations-loading{
    position:absolute;
    inset:0;
    display:flex;
    align-items:center;
    justify-content:center;
    font-weight:700;
    letter-spacing:.02em;
    color:#3a607b;
    z-index:3;
    background:rgba(248,251,255,.92);
}

.df-delegations-map,
.df-canary-map{
    width:100%;
    height:auto;
    display:block;
}

.df-canary-inset-wrap{
    position:absolute;
    left:16px;
    bottom:16px;
    width:min(34%,250px);
    background:rgba(255,255,255,.92);
    border:2px solid rgba(32,82,123,.18);
    border-radius:18px;
    box-shadow:0 18px 32px rgba(22,55,84,.14);
    overflow:hidden;
    backdrop-filter: blur(3px);
}

.df-canary-inset-title{
    padding:10px 14px;
    font-size:.88rem;
    text-transform:uppercase;
    letter-spacing:.08em;
    font-weight:800;
    color:#1e527b;
    background:linear-gradient(135deg,#eff8ff 0%,#e4f0fb 100%);
    border-bottom:1px solid rgba(39,96,140,.10);
}

.df-canary-map{ padding:8px; }

.df-map-watermark{
    font-size:.8rem;
    fill:#6d7f92;
    font-weight:700;
    letter-spacing:.08em;
}

.df-prov-path{
    stroke:#8ea4b8;
    stroke-width:1.15;
    cursor:pointer;
    transition:filter .16s ease, opacity .16s ease, transform .16s ease;
}

.df-prov-path:hover,
.df-prov-path.is-hovered{
    filter:brightness(1.06) saturate(1.08);
}

.df-prov-path.is-selected{
    stroke:#193b59;
    stroke-width:2.4;
    filter:brightness(1.02) saturate(1.16);
}

.df-community-path{
    fill:none;
    stroke:#335d80;
    stroke-width:3.2;
    opacity:.72;
    pointer-events:none;
}

.df-capital-dot{
    fill:#f1b634;
    stroke:#c6514f;
    stroke-width:2;
    pointer-events:none;
}

.df-capital-dot.is-selected{
    r:5.5;
    fill:#d8443d;
    stroke:#fff3d5;
}

.df-delegations-map-legend{
    display:flex;
    flex-wrap:wrap;
    gap:18px 22px;
    margin-top:14px;
    padding:0 2px;
    font-size:.9rem;
    color:#5c6f82;
}

.df-delegations-map-legend span{
    display:inline-flex;
    align-items:center;
    gap:8px;
}

.df-legend-line{
    display:inline-block;
    width:28px;
    border-top-style:solid;
}

.df-legend-line--province{ border-top-width:1.5px; border-top-color:#8ea4b8; }
.df-legend-line--community{ border-top-width:3px; border-top-color:#335d80; }
.df-legend-capital{
    display:inline-block;
    width:10px;
    height:10px;
    border-radius:50%;
    background:#f1b634;
    border:2px solid #c6514f;
}

.df-delegations-placeholder h3,
.df-delegations-selected h3{
    margin:10px 0 12px;
    font-size:1.55rem;
}

.df-delegations-placeholder p,
.df-delegations-selected p{
    color:#5e7387;
}

.df-delegations-placeholder ul{
    margin:18px 0 0;
    padding-left:18px;
    color:#567084;
}

.df-delegations-selected .df-selection-top{
    display:flex;
    justify-content:space-between;
    gap:12px;
    align-items:flex-start;
    margin-bottom:16px;
}

.df-delegations-badges{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
}

.df-delegations-badge{
    display:inline-flex;
    align-items:center;
    border-radius:999px;
    background:#ecf5fc;
    border:1px solid rgba(57,146,197,.18);
    color:#245679;
    padding:7px 12px;
    font-size:.8rem;
    font-weight:800;
    letter-spacing:.05em;
    text-transform:uppercase;
}

.df-delegations-table{
    width:100%;
    border-collapse:separate;
    border-spacing:0;
    margin-top:18px;
    border:1px solid rgba(44,91,128,.10);
    border-radius:18px;
    overflow:hidden;
}

.df-delegations-table tr:nth-child(odd) td,
.df-delegations-table tr:nth-child(odd) th{ background:#fbfdff; }

.df-delegations-table tr:nth-child(even) td,
.df-delegations-table tr:nth-child(even) th{ background:#f5f9fd; }

.df-delegations-table th,
.df-delegations-table td{
    padding:12px 14px;
    vertical-align:top;
    border-bottom:1px solid rgba(44,91,128,.08);
    font-size:.95rem;
}

.df-delegations-table th{
    width:34%;
    color:#214e71;
    font-weight:800;
}

.df-delegations-table td{
    color:#4f677b;
}

.df-delegations-table tr:last-child th,
.df-delegations-table tr:last-child td{ border-bottom:none; }

.df-delegations-info a{ color:#1e6ea0; font-weight:700; }
.df-delegations-contact-card{
    margin-top:16px;
    border-radius:18px;
    border:1px solid rgba(44,91,128,.11);
    background:linear-gradient(180deg,#ffffff 0%,#f7fbff 100%);
    padding:16px;
}

.df-delegations-contact-card + .df-delegations-contact-card{ margin-top:12px; }

.df-delegations-contact-card h4{
    margin:0 0 4px;
    font-size:1rem;
}

.df-delegations-contact-card p{
    margin:0;
    color:#617588;
    font-size:.93rem;
}

.df-delegations-default-note{
    margin-top:16px;
    padding:14px 16px;
    border-radius:16px;
    background:#fff8e7;
    border:1px solid rgba(241,182,52,.28);
    color:#7a6440;
    font-size:.92rem;
}

.df-delegations-error{
    padding:22px;
    border-radius:18px;
    background:#fff5f5;
    border:1px solid rgba(212,68,61,.18);
    color:#8d4743;
}

/* No apilar la información: mantener las dos columnas en escritorio medio. */
@media (min-width:1024px) and (max-width:1199px){
    .df-delegations-card--interactive{padding:clamp(16px,2vw,28px);}
    .df-delegations-map-panel{padding:13px;}
    .df-delegations-info{padding:16px;}
}

@media (max-width: 767px){
    .df-delegations-card--interactive{ padding:18px; border-radius:22px; }
    .df-delegations-card--interactive .df-delegations-card-head{ flex-direction:column; }
    .df-delegations-map-stage{ min-height:500px; }
    .df-canary-inset-wrap{ width:168px; left:10px; bottom:10px; }
    .df-delegations-map-legend{ gap:12px; }
    .df-delegations-selected .df-selection-top{ flex-direction:column; }
    .df-delegations-table th,
    .df-delegations-table td{ display:block; width:100%; }
    .df-delegations-table th{ padding-bottom:4px; }
    .df-delegations-table td{ padding-top:0; }
}

/* V1.1 — Recuadros de territorios independientes: no tapan provincias del mapa. */
.df-delegations-map-stage{min-height:0!important;}
.df-delegations-insets{
    display:grid;
    grid-template-columns:minmax(0,1.05fr) minmax(0,.95fr);
    gap:14px;
    margin-top:14px;
    align-items:start;
}
.df-map-inset{
    min-width:0;
    overflow:hidden;
    border:1px solid #d5e3ee;
    border-radius:17px;
    background:#fff;
    box-shadow:0 5px 18px rgba(24,66,97,.06);
}
.df-map-inset-toggle{
    width:100%;
    appearance:none;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding:12px 15px;
    border:0;
    background:#edf6fc;
    color:#245571;
    font-family:inherit;
    font-weight:800;
    font-size:13px;
    line-height:1.4;
    letter-spacing:.012em;
    cursor:pointer;
    text-align:left;
    transition:background .18s ease;
}
.df-map-inset-toggle:hover,.df-map-inset-toggle:focus-visible{background:#e2f1fa;}
.df-map-inset-toggle:focus-visible{outline:3px solid #3e9fc8;outline-offset:-3px;}
.df-map-inset-heading{display:inline-flex;align-items:center;gap:9px;}
.df-map-inset-symbol{color:#3b9cc1;font-size:15px;}
.df-map-inset-toggle-icon{font-size:21px;line-height:1;flex-shrink:0;min-width:16px;text-align:center;}
.df-map-inset-body{
    max-height:290px;
    opacity:1;
    overflow:hidden;
    transition:max-height .28s ease,opacity .23s ease;
    visibility:visible;
}
.df-map-inset.is-collapsed .df-map-inset-body{
    max-height:0;
    opacity:0;
    pointer-events:none;
    visibility:hidden;
    transition:max-height .28s ease,opacity .2s ease,visibility 0s .28s;
}
.df-map-inset-body svg{display:block;width:100%;max-height:225px;height:auto;padding:10px 12px;box-sizing:border-box;}
.df-city-label{fill:#2b5974;font-family:inherit;font-weight:800;font-size:14px;pointer-events:none;}
.df-city-path{stroke-width:2;}
.df-prov-path:focus-visible{outline:none;stroke:#0b527c;stroke-width:4;filter:brightness(1.1);}

/* Fichas sin direcciones, fax ni etiquetas de zona; solo delegación y contacto. */
.df-delegations-selected .df-selection-top{margin-bottom:14px;}
.df-delegations-identity{
    display:flex;
    align-items:center;
    justify-content:space-between;
    flex-wrap:wrap;
    gap:10px;
    padding:13px 16px;
    border:1px solid #d9e7f0;
    border-radius:15px;
    background:#eef6fb;
}
.df-delegations-identity span{font-size:10px;font-weight:850;letter-spacing:.11em;color:#63849a;}
.df-delegations-identity strong{font-size:15px;color:#1b506e;}
.df-delegations-contact-card h4{font-size:17px;font-weight:800;color:#153e57;margin:0 0 12px;}
.df-delegations-contact-card p{margin:6px 0;font-size:14px;line-height:1.5;overflow-wrap:anywhere;}
.df-delegations-contact-card p strong{color:#284f68;font-weight:800;}
.df-delegations-contact-card .df-delegations-delegate{margin:-3px 0 13px;}
.df-delegations-contact-card .df-delegations-delegate strong{color:#2c5269;font-size:14px;}
.df-delegations-info a{overflow-wrap:anywhere;}
@media(max-width:660px){
    .df-delegations-insets{grid-template-columns:1fr;gap:10px;}
    .df-map-inset-body svg{max-height:230px;}
}
@media(prefers-reduced-motion:reduce){
    .df-map-inset-body,.df-map-inset-toggle,.df-prov-path{transition:none!important;}
}

.df-city-hitbox{
    fill:rgba(237,247,252,.45);
    stroke:#d5e6ef;
    stroke-width:1.5;
    cursor:pointer;
    transition:fill .16s ease,stroke .16s ease;
}
.df-city-hitbox:hover,.df-city-hitbox.is-hovered{fill:rgba(209,238,249,.75);}
.df-city-hitbox.is-selected{fill:rgba(201,235,248,.9);stroke:#3e92ba;stroke-width:2.3;}
.df-city-hitbox:focus-visible{stroke:#2678a0;stroke-width:3.2;outline:none;}

/* V1.2 — Sin recuadro nativo de foco de SVG al hacer clic.
   La navegación por teclado conserva un resaltado del propio contorno. */
.df-delegations-map-stage svg:focus,
.df-delegations-insets svg:focus,
.df-delegations-map-stage svg [tabindex]:focus,
.df-delegations-insets svg [tabindex]:focus,
.df-delegations-map-stage svg *:focus,
.df-delegations-insets svg *:focus {
  outline:none!important;
  outline-width:0!important;
}
.df-delegations-map-stage .df-prov-path:focus-visible,
.df-delegations-insets .df-prov-path:focus-visible {
  stroke:#0a6c9c;
  stroke-width:3!important;
  filter:brightness(1.12) drop-shadow(0 0 3px rgba(12,108,156,.4));
}
.df-delegations-insets .df-city-hitbox:focus-visible {
  stroke:#0a6c9c;
  stroke-width:3!important;
}

/* V1.4 — Territorio Andorra y cobertura comercial por delegación. */
.df-andorra-hit-target{fill:transparent;stroke:none;cursor:pointer;}
.df-andorra-hit-target:focus,.df-andorra-hit-target:focus-visible{outline:none!important;stroke:none!important;}
.df-andorra-label{fill:#234f6b;font-size:16px;font-weight:800;font-family:inherit;pointer-events:none;paint-order:stroke;stroke:#f5fbff;stroke-width:4px;stroke-linejoin:round;}
.df-delegations-assigned{margin:13px 1px 5px;padding:11px 13px;color:#355d76;font-size:13px;line-height:1.65;border:1px solid #e0edf5;border-radius:12px;background:#f6fafd;overflow-wrap:anywhere;}
.df-delegations-assigned strong{font-weight:800;color:#164968;}


/* ================================================================
   v1.5 · Mapa delegaciones: lateral permanente en escritorio y
   panel inferior plegable (bottom sheet) en tablet y móvil.
   En móvil el JS traslada la ficha al body para evitar recortes.
   ================================================================ */
@media (max-width:1023px), (max-width:1366px) and (hover:none) and (pointer:coarse){
    .df-delegations-layout{
        grid-template-columns:minmax(0,1fr);
    }
    .df-delegations-page .df-delegations-info{
        position:fixed;
        bottom:calc(10px + env(safe-area-inset-bottom, 0px));
        left:50%;
        top:auto;
        right:auto;
        transform:translateX(-50%);
        z-index:1100;
        display:flex;
        flex-direction:column;
        width:min(520px, calc(100vw - 24px));
        max-width:calc(100vw - 24px);
        height:auto;
        max-height:50vh;
        max-height:50dvh;
        padding:0;
        border:1px solid rgba(36,92,129,.28);
        border-radius:18px;
        background:#fff;
        box-shadow:0 12px 44px rgba(13,49,76,.25);
        overflow:hidden;
        box-sizing:border-box;
        visibility:hidden;
        opacity:0;
        pointer-events:none;
        transition:opacity .18s ease, visibility .18s ease, box-shadow .18s ease;
    }
    .df-delegations-page .df-delegations-info.is-sheet-visible{
        visibility:visible;
        opacity:1;
        pointer-events:auto;
    }
    .df-delegations-sheet-toggle{
        display:flex;
        flex:0 0 auto;
        align-items:center;
        justify-content:space-between;
        gap:12px;
        width:100%;
        min-height:68px;
        padding:12px 19px;
        background:linear-gradient(110deg,#edf7fd 0%,#fff 92%);
        border:0;
        border-radius:0;
        color:#183f59;
        cursor:pointer;
        font:inherit;
        text-align:left;
        box-sizing:border-box;
    }
    .df-delegations-sheet-toggle:focus-visible{
        outline:3px solid #348fbd;
        outline-offset:-3px;
    }
    .df-delegations-sheet-title-group{
        display:flex;
        flex-direction:column;
        justify-content:center;
        gap:3px;
        min-width:0;
    }
    .df-delegations-sheet-overline{
        color:#5b839b;
        font-size:10px;
        font-weight:800;
        letter-spacing:.09em;
        line-height:1.2;
    }
    #df-delegations-sheet-province{
        color:#183f59;
        font-weight:850;
        font-size:16px;
        line-height:1.25;
        overflow-wrap:anywhere;
    }
    .df-delegations-sheet-chevron{
        display:block;
        flex:0 0 auto;
        width:11px;
        height:11px;
        margin-right:4px;
        border-right:2px solid #3d7190;
        border-bottom:2px solid #3d7190;
        transform:rotate(-135deg);
        transition:transform .2s ease;
    }
    .df-delegations-info.is-sheet-open .df-delegations-sheet-chevron{
        transform:rotate(45deg);
    }
    .df-delegations-page .df-delegations-sheet-content{
        flex:1 1 auto;
        min-height:0;
        overflow-y:auto;
        overscroll-behavior:contain;
        -webkit-overflow-scrolling:touch;
        padding:13px 17px 17px;
        box-sizing:border-box;
        scrollbar-width:thin;
        scrollbar-color:#b1cbdc transparent;
    }
    .df-delegations-page .df-delegations-info:not(.is-sheet-open) .df-delegations-sheet-content{
        display:none;
    }
    .df-delegations-info.is-sheet-open .df-delegations-sheet-toggle{
        border-bottom:1px solid #dce9f2;
    }
    /* Compactar el contenido sin perder datos ni enlaces. */
    .df-delegations-sheet-content .df-card-kicker{display:none;}
    .df-delegations-sheet-content .df-delegations-selected h3{margin:0 0 3px;font-size:1.15rem;}
    .df-delegations-sheet-content .df-selection-top{margin:0 0 9px;}
    .df-delegations-sheet-content .df-selection-top p{margin:0;font-size:12px;}
    .df-delegations-sheet-content .df-delegations-identity{padding:9px 12px;}
    .df-delegations-sheet-content .df-delegations-assigned{
        margin:9px 0 0;
        padding:9px 11px;
        font-size:12px;
        line-height:1.45;
    }
    .df-delegations-sheet-content .df-delegations-contact-card{margin-top:10px;padding:11px 12px;}
    .df-delegations-sheet-content .df-delegations-contact-card h4{margin:0 0 7px;font-size:15px;}
    .df-delegations-sheet-content .df-delegations-contact-card p{font-size:12px;line-height:1.4;}
    .df-delegations-sheet-content .df-delegations-contact-card + .df-delegations-contact-card{margin-top:9px;}
}
@media (max-width:380px){
    .df-delegations-sheet-toggle{min-height:60px;padding:10px 14px;}
    .df-delegations-page .df-delegations-sheet-content{padding:11px 12px 14px;}
}
@media (prefers-reduced-motion: reduce){
    .df-delegations-page .df-delegations-info,
    .df-delegations-sheet-chevron{transition:none!important;}
}
