/* === Intro, sidebar, graphique SVG, grille de cartes === */
        /* --- 5. INTRO SECTION --- */
        .chart-hero-section {
            background: rgba(255, 255, 255, 0.16);
            border-radius: 1.5rem;
            border: 1px solid rgba(255, 255, 255, 0.3);
            padding: 2rem 2.25rem;
            box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.4), 0 2px 8px rgba(0, 0, 0, 0.02);
            transition: background-color 0.3s ease, border-color 0.3s ease;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
        }

        [data-theme="dark"] .chart-hero-section {
            background: rgba(0, 0, 0, 0.16);
            border-color: rgba(255, 255, 255, 0.05);
            box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.02), 0 2px 8px rgba(0, 0, 0, 0.15);
        }

        .chart-hero-header {
            text-align: center;
            margin-bottom: 1.75rem;
        }

        .chart-filter-chip {
            display: none;
            align-items: center;
            gap: 0.4rem;
            margin: 0.65rem auto 0;
            padding: 0.3rem 0.7rem 0.3rem 0.9rem;
            border-radius: 2rem;
            border: 1px solid var(--accent);
            background: var(--accent-light);
            color: var(--accent);
            font-family: inherit;
            font-size: 0.72rem;
            font-weight: 700;
            cursor: pointer;
            transition: background-color 0.15s ease, transform 0.15s ease;
        }

        .chart-filter-chip.is-visible {
            display: inline-flex;
            animation: fadeInCard 0.25s ease forwards;
        }

        .chart-filter-chip:hover,
        .chart-filter-chip:focus-visible {
            transform: translateY(-1px);
        }

        [data-theme="dark"] .chart-filter-chip:hover,
        [data-theme="dark"] .chart-filter-chip:focus-visible {
            background: rgba(251, 113, 133, 0.22);
        }

        .chart-filter-chip:focus-visible {
            outline: 2px solid var(--accent);
            outline-offset: 2px;
        }

        .chart-filter-chip .x {
            width: 12px;
            height: 12px;
            flex-shrink: 0;
        }

        .chart-hero-title {
            font-size: 1.1rem;
            font-weight: 800;
            color: var(--text-primary);
            text-align: center;
            margin-bottom: 0.25rem;
        }

        .chart-hero-subtitle {
            font-size: 0.7rem;
            font-weight: 700;
            color: var(--text-secondary);
            text-transform: uppercase;
            letter-spacing: 0.12em;
            text-align: center;
        }

        .hero-container {
            display: flex;
            flex-direction: column;
            gap: 1.75rem;
            margin-bottom: 2.5rem;
            opacity: 0;
            transform: translateY(30px);
            animation: slideUpEntrance 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.1s forwards;
        }

        .intro-section {
            padding: 2.5rem 0 3rem;
            display: flex;
            flex-direction: column;
            align-items: center;
            text-align: center;
        }

        .intro-badge {
            display: inline-block;
            background: rgba(225, 29, 72, 0.06);
            color: var(--accent);
            border: 1px solid rgba(225, 29, 72, 0.15);
            font-size: 0.65rem;
            font-weight: 800;
            text-transform: uppercase;
            padding: 0.35rem 0.85rem;
            border-radius: 2rem;
            letter-spacing: 0.12em;
            box-shadow: 0 1px 2px rgba(225, 29, 72, 0.02);
        }

        .intro-title {
            font-size: 1.75rem;
            font-weight: 900;
            color: var(--text-primary);
            margin: 0.75rem 0 1rem;
            line-height: 1.2;
        }

        .intro-desc {
            font-size: 0.95rem;
            color: var(--text-secondary);
            line-height: 1.7;
            max-width: 720px;
        }

        .intro-desc strong {
            color: var(--text-primary);
        }

        .intro-badges {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            gap: 0.75rem;
            margin-top: 1.5rem;
        }

        .info-badge {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            background: var(--bg-filter);
            border: 1px solid var(--border-color);
            padding: 0.4rem 1rem 0.4rem 0.4rem; /* moins à gauche car l'icône est déjà entourée */
            border-radius: 2rem;
            font-size: 0.72rem;
            font-weight: 700;
            color: var(--text-secondary);
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
            transition: border-color 0.2s ease, transform 0.2s ease;
        }

        .info-badge span:first-child {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 32px;
            height: 32px;
            border-radius: 50%;
            background: var(--bg-card);
            border: 1px solid var(--border-color);
            font-size: 0.95rem;
            flex-shrink: 0;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
        }

        /* --- 6. SIDEBAR --- */
        .sidebar {
            display: flex;
            flex-direction: column;
            gap: 2rem;
            order: 1;
        }

        .sidebar-section {
            background: var(--bg-sidebar);
            border-radius: 1.5rem;
            border: 1px solid var(--border-color);
            padding: 1.15rem;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05), var(--glass-highlight);
            transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
            opacity: 0;
            transform: translateY(25px);
            animation: slideUpEntrance 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.35s forwards;
        }

        [data-theme="dark"] .sidebar-section {
            box-shadow: 0 10px 45px rgba(0, 0, 0, 0.35), var(--glass-highlight);
        }

        .sidebar-title {
            font-size: 1.05rem;
            font-weight: 800;
            color: var(--text-primary);
            margin-bottom: 0.25rem;
            text-align: center;
        }

        .sidebar-subtitle {
            font-size: 0.65rem;
            color: var(--text-secondary);
            text-transform: uppercase;
            letter-spacing: 0.15em;
            margin-bottom: 1rem;
            text-align: center;
        }

        .filter-group-title {
            font-size: 0.65rem;
            font-weight: 800;
            color: var(--text-secondary);
            text-transform: uppercase;
            letter-spacing: 0.15em;
            margin-bottom: 0.5rem;
            text-align: center;
        }

        .os-filter-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 0.4rem;
            background: var(--bg-filter);
            padding: 0.3rem;
            border-radius: 1rem;
            border: 1px solid var(--border-color);
            margin-bottom: 1rem;
        }

        .os-btn {
            padding: 0.45rem 0.6rem;
            border-radius: 0.7rem;
            font-size: 0.7rem;
            font-weight: 600;
            border: 1px solid transparent;
            cursor: pointer;
            transition: all 0.15s ease;
            background: transparent;
            color: var(--text-filter);
        }

        .os-btn:hover {
            color: var(--text-primary);
            background: var(--bg-card);
            border-color: var(--border-color);
        }

        .os-btn.active {
            background: var(--accent-light);
            color: var(--accent);
            border-color: rgba(225, 29, 72, 0.25);
            font-weight: 700;
            box-shadow: 0 4px 12px rgba(225, 29, 72, 0.08);
        }

        .cat-filters {
            display: flex;
            flex-direction: column;
            gap: 0.35rem;
        }

        .cat-btn {
            text-align: left;
            padding: 0.5rem 0.8rem;
            border-radius: 0.7rem;
            font-size: 0.7rem;
            font-weight: 600;
            border: 1px solid var(--border-color);
            cursor: pointer;
            transition: all 0.15s ease;
            background: var(--bg-filter);
            color: var(--text-filter);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .cat-btn:hover {
            color: var(--text-primary);
            background: var(--bg-card);
        }

        .cat-btn.active {
            background: var(--cat-active-bg);
            color: #fff;
            border-color: var(--cat-active-bg);
            font-weight: 700;
            box-shadow: 0 4px 12px var(--cat-active-shadow);
        }

        .cat-count {
            font-size: 0.6rem;
            font-weight: 800;
            background: rgba(255, 255, 255, 0.2);
            padding: 0.15rem 0.5rem;
            border-radius: 1rem;
            min-width: 1.5rem;
            text-align: center;
        }

        .cat-btn:not(.active) .cat-count {
            background: var(--border-color);
            color: var(--text-tertiary);
        }

        .active-filter-indicator {
            margin-top: 1rem;
            padding: 0.6rem 0.8rem;
            background: var(--accent-light);
            border-radius: 0.6rem;
            font-size: 0.65rem;
            font-weight: 700;
            color: var(--accent);
            text-align: center;
            border: 1px solid rgba(225, 29, 72, 0.2);
        }

        /* --- 7. SVG CHART --- */
        .chart-container {
            width: 100%;
            max-width: 260px;
            margin: 0 auto;
            position: relative;
            flex-shrink: 0;
            opacity: 0;
            animation: fadeInCard 0.6s ease forwards;
            animation-delay: 0.1s;
        }

        .chart-container svg {
            width: 100%;
            height: auto;
            display: block;
        }

        .chart-center-text {
            font-weight: 800;
            fill: var(--text-primary);
        }

        .chart-center-label {
            font-weight: 600;
            fill: var(--text-secondary);
            font-size: 3.5px;
            text-transform: uppercase;
            letter-spacing: 0.1em;
        }

        .chart-stats-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 0.85rem;
            width: 100%;
            margin-top: 2rem;
        }

        @media (max-width: 860px) {
            .chart-stats-grid {
                grid-template-columns: repeat(3, 1fr);
            }
        }

        @media (max-width: 640px) {
            .chart-stats-grid {
                grid-template-columns: repeat(2, 1fr);
            }
        }

        @media (max-width: 380px) {
            .chart-stats-grid {
                grid-template-columns: 1fr;
            }
        }

        .stat-tile {
            display: flex;
            flex-direction: column;
            gap: 0.55rem;
            padding: 0.85rem 1rem;
            border-radius: 1rem;
            border: 1px solid var(--border-color);
            background: var(--tile-bg, var(--bg-filter));
            font-family: inherit;
            text-align: left;
            cursor: pointer;
            position: relative;
            overflow: hidden;
            opacity: 0;
            transform: translateY(12px);
            animation: statTileIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
            animation-delay: calc(var(--i, 0) * 0.045s + 0.15s);
            transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
        }

        .stat-tile:hover,
        .stat-tile:focus-visible {
            transform: translateY(-3px);
            border-color: var(--tile-accent, var(--accent));
            box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
        }

        [data-theme="dark"] .stat-tile:hover,
        [data-theme="dark"] .stat-tile:focus-visible {
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
        }

        .stat-tile:focus-visible {
            outline: 2px solid var(--accent);
            outline-offset: 2px;
        }

        .stat-tile.is-active {
            border-color: var(--tile-accent, var(--accent));
            background: var(--tile-bg-active, var(--bg-filter));
        }

        .stat-tile-top {
            display: flex;
            align-items: center;
            gap: 0.45rem;
            font-size: 0.7rem;
            font-weight: 700;
            color: var(--text-secondary);
        }

        .stat-tile-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            flex-shrink: 0;
        }

        .stat-tile-bottom {
            display: flex;
            align-items: baseline;
            gap: 0.4rem;
        }

        .stat-tile-count {
            font-size: 1.3rem;
            font-weight: 800;
            color: var(--text-primary);
            font-variant-numeric: tabular-nums;
        }

        .stat-tile-pct {
            font-size: 0.65rem;
            font-weight: 700;
            color: var(--text-secondary);
        }

        .stat-tile-arrow {
            position: absolute;
            top: 0.8rem;
            right: 0.8rem;
            font-size: 0.8rem;
            line-height: 1;
            color: var(--tile-accent, var(--accent));
            opacity: 0;
            transform: translateX(-4px);
            transition: opacity 0.2s ease, transform 0.2s ease;
        }

        .stat-tile:hover .stat-tile-arrow,
        .stat-tile:focus-visible .stat-tile-arrow {
            opacity: 1;
            transform: translateX(0);
        }

        @keyframes statTileIn {
            from {
                opacity: 0;
                transform: translateY(12px);
            }

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

        /* --- 8. MAIN CONTENT AREA --- */
        .main-area {
            order: 2;
            min-height: 100dvh;
        }

        .results-header {
            display: flex;
            flex-direction: column;
            gap: 0.25rem;
            margin-bottom: 1.5rem;
        }

        .results-title {
            font-size: 1.5rem;
            font-weight: 800;
            color: var(--text-primary);
        }

        .results-count {
            font-size: 0.8rem;
            color: var(--text-secondary);
        }

        .results-count .hl {
            font-weight: 800;
            color: var(--accent);
        }

        .results-count .total {
            font-weight: 700;
            color: var(--text-primary);
        }

        /* --- 9. SHORTCUT CARDS --- */
        @keyframes fadeInCard {
            from {
                opacity: 0;
                transform: translateY(35px) scale(0.96);
            }

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

        .shortcut-card {
            /* Une surface pleine évite une couche de flou sur chaque carte. */
            background: #f8f9fd;
            border: 1px solid var(--border-color);
            border-radius: 1.5rem;
            padding: 1.5rem;
            box-shadow: var(--shadow-sm);
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            opacity: 0;
            transform: translateY(35px) scale(0.96);
            contain: content;
            /* Le navigateur saute entièrement la mise en page/peinture des cartes
               hors écran. contain-intrinsic-size fournit une hauteur de réserve
               (auto = mémorise la dernière taille réelle) pour un défilement stable. */
            content-visibility: auto;
            contain-intrinsic-size: auto 260px;
            transition: border-color 0.6s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
        }

        [data-theme="dark"] .shortcut-card {
            background: #192236;
        }

        /* Filet de sécurité : si l'observateur ne se déclenche pas (navigateur ancien,
           JS interrompu), les cartes restent visibles au lieu de disparaître. */
        .no-js-reveal .shortcut-card,
        .shortcut-card.card-shown {
            opacity: 1;
            transform: none;
        }

        /* Bascule de thème : on coupe transitions/animations le temps du changement
           pour éviter d'animer des milliers d'éléments d'un coup. */
        .theme-switching *,
        .theme-switching *::before,
        .theme-switching *::after {
            transition: none !important;
        }

        .shortcut-card.card-visible {
            animation: fadeInCard 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
            animation-delay: calc(var(--idx, 0) * 0.06s);
        }

        .chart-segment {
            cursor: pointer;
            transition: stroke-width 0.22s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.22s ease;
        }

        .chart-segment:hover {
            opacity: 1 !important;
            stroke-width: 19 !important;
        }
