@import url('https://fonts.googleapis.com/css2?family=Google+Sans:ital,opsz,wght@0,17..18,400..700;1,17..18,400..700&display=swap');

:root {
    --color-bg: rgba(0, 0, 0, 0.539);
    --color-primary: #10b981;
    --color-primary-dark: #059669;
    --color-accent: #fbbf24;
    --color-text: #f8fafc;
    --color-text-muted: #94a3b8;

    --glass-bg: rgba(0, 0, 0, 0.55);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);

    --z-map: 1;
    --z-overlay: 1000;

    --radius: 6px;
    /* rayon standard — carré mais pas agressif */
    --radius-sm: 3px;
}

/* ============================================
   RESET & BASE
   ============================================ */

.hidden {
    display: none !important;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* Scrollbars uniformes partout */
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

*::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 3px;
}

*::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary);
}

body {
    font-family: "Google Sans", sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

#app-container {
    position: relative;
    width: 100%;
    height: 100%;
}

#map {
    width: 100%;
    height: 100%;
    z-index: var(--z-map);
}

/* Espacement entre les groupes de contrôles Leaflet (zoom, dessin, fond de carte) */
.leaflet-top.leaflet-left .leaflet-control {
    margin-top: 6px;
}

.leaflet-top.leaflet-left .leaflet-control:first-child {
    margin-top: 10px;
}

/* Empêcher les boutons Leaflet de changer de couleur après clic */
.leaflet-bar a,
.leaflet-bar a:visited,
.leaflet-bar a:active,
.leaflet-bar a:focus {
    color: #333;
}

/* Bouton de changement de fond de carte */
.layer-toggle-btn {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    cursor: pointer;
    border-radius: 4px;
}

.layer-toggle-btn:hover {
    background: #f4f4f4;
}

/* ============================================
   GLASSMORPHISM BASE
   ============================================ */

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--glass-shadow);
    color: var(--color-text);
    transform: translateZ(0);
    will-change: transform, opacity;
}

/* ============================================
   TOP BAR — Macro overlay + Filtres côte à côte
   ============================================ */

#top-bar {
    position: absolute;
    top: 20px;
    left: 60px;
    z-index: var(--z-overlay);
    display: flex;
    gap: 8px;
    align-items: flex-start;
    max-width: calc(100vw - 440px);
    pointer-events: none;
}

#top-bar>* {
    pointer-events: all;
}

/* ============================================
   MACRO OVERLAY
   ============================================ */
#filters-floating-box .filter-card {
    min-width: 250px;
}

#macro-overlay {
    min-width: 320px;
    width: fit-content;
    max-width: 480px;
    padding: 18px 20px;
    z-index: var(--z-overlay);
    transition: opacity 0.3s ease, transform 0.3s ease;
    /* Fill remaining space in macro-column (flex child) */
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

#macro-overlay:not(.minimized) {
    height: 100vh; /* Force stretch to parent's max-height */
}

#macro-overlay.minimized {
    height: auto;
    min-height: 0;
    overflow: hidden;
    flex: 0 0 auto;
}

#macro-overlay.minimized .instructions,
#macro-overlay.minimized .stats-grid {
    display: none;
}

#macro-overlay.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-12px);
}

.macro-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

#macro-overlay header h1,
.macro-header h1 {
    font-weight: 700;
    font-size: 1.25rem;
    line-height: 1.2;
    margin-bottom: 2px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--color-text-muted);
    font-size: 0.82rem;
    margin-bottom: 12px;
}

.instructions p {
    font-size: 0.88rem;
    margin-bottom: 10px;
}

.minimize-btn {
    font-size: 1.3rem;
    line-height: 1;
    font-weight: 300;
    opacity: 0.6;
    cursor: pointer;
    background: none;
    border: none;
    color: var(--color-text);
    padding: 0 4px;
    flex-shrink: 0;
    transition: opacity 0.2s;
}

.minimize-btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
}

/* Stats container */
.stats-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
}

.stat-item {
    background: rgba(255, 255, 255, 0.04);
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
}

.stat-label {
    font-size: 0.72rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ============================================
   MACRO COLLAPSIBLE SECTIONS
   ============================================ */

.macro-section {
    margin-bottom: 4px;
}

.macro-section-toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    padding: 7px 10px;
    cursor: pointer;
    font-family: "Google Sans", sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    transition: background 0.15s ease;
}

.macro-section-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
}

.macro-section-chevron {
    font-size: 0.6rem;
    opacity: 0.5;
    transition: transform 0.2s ease;
}

.macro-section-body {
    padding: 6px 0 0;
}

/* ============================================
   KPI CARDS (macro panel indicateurs)
   ============================================ */

.kpi-card {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.04);
}

.kpi-card--col {
    flex-direction: column;
    align-items: flex-start;
}

.kpi-card--span2 {
    grid-column: span 2;
}

.kpi-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    line-height: 1;
}

.kpi-label {
    font-size: 0.68rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 2px;
}

.kpi-sub {
    font-size: 0.72rem;
    color: var(--color-text-muted);
    margin-top: 3px;
}

/* KPI color variants (border + bg) */
.kpi-card--purple {
    border-color: rgba(167, 139, 250, 0.35);
    background: rgba(167, 139, 250, 0.07);
}

.kpi-card--green {
    border-color: rgba(5, 150, 105, 0.35);
    background: rgba(5, 150, 105, 0.07);
}

.kpi-card--blue {
    border-color: rgba(59, 130, 246, 0.35);
    background: rgba(59, 130, 246, 0.07);
}

.kpi-card--emerald {
    border-color: rgba(16, 185, 129, 0.3);
    background: rgba(16, 185, 129, 0.07);
}

.kpi-card--pink {
    border-color: rgba(236, 72, 153, 0.35);
    background: rgba(236, 72, 153, 0.07);
}

.kpi-card--amber {
    border-color: rgba(251, 191, 36, 0.35);
    background: rgba(251, 191, 36, 0.07);
}

.kpi-card--violet {
    border-color: rgba(139, 92, 246, 0.35);
    background: rgba(139, 92, 246, 0.07);
}

.kpi-card--sky {
    border-color: rgba(14, 165, 233, 0.35);
    background: rgba(14, 165, 233, 0.07);
}

.kpi-card--slate {
    border-color: rgba(100, 116, 139, 0.35);
    background: rgba(100, 116, 139, 0.07);
}

.kpi-card--cyan {
    border-color: rgba(6, 182, 212, 0.35);
    background: rgba(6, 182, 212, 0.07);
}

.kpi-card--lime {
    border-color: rgba(34, 197, 94, 0.35);
    background: rgba(34, 197, 94, 0.07);
}

/* KPI grids */
.kpi-grid {
    display: grid;
    gap: 6px;
}

.kpi-grid--2 {
    grid-template-columns: 1fr 1fr;
}

.kpi-grid--3 {
    grid-template-columns: 1fr 1fr 1fr;
}

/* Sub-stat inside KPI (ex: lits hôtels, camping, etc.) */
.kpi-sub-item {
    background: rgba(255, 255, 255, 0.04);
    padding: 6px 8px;
    border-radius: var(--radius-sm);
}

.kpi-sub-item__label {
    font-size: 0.68rem;
    color: var(--color-text-muted);
    margin-bottom: 1px;
}

.kpi-sub-item__value {
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
}

/* Star rating badges */
.kpi-stars {
    display: grid;
    gap: 6px;
    margin-top: 6px;
    width: 100%;
}

.kpi-stars__title {
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.kpi-star-badge {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.16), rgba(251, 191, 36, 0.05));
    border: 1px solid rgba(251, 191, 36, 0.18);
}

.kpi-star-badge__tier {
    min-width: 40px;
    color: #fcd34d;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.kpi-star-badge__label {
    font-size: 0.68rem;
    color: var(--color-text-muted);
}

.kpi-star-badge__count {
    justify-self: end;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
}

.kpi-star-badge--clickable {
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.kpi-star-badge--clickable:hover {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.22), rgba(251, 191, 36, 0.08));
    border-color: rgba(251, 191, 36, 0.3);
}

.kpi-star-badge--active {
    background: rgba(251, 191, 36, 0.25);
    border-color: var(--color-primary);
    box-shadow: 0 0 12px rgba(251, 191, 36, 0.2);
}

/* Accommodation detail grid */
.accom-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px 8px;
    margin: 8px 0 4px;
}

.accom-detail-item {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 6px;
    padding: 3px 6px;
}

.accom-detail-item--clickable {
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s, border-color 0.2s;
    border: 1px solid transparent;
}

.accom-detail-item--clickable:hover {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 6px rgba(167, 139, 250, 0.2);
}

.accom-detail-item--active {
    background: rgba(167, 139, 250, 0.15);
    border-color: rgba(167, 139, 250, 0.5);
    box-shadow: 0 0 10px rgba(167, 139, 250, 0.2);
}

.accom-detail-icon {
    font-size: 0.85rem;
    flex-shrink: 0;
}

.accom-detail-item:nth-child(5) {
    grid-column: span 2;
}

.accom-detail-label {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.6);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.accom-detail-val {
    font-size: 0.78rem;
    font-weight: 700;
    color: #c4b5fd;
    flex-shrink: 0;
}

/* Localisation breadcrumb (hierarchy block) */
.loc-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
    margin-top: 5px;
}

.loc-item {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.75);
    font-weight: 500;
}

.loc-item--city {
    font-weight: 700;
    color: var(--color-primary, #4ade80);
}

.loc-sep {
    font-size: 0.72rem;
    color: var(--color-primary, #4ade80);
    opacity: 0.6;
    margin: 0 2px;
}

/* Density bars */
.density-panel {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    margin-bottom: 8px;
}

.density-panel__title {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.density-bar {
    margin-bottom: 8px;
}

.density-bar--clickable {
    cursor: pointer;
    border-radius: 6px;
    padding: 2px 4px;
    margin-left: -4px;
    margin-right: -4px;
    transition: background 0.2s;
}

.density-bar--clickable:hover {
    background: rgba(255, 255, 255, 0.05);
}

.density-bar__header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 2px;
}

.density-bar__label {
    font-size: 0.72rem;
    color: #fff;
}

.density-bar__value {
    font-size: 0.76rem;
    font-weight: 600;
}

.density-bar__unit {
    font-size: 0.65rem;
    font-weight: 400;
    color: var(--color-text-muted);
}

.density-bar__metrics {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.density-bar__rating {
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--color-text-muted);
    opacity: 0.8;
}

.density-bar__track {
    background: rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-sm);
    height: 5px;
    overflow: hidden;
}

.density-bar__fill {
    height: 100%;
    border-radius: var(--radius-sm);
    transition: width 0.5s ease;
}

/* Heatmap toggles */
.heatmap-toggles {
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.heatmap-toggles__title {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 5px;
}

.heatmap-toggles__row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.heatmap-toggle-label {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    font-size: 0.72rem;
    color: #fff;
}

.heatmap-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

/* Transport density grid */
.transport-density {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    margin-bottom: 6px;
}

.transport-density__title {
    font-size: 0.72rem;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}

.transport-density__grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
    text-align: center;
}

.transport-density__label {
    font-size: 0.65rem;
    color: var(--color-text-muted);
}

.transport-density__value {
    font-size: 0.88rem;
    font-weight: 700;
}

/* Demo KPI card */
.demo-kpi {
    border: 1px solid rgba(16, 185, 129, 0.25);
    background: rgba(16, 185, 129, 0.06);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

.demo-kpi__main {
    flex-shrink: 0;
}

.demo-kpi__label {
    font-size: 0.72rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 2px;
}

.demo-kpi__value {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    line-height: 1;
}

.demo-kpi__zone {
    font-size: 0.72rem;
    color: var(--color-primary);
    margin-top: 2px;
}

.demo-kpi__variation {
    text-align: right;
    margin-left: auto;
}

.demo-kpi__pct {
    font-size: 0.95rem;
    font-weight: bold;
}

.demo-kpi__since {
    font-size: 0.68rem;
    color: var(--color-text-muted);
}

/* Mini treemap sections */
.mini-treemap-section {
    position: relative;
    margin-top: 10px;
    padding: 10px 11px 11px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015)),
        radial-gradient(circle at top left, rgba(16, 185, 129, 0.12), transparent 42%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.07),
        0 10px 24px rgba(0, 0, 0, 0.18);
    overflow: hidden;
}

.mini-treemap-section::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0));
}

.mini-treemap-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.mini-treemap-title-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.mini-treemap-title {
    font-size: 0.74rem;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.mini-treemap-meta {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--color-text-muted);
    font-size: 0.64rem;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.mini-chart-canvas {
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015)),
        linear-gradient(135deg, rgba(15, 23, 42, 0.72), rgba(2, 8, 23, 0.48));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    overflow: hidden;
}

.mini-chart-canvas--lg {
    min-height: 300px;
}

.mini-chart-canvas .js-plotly-plot,
.mini-chart-canvas .plot-container,
.mini-chart-canvas .svg-container {
    border-radius: inherit;
}

.mini-chart-caption {
    margin-top: 7px;
    font-size: 0.69rem;
    line-height: 1.35;
    color: var(--color-text-muted);
}

/* ============================================
   INDICATOR COMPONENTS (ind-*)
   ============================================ */

/* --- ind-row : horizontal bar with label + value --- */
.ind-row {
    margin-bottom: 5px;
}

.ind-row__head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 2px;
}

.ind-row__label {
    font-size: 0.72rem;
    color: var(--color-text-muted);
}

.ind-row__val {
    font-size: 0.74rem;
    font-weight: 600;
}

.ind-row__track {
    height: 5px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    overflow: hidden;
}

.ind-row__fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.4s ease;
}

/* --- ind-inline : compact stat line (icon + label + value) --- */
.ind-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 0;
}

.ind-inline__icon {
    font-size: 0.85rem;
    flex-shrink: 0;
}

.ind-inline__label {
    font-size: 0.72rem;
    color: var(--color-text-muted);
    flex: 1;
}

.ind-inline__val {
    font-size: 0.78rem;
    font-weight: 600;
}

/* --- ind-block : card container with header + content --- */
.ind-block {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
}

.ind-block--purple {
    border-color: rgba(167, 139, 250, 0.3);
    background: rgba(167, 139, 250, 0.05);
}

.ind-block--green {
    border-color: rgba(52, 211, 153, 0.3);
    background: rgba(52, 211, 153, 0.05);
}

.ind-block__header {
    margin-bottom: 6px;
}

.ind-block__title {
    display: block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
    margin-bottom: 2px;
}

.ind-block__big {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-text);
}

.ind-block__unit {
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--color-text-muted);
}

.ind-block__footer {
    margin-top: 6px;
    padding-top: 5px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
}

.ind-block__total {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--color-text-muted);
}

/* --- ind-stacked : stacked horizontal bar + legend --- */
.ind-stacked {
    margin-top: 4px;
}

.ind-stacked__bar {
    display: flex;
    height: 8px;
    border-radius: 3px;
    overflow: hidden;
    gap: 1px;
}

.ind-stacked__seg {
    height: 100%;
    transition: width 0.4s ease;
}

.ind-stacked__legend {
    display: flex;
    gap: 10px;
    margin-top: 4px;
    font-size: 0.7rem;
    color: var(--color-text-muted);
}

.ind-stacked__legend span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ============================================
   FLOATING FILTERS BOX
   ============================================ */

#filters-floating-box {
    z-index: var(--z-overlay);
    /* Pas de fond : chaque filter-card a le sien */
}

#filters-floating-box .filter-card {
    min-width: 175px;
}

.filters-row {
    display: flex;
    gap: 6px;
    align-items: flex-start;
}

/* ============================================
   FILTER SYSTEM
   ============================================ */

.filter-card {
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius);
    overflow: hidden;
    background: rgba(0, 0, 0, 0.58);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    transition: border-color 0.25s ease;
}

.filter-card+.filter-card {
    margin-top: 6px;
}

.filters-row .filter-card+.filter-card {
    margin-top: 0;
}

.filter-card:has(.state--all) {
    border-color: rgba(16, 185, 129, 0.4);
}

.filter-card:has(.state--partial) {
    border-color: rgba(251, 191, 36, 0.4);
}

.filter-toggle-btn {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    border-bottom: 1px solid transparent;
    color: var(--color-text);
    padding: 7px 10px;
    border-radius: 0;
    font-family: "Google Sans", sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
    text-align: left;
}

.filter-toggle-btn:hover {
    background: rgba(16, 185, 129, 0.1);
}

.filter-toggle-btn.is-open {
    border-bottom-color: rgba(255, 255, 255, 0.08);
    background: rgba(16, 185, 129, 0.07);
}

.filter-toggle-btn .btn-label {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.filter-toggle-btn .btn-chevron {
    font-size: 0.6rem;
    opacity: 0.4;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.filter-toggle-btn.is-open .btn-chevron {
    transform: rotate(180deg);
    opacity: 0.8;
}

.filter-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    padding: 1px 5px;
    border-radius: var(--radius-sm);
    font-size: 0.67rem;
    font-weight: 700;
    flex-shrink: 0;
    transition: background 0.2s ease, color 0.2s ease;
}

.filter-badge.badge--all {
    background: rgba(16, 185, 129, 0.22);
    color: var(--color-primary);
}

.filter-badge.badge--partial {
    background: rgba(251, 191, 36, 0.22);
    color: var(--color-accent);
}

.filter-badge.badge--none {
    background: rgba(255, 255, 255, 0.08);
    color: var(--color-text-muted);
}

.filter-card-body {
    padding: 8px 10px 10px;
    background: rgba(0, 0, 0, 0.2);
}

.filter-action-btn {
    width: 100%;
    margin-bottom: 8px;
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-text-muted);
    font-family: "Google Sans", sans-serif;
    font-size: 0.74rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
}

.filter-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-text);
    border-color: rgba(255, 255, 255, 0.25);
}

/* ============================================
   SETTINGS BUTTON & PANEL
   ============================================ */

#settings-toggle-btn {
    position: absolute;
    top: 270px;
    left: 10px;
    z-index: 1001;
    width: 30px;
    height: 30px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    padding: 0;
    transition: background 0.15s ease;
    background: #fff;
    border: 2px solid rgba(0, 0, 0, 0.2);
    box-shadow: none;
    cursor: pointer;
    color: #333;
    line-height: 30px;
}

#settings-toggle-btn:hover {
    background: #f4f4f4;
}

#appearance-settings-panel {
    position: absolute;
    top: 270px;
    left: 50px;
    width: 260px;
    padding: 16px;
    z-index: 1001;
    transition: all 0.2s ease;
}

.settings-title {
    font-size: 0.8rem;
    margin-bottom: 10px;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#close-settings {
    cursor: pointer;
    opacity: 0.5;
    font-size: 1rem;
    transition: opacity 0.2s;
}

#close-settings:hover {
    opacity: 1;
}

.filter-section {
    margin-top: 12px;
}

.filter-section__label {
    color: var(--color-text);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 5px;
}

.filter-section__value {
    color: var(--color-primary);
    font-weight: bold;
}

.filter-section__range {
    width: 100%;
    margin-top: 6px;
    cursor: pointer;
    accent-color: var(--color-primary);
}

.filter-section--row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.filter-section--row .filter-section__label {
    margin-bottom: 0;
}

.color-picker {
    cursor: pointer;
    border: none;
    width: 36px;
    height: 22px;
    padding: 0;
    background: none;
    border-radius: var(--radius-sm);
}

.settings-select {
    width: 100%;
    padding: 5px 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.3);
    color: white;
    cursor: pointer;
    font-family: "Google Sans", sans-serif;
    font-size: 0.8rem;
    margin-top: 5px;
}

.settings-select:focus {
    outline: none;
    border-color: var(--color-primary);
}

.settings-btn {
    width: 100%;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    font-family: "Google Sans", sans-serif;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.settings-btn--info {
    border: 1px solid rgba(59, 130, 246, 0.4);
    background: rgba(59, 130, 246, 0.1);
    color: #93c5fd;
}

.settings-btn--info:hover {
    background: rgba(59, 130, 246, 0.2);
}

.settings-btn--danger {
    margin-top: 6px;
    padding: 5px 8px;
    font-size: 0.75rem;
    border: 1px solid rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.07);
    color: #fca5a5;
}

.settings-btn--danger:hover {
    background: rgba(239, 68, 68, 0.15);
}

.settings-btn__hint {
    display: block;
    font-size: 0.68rem;
    color: var(--color-text-muted);
    margin-top: 3px;
}

/* ============================================
   LOAD NEIGHBORS BUTTON
   ============================================ */

#load-neighbors-btn {
    position: absolute;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    padding: 8px 18px;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    background: var(--color-primary);
    color: white;
    border: none;
    box-shadow: var(--glass-shadow);
    transition: all 0.2s ease;
    font-family: "Google Sans", sans-serif;
    font-size: 0.88rem;
}

#load-neighbors-btn:hover {
    background: var(--color-primary-dark);
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.35);
}

/* ============================================
   MICRO SIDEBAR
   ============================================ */

#micro-sidebar {
    position: absolute;
    top: 20px;
    right: 20px;
    bottom: 20px;
    width: 380px;
    max-width: 90vw;
    z-index: var(--z-overlay);
    display: flex;
    flex-direction: column;
    transform: translateX(120%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

#micro-sidebar.visible {
    transform: translateX(0);
}

#micro-sidebar.minimized {
    bottom: auto;
}

#micro-sidebar.minimized .filters-container,
#micro-sidebar.minimized .poi-list {
    display: none;
}

.sidebar-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h2 {
    font-size: 1.05rem;
    font-weight: 600;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 3px;
    transition: color 0.2s;
}

.icon-btn:hover {
    color: var(--color-text);
}

.filters-container {
    padding: 10px 14px;
    border-bottom: 1px solid var(--glass-border);
}

.search-input {
    width: 100%;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.3);
    color: var(--color-text);
    font-family: "Google Sans", sans-serif;
    font-size: 0.85rem;
}

.search-input:focus {
    outline: none;
    border-color: var(--color-primary);
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.15);
}

#sub-category-filter-container {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    max-height: 120px;
    overflow-y: auto;
}

#category-filter {
    width: 100%;
    padding: 8px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    font-family: "Google Sans", sans-serif;
    cursor: pointer;
}

/* POI List */
.poi-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px 14px;
}

.empty-state {
    text-align: center;
    color: var(--color-text-muted);
    margin-top: 36px;
    font-size: 0.88rem;
}

.poi-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin-bottom: 8px;
    transition: all 0.15s ease;
    cursor: pointer;
}

.poi-card:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: var(--color-primary);
    transform: translateY(-1px);
}

.poi-category-tag {
    display: inline-block;
    font-size: 0.67rem;
    padding: 1px 6px;
    border-radius: var(--radius-sm);
    background: rgba(16, 185, 129, 0.18);
    color: var(--color-primary);
    margin-bottom: 6px;
    text-transform: uppercase;
    font-weight: 600;
}

.poi-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 3px;
}

.poi-desc {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    line-height: 1.4;
}

/* ---- Sort bar ---- */
.poi-sort-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.poi-sort-bar__label {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.poi-sort-select {
    flex: 1;
    padding: 5px 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.3);
    color: var(--color-text);
    font-family: "Google Sans", sans-serif;
    font-size: 0.8rem;
    cursor: pointer;
    transition: border-color 0.15s;
}

.poi-sort-select:focus {
    outline: none;
    border-color: var(--color-primary);
}

/* ---- Group toggle checkbox ---- */
.poi-group-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.poi-group-toggle input[type="checkbox"] {
    accent-color: var(--color-primary);
    width: 14px;
    height: 14px;
    cursor: pointer;
    margin: 0;
}

.poi-group-toggle__label {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    transition: color 0.15s;
}

.poi-group-toggle:hover .poi-group-toggle__label {
    color: var(--color-text);
}

/* ---- Category group header ---- */
.poi-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0 4px;
    margin-bottom: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
    position: sticky;
    top: 0;
    background: rgba(10, 18, 34, 0.92);
    backdrop-filter: blur(6px);
    z-index: 1;
}

.poi-group-header__dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.poi-group-header__count {
    margin-left: auto;
    font-size: 0.68rem;
    opacity: 0.6;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
}

.poi-group-header--spotlight {
    color: var(--color-primary);
    border-bottom-color: rgba(16, 185, 129, 0.35);
    background: rgba(16, 185, 129, 0.06);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    padding-left: 4px;
}

/* ---- Completeness badge ---- */
.poi-completeness {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
}

.poi-completeness__bar-track {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 99px;
    overflow: hidden;
}

.poi-completeness__bar-fill {
    height: 100%;
    border-radius: 99px;
    transition: width 0.3s ease;
}

.poi-completeness__label {
    font-size: 0.68rem;
    font-weight: 600;
    white-space: nowrap;
    min-width: 30px;
    text-align: right;
}

/* ---- Scores widget (fiche détail) ---- */
.poi-scores-widget {
    margin: 14px 0;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
}

.poi-scores-widget__title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 10px;
}

.poi-scores-widget__global {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: none;
}

.poi-score-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 7px;
}

.poi-score-row:last-child {
    margin-bottom: 0;
}

.poi-score-row__label {
    font-size: 0.72rem;
    color: var(--color-text-muted);
    width: 120px;
    flex-shrink: 0;
}

.poi-score-row__track {
    flex: 1;
    height: 5px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 99px;
    overflow: hidden;
}

.poi-score-row__fill {
    height: 100%;
    border-radius: 99px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.poi-score-row__pct {
    font-size: 0.72rem;
    font-weight: 700;
    min-width: 34px;
    text-align: right;
    flex-shrink: 0;
}

/* ============================================
   PRESETS PANEL (Tabbed, bas gauche)
   ============================================ */

#presets-panel {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: var(--z-overlay);
    width: 660px;
    max-width: 95vw;
    max-height: 46vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
    transition: all 0.25s ease;
}

#presets-panel.minimized {
    height: 40px;
    overflow: hidden !important;
}

#presets-panel.minimized .tab-content {
    display: none !important;
}

.presets-tabs {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.25);
    padding-right: 8px;
}

.presets-tabs__list {
    display: flex;
    flex: 1;
    overflow-x: auto;
}

.presets-tabs__list::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    flex: 1 0 auto;
    white-space: nowrap;
    background: none;
    border: none;
    color: var(--color-text-muted);
    padding: 9px 12px;
    cursor: pointer;
    font-family: "Google Sans", sans-serif;
    font-weight: 600;
    font-size: 0.8rem;
    transition: all 0.15s;
    border-bottom: 2px solid transparent;
}

.tab-btn:hover {
    color: var(--color-text);
    background: rgba(255, 255, 255, 0.04);
}

.tab-btn.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
    background: rgba(16, 185, 129, 0.08);
}

.tab-btn:disabled,
.tab-btn.is-disabled {
    color: rgba(255, 255, 255, 0.3);
    cursor: not-allowed;
    opacity: 0.6;
}

.tab-btn:disabled:hover,
.tab-btn.is-disabled:hover {
    background: transparent;
}

.tab-content {
    display: none;
    overflow-y: auto;
    max-height: calc(46vh - 48px);
    padding: 12px;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.2s ease-out;
}

#admin-tabs-contents>.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tab-content::-webkit-scrollbar {
    width: 6px;
}

#admin-tabs-contents>.tab-content.active {
    display: block;
}

.tab-search {
    padding: 8px 0;
}

.preset-search-input {
    width: 100%;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.25);
    color: var(--color-text);
    font-family: "Google Sans", sans-serif;
    font-size: 0.85rem;
    transition: border-color 0.15s, background 0.15s;
}

.preset-search-input:focus {
    outline: none;
    border-color: var(--color-primary);
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.12);
}

.preset-search-input:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.presets-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.preset-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--glass-border);
    color: var(--color-text);
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.15s;
}

.preset-btn:hover {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.preset-btn.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.35);
}

/* Countries */
#countries-results {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.country-option-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius);
    text-align: left;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: all 0.15s ease;
    color: var(--color-text);
    font-family: "Google Sans", sans-serif;
}

.country-option-btn:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(16, 185, 129, 0.3);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.country-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 28px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    flex: 0 0 auto;
    overflow: hidden;
}

.country-flag-image,
.country-active-flag-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.country-flag-fallback {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.country-option-copy {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.country-option-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--color-text);
}

.country-option-meta {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.country-active-card {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius);
    border: 1px solid rgba(16, 185, 129, 0.24);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(15, 23, 42, 0.3));
}

.country-active-card.hidden {
    display: none;
}

.country-active-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.country-active-label {
    font-size: 0.68rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.country-active-name {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--color-text);
}

.country-active-meta {
    font-size: 0.75rem;
    color: var(--color-primary);
}

.country-active-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 32px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    flex: 0 0 auto;
}

.country-active-flag .country-flag-fallback {
    font-size: 0.74rem;
}

/* ============================================
   LEAFLET OVERRIDES
   ============================================ */

.leaflet-container {
    font-family: "Google Sans", sans-serif;
}

.leaflet-bar {
    border: none;
    box-shadow: var(--glass-shadow);
}

.leaflet-bar a {
    background-color: var(--glass-bg);
    color: var(--color-text);
    border-bottom: 1px solid var(--glass-border);
    backdrop-filter: blur(8px);
}

.leaflet-bar a:hover {
    background-color: var(--color-primary);
    color: white;
}

.leaflet-draw-toolbar a {
    background-image: none !important;
    background-color: var(--glass-bg) !important;
    color: var(--color-text) !important;
    border-color: var(--glass-border) !important;
    display: flex !important;
    justify-content: center;
    align-items: center;
    text-decoration: none !important;
    transition: all 0.15s;
}

.leaflet-draw-toolbar a:hover {
    background-color: var(--color-primary) !important;
    color: white !important;
}

.leaflet-draw-draw-polygon::after {
    content: '⬠';
    font-size: 18px;
}

.leaflet-draw-draw-rectangle::after {
    content: '▭';
    font-size: 20px;
    font-weight: bold;
}

.leaflet-draw-edit-edit::after {
    content: '✎';
    font-size: 17px;
}

.leaflet-draw-edit-remove::after {
    content: '';
    font-size: 16px;
}

/* ============================================
   DETAIL VIEW
   ============================================ */

.detail-view {
    padding: 14px 16px;
    animation: slideIn 0.25s ease-out;
    overflow-y: auto;
    max-height: 100%;
}

.detail-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.back-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--glass-border);
    color: var(--color-text);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: "Google Sans", sans-serif;
    font-size: 0.82rem;
    transition: background 0.15s;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.16);
}

.detail-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 6px;
}

.detail-type {
    display: inline-block;
    font-size: 0.74rem;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    background: rgba(16, 185, 129, 0.18);
    color: var(--color-primary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.detail-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.info-row {
    display: flex;
    flex-direction: column;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.info-label {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    margin-bottom: 3px;
}

.info-value a {
    color: var(--color-accent);
    text-decoration: none;
}

.osm-meta-row {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--color-text-muted);
    font-size: 0.75rem;
    opacity: 0.8;
}

.osm-meta-icon {
    font-size: 0.9rem;
    opacity: 0.7;
}

.osm-meta-value {
    font-weight: 500;
}

/* ============================================
   FULLSCREEN CHART
   ============================================ */

#fullscreen-chart-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

#fullscreen-chart-overlay.visible {
    display: flex;
    animation: fadeIn 0.25s ease-out;
}

#fullscreen-chart-overlay .chart-container {
    width: 95%;
    height: 90%;
    flex: 1;
    min-height: 0;
}

#fullscreen-chart-overlay .header {
    width: 95%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

#fullscreen-chart-overlay .title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-primary);
}

#fullscreen-chart-button-close {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.15s;
}

#fullscreen-chart-button-close:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
}

.maximize-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: var(--color-text);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: auto;
    transition: all 0.15s;
}

.maximize-btn:hover {
    background: rgba(16, 185, 129, 0.14);
    border-color: rgba(16, 185, 129, 0.32);
    color: #d1fae5;
}

/* ============================================
   LOADING & ERROR STATES
   ============================================ */

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-bottom-color: var(--color-primary);
    border-radius: 50%;
    display: inline-block;
    animation: rotation 1s linear infinite;
    vertical-align: middle;
}

.loading-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

.load-error-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 16px;
    text-align: center;
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius);
    background: rgba(239, 68, 68, 0.06);
    animation: fadeIn 0.25s ease-out;
}

.load-error-block--small {
    padding: 12px 10px;
    gap: 5px;
}

.load-error-block__icon {
    font-size: 1.6rem;
    line-height: 1;
}

.load-error-block--small .load-error-block__icon {
    font-size: 1.1rem;
}

.load-error-block__msg {
    font-size: 0.85rem;
    color: #fca5a5;
    line-height: 1.4;
    margin: 0;
}

.load-error-block--small .load-error-block__msg {
    font-size: 0.77rem;
}

.load-error-block__retry-btn {
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(251, 191, 36, 0.5);
    background: rgba(251, 191, 36, 0.1);
    color: var(--color-accent);
    font-family: "Google Sans", sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
}

.load-error-block__retry-btn:hover {
    background: rgba(251, 191, 36, 0.22);
}

.load-error-block__retry-btn:active {
    transform: scale(0.96);
}

.load-error-block--small .load-error-block__retry-btn {
    padding: 4px 10px;
    font-size: 0.74rem;
}

/* ============================================
   POI SELECTION PIN
   ============================================ */

.poi-selection-pin {
    position: relative;
    width: 28px;
    height: 42px;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.5));
    animation: pin-drop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.poi-selection-pin__head {
    position: absolute;
    top: 0;
    left: 0;
    width: 28px;
    height: 28px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    border: 2px solid #fff;
}

.poi-selection-pin__tail {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 14px solid #ef4444;
}

.poi-selection-pin__pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin-top: -20px;
    margin-left: -20px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.22);
    animation: pin-pulse 1.8s ease-out infinite;
}

.poi-selection-tooltip {
    background: rgba(0, 0, 0, 0.8) !important;
    border: 1px solid rgba(239, 68, 68, 0.5) !important;
    color: #f8fafc !important;
    font-family: "Google Sans", sans-serif !important;
    font-size: 0.82rem !important;
    border-radius: var(--radius-sm) !important;
    padding: 4px 8px !important;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4) !important;
}

/* ============================================
   ENRICHED POI DETAIL VIEW
   ============================================ */

.poi-section {
    margin-top: 12px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.02);
}

.poi-section__title {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--color-text-muted);
}

.poi-section__title--toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
    transition: background 0.15s;
}

.poi-section__title--toggle:hover {
    background: rgba(255, 255, 255, 0.08);
}

.poi-section__chevron {
    font-size: 0.8rem;
    transition: transform 0.2s ease;
    color: var(--color-text-muted);
}

.poi-section__subtitle {
    padding: 6px 12px;
    margin-top: 8px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.poi-section .detail-info {
    padding: 4px 0;
}

/* ── Transport filter toggles ────────────── */
.poi-transport-filter {
    padding: 10px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.02);
}

.poi-transport-filter__title {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
}

.poi-transport-filter__toggles {
    display: flex;
    gap: 6px;
}

.poi-transport-filter__toggles--wrap {
    flex-wrap: wrap;
}

.poi-transport-toggle {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 0.75rem;
}

.poi-transport-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.poi-transport-toggle:has(input:checked) {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.3);
}

.poi-transport-toggle--disabled {
    opacity: 0.35;
    pointer-events: none;
}

.poi-transport-toggle input[type="checkbox"] {
    display: none;
}

.poi-transport-toggle__icon {
    font-size: 1rem;
    line-height: 1;
}

.poi-transport-toggle__label {
    font-weight: 600;
    color: var(--color-text);
    font-size: 0.72rem;
}

/* ── Transit stop markers on map ────────── */
.transit-stop-marker {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid var(--stop-color, #3b82f6);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 8px var(--stop-color, #3b82f6);
    animation: transit-marker-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.transit-stop-marker__icon {
    font-size: 14px;
    line-height: 1;
}

.transit-stop-tooltip {
    background: rgba(10, 15, 30, 0.92) !important;
    border: 1px solid rgba(59, 130, 246, 0.4) !important;
    color: #f8fafc !important;
    font-family: "Outfit", sans-serif !important;
    font-size: 0.8rem !important;
    border-radius: 6px !important;
    padding: 4px 8px !important;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4) !important;
}

@keyframes transit-marker-pop {
    from {
        transform: scale(0);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.info-row--highlight {
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.02);
}

/* --- SURBRILLANCE MARKETING DIGITAL --- */

/* Ligne entière cliquable pour le site web */
.info-row.info-row--digital-link {
    flex-direction: row;
    /* Force l'affichage horizontal au lieu de vertical */
    justify-content: space-between;
    padding: 8px 10px;
    margin: 2px -10px;
    border-radius: 6px;
    border-bottom: none;
    /* Enlève la barre grise en bas */
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.info-row.info-row--digital-link:hover {
    background-color: rgba(255, 255, 255, 0.15);
    /* Plus visible */
    transform: translateX(4px);
    cursor: pointer;
}

/* Boutons individuels pour les réseaux sociaux */
.digital-social-btn {
    display: inline-block;
    /* Obligatoire pour que l'animation "levée" fonctionne */
    padding: 4px 10px;
    border: 1px solid;
    border-radius: 12px;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.05);
}

.digital-social-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    /* L'effet de soulèvement marchera maintenant ! */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Lien site web dans la fiche POI */
.info-website-link {
    text-decoration: none;
    font-weight: 600;
    font-size: 0.82rem;
    transition: all 0.15s ease;
    word-break: break-all;
    text-align: right;
}

.info-website-link:hover {
    text-decoration: underline;
    filter: brightness(1.3);
}

/* Gallery */
.poi-gallery {
    margin: 12px 0 4px;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.poi-gallery--loading {
    background: rgba(255, 255, 255, 0.04);
}

.poi-gallery__skeleton {
    width: 100%;
    height: 180px;
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.03) 25%, rgba(255, 255, 255, 0.08) 50%, rgba(255, 255, 255, 0.03) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
    border-radius: var(--radius-sm);
}

.poi-gallery__main {
    width: 100%;
    max-height: 200px;
    overflow: hidden;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.poi-gallery__img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: opacity 0.3s ease;
}

.poi-gallery__thumbs {
    display: flex;
    gap: 3px;
    padding: 3px;
    overflow-x: auto;
    background: rgba(0, 0, 0, 0.3);
}

.poi-gallery__thumb {
    width: 56px;
    height: 42px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    cursor: pointer;
    opacity: 0.5;
    border: 2px solid transparent;
    transition: opacity 0.15s, border-color 0.15s;
}

.poi-gallery__thumb:hover,
.poi-gallery__thumb.active {
    opacity: 1;
    border-color: var(--color-primary);
}

/* Opening Hours */
.oh-badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.76rem;
    font-weight: 700;
}

.oh-badge--open {
    background: rgba(16, 185, 129, 0.18);
    color: var(--color-primary);
}

.oh-value {
    font-size: 0.8rem;
    font-family: monospace;
    color: var(--color-text);
    line-height: 1.5;
    word-break: break-word;
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(16px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes rotation {
    to {
        transform: rotate(360deg);
    }
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

@keyframes pin-drop {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes pin-pulse {
    0% {
        transform: scale(0.5);
        opacity: 0.8;
    }

    100% {
        transform: scale(2.2);
        opacity: 0;
    }
}

/* ============================================
   POI CATEGORY HIGHLIGHT
   ============================================ */
.poi-category-highlight {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.9);
    animation: pulse-category 2s infinite;
}

@keyframes pulse-category {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 var(--pulse-color);
    }

    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(255, 255, 255, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    }
}

/* ============================================
   DIGITAL FILTER CLICKABLE BARS
   ============================================ */
.ind-row--clickable {
    cursor: pointer;
    border-radius: 6px;
    padding: 4px 6px;
    margin: 2px -6px;
    transition: background 0.2s, box-shadow 0.2s, border-left 0.2s;
    border-left: 3px solid transparent;
}

.ind-row--clickable:hover {
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.05);
}

.ind-row--active {
    background: rgba(255, 255, 255, 0.08);
    border-left: 3px solid var(--color-primary);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.12);
}

/* Clickable section headers (Transports, Services, Présence numérique) */
.ind-block__header--clickable {
    cursor: pointer;
    border-radius: 6px;
    padding: 8px 10px;
    transition: background 0.2s, box-shadow 0.2s;
    border-left: 3px solid transparent;
}

.ind-block__header--clickable:hover {
    background: rgba(255, 255, 255, 0.06);
}

.ind-block__header--active {
    background: rgba(16, 185, 129, 0.1);
    border-left: 3px solid var(--color-primary);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.15);
}

/* ============================================
   POI DIGITAL HIGHLIGHT (map markers)
   ============================================ */
.poi-digital-highlight {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid var(--glow-color, #34d399);
    box-shadow: 0 0 8px var(--glow-color, #34d399), 0 0 16px var(--glow-color, #34d399);
    animation: digital-pulse 1.6s ease-in-out infinite;
}

@keyframes digital-pulse {

    0%,
    100% {
        box-shadow: 0 0 6px var(--glow-color), 0 0 12px var(--glow-color);
        transform: scale(1);
    }

    50% {
        box-shadow: 0 0 12px var(--glow-color), 0 0 24px var(--glow-color);
        transform: scale(1.1);
    }
}

/* ============================================
   OVERTOURISM HEATMAP GRADIENT EFFECT
   ============================================ */
.overtourism-gradient-polygon {
    filter: blur(14px);
    transition: filter 0.3s ease;
}

/* ============================================
   OVERTOURISM POI PIN MARKERS
   ============================================ */
.overtourism-poi-pin {
    position: relative;
    width: var(--pin-size, 26px);
    height: calc(var(--pin-size, 26px) + var(--pin-tip, 10px));
    animation: ot-pin-drop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    cursor: pointer;
    transition: transform 0.15s ease;
}

.overtourism-poi-pin:hover {
    transform: scale(1.18);
}

.overtourism-poi-pin__head {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: var(--pin-size, 26px);
    height: var(--pin-size, 26px);
    border-radius: 50%;
    background: var(--pin-color, #ef4444);
    border: 2.5px solid rgba(255, 255, 255, 0.85);
}

.overtourism-poi-pin__tip {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: var(--pin-tip, 10px) solid var(--pin-color, #ef4444);
}

/* Tooltip for overtourism POI pins */
.overtourism-poi-tooltip {
    background: rgba(10, 15, 30, 0.92) !important;
    border: 1px solid rgba(251, 191, 36, 0.4) !important;
    color: #f8fafc !important;
    font-family: "Outfit", sans-serif !important;
    font-size: 0.82rem !important;
    border-radius: 8px !important;
    padding: 5px 10px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45) !important;
    backdrop-filter: blur(6px) !important;
}

.overtourism-poi-tooltip::before {
    border-top-color: rgba(10, 15, 30, 0.92) !important;
}

@keyframes ot-pin-drop {
    from {
        transform: translateY(-14px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ============================================
   EXPORT BUTTON (icon, left sidebar)
   ============================================ */

#export-zone-btn {
    position: absolute;
    top: 310px;
    left: 10px;
    z-index: 1001;
    width: 30px;
    height: 30px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: #fff;
    border: 2px solid rgba(0, 0, 0, 0.2);
    box-shadow: none;
    cursor: pointer;
    color: #333;
    transition: background 0.15s ease, border-color 0.2s ease;
}

#export-zone-btn:hover {
    background: #f4f4f4;
}

#export-zone-btn.hidden {
    display: none !important;
}

/* ============================================
   TRAIL TOOLTIP (hover on paths)
   ============================================ */

.trail-tooltip {
    background: rgba(5, 10, 20, 0.92) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 8px !important;
    padding: 6px 12px !important;
    color: #f1f5f9 !important;
    font-family: "Google Sans", sans-serif !important;
    font-size: 0.78rem !important;
    line-height: 1.4 !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    white-space: nowrap !important;
}

.trail-tooltip::before {
    border-top-color: rgba(5, 10, 20, 0.92) !important;
}

/* ============================================
   UNESCO + NATURA 2000 CARDS
   ============================================ */

.env-sites-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 8px;
}

.env-card {
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: border-color 0.2s ease;
}

.env-card--unesco {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(217, 119, 6, 0.06));
}

.env-card--natura {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.12), rgba(22, 163, 74, 0.06));
}

.env-card__icon {
    font-size: 1.4rem;
    line-height: 1;
    margin-bottom: 2px;
}

.env-card__count {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.1;
}

.env-card--unesco .env-card__count {
    color: #f59e0b;
}

.env-card--natura .env-card__count {
    color: #22c55e;
}

.env-card__label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
    margin-bottom: 6px;
}

.env-sites-grid--single {
    grid-template-columns: 1fr;
}

/* Badge container */
.env-card__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
    margin-top: 4px;
}

/* Round badge (pill / capsule) */
.env-site-badge {
    display: inline-block;
    font-size: 0.62rem;
    font-weight: 500;
    line-height: 1;
    padding: 4px 9px;
    border-radius: 999px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.env-site-badge--whc {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.env-site-badge--natura {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.25);
}

.env-site-badge:hover {
    transform: scale(1.05);
}

.env-site-badge--whc:hover {
    background: rgba(245, 158, 11, 0.28);
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.25);
}

.env-site-badge--natura:hover {
    background: rgba(34, 197, 94, 0.28);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.25);
}

.env-site-badge--active {
    font-weight: 700;
}

.env-site-badge--whc.env-site-badge--active {
    background: rgba(245, 158, 11, 0.35);
    color: #f59e0b;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
    border-color: rgba(245, 158, 11, 0.5);
}

.env-site-badge--natura.env-site-badge--active {
    background: rgba(34, 197, 94, 0.35);
    color: #22c55e;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.3);
    border-color: rgba(34, 197, 94, 0.5);
}

/* Pulse animation for highlighted env markers */
@keyframes envPulse {
    0% {
        transform: scale(1);
        opacity: 0.9;
    }

    50% {
        transform: scale(1.4);
        opacity: 0.4;
    }

    100% {
        transform: scale(1);
        opacity: 0.9;
    }
}

.env-pulse-marker {
    animation: envPulse 2s ease-in-out infinite;
}

/* ============================================
   MACRO COMPLETENESS SCORE
   ============================================ */

.completeness-macro {
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.completeness-macro__header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.completeness-macro__gauge {
    position: relative;
    width: 70px;
    height: 70px;
    flex-shrink: 0;
}

.completeness-svg {
    width: 100%;
    height: 100%;
}

.completeness-ring {
    transition: stroke-dashoffset 0.8s ease;
}

.completeness-macro__score {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.completeness-macro__value {
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1;
}

.completeness-macro__unit {
    font-size: 0.55rem;
    color: var(--color-text-muted);
}

.completeness-macro__info {
    flex: 1;
}

.completeness-macro__title {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--color-text);
}

.completeness-macro__rating {
    font-size: 0.85rem;
    font-weight: 700;
}

.completeness-macro__sub {
    font-size: 0.65rem;
    color: var(--color-text-muted);
    margin-top: 1px;
}

.completeness-macro__dims {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
}

.completeness-dim {
    display: flex;
    align-items: center;
    gap: 6px;
}

.completeness-dim__label {
    font-size: 0.68rem;
    color: var(--color-text-muted);
    width: 80px;
    flex-shrink: 0;
}

.completeness-dim__track {
    flex: 1;
    height: 5px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    overflow: hidden;
}

.completeness-dim__fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s ease;
}

.completeness-dim__val {
    font-size: 0.68rem;
    font-weight: 600;
    width: 32px;
    text-align: right;
    flex-shrink: 0;
}

.completeness-macro__cats-title {
    font-size: 0.65rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.completeness-macro__cats {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.completeness-cat {
    display: flex;
    align-items: center;
    gap: 5px;
}

.completeness-cat__label {
    font-size: 0.65rem;
    color: var(--color-text);
    width: 85px;
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.completeness-cat__track {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    overflow: hidden;
}

.completeness-cat__fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.6s ease;
}

.completeness-cat__val {
    font-size: 0.63rem;
    font-weight: 600;
    width: 28px;
    text-align: right;
    flex-shrink: 0;
}

.completeness-cat__count {
    font-size: 0.58rem;
    color: var(--color-text-muted);
    width: 22px;
    text-align: right;
    opacity: 0.6;
}

/* ============================================
   MACRO COLUMN (stacks macro-overlay + dashboard)
   ============================================ */

#macro-column {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 320px;
    max-width: 480px;
    /* Dynamically adjusted via JS: shrinks when presets panel is open, grows when minimized */
    max-height: var(--macro-column-max-h, calc(100vh - 46vh - 60px));
    transition: max-height 0.3s ease;
}

/* ============================================
   DASHBOARD PANEL — 6 KPIs minimaliste
   ============================================ */

#dashboard-panel {
    padding: 14px 16px;
    z-index: var(--z-overlay);
    transition: opacity 0.35s ease, transform 0.35s ease;
    animation: dashboardSlideIn 0.4s ease both;
}

#dashboard-panel.minimized {
    overflow: hidden;
}

#dashboard-panel.minimized .dashboard-grid,
#dashboard-panel.minimized .dashboard-details-btn {
    display: none;
}

/* "Voir les détails" button */
.dashboard-details-btn {
    display: block;
    width: 100%;
    margin-top: 8px;
    padding: 7px 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.04);
    color: var(--color-text-muted);
    font-family: "Google Sans", sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.dashboard-details-btn:hover {
    background: rgba(96, 165, 250, 0.12);
    color: #fff;
    border-color: rgba(96, 165, 250, 0.35);
}

@keyframes dashboardSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.dashboard-header h2 {
    font-weight: 700;
    font-size: 0.88rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    background: linear-gradient(135deg, #60a5fa, #a78bfa);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* 6-card grid: 2 columns × 3 rows */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

/* Individual KPI card */
.dashboard-kpi {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: var(--radius-sm);
    padding: 10px 11px 9px;
    position: relative;
    overflow: hidden;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.dashboard-kpi--clickable {
    cursor: pointer;
}

.dashboard-kpi:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

/* Accent left stripe */
.dashboard-kpi::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 0;
    bottom: 6px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--kpi-accent, rgba(255, 255, 255, 0.15));
    opacity: 0.8;
    transition: opacity 0.2s;
}

.dashboard-kpi:hover::before {
    opacity: 1;
}

.dashboard-kpi--clickable:focus-visible {
    outline: 2px solid var(--kpi-accent, rgba(255, 255, 255, 0.5));
    outline-offset: 2px;
}

/* Color variants (via CSS custom property) */
.dashboard-kpi--loc      { --kpi-accent: #10b981; }
.dashboard-kpi--infra    { --kpi-accent: #fbbf24; }
.dashboard-kpi--mobility { --kpi-accent: #34d399; }
.dashboard-kpi--territory{ --kpi-accent: #60a5fa; }
.dashboard-kpi--tourism  { --kpi-accent: #a78bfa; }
.dashboard-kpi--notoriety{ --kpi-accent: #ec4899; }

.dashboard-kpi__icon {
    font-size: 0.82rem;
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.dashboard-kpi__title {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
    margin-bottom: 5px;
}

.dashboard-kpi__body {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

/* Breadcrumb for Localisation */
.dash-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1px;
}

.dash-breadcrumb__item {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.65);
    font-weight: 400;
}

.dash-breadcrumb__sep {
    font-size: 0.6rem;
    color: var(--color-primary);
    opacity: 0.5;
    margin: 0 2px;
}

.dash-breadcrumb__item--highlight {
    font-weight: 700;
    color: var(--color-primary);
}

/* Badge pair (Transports / Services) */
.dash-badge-row {
    display: flex;
    gap: 4px;
}

.dash-badge {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 5px 4px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
}

.dash-badge__val {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
    color: #fff;
}

.dash-badge__label {
    font-size: 0.55rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 2px;
    text-align: center;
}

.dash-badge--transport {
    border-color: rgba(251, 191, 36, 0.2);
    background: rgba(251, 191, 36, 0.06);
}

.dash-badge--transport .dash-badge__val {
    color: #fbbf24;
}

.dash-badge--service {
    border-color: rgba(14, 165, 233, 0.2);
    background: rgba(14, 165, 233, 0.06);
}

.dash-badge--service .dash-badge__val {
    color: #0ea5e9;
}

/* Mini horizontal bars (shared by Mobility, Territory, Tourism) */
.dash-bar-row {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 2px;
}

.dash-bar-row__label {
    font-size: 0.62rem;
    color: rgba(255, 255, 255, 0.7);
    width: 70px;
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-bar-row__track {
    flex: 1;
    height: 5px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    overflow: hidden;
    min-width: 30px;
}

.dash-bar-row__fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s ease;
}

.dash-bar-row__val {
    font-size: 0.62rem;
    font-weight: 600;
    flex-shrink: 0;
    min-width: 32px;
    text-align: right;
}

/* Tourism saturation metrics */
.dash-metric {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 2px 0;
}

.dash-metric__label {
    font-size: 0.62rem;
    color: rgba(255, 255, 255, 0.6);
}

.dash-metric__val {
    font-size: 0.72rem;
    font-weight: 700;
}

.dash-metric__rating {
    font-size: 0.55rem;
    color: var(--color-text-muted);
    margin-left: 4px;
    font-weight: 400;
}

/* Notoriety compact */
.dash-notoriety-big {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.dash-notoriety-big__val {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    line-height: 1;
}

.dash-notoriety-big__label {
    font-size: 0.6rem;
    color: var(--color-text-muted);
}

.dash-pv-mini {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-top: 2px;
}

.dash-pv-mini__val {
    font-size: 0.78rem;
    font-weight: 700;
    color: #ec4899;
}

.dash-pv-mini__label {
    font-size: 0.58rem;
    color: var(--color-text-muted);
}
