/**
 * WPBakery Cable Generator - Carte interactive SVG
 * Recherche integree, palette gris nuancee, responsive
 */

#wpcg-carte {
    --wpcg-ink: #2d3538;
    --wpcg-ink-soft: #677174;
    --wpcg-accent: #7a8588;
    --wpcg-accent-strong: #4a5255;
    --wpcg-accent-soft: rgba(74, 82, 85, 0.12);
    --wpcg-panel: rgba(255, 255, 255, 0.94);
    --wpcg-line: rgba(56, 63, 66, 0.12);
    --wpcg-stage: #f5f3ee;
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    position: relative;
    background: transparent;
    border: 0;
    border-radius: 0;
    overflow: visible;
    user-select: none;
    -webkit-user-select: none;
    box-shadow: none;
}

#wpcg-carte::before {
    display: none;
}

.wpcg-toolbar {
    display: none;
}

.wpcg-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(320px, 380px);
    gap: 18px;
    align-items: start;
    padding: 0;
}

.wpcg-layout__main,
.wpcg-layout__sidebar {
    min-width: 0;
}

.wpcg-layout__sidebar {
    align-self: start;
    min-height: 0;
}

.wpcg-search {
    position: relative;
    width: 100%;
    padding: 12px 14px;
    background: var(--wpcg-panel);
    border: 1px solid var(--wpcg-line);
    border-radius: 16px;
    box-shadow: 0 12px 22px rgba(35, 38, 39, 0.06);
    backdrop-filter: blur(10px);
    z-index: 80;
}

.wpcg-search__eyebrow {
    font-family: 'Jost', sans-serif;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--wpcg-accent-strong);
    margin-bottom: 4px;
}

.wpcg-search__title {
    display: block;
    font-family: 'Jost', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: var(--wpcg-ink);
    margin-bottom: 2px;
}

.wpcg-search__summary {
    font-family: 'Jost', sans-serif;
    font-size: 11px;
    color: var(--wpcg-ink-soft);
    margin-bottom: 8px;
}

.wpcg-search__intro {
    font-family: 'Jost', sans-serif;
    font-size: 12px;
    line-height: 1.5;
    color: var(--wpcg-ink-soft);
    margin-bottom: 8px;
}

.wpcg-search__field {
    display: flex;
    gap: 8px;
    align-items: center;
}

.wpcg-search__input {
    flex: 1;
    min-width: 0;
    border: 1px solid rgba(56, 63, 66, 0.12);
    border-radius: 999px;
    background: rgba(255,255,255,0.98);
    color: var(--wpcg-ink);
    font-family: 'Jost', sans-serif;
    font-size: 14px;
    padding: 11px 15px;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.wpcg-search__input:focus {
    border-color: rgba(74, 82, 85, 0.32);
    box-shadow: 0 0 0 4px rgba(74, 82, 85, 0.10);
    background: #fff;
}

.wpcg-search__clear {
    border: 0;
    border-radius: 999px;
    background: rgba(45, 53, 56, 0.08);
    color: var(--wpcg-ink);
    font-family: 'Jost', sans-serif;
    font-size: 12px;
    font-weight: 600;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.18s ease, color 0.18s ease;
}

.wpcg-search__clear:hover {
    background: rgba(45, 53, 56, 0.12);
    transform: translateY(-1px);
}

.wpcg-search__results {
    display: grid;
    gap: 8px;
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 8px);
    max-height: 420px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    padding: 4px;
    border-radius: 16px;
    background: rgba(255,255,255,0.96);
    border: 1px solid var(--wpcg-line);
    box-shadow: 0 18px 30px rgba(35, 38, 39, 0.12);
    z-index: 90;
    scrollbar-width: thin;
    scrollbar-color: rgba(74, 82, 85, 0.42) rgba(45, 53, 56, 0.08);
}

.wpcg-search__results::-webkit-scrollbar {
    width: 10px;
}

.wpcg-search__results::-webkit-scrollbar-track {
    background: rgba(45, 53, 56, 0.06);
    border-radius: 999px;
}

.wpcg-search__results::-webkit-scrollbar-thumb {
    background: rgba(74, 82, 85, 0.34);
    border-radius: 999px;
    border: 2px solid rgba(255,255,255,0.96);
}

.wpcg-search__results::-webkit-scrollbar-thumb:hover {
    background: rgba(74, 82, 85, 0.48);
}

.wpcg-search:not(.is-open) .wpcg-search__results {
    display: none;
}

.wpcg-search-result,
.wpcg-search-empty {
    width: 100%;
    text-align: left;
    border-radius: 14px;
}

.wpcg-search-result {
    display: grid;
    gap: 4px;
    border: 1px solid rgba(56, 63, 66, 0.08);
    background: rgba(255,255,255,0.96);
    padding: 11px 12px;
    cursor: pointer;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.wpcg-search-result:hover,
.wpcg-search-result.is-active {
    border-color: rgba(74, 82, 85, 0.2);
    background: rgba(255,255,255,0.98);
    box-shadow: 0 12px 22px rgba(35, 38, 39, 0.08);
    transform: translateY(-1px);
}

.wpcg-search-result__title {
    font-family: 'Jost', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--wpcg-ink);
}

.wpcg-search-result__badge {
    justify-self: start;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--wpcg-accent-soft);
    color: var(--wpcg-accent-strong);
    font-family: 'Jost', sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.wpcg-search-result__meta,
.wpcg-search-empty {
    font-family: 'Jost', sans-serif;
    font-size: 12px;
    line-height: 1.4;
    color: var(--wpcg-ink-soft);
}

.wpcg-search-empty {
    border: 1px dashed rgba(56, 63, 66, 0.14);
    background: rgba(255,255,255,0.76);
    padding: 12px;
}

.wpcg-chaine-explorer {
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: sticky;
    top: 0;
    min-height: 0;
}

.wpcg-sidebar-switch {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 6px;
    background: rgba(255,255,255,0.9);
    border: 1px solid rgba(56, 63, 66, 0.1);
    border-radius: 999px;
    box-shadow: 0 12px 22px rgba(35, 38, 39, 0.05);
}

.wpcg-sidebar-switch__button {
    border: 0;
    border-radius: 999px;
    min-height: 46px;
    padding: 0 16px;
    background: transparent;
    color: var(--wpcg-ink-soft);
    font-family: 'Jost', sans-serif;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.wpcg-sidebar-switch__button:hover {
    color: var(--wpcg-ink);
}

.wpcg-sidebar-switch__button.is-active {
    background: #161a1f;
    color: #fff;
    box-shadow: 0 10px 18px rgba(22, 26, 31, 0.18);
}

.wpcg-sidebar-switch__button:focus-visible {
    outline: 2px solid rgba(74, 82, 85, 0.32);
    outline-offset: 2px;
}

.wpcg-sidebar-mode {
    display: grid;
    gap: 12px;
    min-width: 0;
}

.wpcg-sidebar-mode.is-hidden {
    display: none;
}

.wpcg-search--cities,
.wpcg-search--chaines {
    z-index: 30;
    flex-shrink: 0;
}

.wpcg-context-panel {
    background: rgba(255,255,255,0.9);
    border: 1px solid rgba(56, 63, 66, 0.1);
    border-radius: 16px;
    padding: 14px;
    box-shadow: 0 12px 22px rgba(35, 38, 39, 0.05);
    min-height: 0;
    max-height: min(72vh, 880px);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(74, 82, 85, 0.42) rgba(45, 53, 56, 0.08);
}

.wpcg-context-panel.is-hidden {
    display: none;
}

.wpcg-context-panel::-webkit-scrollbar {
    width: 10px;
}

.wpcg-context-panel::-webkit-scrollbar-track {
    background: rgba(45, 53, 56, 0.06);
    border-radius: 999px;
}

.wpcg-context-panel::-webkit-scrollbar-thumb {
    background: rgba(74, 82, 85, 0.34);
    border-radius: 999px;
    border: 2px solid rgba(255,255,255,0.96);
}

.wpcg-context-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(74, 82, 85, 0.48);
}

.wpcg-context-panel[data-context-mode$="empty"] {
    min-height: 180px;
}

.wpcg-chaine-coverage,
.wpcg-dept-context {
    display: grid;
    gap: 12px;
}

.wpcg-chaine-empty {
    display: grid;
    gap: 8px;
    align-content: start;
}

.wpcg-chaine-empty__title,
.wpcg-chaine-coverage__title {
    font-family: 'Jost', sans-serif;
    color: var(--wpcg-ink);
}

.wpcg-chaine-empty__title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.wpcg-chaine-empty__body,
.wpcg-chaine-coverage__summary,
.wpcg-chaine-coverage__aliases {
    font-family: 'Jost', sans-serif;
    font-size: 12px;
    line-height: 1.5;
    color: var(--wpcg-ink-soft);
}

.wpcg-chaine-coverage__header {
    display: grid;
    gap: 10px;
    margin-bottom: 12px;
}

.wpcg-chaine-featured__title {
    margin-top: 14px;
    font-family: 'Jost', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--wpcg-accent-strong);
}

.wpcg-chaine-featured {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.wpcg-chaine-featured__item {
    border: 0;
    border-radius: 999px;
    padding: 8px 12px;
    background: rgba(45, 53, 56, 0.08);
    color: var(--wpcg-ink);
    font-family: 'Jost', sans-serif;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.18s ease, background 0.18s ease;
}

.wpcg-chaine-featured__item:hover {
    background: rgba(45, 53, 56, 0.12);
    transform: translateY(-1px);
}

.wpcg-chaine-coverage__eyebrow {
    font-family: 'Jost', sans-serif;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--wpcg-accent-strong);
    margin-bottom: 4px;
}

.wpcg-chaine-coverage__title {
    margin: 0 0 3px;
    font-size: 22px;
    font-weight: 600;
}

.wpcg-chaine-coverage__stats,
.wpcg-chaine-card__meta,
.wpcg-chaine-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.wpcg-chaine-stat,
.wpcg-chaine-card__meta span {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(45, 53, 56, 0.06);
    color: #616b6f;
    font-family: 'Jost', sans-serif;
    font-size: 11px;
}

.wpcg-chaine-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 12px;
}

.wpcg-chaine-explorer[data-layout="list"] .wpcg-chaine-list {
    grid-template-columns: 1fr;
}

.wpcg-chaine-explorer[data-layout="list"] .wpcg-chaine-card {
    gap: 7px;
    padding: 12px 14px;
}

.wpcg-chaine-card {
    display: grid;
    gap: 8px;
    background: rgba(255,255,255,0.98);
    border: 1px solid rgba(56, 63, 66, 0.1);
    border-radius: 16px;
    padding: 14px;
    box-shadow: 0 12px 22px rgba(35, 38, 39, 0.04);
}

.wpcg-chaine-card__city {
    font-family: 'Jost', sans-serif;
    font-size: 17px;
    font-weight: 600;
    color: var(--wpcg-ink);
}

.wpcg-chaine-card__network {
    font-family: 'Jost', sans-serif;
    font-size: 13px;
    color: var(--wpcg-ink-soft);
}

.wpcg-chaine-card__button,
.wpcg-chaine-card__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    font-family: 'Jost', sans-serif;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.wpcg-chaine-card__button {
    border: 0;
    background: rgba(45, 53, 56, 0.08);
    color: var(--wpcg-ink);
    cursor: pointer;
}

.wpcg-chaine-card__button:hover,
.wpcg-chaine-card__link:hover {
    transform: translateY(-1px);
}

.wpcg-chaine-card__link {
    border: 1px solid rgba(56, 63, 66, 0.12);
    background: rgba(255,255,255,0.98);
    color: var(--wpcg-accent-strong);
}

.wpcg-stage {
    position: relative;
    padding: 0;
    min-width: 0;
    background: rgba(255,255,255,0.94);
    border: 1px solid rgba(56, 63, 66, 0.1);
    border-radius: 24px;
    box-shadow: 0 20px 36px rgba(35, 38, 39, 0.08);
    overflow: visible;
}

#wpcg-carte svg {
    display: block;
    width: 100%;
    height: auto;
    border-radius: inherit;
    background: var(--wpcg-stage);
    transition: aspect-ratio 0.3s ease;
    filter: none;
}

/* Regions */
.wpcg-region {
    fill: #efefec;
    stroke: rgba(255,255,255,0.92);
    stroke-width: 0.55;
    cursor: default;
    transition: fill 0.2s, opacity 0.3s, filter 0.2s, stroke 0.2s;
}

.wpcg-region.has-cities {
    cursor: pointer;
}

.wpcg-region.has-cities:hover {
    stroke: rgba(45, 53, 56, 0.26);
    filter: brightness(0.98) drop-shadow(0 6px 12px rgba(35,38,39,0.10));
}

.wpcg-region.active {
    stroke: rgba(45, 53, 56, 0.46);
    stroke-width: 0.7;
}

.wpcg-region.dimmed {
    opacity: 0.12;
    pointer-events: none;
}

.wpcg-region.hidden {
    display: none;
}

/* Marqueurs villes */
.wpcg-city {
    fill: #faf9f7;
    stroke: rgba(45, 53, 56, 0.84);
    stroke-width: 0.24;
    cursor: pointer;
    transition: fill 0.2s ease, stroke-width 0.2s ease, filter 0.24s ease;
    vector-effect: non-scaling-stroke;
}

.wpcg-city:hover {
    fill: #d8dbd8;
    stroke: var(--wpcg-accent-strong);
    stroke-width: 0.3;
    filter: drop-shadow(0 0 1.5px rgba(0,0,0,0.16));
}

.wpcg-city.is-selected {
    fill: #97a0a3;
    stroke: rgba(255,255,255,0.98);
    stroke-width: 0.52;
    filter: drop-shadow(0 0 4px rgba(74,82,85,0.22));
}

.wpcg-city-pulse {
    fill: none;
    stroke: rgba(154, 162, 166, 0.68);
    stroke-width: 0.3;
    pointer-events: none;
    vector-effect: non-scaling-stroke;
}

.wpcg-city-cluster {
    fill: var(--wpcg-accent);
    stroke: #fbfbfa;
    stroke-width: 0.42;
    cursor: pointer;
    transition: transform 0.22s ease, filter 0.22s ease, fill 0.22s ease;
    vector-effect: non-scaling-stroke;
}

.wpcg-city-cluster:hover {
    fill: var(--wpcg-accent-strong);
    filter: drop-shadow(0 8px 14px rgba(0,0,0,0.18));
}

.wpcg-city-cluster.is-open {
    fill: #353d40;
    filter: drop-shadow(0 8px 14px rgba(0,0,0,0.18));
}

.wpcg-city-cluster.is-selected {
    fill: #353d40;
    filter: drop-shadow(0 8px 14px rgba(0,0,0,0.18));
}

.wpcg-cluster-label {
    fill: #fff;
    font-family: 'Jost', sans-serif;
    font-weight: 600;
    pointer-events: none;
}

.wpcg-cluster-spoke {
    stroke: rgba(255,255,255,0.82);
    stroke-width: 0.45;
    pointer-events: none;
    vector-effect: non-scaling-stroke;
}

.wpcg-city-expanded {
    stroke-width: 0.38;
    filter: drop-shadow(0 0 1.5px rgba(0,0,0,0.18));
}

.wpcg-cluster-picker {
    position: absolute;
    min-width: 220px;
    max-width: 280px;
    padding: 10px;
    background: rgba(255,255,255,0.96);
    border: 1px solid rgba(30,30,30,0.08);
    border-radius: 16px;
    box-shadow: 0 20px 36px rgba(0,0,0,0.12);
    backdrop-filter: blur(10px);
    z-index: 90;
    display: none;
}

.wpcg-cluster-picker.visible {
    display: block;
}

.wpcg-cluster-picker-title {
    font-family: 'Jost', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #777;
    margin: 2px 4px 8px;
}

.wpcg-cluster-picker-item {
    width: 100%;
    display: block;
    text-align: left;
    background: #fff;
    border: 1px solid rgba(56, 63, 66, 0.10);
    border-radius: 12px;
    padding: 9px 11px;
    margin: 0 0 6px;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.wpcg-cluster-picker-item:last-child {
    margin-bottom: 0;
}

.wpcg-cluster-picker-item:hover {
    border-color: rgba(74, 82, 85, 0.24);
    box-shadow: 0 10px 22px rgba(0,0,0,0.08);
    transform: translateY(-1px);
}

.wpcg-cluster-picker-name {
    display: block;
    font-family: 'Jost', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #1f1f1f;
}

.wpcg-cluster-picker-reseau {
    display: block;
    margin-top: 2px;
    font-family: 'Jost', sans-serif;
    font-size: 12px;
    color: #6d6d6d;
}

/* Labels DOM-TOM */
.wpcg-domtom-label {
    fill: #7f8a8f;
    font-family: 'Jost', sans-serif;
    font-size: 10px;
    font-weight: 500;
    text-anchor: middle;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    pointer-events: none;
}

.wpcg-domtom-border {
    fill: none;
    stroke: rgba(86, 102, 108, 0.34);
    stroke-width: 0.3;
    stroke-dasharray: 2 1;
}

/* Tooltip */
.wpcg-tooltip {
    position: absolute;
    pointer-events: none;
    background: var(--wpcg-ink);
    color: #fff;
    font-family: 'Jost', sans-serif;
    font-size: 13px;
    padding: 9px 13px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.08);
    white-space: nowrap;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.15s;
    box-shadow: 0 14px 28px rgba(11,16,19,0.24);
}

.wpcg-tooltip.visible {
    opacity: 1;
}

.wpcg-tooltip-count {
    color: rgba(255,255,255,0.68);
    font-size: 11px;
    margin-left: 6px;
}

.wpcg-tooltip-reseau {
    color: rgba(255,255,255,0.72);
    font-size: 11px;
    display: block;
}

.wpcg-tooltip-context {
    display: block;
    color: rgba(255,255,255,0.72);
    font-size: 11px;
    margin-top: 2px;
}

/* Bouton retour */
.wpcg-back {
    position: absolute;
    top: 14px;
    left: 14px;
    background: var(--wpcg-panel);
    color: var(--wpcg-ink);
    border: 1px solid rgba(68,68,68,0.16);
    border-radius: 999px;
    padding: 7px 15px;
    font-family: 'Jost', sans-serif;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.04em;
    cursor: pointer;
    z-index: 10;
    transition: color 0.22s ease, border-color 0.22s ease, background 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease;
    display: none;
    box-shadow: 0 10px 24px rgba(0,0,0,0.08);
    backdrop-filter: blur(8px);
    max-width: calc(100% - 28px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wpcg-back:hover {
    color: var(--wpcg-accent-strong);
    border-color: rgba(74, 82, 85, 0.24);
    background: rgba(255,255,255,0.98);
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(0,0,0,0.1);
}

.wpcg-back.visible {
    display: block;
}

/* Info cards - sous la carte au clic sur une region */
.wpcg-info-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 0;
    font-family: 'Jost', sans-serif;
}

.wpcg-info-card {
    background: rgba(255,255,255,0.88);
    border: 1px solid rgba(56, 63, 66, 0.10);
    border-radius: 16px;
    padding: 15px 16px;
    transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s, background 0.2s;
    box-shadow: 0 14px 24px rgba(35, 38, 39, 0.04);
}

.wpcg-info-card:hover {
    border-color: rgba(74, 82, 85, 0.18);
    box-shadow: 0 18px 28px rgba(35, 38, 39, 0.08);
    transform: translateY(-1px);
}

.wpcg-info-card.is-selected {
    background: rgba(255,255,255,0.98);
    border-color: rgba(74, 82, 85, 0.28);
    box-shadow: 0 0 0 4px rgba(74, 82, 85, 0.10), 0 18px 28px rgba(35, 38, 39, 0.08);
}

.wpcg-info-card-ville {
    font-weight: 600;
    font-size: 16px;
    color: var(--wpcg-ink);
    margin-bottom: 2px;
}

.wpcg-info-card-type {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--wpcg-accent-soft);
    color: var(--wpcg-accent-strong);
    font-family: 'Jost', sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.wpcg-info-card-parent {
    font-size: 12px;
    color: var(--wpcg-ink-soft);
    margin-bottom: 6px;
}

.wpcg-info-card-reseau {
    font-size: 13px;
    color: var(--wpcg-ink-soft);
    margin-bottom: 8px;
}

.wpcg-info-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.wpcg-info-card-meta span {
    font-size: 11px;
    color: #616b6f;
    background: rgba(45, 53, 56, 0.06);
    padding: 3px 9px;
    border-radius: 999px;
}

.wpcg-legend {
    position: static;
    background: var(--wpcg-panel);
    border: 1px solid rgba(56, 63, 66, 0.10);
    border-radius: 16px;
    padding: 10px 12px;
    font-family: 'Jost', sans-serif;
    box-shadow: 0 12px 22px rgba(35, 38, 39, 0.06);
    min-width: 0;
    max-width: none;
    backdrop-filter: blur(10px);
    pointer-events: auto;
}

.wpcg-legend.is-hidden {
    display: none;
}

.wpcg-legend-title {
    color: var(--wpcg-ink-soft);
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 4px;
}

.wpcg-legend-summary {
    color: var(--wpcg-ink-soft);
    font-size: 11px;
    line-height: 1.4;
    margin-bottom: 8px;
}

.wpcg-legend-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}

.wpcg-legend-color {
    width: 14px;
    height: 10px;
    border-radius: 999px;
    border: 1px solid rgba(56, 63, 66, 0.10);
    flex-shrink: 0;
}

.wpcg-legend-label {
    color: var(--wpcg-ink-soft);
    font-size: 11px;
}

.wpcg-legend-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    padding: 0 7px;
    min-height: 20px;
    border-radius: 999px;
    background: rgba(45, 53, 56, 0.07);
    color: var(--wpcg-ink);
    font-size: 10px;
    font-weight: 600;
}

/* Chargement */
.wpcg-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 300px;
    color: var(--wpcg-ink-soft);
    font-family: 'Jost', sans-serif;
    font-size: 14px;
    gap: 12px;
}

.wpcg-loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(45, 53, 56, 0.14);
    border-top-color: var(--wpcg-accent);
    border-radius: 50%;
    animation: wpcg-spin 0.8s linear infinite;
}

@keyframes wpcg-spin {
    to { transform: rotate(360deg); }
}

/* Couche départements — fill appliqué via JS getColor() */
.wpcg-dept {
    stroke: rgba(255,255,255,0.85);
    stroke-width: 0.55;
    vector-effect: non-scaling-stroke;
    pointer-events: all;
    cursor: default;
    transition: fill 0.2s, opacity 0.3s, filter 0.2s, stroke 0.2s;
}

.wpcg-dept.has-cities {
    cursor: pointer;
}

.wpcg-dept.has-cities:hover {
    stroke: rgba(45, 53, 56, 0.24);
    filter: brightness(0.98) drop-shadow(0 8px 14px rgba(35,38,39,0.10));
}

.wpcg-dept.active {
    stroke: none;
    stroke-width: 0;
}

.wpcg-dept.dimmed {
    opacity: 0.15;
    pointer-events: none;
}

.wpcg-dept.hidden {
    display: none;
}

/* ============================
   RESPONSIVE MOBILE
   ============================ */
@media (max-width: 980px) {
    .wpcg-layout {
        grid-template-columns: 1fr;
    }

    .wpcg-chaine-explorer {
        position: static;
    }

    .wpcg-sidebar-switch {
        gap: 6px;
        padding: 4px;
    }

    .wpcg-sidebar-switch__button {
        min-height: 44px;
        padding: 8px 12px;
        font-size: 12px;
    }

    .wpcg-context-panel {
        min-height: 0;
        max-height: none;
    }
}

@media (max-width: 768px) {
    #wpcg-carte {
        border-radius: 0;
    }

    .wpcg-layout {
        grid-template-columns: 1fr;
        padding: 0;
    }

    .wpcg-chaine-explorer {
        position: static;
    }

    .wpcg-context-panel {
        min-height: 0;
        max-height: none;
    }

    .wpcg-search {
        padding: 12px;
    }

    .wpcg-search__title {
        font-size: 15px;
    }

    .wpcg-search__summary {
        font-size: 11px;
    }

    .wpcg-search__field {
        flex-direction: column;
        align-items: stretch;
    }

    .wpcg-search__clear {
        width: 100%;
    }

    .wpcg-stage {
        border-radius: 18px;
    }

    .wpcg-legend {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
        padding: 8px 12px;
        border-radius: 14px;
        box-shadow: 0 10px 20px rgba(35, 38, 39, 0.06);
        min-width: 0;
        max-width: none;
    }

    .wpcg-legend-title {
        margin-bottom: 0;
        margin-right: 4px;
        font-size: 9px;
    }

    .wpcg-legend-summary {
        width: 100%;
        margin-bottom: 2px;
        font-size: 10px;
    }

    .wpcg-legend-item {
        display: inline-grid;
        grid-template-columns: auto auto auto;
        margin-bottom: 0;
        gap: 4px;
    }

    .wpcg-legend-color {
        width: 10px;
        height: 8px;
    }

    .wpcg-legend-label {
        font-size: 10px;
    }

    .wpcg-back {
        top: 10px;
        left: 10px;
        font-size: 11px;
        padding: 5px 10px;
        max-width: calc(100% - 20px);
    }

    .wpcg-tooltip {
        font-size: 12px;
        padding: 4px 8px;
    }

    .wpcg-cluster-picker {
        min-width: 180px;
        max-width: min(260px, calc(100vw - 32px));
        padding: 8px;
    }

    .wpcg-stage {
        padding: 0;
    }
}
