        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        :root {
            --primary: #2C3E50;
            --secondary: #E74C3C;
            --accent: #3498DB;
            --success: #27AE60;
            --warning: #F39C12;
            --bg-dark: #1a1a1a;
            --bg-light: #f8f9fa;
            --text-dark: #2d3436;
            --text-light: #636e72;
            --border: #dfe6e9;
            --shadow: rgba(0, 0, 0, 0.1);
            --family-factual: #2C3E50;
            --family-stats: #8E44AD;
            --family-realtime: #E67E22;
            --family-incubator: #0E7490;
            --family-tools: #16A085;
            --page-padding: 2px;
            --header-height: 48px;
            --sidebar-foot-height: 32px;
        }

        html {
            height: 100%;
        }

        body {
            font-family: 'DM Sans', sans-serif;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            height: 100%;
            padding: var(--page-padding);
            color: var(--text-dark);
            overflow: hidden;
        }

        .container {
            max-width: 100%;
            width: 100%;
            height: 100%;
            margin: 0 auto;
            background: white;
            border-radius: 10px;
            overflow: hidden;
            box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
            display: flex;
            flex-direction: column;
            min-height: 0;
        }

        @media (min-width: 1900px) {
            .container {
                max-width: 1880px;
            }
        }

        .header {
            background: linear-gradient(135deg, #1f2933 0%, #2c3e50 100%);
            color: white;
            padding: 6px 16px;
            flex-shrink: 0;
            min-height: var(--header-height);
            position: relative;
            overflow: hidden;
            display: flex;
            align-items: center;
            gap: 14px;
        }

        .header-logo-link {
            display: flex;
            align-items: center;
            flex-shrink: 0;
            position: relative;
            z-index: 2;
            text-decoration: none;
            border-radius: 50%;
            overflow: hidden;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
            transition: transform 0.2s ease, box-shadow 0.2s ease;
        }

        .header-logo-link:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
        }

        .header-logo-mark {
            display: block;
            width: 32px;
            height: 32px;
            object-fit: cover;
        }

        .header-actions {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-left: auto;
            position: relative;
            z-index: 2;
            flex-shrink: 0;
        }

        .header-legend-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 32px;
            height: 32px;
            padding: 0;
            border: 1px solid rgba(255, 255, 255, 0.22);
            border-radius: 8px;
            background: rgba(255, 255, 255, 0.06);
            color: rgba(255, 255, 255, 0.92);
            cursor: pointer;
            transition: background 0.18s, border-color 0.18s, color 0.18s;
        }

        .header-legend-btn svg {
            width: 15px;
            height: 15px;
        }

        .header-legend-btn:hover,
        .header-legend-btn.is-active {
            background: rgba(255, 255, 255, 0.14);
            border-color: rgba(255, 255, 255, 0.35);
            color: #fff;
        }

        .header-kpi-btn {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 6px 10px;
            border: 1px solid rgba(255, 255, 255, 0.22);
            border-radius: 8px;
            background: rgba(255, 255, 255, 0.06);
            color: rgba(255, 255, 255, 0.92);
            font-family: inherit;
            font-size: 0.68rem;
            font-weight: 600;
            letter-spacing: 0.02em;
            cursor: pointer;
            transition: background 0.18s, border-color 0.18s, color 0.18s;
        }

        .header-kpi-btn svg {
            width: 14px;
            height: 14px;
            opacity: 0.9;
        }

        .header-kpi-btn:hover,
        .header-kpi-btn.is-active {
            background: rgba(255, 255, 255, 0.14);
            border-color: rgba(255, 255, 255, 0.35);
            color: #fff;
        }

        .header-kpi-btn.is-loading {
            opacity: 0.65;
            cursor: wait;
            pointer-events: none;
        }

        .header-weather {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 5px 10px;
            border-radius: 8px;
            background: rgba(255, 255, 255, 0.08);
            border: 1px solid rgba(255, 255, 255, 0.12);
            backdrop-filter: blur(6px);
            min-width: 0;
        }

        .header-weather-icon {
            font-size: 1.1rem;
            line-height: 1;
            opacity: 0.95;
        }

        .header-weather-body {
            min-width: 0;
        }

        .header-weather-temp {
            font-size: 0.95rem;
            font-weight: 700;
            font-family: 'JetBrains Mono', monospace;
            line-height: 1.1;
        }

        .header-weather-desc,
        .header-weather-station {
            font-size: 0.58rem;
            opacity: 0.82;
            line-height: 1.25;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            max-width: 140px;
        }

        .header-weather-station {
            opacity: 0.65;
            font-family: 'JetBrains Mono', monospace;
        }

        .header-titles {
            flex: 1;
            min-width: 0;
        }

        .header::before {
            content: '';
            position: absolute;
            top: -50%;
            right: -10%;
            width: 400px;
            height: 400px;
            background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
            border-radius: 50%;
        }

        .header h1 {
            font-size: 1.08rem;
            font-weight: 700;
            margin-bottom: 1px;
            position: relative;
            z-index: 1;
            letter-spacing: 0.15px;
        }

        .header .subtitle {
            font-size: 0.68rem;
            opacity: 0.78;
            font-family: 'JetBrains Mono', monospace;
            position: relative;
            z-index: 1;
        }

        @media (max-width: 900px) {
            .header h1 {
                font-size: 1rem;
            }

            .header-kpi-btn span {
                display: none;
            }
        }

        @media (max-width: 640px) {
            :root {
                --header-height: 62px;
            }

            .header {
                flex-wrap: wrap;
                gap: 6px;
                padding: 6px 12px;
            }

            .header-titles {
                order: 2;
                flex: 1 1 100%;
            }

            .header-actions {
                order: 1;
                margin-left: auto;
            }
        }

        .main-content {
            display: grid;
            grid-template-columns: var(--sidebar-width, 320px) 6px minmax(0, 1fr);
            grid-template-areas: "sidebar resizer map";
            gap: 0;
            flex: 1;
            min-height: 0;
            position: relative;
            overflow: hidden;
            transition: grid-template-columns 0.24s ease;
        }

        .main-content .sidebar {
            grid-area: sidebar;
        }

        .main-content .sidebar-resizer {
            grid-area: resizer;
        }

        .main-content .map-stage {
            grid-area: map;
            min-width: 0;
            min-height: 0;
        }

        .main-content.is-sidebar-collapsed {
            grid-template-columns: minmax(0, 1fr);
            grid-template-areas: "map";
        }

        .main-content.is-sidebar-collapsed .sidebar,
        .main-content.is-sidebar-collapsed .sidebar-resizer {
            display: none;
        }

        .sidebar-backdrop {
            display: none;
            pointer-events: none;
        }

        body.legend-panel-open .header-legend-btn {
            background: rgba(255, 255, 255, 0.14);
            border-color: rgba(255, 255, 255, 0.35);
            color: #fff;
        }

        .map-tool--legend.is-active {
            background: #2c3e50;
            border-color: #2c3e50;
            color: #fff;
        }

        /* Visible left-edge handle to reopen the legend when collapsed */
        .sidebar-gutter {
            position: absolute;
            left: 0;
            top: 0;
            bottom: 0;
            z-index: 1102;
            width: 22px;
            display: none;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 6px;
            padding: 0;
            border: none;
            border-right: 2px solid #94a3b8;
            border-radius: 0;
            background: linear-gradient(90deg, #e8eef4 0%, #f1f5f9 55%, rgba(241, 245, 249, 0.88) 100%);
            color: #334155;
            cursor: pointer;
            pointer-events: auto;
            box-shadow: 3px 0 14px rgba(15, 23, 42, 0.12);
            transition: width 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
        }

        .sidebar-gutter svg {
            width: 16px;
            height: 16px;
            flex-shrink: 0;
        }

        .sidebar-gutter-label {
            writing-mode: vertical-rl;
            transform: rotate(180deg);
            font-size: 0.58rem;
            font-weight: 700;
            letter-spacing: 0.08em;
            text-transform: uppercase;
            line-height: 1;
            color: #64748b;
            user-select: none;
            pointer-events: none;
        }

        .sidebar-gutter:hover,
        .sidebar-gutter:focus-visible {
            width: 28px;
            background: linear-gradient(90deg, #dce4ec 0%, #eef2f6 100%);
            color: #1f2933;
            border-right-color: #64748b;
            box-shadow: 4px 0 18px rgba(15, 23, 42, 0.16);
            outline: none;
        }

        body.legend-panel-closed .sidebar-gutter {
            display: flex;
        }

        /* Draggable divider between sidebar and map */
        .sidebar-resizer {
            position: relative;
            background: var(--border);
            cursor: col-resize;
            transition: background 0.15s;
            user-select: none;
            touch-action: none;
        }

        .sidebar-resizer::before {
            content: '';
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 4px;
            height: 36px;
            background: #94a3b8;
            border-radius: 2px;
            opacity: 0.5;
            transition: opacity 0.15s, background 0.15s;
        }

        .sidebar-resizer:hover {
            background: #cbd5e1;
        }

        .sidebar-resizer:hover::before,
        .sidebar-resizer.is-dragging::before {
            opacity: 1;
            background: #3498DB;
        }

        .sidebar-resizer.is-dragging {
            background: #93c5fd;
        }

        /* Global cursor during drag to avoid flicker */
        body.is-resizing,
        body.is-resizing * {
            cursor: col-resize !important;
            user-select: none !important;
        }

        .sidebar {
            display: flex;
            flex-direction: column;
            min-width: 0;
            background: #f8f9fa;
            border-right: 1px solid var(--border);
            overflow: hidden;
            position: relative;
            transition: transform 0.24s ease, opacity 0.24s ease, width 0.24s ease;
        }

        .sidebar-toolbar {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            flex-shrink: 0;
            padding: 8px 10px 6px;
            border-bottom: 1px solid #e8ecef;
            background: #fafbfc;
        }

        .sidebar-toolbar-label {
            font-size: 0.72rem;
            font-weight: 700;
            letter-spacing: 0.04em;
            text-transform: uppercase;
            color: #64748b;
        }

        .sidebar-collapse-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 28px;
            height: 28px;
            padding: 0;
            border: 1px solid #e2e8f0;
            border-radius: 6px;
            background: #fff;
            color: #64748b;
            cursor: pointer;
            transition: background 0.15s, border-color 0.15s, color 0.15s;
        }

        .sidebar-collapse-btn svg {
            width: 16px;
            height: 16px;
        }

        .sidebar-collapse-btn:hover {
            background: #f4f6f8;
            border-color: #cbd5e1;
            color: #334155;
        }

        .sidebar-drag-handle {
            display: none;
        }

        .sidebar-scroll {
            flex: 1;
            min-height: 0;
            min-width: 0;
            overflow-y: auto;
            overflow-x: hidden;
            padding: 10px 12px 12px;
        }

        @media (max-width: 900px) {
            .main-content,
            .main-content.is-sidebar-collapsed {
                display: block;
                grid-template-columns: none;
                grid-template-areas: none;
            }

            .main-content .sidebar-resizer {
                display: none !important;
            }

            .main-content .map-stage {
                width: 100%;
                height: 100%;
            }

            .main-content.is-mobile-sidebar .sidebar {
                display: flex;
            }

            .main-content:not(.is-mobile-sidebar) .sidebar {
                display: none;
            }

            .sidebar-backdrop {
                display: block;
                position: fixed;
                top: var(--header-height);
                right: 0;
                bottom: 0;
                left: 0;
                z-index: 1090;
                background: rgba(15, 23, 42, 0.42);
                opacity: 0;
                pointer-events: none;
                transition: opacity 0.24s ease;
            }

            .main-content.is-sidebar-open .sidebar-backdrop {
                opacity: 1;
                pointer-events: auto;
            }

            body.sidebar-mobile-open {
                overflow: hidden;
            }

            .sidebar {
                position: fixed;
                top: var(--header-height);
                left: 0;
                bottom: 0;
                z-index: 1100;
                width: min(92vw, 360px);
                max-width: 100%;
                border-right: 1px solid var(--border);
                box-shadow: none;
                transform: translateX(-110%);
                transition: transform 0.28s ease, box-shadow 0.28s ease, visibility 0.28s ease;
                will-change: transform;
            }

            .main-content:not(.is-sidebar-open) .sidebar {
                pointer-events: none;
                visibility: hidden;
            }

            .main-content.is-sidebar-open .sidebar {
                pointer-events: auto;
                visibility: visible;
                transform: translateX(var(--sidebar-drag-offset, 0px));
                box-shadow: 12px 0 32px rgba(15, 23, 42, 0.2);
            }

            .sidebar.is-dragging {
                transition: none;
            }

            .sidebar-drag-handle {
                display: block;
                position: absolute;
                top: 0;
                right: 0;
                bottom: 0;
                width: 28px;
                cursor: grab;
                touch-action: none;
                background: linear-gradient(90deg, transparent, rgba(148, 163, 184, 0.12));
            }

            .sidebar-drag-handle::after {
                content: '';
                position: absolute;
                top: 50%;
                right: 10px;
                transform: translateY(-50%);
                width: 4px;
                height: 36px;
                border-radius: 2px;
                background: #cbd5e1;
            }

            .sidebar-drag-handle:active {
                cursor: grabbing;
            }
        }

        .sidebar-foot {
            flex-shrink: 0;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            min-height: var(--sidebar-foot-height);
            padding: 6px 12px;
            border-top: 1px solid var(--border);
            background: #fafbfc;
        }

        .sidebar-foot-meta {
            display: flex;
            align-items: center;
            gap: 0;
            flex-shrink: 0;
        }

        .sidebar-foot-repo {
            color: #7f8c8d;
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.62rem;
            font-weight: 500;
            text-decoration: none;
            transition: color 0.18s;
            max-width: 100%;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .sidebar-foot-repo:hover {
            color: #3498DB;
        }

        .sidebar-foot-version {
            color: #bdc3c7;
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.58rem;
            white-space: nowrap;
            flex-shrink: 0;
        }

        .sidebar-foot-version::before {
            content: '·';
            margin-right: 8px;
            opacity: 0.7;
        }

        .sidebar-foot-guide {
            color: #95a5a6;
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.58rem;
            font-weight: 500;
            text-decoration: none;
            white-space: nowrap;
            transition: color 0.18s;
        }

        .sidebar-foot-guide::before {
            content: '·';
            margin: 0 8px;
            opacity: 0.7;
            color: #bdc3c7;
        }

        .sidebar-foot-guide:hover {
            color: #3498DB;
        }

        .legend-section {
            margin-bottom: 22px;
        }

        .legend-title {
            font-size: 0.76rem;
            font-weight: 600;
            text-transform: none;
            letter-spacing: 0.01em;
            color: #5b6770;
            margin-bottom: 8px;
            font-family: 'DM Sans', sans-serif;
            min-width: 0;
            overflow-wrap: anywhere;
        }

        .quality-section-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
        }

        .sidebar-quality-btn {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            flex-shrink: 0;
            border: 1px solid #3498DB;
            background: #fff;
            color: #3498DB;
            border-radius: 6px;
            padding: 4px 8px;
            font-family: inherit;
            font-size: 0.68rem;
            font-weight: 600;
            cursor: pointer;
            line-height: 1.2;
            text-transform: none;
            letter-spacing: 0;
            transition: background 0.18s, color 0.18s, box-shadow 0.18s;
        }

        .sidebar-quality-btn:hover {
            background: #ebf5fb;
        }

        .sidebar-quality-btn.is-active {
            background: #3498DB;
            color: #fff;
            box-shadow: 0 2px 6px rgba(52, 152, 219, 0.35);
        }

        .sidebar-quality-btn-icon {
            font-size: 0.85rem;
            line-height: 1;
        }

        .legend-item {
            display: flex;
            align-items: center;
            min-width: 0;
            padding: 7px 8px;
            margin-bottom: 4px;
            background: #fafbfc;
            border-radius: 5px;
            border: 1px solid #e8ecef;
            transition: background 0.15s ease, border-color 0.15s ease;
            cursor: pointer;
        }

        .legend-item:hover {
            background: #f4f6f8;
            border-color: #d5dce3;
        }

        .legend-color {
            width: 40px;
            height: 4px;
            border-radius: 2px;
            margin-right: 12px;
        }

        .legend-color.legend-swatch-emoji {
            width: 22px;
            height: 22px;
            min-width: 22px;
            min-height: 22px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 1rem;
            line-height: 1;
            background: transparent;
            flex-shrink: 0;
        }

        .legend-label {
            flex: 1;
            min-width: 0;
            font-size: 0.82rem;
            font-weight: 500;
            color: #4a5568;
            overflow-wrap: anywhere;
        }

        .legend-count {
            font-size: 0.68rem;
            color: #95a5a6;
            font-family: 'JetBrains Mono', monospace;
        }

        .legend-km-hint {
            margin: 2px 0 8px;
            font-size: 0.68rem;
            font-weight: 500;
            color: var(--text-light);
            letter-spacing: 0.02em;
        }

        .legend-count-km {
            font-weight: 700;
            color: #334155;
            white-space: nowrap;
        }

        .legend-item-summary {
            background: #f4f8fa;
            border-color: #dce6ec;
            font-weight: 600;
        }

        .legend-item-summary .legend-label {
            font-weight: 700;
        }

        .legend-color-spacer {
            background: transparent !important;
            visibility: hidden;
        }

        .info-box {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 20px;
            border-radius: 12px;
            margin-top: 20px;
        }

        .info-box h3 {
            font-size: 1rem;
            margin-bottom: 10px;
            opacity: 0.95;
        }

        .info-box .stat {
            display: flex;
            justify-content: space-between;
            padding: 8px 0;
            border-bottom: 1px solid rgba(255,255,255,0.2);
            font-size: 0.9rem;
        }

        .info-box .stat:last-child {
            border-bottom: none;
        }

        .info-box .stat-value {
            font-weight: 700;
            font-family: 'JetBrains Mono', monospace;
        }

        #map {
            height: 100%;
            background: #f5f5f5;
        }

        .map-stage {
            position: relative;
            height: 100%;
            min-height: 0;
            overflow: hidden;
        }

        /* Floating data quality button */
        /* === Unified toolbar (top-right) === */
        .map-toolbar {
            position: absolute;
            top: 12px;
            right: 12px;
            z-index: 1000;
            display: flex;
            gap: 4px;
            padding: 4px;
            background: rgba(255, 255, 255, 0.94);
            border: 1px solid #e5e9ec;
            border-radius: 10px;
            box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
            backdrop-filter: blur(10px);
            max-width: calc(100% - 24px);
            flex-wrap: wrap;
        }

        .map-tool {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            background: transparent;
            border: 1px solid transparent;
            border-radius: 7px;
            padding: 7px 10px;
            font-family: inherit;
            font-size: 0.76rem;
            font-weight: 600;
            color: #4a5568;
            cursor: pointer;
            white-space: nowrap;
            line-height: 1;
            transition: background 0.18s, color 0.18s, border-color 0.18s, box-shadow 0.18s;
        }

        .map-tool:hover {
            background: #f4f6f8;
            color: #1f2933;
            border-color: #e2e8f0;
        }

        .map-tool:active {
            transform: translateY(1px);
        }

        .map-tool.is-active {
            background: #2c3e50;
            color: #fff;
            border-color: #2c3e50;
            box-shadow: 0 2px 8px rgba(44, 62, 80, 0.22);
        }

        .map-tool--compact {
            padding: 7px 9px;
        }

        .map-tool--compact .map-tool-icon--svg {
            margin: 0;
        }

        .map-tool.is-active.is-bounce {
            animation: mapToolBounce 2.4s ease-in-out infinite;
        }

        @keyframes mapToolBounce {
            0%, 100% { transform: translateY(0); }
            50% { transform: translateY(-2px); }
        }

        .map-tool.is-loading {
            opacity: 0.65;
            cursor: wait;
            pointer-events: none;
        }

        .map-tool .map-tool-icon {
            font-size: 1.05rem;
            line-height: 1;
        }

        .map-tool .map-tool-icon--svg {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 16px;
            height: 16px;
        }

        .map-tool .map-tool-icon--svg svg {
            width: 16px;
            height: 16px;
        }

        .map-tool .map-tool-label {
            font-size: 0.72rem;
            letter-spacing: 0.01em;
        }

        /* On narrow screens show icons only to stay compact */
        @media (max-width: 1100px) {
            .map-tool .map-tool-label {
                display: none;
            }
            .map-tool {
                padding: 9px;
            }
        }

        /* Bison Futé markers */
        .bison-fute-marker {
            background: transparent !important;
            border: none !important;
            text-align: center;
        }

        /* Data quality panel */
        .quality-panel {
            position: absolute;
            top: 14px;
            right: 14px;
            z-index: 999;
            background: white;
            border-radius: 12px;
            box-shadow: 0 8px 24px rgba(0,0,0,0.2);
            width: 380px;
            max-height: 80vh;
            overflow-y: auto;
            display: none;
            animation: slideIn 0.3s ease;
        }

        .quality-panel.active {
            display: block;
        }

        .bridge-viewer-panel {
            position: absolute;
            right: 14px;
            bottom: 14px;
            z-index: 1001;
            width: min(520px, calc(100% - 28px));
            max-height: min(720px, calc(100% - 92px));
            background: #ffffff;
            border: 1px solid rgba(44, 62, 80, 0.12);
            border-radius: 14px;
            box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
            display: none;
            overflow: hidden;
        }

        .bridge-viewer-panel.active {
            display: flex;
            flex-direction: column;
            animation: bridgeViewerIn 0.3s ease;
        }

        @keyframes bridgeViewerIn {
            from {
                opacity: 0;
                transform: translateY(10px) scale(0.985);
            }
            to {
                opacity: 1;
                transform: translateY(0) scale(1);
            }
        }

        .bridge-viewer-header {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 12px;
            padding: 14px 16px 12px;
            background: linear-gradient(135deg, #1f2933 0%, #2c3e50 100%);
            border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        }

        .bridge-viewer-heading {
            min-width: 0;
        }

        .bridge-viewer-kicker {
            margin: 0 0 4px;
            font-size: 0.6rem;
            font-weight: 700;
            letter-spacing: 0.1em;
            text-transform: uppercase;
            color: rgba(255, 255, 255, 0.52);
        }

        .bridge-viewer-header h2 {
            margin: 0;
            color: #ffffff;
            font-size: 1.05rem;
            line-height: 1.25;
            font-weight: 700;
            overflow-wrap: anywhere;
        }

        .bridge-viewer-header p {
            margin: 5px 0 0;
            color: rgba(255, 255, 255, 0.72);
            font-size: 0.74rem;
            line-height: 1.35;
        }

        .bridge-viewer-close {
            width: 30px;
            height: 30px;
            flex: 0 0 30px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border: 1px solid rgba(255, 255, 255, 0.18);
            border-radius: 8px;
            background: rgba(255, 255, 255, 0.08);
            color: rgba(255, 255, 255, 0.92);
            cursor: pointer;
            transition: background 0.18s, border-color 0.18s;
        }

        .bridge-viewer-close svg {
            width: 14px;
            height: 14px;
        }

        .bridge-viewer-close:hover {
            background: rgba(255, 255, 255, 0.16);
            border-color: rgba(255, 255, 255, 0.28);
        }

        .bridge-viewer-content {
            padding: 14px 16px 16px;
            overflow-y: auto;
            background: linear-gradient(180deg, #fafbfc 0%, #ffffff 120px);
        }

        .bridge-viewer-section {
            margin-bottom: 14px;
        }

        .bridge-viewer-section:last-child {
            margin-bottom: 0;
        }

        .bridge-viewer-section-title {
            margin: 0 0 8px;
            font-size: 0.66rem;
            font-weight: 700;
            letter-spacing: 0.08em;
            text-transform: uppercase;
            color: #7f8c8d;
        }

        .bridge-viewer-stats {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
            margin-bottom: 12px;
        }

        .bridge-viewer-stat {
            display: inline-flex;
            align-items: baseline;
            gap: 5px;
            padding: 5px 9px;
            border-radius: 999px;
            background: #ffffff;
            border: 1px solid #e8ecef;
            font-size: 0.68rem;
            color: #64748b;
            line-height: 1;
        }

        .bridge-viewer-stat strong {
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.78rem;
            font-weight: 700;
            color: #2c3e50;
        }

        .bridge-viewer-meta {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
            margin-bottom: 12px;
        }

        .bridge-viewer-meta-chip {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            padding: 4px 8px;
            border-radius: 6px;
            background: #f4f6f8;
            border: 1px solid #e8ecef;
            font-size: 0.7rem;
            color: #4a5568;
            line-height: 1.2;
        }

        .bridge-viewer-meta-chip strong {
            font-weight: 700;
            color: #64748b;
            font-size: 0.62rem;
            text-transform: uppercase;
            letter-spacing: 0.04em;
        }

        .bridge-viewer-osm-link {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            margin-top: 10px;
            font-size: 0.72rem;
            font-weight: 600;
            color: #3498db;
            text-decoration: none;
        }

        .bridge-viewer-osm-link:hover {
            text-decoration: underline;
        }

        .bridge-schematic {
            margin-bottom: 0;
        }

        .bridge-schematic-stage {
            position: relative;
            min-height: 232px;
            padding: 10px 6px 14px;
            border-radius: 12px;
            background: linear-gradient(180deg, #f8fafc 0%, #eef3f8 52%, #e6f0f7 100%);
            border: 1px solid #e2e8f0;
            overflow: hidden;
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
        }

        .bridge-schematic-stage::before {
            content: '';
            position: absolute;
            left: 0;
            right: 0;
            bottom: 0;
            height: 32%;
            background: linear-gradient(180deg, rgba(52, 152, 219, 0) 0%, rgba(52, 152, 219, 0.07) 100%);
            pointer-events: none;
        }

        .bridge-schematic-stage::after {
            content: '';
            position: absolute;
            left: 10%;
            right: 10%;
            bottom: 18%;
            height: 2px;
            border-radius: 999px;
            background: linear-gradient(90deg, transparent, rgba(52, 152, 219, 0.35), transparent);
            pointer-events: none;
        }

        .bridge-schematic-photos {
            position: absolute;
            left: 0;
            right: 0;
            height: 34%;
            pointer-events: none;
        }

        .bridge-schematic-photos--top {
            top: 4px;
        }

        .bridge-schematic-photos--bottom {
            bottom: 4px;
        }

        .bridge-schematic-photo {
            position: absolute;
            transform: translateX(-50%);
            width: 58px;
            border: 2px solid var(--bridge-part-color, #7F8C8D);
            border-radius: 8px;
            background: #ffffff;
            padding: 0;
            overflow: hidden;
            cursor: pointer;
            pointer-events: auto;
            box-shadow: 0 3px 10px rgba(15, 23, 42, 0.14);
            transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
        }

        .bridge-schematic-photo:hover,
        .bridge-schematic-photo.is-active {
            border-color: #2C3E50;
            box-shadow: 0 6px 16px rgba(44, 62, 80, 0.22);
            transform: translateX(-50%) translateY(-2px);
        }

        .bridge-schematic-photo.is-active {
            outline: 2px solid rgba(44, 62, 80, 0.18);
            outline-offset: 1px;
        }

        .bridge-schematic-photo img,
        .bridge-schematic-photo-placeholder {
            display: block;
            width: 100%;
            aspect-ratio: 4 / 3;
            object-fit: cover;
            background: #eef2f5;
            color: #2C3E50;
            font-size: 0.72rem;
            font-weight: 800;
            line-height: 2.4;
            text-align: center;
        }

        .bridge-schematic-photo-label {
            display: block;
            padding: 2px 4px 3px;
            font-size: 0.58rem;
            font-weight: 700;
            color: #5b6770;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .bridge-schematic-structure {
            position: absolute;
            left: 8px;
            right: 8px;
            top: 50%;
            transform: translateY(-50%);
            display: grid;
            grid-template-columns: 52px 1fr 52px;
            align-items: center;
            gap: 8px;
            z-index: 1;
        }

        .bridge-schematic-abutment {
            height: 62px;
            border-radius: 8px 8px 4px 4px;
            border: 2px solid var(--bridge-part-color, #E67E22);
            background: linear-gradient(
                180deg,
                color-mix(in srgb, var(--bridge-part-color, #E67E22) 22%, white) 0%,
                color-mix(in srgb, var(--bridge-part-color, #E67E22) 10%, white) 100%
            );
            display: flex;
            align-items: center;
            justify-content: center;
            text-align: center;
            font-size: 0.6rem;
            font-weight: 800;
            color: #2C3E50;
            line-height: 1.1;
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 2px 6px rgba(15, 23, 42, 0.08);
        }

        .bridge-schematic-deck {
            position: relative;
            height: 22px;
            border-radius: 5px;
            background: linear-gradient(180deg, #3d5166 0%, #2c3e50 58%, #243342 100%);
            box-shadow: 0 4px 12px rgba(44, 62, 80, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.14);
        }

        .bridge-schematic-deck-label {
            position: absolute;
            left: 50%;
            top: -18px;
            transform: translateX(-50%);
            font-size: 0.58rem;
            font-weight: 700;
            letter-spacing: 0.04em;
            text-transform: uppercase;
            color: #60717c;
            white-space: nowrap;
        }

        .bridge-schematic-pillar {
            position: absolute;
            top: -12px;
            width: 12px;
            height: 42px;
            transform: translateX(-50%);
            border-radius: 3px 3px 2px 2px;
            background: linear-gradient(180deg, #9b59b6 0%, #8e44ad 55%, #6c3483 100%);
            box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
        }

        .bridge-schematic-pillar::before {
            content: '';
            position: absolute;
            top: -3px;
            left: -2px;
            right: -2px;
            height: 5px;
            border-radius: 2px 2px 0 0;
            background: #a569bd;
        }

        .bridge-viewer-hero {
            position: relative;
            width: 100%;
            aspect-ratio: 16 / 9;
            border-radius: 12px;
            overflow: hidden;
            background: #1f2933;
            border: 1px solid #e2e8f0;
            box-shadow: 0 8px 22px rgba(15, 23, 42, 0.12);
        }

        .bridge-viewer-hero-inner {
            width: 100%;
            height: 100%;
        }

        .bridge-viewer-hero-link {
            display: block;
            width: 100%;
            height: 100%;
        }

        .bridge-viewer-hero-img,
        .bridge-viewer-hero-frame {
            display: block;
            width: 100%;
            height: 100%;
            border: 0;
            object-fit: cover;
        }

        .bridge-viewer-hero-badge {
            position: absolute;
            left: 10px;
            top: 10px;
            padding: 4px 8px;
            border-radius: 999px;
            font-size: 0.62rem;
            font-weight: 700;
            letter-spacing: 0.03em;
            text-transform: uppercase;
            color: #ffffff;
            background: rgba(15, 23, 42, 0.72);
            backdrop-filter: blur(6px);
            border: 1px solid rgba(255, 255, 255, 0.14);
        }

        .bridge-viewer-hero-badge--panoramax {
            background: rgba(39, 174, 96, 0.82);
        }

        .bridge-viewer-hero-badge--mapillary {
            background: rgba(52, 152, 219, 0.82);
        }

        .bridge-viewer-empty {
            height: 100%;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 6px;
            padding: 22px;
            text-align: center;
            color: #94a3b8;
            font-size: 0.84rem;
            line-height: 1.4;
        }

        .bridge-viewer-empty::before {
            content: '📷';
            font-size: 1.4rem;
            opacity: 0.55;
        }

        .bridge-viewer-selected {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
            margin-top: 10px;
            padding: 10px 12px;
            border-radius: 10px;
            background: #f8fafb;
            border: 1px solid #e8ecef;
            font-size: 0.76rem;
            color: #5b6770;
        }

        .bridge-viewer-selected-meta {
            min-width: 0;
            flex: 1;
            line-height: 1.35;
        }

        .bridge-viewer-selected a {
            flex-shrink: 0;
            display: inline-flex;
            align-items: center;
            padding: 5px 9px;
            border-radius: 6px;
            background: #ffffff;
            border: 1px solid #dce3ea;
            color: #2c3e50;
            text-decoration: none;
            font-weight: 700;
            font-size: 0.7rem;
            transition: background 0.15s, border-color 0.15s;
        }

        .bridge-viewer-selected a:hover {
            background: #f4f6f8;
            border-color: #cbd5e1;
        }

        .bridge-viewer-parts {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
            margin-top: 0;
        }

        .bridge-photo-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
            gap: 8px;
            margin-top: 0;
        }

        .bridge-photo-card {
            min-width: 0;
            border: 1px solid #e2e8f0;
            border-radius: 10px;
            background: #ffffff;
            padding: 0;
            overflow: hidden;
            cursor: pointer;
            text-align: left;
            transition: border-color 0.16s, box-shadow 0.16s, transform 0.16s;
        }

        .bridge-photo-card:hover,
        .bridge-photo-card.is-active {
            border-color: #2C3E50;
            box-shadow: 0 4px 12px rgba(44, 62, 80, 0.16);
        }

        .bridge-photo-card.is-active {
            outline: 2px solid rgba(44, 62, 80, 0.12);
            outline-offset: 0;
        }

        .bridge-photo-card:active {
            transform: translateY(1px);
        }

        .bridge-photo-card img,
        .bridge-photo-card-placeholder {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 100%;
            aspect-ratio: 4 / 3;
            object-fit: cover;
            background: #eef2f5;
            color: #2C3E50;
            font-size: 0.76rem;
            font-weight: 700;
        }

        .bridge-photo-card-meta {
            display: grid;
            gap: 3px;
            padding: 7px;
            font-size: 0.68rem;
            line-height: 1.2;
            color: #5b6770;
        }

        .bridge-photo-card-source {
            font-weight: 700;
            color: #2C3E50;
        }

        .bridge-photo-card-part {
            display: inline-flex;
            align-items: center;
            gap: 4px;
        }

        .bridge-photo-card-part::before {
            content: '';
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: var(--bridge-part-color, #7F8C8D);
        }

        .bridge-part-pill {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            padding: 3px 7px;
            border-radius: 999px;
            background: color-mix(in srgb, var(--bridge-part-color, #7F8C8D) 14%, white);
            color: #2C3E50;
            font-size: 0.72rem;
            font-weight: 700;
            white-space: nowrap;
        }

        .bridge-part-pill::before {
            content: '';
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: var(--bridge-part-color, #7F8C8D);
        }

        @media (max-width: 640px) {
            .bridge-viewer-panel {
                right: 8px;
                left: 8px;
                bottom: 8px;
                width: auto;
                max-height: calc(100% - 80px);
                border-radius: 12px;
            }

            .bridge-viewer-content {
                padding: 12px;
            }

            .bridge-schematic-stage {
                min-height: 210px;
            }

            .bridge-photo-grid {
                grid-template-columns: repeat(2, minmax(0, 1fr));
            }
        }

        #map.bridge-map-zooming .bridge-group-marker-wrapper,
        #map.bridge-map-zooming .bridge-photo-marker-wrapper {
            visibility: hidden !important;
            pointer-events: none !important;
        }

        .bridge-group-marker-wrapper {
            background: transparent !important;
            border: none !important;
            pointer-events: auto !important;
        }

        .bridge-group-marker {
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            border: 3px solid #ffffff;
            background: rgba(149, 165, 166, 0.9);
            color: #ffffff;
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.72rem;
            font-weight: 800;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.24);
            cursor: pointer;
            padding: 0;
            margin: 0;
            appearance: none;
            -webkit-appearance: none;
            line-height: 1;
            pointer-events: auto;
            touch-action: manipulation;
            transition: transform 0.15s ease, box-shadow 0.15s ease;
        }

        .bridge-group-marker.is-cluster.has-photos {
            background: rgba(243, 156, 18, 0.88);
            box-shadow: 0 4px 16px rgba(243, 156, 18, 0.35);
        }

        .bridge-group-marker.is-cluster:not(.has-photos) {
            background: rgba(127, 140, 141, 0.82);
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
        }

        .bridge-group-marker.is-cluster span {
            font-size: 0.78rem;
            letter-spacing: -0.02em;
        }

        .bridge-group-marker.is-cluster {
            border-width: 2px;
        }

        .bridge-group-marker.is-solo {
            border-width: 2px;
            background: rgba(127, 140, 141, 0.82);
        }

        .bridge-group-marker.is-solo.has-photos {
            background: rgba(243, 156, 18, 0.9);
        }

        .bridge-group-marker:hover {
            transform: scale(1.06);
            box-shadow: 0 5px 14px rgba(0, 0, 0, 0.3);
        }

        .bridge-photo-marker-wrapper {
            background: transparent !important;
            border: none !important;
        }

        .bridge-photo-marker {
            width: 28px;
            height: 28px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            border: 3px solid var(--bridge-part-color, #7F8C8D);
            background: #ffffff;
            color: #2C3E50;
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.78rem;
            font-weight: 800;
            box-shadow: 0 2px 7px rgba(0, 0, 0, 0.28);
        }

        .bridge-photo-marker.is-panoramax span {
            color: #16A085;
        }

        .bridge-photo-marker.is-mapillary span {
            color: #2ECC71;
        }

        .bridge-source-controls {
            display: grid;
            grid-template-columns: 1fr;
            gap: 7px;
        }

        .bridge-source-toggle {
            display: grid;
            grid-template-columns: 12px 1fr auto;
            align-items: center;
            gap: 8px;
            min-height: 34px;
            border: 1px solid #dfe6e9;
            border-radius: 7px;
            background: #ffffff;
            color: #5b6770;
            padding: 7px 9px;
            font-family: inherit;
            font-size: 0.78rem;
            font-weight: 700;
            cursor: pointer;
            text-align: left;
            transition: border-color 0.16s, background 0.16s, color 0.16s;
        }

        .bridge-source-toggle:hover {
            border-color: #0E7490;
            background: #f3fafb;
        }

        .bridge-source-toggle.is-active {
            border-color: #0E7490;
            color: #2C3E50;
            background: #eefbfc;
        }

        .bridge-source-toggle:not(.is-active) {
            opacity: 0.62;
        }

        .bridge-source-toggle.is-disabled-by-layer {
            opacity: 0.5;
        }

        .bridge-source-dot {
            width: 10px;
            height: 10px;
            border-radius: 50%;
            background: #95A5A6;
        }

        .bridge-source-dot--panoramax {
            background: #16A085;
        }

        .bridge-source-dot--mapillary {
            background: #2ECC71;
        }

        .bridge-source-count {
            font-family: 'JetBrains Mono', monospace;
            color: #2C3E50;
        }

        .sensitive-zone-swatch {
            background: rgba(64, 145, 108, 0.22);
            border: 2px solid #1B4332;
            height: 13px;
            width: 24px;
            border-radius: 3px;
        }

        .inaturalist-swatch {
            background: #40916C;
            width: 10px;
            height: 10px;
            border-radius: 50%;
            border: 2px solid #fff;
        }

        .webcam-swatch {
            width: 12px;
            height: 12px;
            border-radius: 50%;
            border: 2px solid #fff;
        }

        .webcam-swatch--traffic {
            background: #C0392B;
        }

        .webcam-swatch--mountain {
            background: #0E7490;
        }

        .webcam-marker-wrapper {
            background: transparent;
            border: none;
        }

        .webcam-marker {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 26px;
            height: 26px;
            border-radius: 50%;
            background: var(--webcam-color, #0E7490);
            color: #fff;
            border: 2px solid #fff;
            box-shadow: 0 1px 4px rgba(0, 0, 0, 0.28);
        }

        .webcam-marker svg {
            width: 14px;
            height: 14px;
        }

        .webcam-leaflet-popup .leaflet-popup-content {
            margin: 10px 12px;
            width: min(380px, calc(100vw - 72px)) !important;
        }

        .webcam-popup-frame {
            width: 100%;
            aspect-ratio: 16 / 10;
            border-radius: 6px;
            overflow: hidden;
            background: #111;
        }

        .webcam-popup-iframe,
        .webcam-popup-video,
        .webcam-popup-image {
            display: block;
            width: 100%;
            height: 100%;
            border: 0;
            object-fit: cover;
            background: #111;
        }

        .webcam-popup-unavailable {
            margin: 0;
            padding: 24px 12px;
            text-align: center;
            font-size: 0.82rem;
            color: #60717c;
            background: #f4f6f8;
            border-radius: 6px;
        }

        .inaturalist-popup-photo {
            display: block;
            width: 100%;
            max-height: 140px;
            object-fit: cover;
            border-radius: 6px;
            margin-bottom: 8px;
        }

        .bridge-zoom-hint,
        .weather-station-marker-wrapper {
            background: transparent;
            border: none;
        }

        .weather-station-marker {
            display: block;
            width: 16px;
            height: 16px;
            border-radius: 50%;
            background: #1B4332;
            box-shadow: 0 0 0 3px #fff, 0 0 0 4px #2D6A4F;
        }

        .weather-station-swatch {
            width: 16px !important;
            height: 16px !important;
            border-radius: 50%;
            margin-right: 12px;
            flex-shrink: 0;
            background: #1B4332;
            box-shadow: 0 0 0 2px #fff, 0 0 0 3px #2D6A4F;
        }

        .weather-stations-hint,
        .sensitive-zones-hint,
        .inaturalist-sensitive-hint,
        .webcams-hint {
            margin-top: 8px;
            padding: 7px 8px;
            border-radius: 6px;
            background: #f4f6f8;
            color: #60717c;
            font-size: 0.7rem;
            line-height: 1.35;
        }

        .weather-station-popup {
            font-size: 0.82rem;
            line-height: 1.45;
            color: #2c3e50;
            min-width: 160px;
        }

        .weather-station-popup h4 {
            margin: 0 0 6px;
            font-size: 0.88rem;
            font-weight: 700;
        }

        .weather-station-popup dl {
            margin: 0;
            display: grid;
            grid-template-columns: auto 1fr;
            gap: 4px 10px;
        }

        .weather-station-popup dt {
            color: #7f8c8d;
            font-size: 0.72rem;
        }

        .weather-station-popup dd {
            margin: 0;
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.76rem;
        }

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

        .quality-header {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 15px 20px;
            border-radius: 12px 12px 0 0;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .quality-header h3 {
            margin: 0;
            font-size: 1rem;
            font-weight: 600;
        }

        .quality-close {
            background: rgba(255,255,255,0.2);
            border: none;
            color: white;
            width: 28px;
            height: 28px;
            border-radius: 50%;
            cursor: pointer;
            font-size: 1.2rem;
            line-height: 1;
            transition: background 0.2s;
        }

        .quality-close:hover {
            background: rgba(255,255,255,0.3);
        }

        .quality-content {
            padding: 20px;
        }

        /* === Department KPI dashboard (overlay sidebar + map) === */
        .dashboard-overlay {
            position: fixed;
            inset: 0;
            z-index: 2500;
            display: none;
            align-items: center;
            justify-content: center;
            padding: 24px;
            background: rgba(17, 24, 39, 0.45);
            backdrop-filter: blur(4px);
        }

        .dashboard-overlay.active {
            display: flex;
        }

        .dashboard-panel {
            position: relative;
            width: min(1180px, calc(100vw - 48px));
            max-height: min(82vh, 820px);
            background: #fafbfc;
            border-radius: 12px;
            box-shadow: 0 20px 48px rgba(15, 23, 42, 0.18);
            border: 1px solid #dfe4ea;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            animation: dashboardIn 0.24s ease;
        }

        @keyframes dashboardIn {
            from { opacity: 0; transform: translateY(8px) scale(0.99); }
            to { opacity: 1; transform: translateY(0) scale(1); }
        }

        .dashboard-loading {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 10px;
            min-height: 120px;
            padding: 20px 16px;
            text-align: center;
            font-size: 0.82rem;
            color: #5d6d7e;
            background: #fff;
        }

        .dashboard-loading-error {
            min-height: 140px;
        }

        .dashboard-retry-btn {
            margin-top: 4px;
            border: 1px solid #5d6d7e;
            background: white;
            color: #2c3e50;
            border-radius: 8px;
            padding: 8px 14px;
            font-family: inherit;
            font-size: 0.82rem;
            font-weight: 600;
            cursor: pointer;
        }

        .dashboard-retry-btn:hover {
            background: #f4f6f8;
        }

        .dashboard-loading p {
            margin: 0;
        }

        .dashboard-spinner {
            width: 28px;
            height: 28px;
            border: 2px solid #dce4ec;
            border-top-color: #5d6d7e;
            border-radius: 50%;
            animation: dashboardSpin 0.75s linear infinite;
        }

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

        .dashboard-header {
            background: linear-gradient(135deg, #2c3e50 0%, #3d5166 100%);
            color: white;
            padding: 12px 16px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 8px;
            flex-shrink: 0;
        }

        .dashboard-header h2 {
            margin: 0;
            font-size: 0.95rem;
            font-weight: 700;
            letter-spacing: 0.2px;
        }

        .dashboard-subtitle {
            margin: 2px 0 0;
            font-size: 0.68rem;
            opacity: 0.78;
        }

        .dashboard-close {
            background: rgba(255, 255, 255, 0.2);
            border: none;
            color: white;
            width: 26px;
            height: 26px;
            border-radius: 50%;
            cursor: pointer;
            font-size: 1.1rem;
            line-height: 1;
            flex-shrink: 0;
        }

        .dashboard-close:hover {
            background: rgba(255, 255, 255, 0.32);
        }

        .dashboard-content {
            padding: 12px 14px 14px;
            overflow-y: auto;
            overflow-x: hidden;
            flex: 1;
            min-height: 0;
            background: #fafbfc;
        }

        .dashboard-sections {
            display: grid;
            grid-template-columns: repeat(3, minmax(0, 1fr));
            gap: 12px;
        }

        .dash-block {
            background: #fff;
            border: 1px solid #e2e9ef;
            border-radius: 10px;
            padding: 10px 11px 11px;
            min-width: 0;
            box-shadow: 0 1px 4px rgba(15, 23, 42, 0.05);
        }

        .dash-block-title {
            margin: 0 0 8px;
            padding-bottom: 6px;
            border-bottom: 1px solid #eef3f6;
            font-size: 0.72rem;
            font-weight: 700;
            letter-spacing: 0.03em;
            text-transform: uppercase;
            color: #16A085;
            display: flex;
            align-items: baseline;
            justify-content: space-between;
            gap: 8px;
        }

        .dash-block-vintage {
            font-size: 0.58rem;
            font-weight: 500;
            letter-spacing: 0;
            text-transform: none;
            color: #94a3b8;
            white-space: nowrap;
        }

        .dash-tiles {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
            gap: 7px;
        }

        .dash-tile {
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            justify-content: flex-start;
            gap: 2px;
            min-height: 58px;
            padding: 8px 9px;
            background: #f8fafb;
            border: 1px solid #e8eef3;
            border-radius: 8px;
            text-align: left;
        }

        .dash-tile-full {
            grid-column: 1 / -1;
        }

        .dash-tile-value {
            font-family: 'JetBrains Mono', monospace;
            font-weight: 700;
            font-size: 0.92rem;
            color: #0f172a;
            line-height: 1.2;
            max-width: 100%;
            font-variant-numeric: tabular-nums;
        }

        .dash-tile-full .dash-tile-value {
            font-size: 0.84rem;
        }

        .dash-tile-meta {
            line-height: 1;
        }

        .dash-tile-unit {
            font-family: inherit;
            font-size: 0.58rem;
            font-weight: 600;
            letter-spacing: 0.04em;
            text-transform: uppercase;
            color: #64748b;
        }

        .dash-tile-unit-inline {
            margin-left: 2px;
            font-size: 0.72rem;
        }

        .dash-tile-label {
            font-size: 0.66rem;
            font-weight: 600;
            color: #475569;
            line-height: 1.25;
            margin-top: 2px;
        }

        .dash-tile-hint {
            font-size: 0.58rem;
            font-weight: 500;
            color: #94a3b8;
            line-height: 1.2;
        }

        .dash-tile-detail {
            font-size: 0.58rem;
            font-weight: 500;
            color: #64748b;
            line-height: 1.2;
        }

        @media (max-width: 900px) {
            .dashboard-sections {
                grid-template-columns: repeat(2, minmax(0, 1fr));
            }
        }

        @media (max-width: 520px) {
            .dashboard-sections {
                grid-template-columns: 1fr;
            }

            .dashboard-panel {
                top: 78px;
                left: 8px;
                right: 8px;
                max-height: calc(100% - 88px);
            }

            .dash-tiles {
                grid-template-columns: repeat(auto-fit, minmax(76px, 1fr));
            }
        }

        .quality-metric {
            background: #f8f9fa;
            border-radius: 8px;
            padding: 15px;
            margin-bottom: 15px;
            border-left: 4px solid #3498DB;
        }

        .quality-metric-title {
            font-weight: 600;
            color: #2C3E50;
            margin-bottom: 8px;
            font-size: 0.9rem;
        }

        .quality-metric-value {
            font-family: 'JetBrains Mono', monospace;
            font-size: 1.5rem;
            font-weight: 700;
            color: #3498DB;
            margin-bottom: 5px;
        }

        .quality-metric-desc {
            font-size: 0.8rem;
            color: #666;
            line-height: 1.4;
        }

        .quality-status {
            display: inline-block;
            padding: 4px 12px;
            border-radius: 20px;
            font-size: 0.75rem;
            font-weight: 600;
            margin-top: 8px;
        }

        .quality-status.good { background: #d4edda; color: #155724; }
        .quality-status.warning { background: #fff3cd; color: #856404; }
        .quality-status.error { background: #f8d7da; color: #721c24; }

        .quality-list {
            list-style: none;
            padding: 0;
            margin: 10px 0 0 0;
        }

        .quality-list li {
            padding: 6px 0;
            font-size: 0.85rem;
            color: #555;
            border-bottom: 1px solid #e9ecef;
        }

        .quality-list li:last-child {
            border-bottom: none;
        }

        .quality-link {
            color: #3498DB;
            text-decoration: none;
            font-weight: 500;
        }

        .quality-link:hover {
            text-decoration: underline;
        }


        .route-popup {
            font-family: 'DM Sans', sans-serif;
            max-width: 350px;
            max-height: 420px;
            overflow-y: auto;
        }

        .route-popup h3 {
            margin: 0 0 12px 0;
            color: var(--primary);
            font-size: 1.2rem;
            padding-bottom: 8px;
            border-bottom: 2px solid #3498DB;
        }

        .route-popup .detail {
            margin: 6px 0;
            font-size: 0.9rem;
            color: var(--text-light);
            line-height: 1.5;
        }

        .route-popup .detail strong {
            color: var(--text-dark);
        }
        
        .route-popup a {
            transition: all 0.2s ease;
        }
        
        .route-popup a:hover {
            transform: translateX(3px);
            opacity: 0.8;
        }

        .bridge-popup {
            max-width: 380px;
        }

        .bridge-photo-popup-img,
        .bridge-photo-popup-placeholder {
            width: 100%;
            aspect-ratio: 16 / 9;
            display: flex;
            align-items: center;
            justify-content: center;
            object-fit: cover;
            border-radius: 6px;
            background: #eef2f5;
            color: #2C3E50;
            font-weight: 700;
            margin-bottom: 8px;
        }

        .controls {
            position: absolute;
            top: 20px;
            right: 20px;
            z-index: 1000;
            display: flex;
            gap: 10px;
        }

        .control-btn {
            background: white;
            border: none;
            padding: 12px 20px;
            border-radius: 8px;
            cursor: pointer;
            font-family: 'DM Sans', sans-serif;
            font-weight: 600;
            font-size: 0.85rem;
            box-shadow: 0 4px 12px var(--shadow);
            transition: all 0.3s ease;
        }

        .control-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 16px var(--shadow);
        }

        @keyframes fadeIn {
            from {
                opacity: 0;
                transform: translateY(20px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .legend-item {
            animation: fadeIn 0.5s ease backwards;
        }

        .legend-item:nth-child(1) { animation-delay: 0.1s; }
        .legend-item:nth-child(2) { animation-delay: 0.2s; }
        .legend-item:nth-child(3) { animation-delay: 0.3s; }
        .legend-item:nth-child(4) { animation-delay: 0.4s; }

        /* Neutral attribution: hide Leaflet's default Ukraine support marker if present */
        .leaflet-control-attribution a[href*="support-ukraine"],
        .leaflet-control-attribution .leaflet-attribution-flag {
            display: none !important;
        }

        .leaflet-popup-content-wrapper {
            border-radius: 12px;
            padding: 8px;
        }

        .leaflet-popup-tip {
            background: white;
        }

        /* Route labels */
        .route-label-container {
            transform: translate(-50%, -50%);
        }

        .route-label {
            background: rgba(255, 255, 255, 0.95);
            border: 2px solid;
            border-radius: 6px;
            padding: 3px 8px;
            font-family: 'JetBrains Mono', monospace;
            font-weight: 700;
            font-size: 11px;
            white-space: nowrap;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
            pointer-events: none;
            text-align: center;
            transform-origin: center center;
            transition: opacity 0.12s ease-out;
        }

        .route-label-cluster {
            display: flex;
            flex-direction: column;
            gap: 2px;
            align-items: stretch;
            pointer-events: auto;
            cursor: pointer;
        }

        .route-label-cluster .route-label {
            pointer-events: none;
        }

        .route-label-cluster-badge {
            background: rgba(44, 62, 80, 0.92);
            color: #fff;
            border: 2px solid #2C3E50;
            border-radius: 6px;
            padding: 3px 8px;
            font-family: 'JetBrains Mono', monospace;
            font-weight: 700;
            font-size: 11px;
            white-space: nowrap;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
            text-align: center;
        }

        .route-label.regional {
            border-color: #E74C3C;
            color: #E74C3C;
        }

        .route-label.territorial {
            border-color: #F39C12;
            color: #F39C12;
        }

        .route-label.local {
            border-color: #3498DB;
            color: #3498DB;
        }

        /* Custom scrollbar */
        .sidebar-scroll::-webkit-scrollbar {
            width: 8px;
        }

        .sidebar-scroll::-webkit-scrollbar-track {
            background: #e0e0e0;
            border-radius: 4px;
        }

        .sidebar-scroll::-webkit-scrollbar-thumb {
            background: #999;
            border-radius: 4px;
        }

        .sidebar-scroll::-webkit-scrollbar-thumb:hover {
            background: #666;
        }

        /* Scrollbar pour la liste des routes */
        #road-list::-webkit-scrollbar {
            width: 6px;
        }

        #road-list::-webkit-scrollbar-track {
            background: #f0f0f0;
            border-radius: 3px;
        }

        #road-list::-webkit-scrollbar-thumb {
            background: #ccc;
            border-radius: 3px;
        }

        #road-list::-webkit-scrollbar-thumb:hover {
            background: #999;
        }

        /* Items de la liste des routes */
        .road-item {
            padding: 10px 12px;
            border-bottom: 1px solid #f0f0f0;
            cursor: pointer;
            transition: all 0.2s ease;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .road-item:last-child {
            border-bottom: none;
        }

        .road-item:hover {
            background: #f8f9fa;
        }

        .road-item.active {
            background: #e8f4f8;
            border-left: 3px solid #3498DB;
        }

        .road-badge {
            font-family: 'JetBrains Mono', monospace;
            font-weight: 700;
            font-size: 0.85rem;
            padding: 4px 8px;
            border-radius: 4px;
            min-width: 50px;
            text-align: center;
        }

        .road-badge.regional {
            background: #E74C3C;
            color: white;
        }

        .road-badge.territorial {
            background: #F39C12;
            color: white;
        }

        .road-badge.local {
            background: #3498DB;
            color: white;
        }

        .road-name {
            flex: 1;
            font-size: 0.85rem;
            color: #666;
        }

        /* Panneau d'informations de route */
        .road-info-title {
            font-family: 'JetBrains Mono', monospace;
            font-weight: 700;
            font-size: 1.2rem;
            color: #2C3E50;
            margin-bottom: 15px;
            padding-bottom: 10px;
            border-bottom: 2px solid #dfe6e9;
        }

        .road-info-item {
            display: flex;
            justify-content: space-between;
            padding: 8px 0;
            border-bottom: 1px solid #f0f0f0;
            font-size: 0.85rem;
        }

        .road-info-item:last-child {
            border-bottom: none;
        }

        .road-info-label {
            color: #666;
            font-weight: 500;
        }

        .road-info-value {
            color: #2C3E50;
            font-weight: 600;
            text-align: right;
            font-family: 'JetBrains Mono', monospace;
        }

        .road-info-badge {
            display: inline-block;
            padding: 3px 8px;
            border-radius: 4px;
            font-size: 0.75rem;
            font-weight: 600;
            margin-top: 5px;
        }

        /* Style pour les liens de communes */
        .commune-link:hover {
            color: #2C3E50 !important;
            text-decoration: underline !important;
        }

        /* Marqueur de commune temporaire */
        .commune-marker {
            animation: fadeInScale 0.3s ease;
        }

        @keyframes fadeInScale {
            from {
                opacity: 0;
                transform: scale(0.8);
            }
            to {
                opacity: 1;
                transform: scale(1);
            }
        }

        /* Layer / family visibility eye icon */
        .toggle-icon {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border-radius: 6px;
            border: 1px solid transparent;
            background: transparent;
            color: #2C3E50;
            transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease, transform 0.18s ease, opacity 0.18s ease;
            flex-shrink: 0;
            line-height: 0;
        }

        .toggle-icon .eye-glyph {
            display: block;
        }

        .layer-toggle-icon {
            width: 24px;
            height: 24px;
            cursor: pointer;
            color: #7f8c8d;
        }

        .layer-toggle-icon .eye-glyph {
            width: 15px;
            height: 15px;
        }

        .legend-family-vis {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            flex-shrink: 0;
            margin: 0;
            padding: 2px 6px 2px 3px;
            border: 1px solid #e8ecef;
            border-radius: 5px;
            background: #fafbfc;
            cursor: pointer;
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.6rem;
            font-weight: 500;
            color: #95a5a6;
            line-height: 1;
            -webkit-appearance: none;
            appearance: none;
            transition: background 0.15s ease, border-color 0.15s ease;
        }

        .legend-family-vis:hover {
            background: #f4f6f8;
            border-color: #d5dce3;
        }

        .family-eye-icon {
            width: 20px;
            height: 20px;
            flex-shrink: 0;
            color: #7f8c8d;
        }

        .family-eye-icon .eye-glyph {
            width: 14px;
            height: 14px;
        }

        .family-vis-count {
            display: inline-flex;
            align-items: baseline;
            gap: 0;
            min-width: 2.2em;
            letter-spacing: 0;
        }

        .family-vis-count strong {
            color: #2C3E50;
            font-weight: 700;
        }

        .family-vis-sep {
            opacity: 0.45;
            margin: 0 1px;
        }

        .legend-family-vis:has(.family-eye-icon.is-hidden) .family-vis-count strong {
            color: #95a5a6;
        }

        .toggle-icon.is-open {
            color: #4a5568;
        }

        .toggle-icon.is-partial {
            color: #7f8c8d;
        }

        .toggle-icon.is-hidden {
            color: #8a96a3;
        }

        .legend-title:hover .layer-toggle-icon,
        .family-eye-icon:hover {
            color: #5b6770;
        }

        .legend-family-vis:focus-visible,
        .layer-toggle-icon:focus-visible {
            outline: 2px solid rgba(44, 62, 80, 0.3);
            outline-offset: 1px;
        }

        .freshness-badge.is-layer-hidden .freshness-pill {
            color: #bdc3c7;
            background: #f0f1f2;
            border-color: rgba(44, 62, 80, 0.18);
        }

        .freshness-badge.is-layer-hidden .freshness-dot {
            background: #bdc3c7;
        }

        /* Freshness badge (integration date + next refresh) */
        .freshness-badge {
            margin: 2px 0 8px 0;
            line-height: 1;
            max-width: 100%;
        }

        .freshness-pill {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            max-width: 100%;
            flex-wrap: wrap;
            padding: 3px 9px;
            border-radius: 11px;
            border: 1px solid rgba(44, 62, 80, 0.32);
            background: #f3f4f5;
            color: #5b6770;
            font-size: 0.65rem;
            font-weight: 600;
            font-family: 'JetBrains Mono', monospace;
            line-height: 1.4;
            cursor: help;
        }

        .freshness-dot {
            width: 5px;
            height: 5px;
            border-radius: 50%;
            display: inline-block;
            flex-shrink: 0;
            background: #95a5a6;
        }

        .freshness-pill--stale .freshness-dot,
        .freshness-pill--late .freshness-dot {
            background: #7f8c8d;
        }

        .freshness-pill--stale {
            border-color: rgba(44, 62, 80, 0.48);
        }

        .freshness-pill--error {
            border-color: rgba(44, 62, 80, 0.55);
        }

        .freshness-error-icon {
            margin-left: 2px;
            font-size: 0.6rem;
            opacity: 0.75;
        }

        /* "Refresh schedule" panel */
        .refresh-formula {
            display: grid;
            gap: 8px;
        }

        .refresh-formula-row {
            display: flex;
            flex-direction: column;
            align-items: stretch;
            gap: 6px;
            padding: 8px 10px;
            background: white;
            border: 1px solid #e6edef;
            border-left: 3px solid #95A5A6;
            border-radius: 6px;
            font-size: 0.78rem;
            min-width: 0;
        }

        .refresh-formula-row[data-schedule-key="osm"]      { border-left-color: #3498DB; }
        .refresh-formula-row[data-schedule-key="external"] { border-left-color: #F39C12; }
        .refresh-formula-row[data-schedule-key="incubator"] { border-left-color: #0E7490; }
        .refresh-formula-row[data-schedule-key="live"]     { border-left-color: #27AE60; }
        .refresh-formula-row[data-schedule-key="static"]   { border-left-color: #7f8c8d; }

        .refresh-formula-row .refresh-formula-label {
            font-weight: 700;
            color: #2C3E50;
            min-width: 0;
            overflow-wrap: anywhere;
        }

        .refresh-formula-row .refresh-formula-meta {
            color: #5b6770;
            text-align: left;
            line-height: 1.45;
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.7rem;
            min-width: 0;
            overflow-wrap: anywhere;
        }

        /* Wikidata infobox in route popup (read-only, auto-loaded) */
        .route-popup .popup-infobox-section {
            margin-top: 12px;
            padding-top: 12px;
            border-top: 2px solid #ecf0f1;
        }

        .route-popup .popup-infobox-title {
            font-size: 0.68rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.6px;
            color: #7f8c8d;
            margin-bottom: 8px;
            user-select: none;
            pointer-events: none;
        }

        .popup-infobox-loading,
        .popup-infobox-host .infobox-error {
            padding: 12px;
            text-align: center;
            color: #7f8c8d;
            font-size: 0.78rem;
        }

        .popup-infobox-host .infobox-error {
            color: #E74C3C;
        }

        .wikidata-infobox {
            background: #fdfefe;
            border: 1px solid #ecf0f1;
            border-radius: 6px;
            padding: 10px 12px;
        }

        .infobox-shield-wrap {
            display: flex;
            justify-content: center;
            margin-bottom: 10px;
        }

        .infobox-shield {
            max-width: 100%;
            max-height: 72px;
            width: auto;
            height: auto;
            object-fit: contain;
            filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.12));
            pointer-events: none;
            user-select: none;
        }

        .infobox-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            gap: 8px;
            margin-bottom: 8px;
        }

        .infobox-header-text {
            flex: 1;
            min-width: 0;
        }

        .infobox-title {
            font-size: 0.95rem;
            font-weight: 700;
            color: #2C3E50;
        }

        .infobox-description {
            font-size: 0.76rem;
            color: #7f8c8d;
            font-style: italic;
            margin-top: 2px;
        }

        .infobox-qid {
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.65rem;
            color: #95A5A6;
            flex-shrink: 0;
            padding: 2px 6px;
            border: 1px solid #ecf0f1;
            border-radius: 4px;
            background: #f8f9fa;
        }

        .infobox-illustration {
            display: block;
            max-width: 100%;
            max-height: 140px;
            object-fit: cover;
            border-radius: 6px;
            margin: 8px auto;
            border: 1px solid #ecf0f1;
            pointer-events: none;
            user-select: none;
        }

        .infobox-extract {
            font-size: 0.76rem;
            line-height: 1.5;
            color: #2c3e50;
            background: #f8f9fa;
            border-left: 3px solid #3498DB;
            padding: 8px 10px;
            border-radius: 4px;
            margin: 8px 0;
        }

        .infobox-table {
            width: 100%;
            font-size: 0.76rem;
            border-collapse: collapse;
        }

        .infobox-prop-label {
            padding: 4px 8px 4px 0;
            font-weight: 600;
            color: #5b6770;
            vertical-align: top;
            white-space: nowrap;
        }

        .infobox-prop-value {
            padding: 4px 0;
            color: #2c3e50;
        }

        .infobox-empty {
            font-size: 0.76rem;
            color: #95A5A6;
            font-style: italic;
        }

        .infobox-source {
            margin-top: 10px;
            padding-top: 8px;
            border-top: 1px solid #ecf0f1;
            font-size: 0.65rem;
            color: #bdc3c7;
            text-align: right;
        }

        /* Pictogrammes de vitesse type panneau rond */
        .speed-picto-wrapper,
        .restriction-picto-wrapper {
            background: transparent !important;
            border: none !important;
        }

        .speed-picto {
            background: white;
            border: 2.5px solid #C0392B;
            border-radius: 50%;
            width: 22px;
            height: 22px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-family: 'JetBrains Mono', monospace;
            font-weight: 700;
            font-size: 0.62rem;
            color: #2C3E50;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
        }

        /* Pictogrammes de restriction (hauteur/poids/longueur/largeur) */
        .restriction-picto {
            background: white;
            border: 2px solid #2C3E50;
            border-radius: 6px;
            height: 22px;
            padding: 0 5px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 3px;
            font-family: 'JetBrains Mono', monospace;
            font-weight: 700;
            font-size: 0.6rem;
            color: #2C3E50;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
            white-space: nowrap;
            width: max-content;
        }

        .restriction-picto-icon {
            font-size: 0.75rem;
            line-height: 1;
        }

        /* Dynamic restrictions legend in sidebar */
        .limitations-legend-scale {
            display: grid;
            grid-template-columns: repeat(7, 1fr);
            gap: 2px;
            margin: 6px 0;
            border-radius: 4px;
            overflow: hidden;
        }

        .limitations-legend-step {
            text-align: center;
            font-family: 'JetBrains Mono', monospace;
            font-weight: 700;
            font-size: 0.65rem;
            padding: 4px 2px;
            color: white;
            text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
        }

        /* === Pied de page === */
        .site-footer {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 16px;
            padding: 10px 20px;
            border-top: 1px solid var(--border);
            background: #fafbfc;
            font-size: 0.62rem;
            line-height: 1.45;
            color: #95a5a6;
        }

        .site-footer-credit {
            flex: 1;
            min-width: 0;
            margin: 0;
        }

        .site-footer-credit a {
            color: #7f8c8d;
            font-weight: 500;
            text-decoration: none;
            transition: color 0.18s;
        }

        .site-footer-credit a:hover {
            color: #3498DB;
            text-decoration: underline;
        }

        .site-footer-repo-box {
            flex-shrink: 0;
            display: inline-flex;
            align-items: center;
            gap: 8px;
            border: 1px solid var(--border);
            border-radius: 6px;
            padding: 4px 10px;
            background: white;
            font-size: 0.6rem;
            line-height: 1.2;
        }

        .site-footer-repo-box a {
            color: #95a5a6;
            font-family: 'JetBrains Mono', monospace;
            font-weight: 500;
            text-decoration: none;
            transition: color 0.18s;
        }

        .site-footer-repo-box a:hover {
            color: #3498DB;
        }

        .site-footer-version {
            color: #bdc3c7;
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.58rem;
            white-space: nowrap;
        }

        .site-footer-version::before {
            content: '·';
            margin-right: 8px;
            opacity: 0.7;
        }

        @media (max-width: 720px) {
            .site-footer {
                flex-direction: column;
                align-items: flex-start;
            }
        }

        /* === "Network Information" tiles === */
        .network-stats {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 6px;
            padding: 10px;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            border-radius: 10px;
            box-shadow: 0 4px 12px rgba(102, 126, 234, 0.18);
        }

        .network-tile {
            background: rgba(255, 255, 255, 0.96);
            border: 1px solid rgba(255, 255, 255, 0.5);
            border-radius: 6px;
            padding: 8px 10px;
            text-align: center;
            backdrop-filter: blur(4px);
        }

        .network-tile-wide {
            grid-column: 1 / -1;
        }

        .network-tile-value {
            font-family: 'JetBrains Mono', monospace;
            font-weight: 700;
            font-size: 1.05rem;
            color: #2C3E50;
            line-height: 1.15;
        }

        .network-tile-label {
            font-size: 0.65rem;
            color: #7f8c8d;
            text-transform: uppercase;
            letter-spacing: 0.4px;
            margin-top: 3px;
        }

        /* === Familles de sections de la sidebar === */
        .legend-family {
            margin: 0 0 12px 0;
            border-radius: 6px;
            border: 1px solid #e8ecef;
            border-left: 2px solid var(--family-accent, #c5cdd4);
            background: #fff;
            overflow: hidden;
            min-width: 0;
        }

        .legend-family[data-family="factual"]  { --family-accent: #8b95a1; }
        .legend-family[data-family="stats"]    { --family-accent: #9a8fa8; }
        .legend-family[data-family="realtime"] { --family-accent: #b39a84; }
        .legend-family[data-family="incubator"] { --family-accent: #7a9da8; }
        .legend-family[data-family="tools"]    { --family-accent: #7fa89f; }

        .legend-family-header {
            display: flex;
            align-items: center;
            gap: 2px;
            width: 100%;
        }

        .legend-family-expand,
        .legend-family-chevron-btn {
            display: inline-flex;
            align-items: center;
            border: none;
            background: transparent;
            cursor: pointer;
            font-family: inherit;
            text-transform: none;
            font-size: 0.78rem;
            letter-spacing: 0.01em;
            font-weight: 600;
            color: #4a5568;
            text-align: left;
            transition: background 0.15s;
        }

        .legend-family-expand {
            display: flex;
            align-items: center;
            gap: 7px;
            flex: 1;
            min-width: 0;
            padding: 9px 0 9px 10px;
        }

        .legend-family-chevron-btn {
            padding: 9px 10px 9px 4px;
            flex-shrink: 0;
        }

        .legend-family-expand:hover,
        .legend-family-chevron-btn:hover {
            background: #f8f9fa;
        }

        .legend-family-icon {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 18px;
            height: 18px;
            flex-shrink: 0;
            opacity: 0.72;
        }

        .legend-family-icon svg {
            width: 15px;
            height: 15px;
            stroke: #7f8c8d;
            display: block;
        }

        .legend-family-label {
            flex: 1;
            min-width: 0;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }


        .legend-family-chevron {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 16px;
            height: 16px;
            transition: transform 0.2s ease;
            color: #95a5a6;
            flex-shrink: 0;
        }

        .legend-family-chevron svg {
            width: 12px;
            height: 12px;
            stroke: currentColor;
        }

        .legend-family[data-expanded="false"] .legend-family-chevron {
            transform: rotate(-90deg);
        }

        .legend-family[data-expanded="false"] .legend-family-body {
            display: none;
        }

        .legend-family-body {
            padding: 4px 8px 10px;
            background: #f8f9fa;
            border-top: 1px solid #e8ecef;
        }

        .legend-family-body .legend-section {
            margin: 0 0 8px 0;
            padding: 10px 8px 8px;
            background: #fff;
            border: 1px solid #e8ecef;
            border-radius: 5px;
        }

        .legend-family-body .legend-section:last-child {
            margin-bottom: 0;
        }

        .legend-family-body .legend-section .legend-title {
            padding-bottom: 6px;
            margin-bottom: 6px;
            border-bottom: 1px solid #f0f2f4;
        }

        /* La section dynamique Limitations cache son margin auto historique quand elle est dans une famille */
        .legend-family-body .legend-section[style*="display:none"] {
            margin: 0;
        }
    
