:root {
            --bg-primary: #0a0c10;
            --bg-secondary: #13161c;
            --bg-card: #1a1e26;
            --bg-elevated: #242a35;
            --text-primary: #f5f7fa;
            --text-secondary: #9ca3af;
            --text-muted: #6b7280;
            --accent-gold: #f59e0b;
            --accent-gold-light: #fbbf24;
            --accent-blue: #3b82f6;
            --accent-blue-light: #60a5fa;
            --accent-purple: #8b5cf6;
            --accent-purple-light: #a78bfa;
            --accent-green: #10b981;
            --accent-green-light: #34d399;
            --accent-red: #ef4444;
            --border-subtle: rgba(255,255,255,0.08);
            --border-hover: rgba(255,255,255,0.15);
            --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
            --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
            --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
        }
        
        * {
            box-sizing: border-box;    
            font-style: normal;
            font-weight: normal;
            margin: 0;
            padding: 0;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
        }
        
        body {
            font-family: 'DM Sans', sans-serif;
            background: #f1f0ea;
            color: var(--text-primary);
            min-height: 100vh;
            overflow: hidden;
        }

        @font-face {
            font-family: 'Tungsten';
            src: url('../fonts/Tungsten-SemiBold.woff2') format('woff2'),
                url('../fonts/Tungsten-SemiBold.woff') format('woff');
            font-display: swap;
        }
        
        /* ==================== HEADER ==================== */
        .header {
            position: fixed;
            top: 0;
            right: 0;
            z-index: 100;
            padding: 1rem 2rem;
            background-color: transparent;
            display: flex;
            align-items: center;
            justify-content: end;
            width: 25%;
            right: 0;
            justify-content: flex-start;
        }
        
        .header-left h1 {
            font-family: 'Playfair Display', serif;
            font-size: 1.5rem;
            font-weight: 700;
            letter-spacing: -0.02em;
            background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-gold-light) 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }
        
        .header-left p {
            font-size: 0.8rem;
            color: var(--text-secondary);
            margin-top: 0.2rem;
        }
        
        .header-right {
            display: flex;
            align-items: center;
            gap: 1rem;
            width: 100%;
        }
        
        /* ==================== SEARCH ==================== */
        .search-wrapper {
            position: relative;
        }
        
        .search-input {
            width: 100%;
            padding: 0.6rem 1rem 0.6rem 2.5rem;
            background: #fff;
            border: 1px solid var(--border-subtle);
            border-radius: 8px;
            color: #000;
            font-size: 0.85rem;
            font-family: inherit;
            outline: none;
            transition: all 0.2s ease;
        }
        
        .search-input:focus {
            border-color: var(--accent-gold);
            box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
        }
        
        .search-input::placeholder {
            color: var(--text-muted);
        }
        
        .search-icon {
            position: absolute;
            left: 0.8rem;
            top: 50%;
            transform: translateY(-50%);
            color: var(--text-muted);
            pointer-events: none;
        }

        .filter-btns {
            display: flex;
            flex-direction: row;
            gap: 0.4rem;
            position: fixed;
            top: 1rem;
            left: 1rem;
            z-index: 100;
        }

        .filter-btn {
            padding: 0.45rem 0.6rem;
            background: #ffdf00;
            border: 1px solid var(--border-subtle);
            border-radius: 8px;
            color: #000;
            font-size: 0.8rem;
            font-family: inherit;
            line-height: 1.3;
            text-align: left;
            cursor: pointer;
            transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
            width: 32%;
        }

        .filter-btn:hover {
            background-color: #000;
            border-color: #000;
            color: #ffdf00;
        }

        .filter-btn.active {
            background: #000;
            border-color: #000;
            color: #ffdf00;
            font-weight: 600;
        }
        
        /* contain: layout style → el browser no necesita recalcular layout fuera del SVG
           cuando cambian nodos internos (animaciones de expand/collapse) */
        #network-container {
            width: 100vw;
            height: 100vh;
            cursor: grab;
            contain: layout style;
            background: 
                radial-gradient(ellipse at 20% 80%, rgba(59, 130, 246, 0.05) 0%, transparent 50%),
                radial-gradient(ellipse at 80% 20%, rgba(139, 92, 246, 0.05) 0%, transparent 50%),
                radial-gradient(ellipse at 50% 50%, rgba(245, 158, 11, 0.02) 0%, transparent 70%);
        }
        
        #network-container:active {
            cursor: grabbing;
        }
        
        /* ==================== NODES ==================== */
        .node {
            cursor: pointer;
            transition: opacity 0.4s ease;
        }
        
        .node:hover .node-circle,
        .node:hover .node-shape {
            opacity: 0.82;
        }
        
        .node-ring {
            fill: none;
            stroke-width: 2px;
            opacity: 0;
            transition: opacity 0.3s ease, stroke 0.3s ease;
        }
        
        .node-circle,
        .node-shape {
            stroke: none;
            transition: opacity 0.3s ease;
        }
        
        /* Congresista - Círculo con borde gris */
        .node-congressperson .node-circle {
            fill: var(--bg-card);
            stroke: #9ca3af;
            stroke-width: 3px;
        }
        .node-congressperson .node-ring {
            stroke: #9ca3af;
            opacity: 0;
        }
        
        /* Familiar - Hexágono sin borde */
        .node-familiar .node-hexagon {
            fill: var(--accent-blue);
            stroke: none;
        }
        .node-familiar .node-ring {
            stroke: var(--accent-blue);
            stroke-width: 2px;
            opacity: 0;
        }
        .node-familiar:hover .node-hexagon {
            opacity: 0.82;
        }
        
        /* Entidad - Rombo/Diamante sin borde */
        .node-entity .node-diamond {
            fill: var(--accent-purple);
            stroke: none;
        }
        .node-entity .node-ring {
            stroke: var(--accent-purple);
            stroke-width: 2px;
            opacity: 0;
        }
        .node-entity:hover .node-diamond {
            opacity: 0.82;
        }
        
        /* Contrato - Cuadrado redondeado sin borde */
        .node-contract .node-square {
            fill: var(--accent-green);
            stroke: none;
        }
        .node-contract .node-ring {
            stroke: var(--accent-green);
            stroke-width: 2px;
            opacity: 0;
        }
        .node-contract:hover .node-square {
            opacity: 0.82;
        }
        
        /* Ícono SVG dentro de nodos */
        .node-svg-icon {
            pointer-events: none;
        }
        
        /* Estados */
        .node.highlighted .node-circle,
        .node.highlighted .node-shape {
            opacity: 0.9;
        }
        
        .node.highlighted .node-ring {
            opacity: 0.6;
        }
        
        .node.dimmed {
            opacity: 0.08;
        }
        
        .node-label {
            font-size: 10px;
            font-weight: 600;
            fill: #4a4a4a;
            text-anchor: middle;
            pointer-events: none;
        }
        
        .node-sublabel {
            font-size: 8px;
            font-weight: 400;
            fill: #4a4a4a;
            text-anchor: middle;
            pointer-events: none;
        }
        
        .node-icon {
            fill: var(--text-primary);
            pointer-events: none;
        }
        
        /* ==================== LINKS ==================== */
        .link {
            fill: none;
            stroke-linecap: round;
            transition: opacity 0.4s ease, stroke-opacity 0.4s ease;
        }
        
        .link.highlighted {
            stroke-width: 3px !important;
        }
        
        .link.dimmed {
            stroke-opacity: 0.03;
        }
        
        .link-congressperson-familiar {
            stroke: #9ca3af;
            stroke-width: 2px;
            stroke-opacity: 0.7;
        }
        
        .link-familiar-contract {
            stroke: var(--accent-blue);
            stroke-width: 2px;
            stroke-opacity: 0.6;
            stroke-dasharray: 6 4;
        }
        
        .link-contract-entity {
            stroke: var(--accent-green);
            stroke-width: 2px;
            stroke-opacity: 0.7;
        }

        .link-congressperson-contract {
            stroke: #9ca3af;
            stroke-width: 2px;
            stroke-opacity: 0.7;
        }
        
        /* ==================== TOOLTIP ==================== */
        .tooltip {
            position: fixed;
            background: #2d3748;
            border: none;
            border-radius: 12px;
            padding: 1.25rem 1.5rem;
            min-width: 280px;
            max-width: 360px;
            pointer-events: none;
            opacity: 0;
            transform: translateY(5px);
            transition: opacity 0.2s ease, transform 0.2s ease;
            z-index: 1000;
            box-shadow: 0 10px 40px rgba(0,0,0,0.4);
        }
        
        .tooltip.visible {
            opacity: 1;
            transform: translateY(0);
        }
        
        .tooltip-type {
            display: inline-block;
            font-size: 0.7rem;
            text-transform: uppercase;
            letter-spacing: 0.1em;
            font-weight: 700;
            padding: 0.35rem 0.75rem;
            border-radius: 4px;
            margin-bottom: 0.75rem;
        }
        
        .tooltip-type.congressperson { 
            background: var(--accent-gold); 
            color: #1a1a1a; 
        }
        .tooltip-type.familiar { 
            background: var(--accent-blue); 
            color: #fff; 
        }
        .tooltip-type.entity { 
            background: var(--accent-purple); 
            color: #fff; 
        }
        .tooltip-type.contract { 
            background: var(--accent-green); 
            color: #1a1a1a; 
        }
        
        .tooltip-title {
            font-family: 'Tungsten';
            font-size: 1.4rem;
            font-weight: 700;
            color: #fff;
            margin-bottom: 1rem;
            line-height: 1.3;
        }
        
        .tooltip-grid {
            display: flex;
            flex-direction: column;
            gap: 0.6rem;
        }
        
        .tooltip-row {
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            gap: 0.15rem;
        }
        
        .tooltip-key {
            color: var(--accent-gold);
            font-size: 0.75rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.04em;
            flex-shrink: 0;
        }
        
        .tooltip-value {
            color: #fff;
            font-weight: 400;
            font-size: 0.85rem;
            text-align: left;
            line-height: 1.4;
        }
        
        .tooltip-value.highlight {
            color: var(--accent-gold);
            font-weight: 700;
        }
        
        .tooltip-action {
            display: inline-flex;
            align-items: center;
            gap: 0.4rem;
            margin-top: 0.75rem;
            padding: 0.5rem 0.9rem;
            background: var(--accent-green);
            color: var(--bg-primary);
            text-decoration: none;
            border-radius: 6px;
            font-size: 0.7rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            transition: all 0.2s ease;
        }
        
        .tooltip-action:hover {
            background: var(--accent-green-light);
        }
        
        /* ==================== SIDEBAR ==================== */
        .sidebar {
            display: none !important;

            position: fixed;
            right: 0;
            top: 0;
            bottom: 0;
            width: 320px;
            background: var(--bg-secondary);
            border-left: 1px solid var(--border-subtle);
            padding: 5rem 1.5rem 1.5rem;
            transform: translateX(100%);
            transition: transform 0.3s ease;
            z-index: 999999;
            overflow-y: auto;
        }
        
        .sidebar.visible {
            transform: translateX(0);
        }
        
        .sidebar-close {
            position: absolute;
            top: 1rem;
            right: 1rem;
            width: 32px;
            height: 32px;
            background: var(--bg-card);
            border: 1px solid var(--border-subtle);
            border-radius: 6px;
            color: var(--text-secondary);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s ease;
        }
        
        .sidebar-close:hover {
            background: var(--bg-elevated);
            color: var(--text-primary);
        }
        
        .sidebar-header {
            margin-bottom: 1.5rem;
        }
        
        .sidebar-badge {
            display: inline-block;
            font-size: 0.65rem;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            font-weight: 600;
            padding: 0.25rem 0.6rem;
            border-radius: 4px;
            margin-bottom: 0.5rem;
        }
        
        .sidebar-title {
            font-family: 'Playfair Display', serif;
            font-size: 1.4rem;
            font-weight: 700;
            margin-bottom: 0.25rem;
        }
        
        .sidebar-subtitle {
            font-size: 0.85rem;
            color: var(--text-secondary);
        }
        
        .sidebar-section {
            margin-bottom: 1.5rem;
        }
        
        .sidebar-section-title {
            font-size: 0.7rem;
            text-transform: uppercase;
            letter-spacing: 0.1em;
            color: var(--text-muted);
            margin-bottom: 0.75rem;
            font-weight: 600;
        }
        
        .sidebar-stat {
            display: flex;
            justify-content: space-between;
            padding: 0.6rem 0;
            border-bottom: 1px solid var(--border-subtle);
        }
        
        .sidebar-stat:last-child {
            border-bottom: none;
        }
        
        .sidebar-stat-value {
            font-weight: 700;
            color: var(--accent-gold);
        }
        
        .sidebar-connections {
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }
        
        .sidebar-connection {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            padding: 0.6rem 0.75rem;
            background: var(--bg-card);
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.2s ease;
        }
        
        .sidebar-connection:hover {
            background: var(--bg-elevated);
        }
        
        .sidebar-connection-icon {
            width: 28px;
            height: 28px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.9rem;
        }
        
        .sidebar-connection-info {
            flex: 1;
            min-width: 0;
        }
        
        .sidebar-connection-name {
            font-size: 0.8rem;
            font-weight: 600;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        
        .sidebar-connection-type {
            font-size: 0.7rem;
            color: var(--text-muted);
        }
        
        /* ==================== LEGEND ==================== */
        .legend {
            position: fixed;
            bottom: 5.5rem;
            left: 50%;
            transform: translateX(-50%);
            display: flex;
            flex-wrap: wrap;
            gap: 1rem;
            background: #fff;
            padding: 0.75rem 1.25rem;
            border-radius: 0;
            border: 1px solid var(--border-subtle);
            z-index: 50;
            white-space: nowrap;
        }
        
        .legend-item {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-size: 0.75rem;
            color: #000;
        }
        
        .legend-shape {
            width: 14px;
            height: 14px;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        /* Círculo para congresista */
        .legend-shape.congressperson {
            width: 12px;
            height: 12px;
            border-radius: 50%;
            background: #4b4b4b;
        }
        
        /* Hexágono para familiar */
        .legend-shape.familiar {
            width: 14px;
            height: 14px;
            background: var(--accent-blue);
            clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
        }
        
        /* Rombo para entidad */
        .legend-shape.entity {
            width: 12px;
            height: 12px;
            background: var(--accent-purple);
            transform: rotate(45deg);
        }
        
        /* Cuadrado redondeado para contrato */
        .legend-shape.contract {
            width: 11px;
            height: 11px;
            background: var(--accent-green);
            border-radius: 3px;
        }
        
        /* Mantener soporte legacy para legend-dot */
        .legend-dot {
            width: 10px;
            height: 10px;
            border-radius: 50%;
        }
        
        .legend-dot.congressperson { background: var(--accent-gold); }
        .legend-dot.familiar { background: var(--accent-blue); }
        .legend-dot.entity { background: var(--accent-purple); }
        .legend-dot.contract { background: var(--accent-green); }
        
        /* ==================== CONTROLS ==================== */
        .controls {
            position: fixed;
            bottom: 1.5rem;
            right: 1.5rem;
            display: flex;
            gap: 0.5rem;
            z-index: 50;
        }
        
        .control-btn {
            width: 36px;
            height: 36px;
            border: 1px solid var(--border-subtle);
            background: var(--bg-card);
            color: var(--text-secondary);
            border-radius: 8px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s ease;
        }
            #reset-view{
                display: none;
            }
        
        .control-btn:hover {
            background: var(--bg-elevated);
            color: var(--text-primary);
            border-color: var(--border-hover);
        }
        
        .control-btn.active {
            background: var(--accent-gold);
            color: var(--bg-primary);
            border-color: var(--accent-gold);
        }
        
        /* ==================== STATS WRAPPER ==================== */
        .stats-wrapper {
            position: fixed;
            bottom: 1.5rem;
            left: 50%;
            transform: translateX(-50%);
            display: flex;
            align-items: center;
            gap: 0.5rem;
            z-index: 50;
            width: 60%;
        }

        /* ==================== STATS BAR ==================== */
        .stats-bar {
            display: flex;
            gap: 0.9rem;
            background: #fff;
            padding: 0.6rem 0.5rem;
            border-radius: 10px;
            border: 1px solid var(--border-subtle);
            margin: 0 auto;
        }
        
        .stat-item {
            text-align: center;
        }
        
        .stat-value {
            font-size: 1.2rem;
            font-weight: 700;
            color: #000;
        }
        
        .stat-label {
            font-size: 0.65rem;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            color: var(--text-muted);
        }
        
        /* ==================== DISCLAIMER BUTTON (obsoleto — oculto) ==================== */
        .disclaimer-btn { display: none; }

        /* ==================== DISCLAIMER MODAL (obsoleto — oculto) ==================== */
        .disclaimer-overlay { display: none !important; }

        /* ==================== DISCLAIMER ACORDEÓN ==================== */
        /* ── Shell de posicionamiento ── */
        .disclaimer-accordion {
            position: fixed;
            bottom: 1.5rem;
            left: 1.5rem;
            width: 300px;
            /*background: rgba(19, 19, 19, 0.75);*/
            border-radius: 12px;
            z-index: 200;
            overflow: hidden;
            /*transition: box-shadow 0.2s ease;*/
        }

        /* ── Enlace "VER OTROS DESCARGOS" — sobre el card ── */
        .disclaimer-ver-mas {
            display: none;          /* oculto por defecto; JS lo muestra con .visible */
            align-self: flex-end;
            font-size: 0.8rem;
            font-weight: 700;
            color: #000;
            text-decoration: none;
            white-space: nowrap;
            transition: color 0.15s ease;
            text-align: right;
            width: fit-content;
            background: #edc208;
            box-sizing: border-box;
            padding: 10px;
            border-radius: 10px;
            letter-spacing: .5px;
            margin-bottom: 10px;
        }
        .disclaimer-ver-mas.visible { display: block; }
        .disclaimer-ver-mas:hover { color: #111827; text-decoration: underline; }

        /* ── Card visual ── */
        .disclaimer-accordion-card {
            border-radius: 12px;
            overflow: hidden;
            transition: box-shadow 0.2s ease;
        }
        .disclaimer-accordion-card:hover {
            /*box-shadow: 0 10px 38px rgba(0,0,0,0.55);*/
        }

        .disclaimer-accordion:hover .disclaimer-accordion-card {
            /*box-shadow: 0 10px 38px rgba(0,0,0,0.55);*/
        }

        /* ── Header siempre visible ── */
        .disclaimer-accordion-header {
            background: rgba(19, 19, 19, 0.85);
            display: flex;
            align-items: center;
            gap: 0.6rem;
            padding: 0.75rem 0.85rem;
            cursor: pointer;
            user-select: none;
            -webkit-user-select: none;
        }

        .disclaimer-accordion-icon {
            width: 30px;
            height: 30px;
            /*background: rgba(245, 158, 11, 0.1);
            border: 1px solid rgba(245, 158, 11, 0.28);*/
            border-radius: 7px;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }

        .disclaimer-accordion-title {
            flex: 1;
            font-size: 1.1rem;
            font-weight: 700;
            line-height: 1.1;
            color: #EDC108;
        }

        .disclaimer-accordion-chevron {
            width: 24px;
            height: 24px;
            background: rgba(255,255,255,0.06);
            border: none;
            border-radius: 5px;
            color: #9ca3af;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            transition: background 0.15s ease, color 0.15s ease, transform 0.3s ease;
        }

        .disclaimer-accordion-chevron:hover {
            background: rgba(255,255,255,0.12);
            color: #fff;
        }

        /* ── Body expandible ── */
        .disclaimer-accordion-body {
            background: rgba(19, 19, 19, 0.85);
            padding: 0 0.85rem 0.85rem;
            max-height: 400px;
            transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s ease, opacity 0.25s ease;
            opacity: 1;
            overflow-y: scroll;
        }

        .disclaimer-accordion-body p {
            font-size: 0.78rem;
            color: #fff;
            line-height: 1.6;
            margin: 0;
        }
            .disclaimer-accordion-body p strong{
                font-weight: 900;
            }

        /* ── Oculto hasta que se seleccione un congresista ── */
        .disclaimer-accordion.hidden { display: none !important; }

        /* ── Estado colapsado ── */
        .disclaimer-accordion.collapsed .disclaimer-accordion-body {
            max-height: 0;
            padding-bottom: 0;
            opacity: 0;
        }

        .disclaimer-accordion.collapsed .disclaimer-accordion-chevron {
            transform: rotate(180deg);
        }

        /* Separador entre header y body */
        .disclaimer-accordion:not(.collapsed) .disclaimer-accordion-header {
            /*border-bottom: 1px solid rgba(255,255,255,0.07);*/
        }

        /* ==================== ANIMATIONS ==================== */
        @keyframes pulse-ring {
            0% { r: 45; opacity: 0.6; }
            100% { r: 65; opacity: 0; }
        }
        
        @keyframes pulse-ring-active {
            0% { r: 45; opacity: 0.8; }
            100% { r: 75; opacity: 0; }
        }
        
        /* ==================== DATA LOADER ==================== */
        .loader-overlay {
            position: fixed;
            inset: 0;
            background: var(--bg-primary);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            z-index: 9999;
            transition: opacity 0.5s ease;
        }
        
        .loader-overlay.hidden {
            opacity: 0;
            pointer-events: none;
        }
        
        .loader-spinner {
            width: 48px;
            height: 48px;
            border: 3px solid var(--border-subtle);
            border-top-color: var(--accent-gold);
            border-radius: 50%;
            animation: spin 1s linear infinite;
        }
        
        .loader-text {
            margin-top: 1rem;
            color: var(--text-secondary);
            font-size: 0.9rem;
        }
        
        @keyframes spin {
            to { transform: rotate(360deg); }
        }
        
        /* ==================== FILE INPUT ==================== */
        .file-input-wrapper {
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        
        .file-input-btn {
            padding: 0.5rem 1rem;
            background: var(--bg-card);
            border: 1px solid var(--border-subtle);
            border-radius: 6px;
            color: var(--text-secondary);
            font-size: 0.8rem;
            cursor: pointer;
            transition: all 0.2s ease;
        }
        
        .file-input-btn:hover {
            background: var(--bg-elevated);
            color: var(--text-primary);
        }
        
        #file-input {
            display: none;
        }
        .file-input-wrapper {
            display: none;
        }
        /* ==================== SIDEBAR OPEN STATE ==================== */
        .sidebar.open {
            transform: translateX(0);
        }

        /* ==================== SEARCH DROPDOWN ==================== */
        .search-wrapper {
            position: relative;
            width: 100%;
        }

        .search-dropdown {
            display: none;
            position: absolute;
            top: calc(100% + 6px);
            right: 0;
            left: 0;
           min-width: auto;
            background: #1e2330;
            border: 1px solid rgba(245, 158, 11, 0.25);
            border-radius: 10px;
            overflow-y: auto;
            max-height: 320px;
            z-index: 9999;
            box-shadow: 0 12px 40px rgba(0,0,0,0.5);
            animation: dropdownIn 0.18s ease;
        }

        .search-dropdown.open {
            display: block;
        }

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

        .search-dropdown-item {
            display: flex;
            align-items: center;
            gap: 0.6rem;
            padding: 0.65rem 1rem;
            cursor: pointer;
            transition: background 0.15s ease;
            border-bottom: 1px solid rgba(255,255,255,0.05);
        }

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

        .search-dropdown-item:hover {
            background: rgba(245, 158, 11, 0.1);
        }

        .search-dropdown-icon {
            font-size: 0.9rem;
            flex-shrink: 0;
        }

        .search-dropdown-avatar {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            overflow: hidden;
            flex-shrink: 0;
            background: rgba(245, 158, 11, 0.15);
            border: 1.5px solid rgba(245, 158, 11, 0.3);
            position: relative;
        }

        .search-dropdown-avatar img.search-dropdown-photo {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
        }

        .search-dropdown-initials {
            width: 100%;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.65rem;
            font-weight: 700;
            color: var(--accent-gold);
            font-family: 'DM Sans', sans-serif;
            letter-spacing: 0.03em;
        }

        .search-dropdown-name {
            font-size: 0.85rem;
            color: #e5e7eb;
        }

        .search-dropdown-name mark {
            background: transparent;
            color: var(--accent-gold);
            font-weight: 700;
        }

        .search-dropdown-empty {
            padding: 0.75rem 1rem;
            font-size: 0.82rem;
            color: var(--text-muted);
            text-align: center;
        }

        /* ==================== CONGRESSPERSON HOVER / EXPAND ==================== */
        .node-congressperson {
            cursor: pointer;
        }

        .node-congressperson:hover .node-circle {
            stroke: var(--accent-gold) !important;
            stroke-width: 3px !important;
        }

        .node-congressperson.expanded .node-circle {
            stroke: var(--accent-gold) !important;
            stroke-width: 4px !important;
            filter: drop-shadow(0 0 14px rgba(245, 158, 11, 0.6));
        }

        /* ==================== HINT LABEL ==================== */
        .hint-label {
            position: fixed;
            bottom: 5.5rem;
            left: 50%;
            transform: translateX(-50%);
            background: rgba(26, 30, 38, 0.92);
            border: 1px solid rgba(255,255,255,0.08);
            padding: 0.5rem 1.25rem;
            border-radius: 20px;
            font-size: 0.75rem;
            color: var(--text-muted);
            z-index: 50;
            pointer-events: none;

            display: none;

        }

        .hint-label span {
            color: var(--accent-gold);
        }

/* ==================== NODE DETAIL PANEL ==================== */
.node-panel {
    display: none !important;
    position: fixed;
    top: 50%;
    right: 1.75rem;
    transform: translateY(-50%) translateX(110%);
    width: 320px;
    max-height: calc(100vh - 10rem);
    background: #1c2030;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 14px;
    padding: 1.25rem 1.4rem 1.4rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.04);
    z-index: 500;
    transition: transform 0.35s cubic-bezier(0.34,1.2,0.64,1), opacity 0.3s ease;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.node-panel.visible {
    transform: translateY(-50%) translateX(0);
    opacity: 1;
    pointer-events: all;
}

/* ── Panel header ── */
.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.6rem;
}

.panel-badge {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
}

.panel-close {
    width: 26px;
    height: 26px;
    background: rgba(255,255,255,0.07);
    border: none;
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.panel-close:hover {
    background: rgba(255,255,255,0.14);
    color: var(--text-primary);
}

/* ── Panel title ── */
.panel-title {
    font-family: 'Tungsten', 'Playfair Display', serif;
    font-size: 1.45rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.25;
    margin-bottom: 1rem;
    letter-spacing: 0.01em;
}

/* ── KV rows ── */
.panel-kv-grid {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.panel-kv {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
}

.panel-k {
    font-size: 0.72rem;
    color: var(--accent-gold);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

.panel-v {
    font-size: 0.82rem;
    color: #e5e7eb;
    text-align: left;
    line-height: 1.4;
}

/* ── Divider ── */
.panel-divider {
    height: 1px;
    background: rgba(255,255,255,0.08);
    margin: 0.9rem 0;
}

/* ── Summary row (CP network stats) ── */
.panel-summary-row {
    display: flex;
    justify-content: space-around;
    margin-bottom: 0.75rem;
}

.panel-summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
}

.panel-summary-val {
    font-size: 1.5rem;
    font-weight: 800;
    font-family: 'Tungsten', sans-serif;
    line-height: 1;
}

.panel-summary-lbl {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

/* ── Total row ── */
.panel-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-total-lbl {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.panel-total-val {
    font-size: 1rem;
    font-weight: 800;
    color: var(--accent-gold);
    font-family: 'Tungsten', sans-serif;
    letter-spacing: 0.02em;
}

/* ── Section title ── */
.panel-section-title {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 0.6rem;
}

/* ── Scrollable list for contracts ── */
.panel-scroll-list {
    overflow-y: auto;
    max-height: 320px;
    margin-top: 0.25rem;
    padding-right: 0.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;

    /* Custom scrollbar */
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}

.panel-scroll-list::-webkit-scrollbar { width: 4px; }
.panel-scroll-list::-webkit-scrollbar-track { background: transparent; }
.panel-scroll-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }

.panel-list-item {
    background: rgba(255,255,255,0.04);
    border-radius: 8px;
    padding: 0.55rem 0.7rem;
    border: 1px solid rgba(255,255,255,0.05);
}

.panel-list-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.panel-list-badge {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 0.18rem 0.5rem;
    border-radius: 20px;
}

.panel-list-amount {
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
}

.panel-list-entity {
    font-size: 0.73rem;
    color: var(--text-secondary);
    line-height: 1.35;
    margin-bottom: 0.15rem;
}

.panel-list-meta {
    font-size: 0.67rem;
    color: var(--text-muted);
}

.panel-list-more {
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-muted);
    padding: 0.5rem 0;
    font-style: italic;
}

/* ── Stats bar pop animation ── */
.stat-value {
    display: inline-block;
    transition: transform 0.25s ease;
}

.disclaimer-accordion.collapsed{
    width: 19%;
}

/* =================================================================
   MOBILE RESPONSIVE — OPTIMIZACIONES PARA PANTALLAS PEQUEÑAS
   Breakpoints: 768px (tablet), 600px (móvil), 400px (móvil small)
================================================================= */

/* ── GPU acceleration solo donde importa ──
   will-change en CADA nodo crea docenas de compositing layers → memory pressure en móvil.
   Solo el grupo raíz necesita su propia capa GPU (es lo que se transforma en pan/zoom). */
.node {
    /* sin will-change: el compositor maneja el grupo completo como una sola capa */
}

/* ── Grupo SVG principal: UNA sola capa GPU para todo el grafo ──
   - transform-origin fijo aquí → no se muta en cada evento zoom
   - backface-visibility: hidden → hint adicional al compositor
   - contain: layout style → aisla el árbol del layout del resto del documento */
#network-container > g {
    will-change: transform;
    transform-origin: 0 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* ── Evitar tap highlight en iOS + habilitar touch drag ── */
#network-container {
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

/* =================================================================
   TABLET / MÓVIL (≤ 768px)
================================================================= */
@media (max-width: 768px) {

    /* ── Header: solo barra de búsqueda ── */
    .header {
        padding: 0.65rem 0.75rem;
        gap: 0.5rem;
        background: rgba(241, 240, 234, 0.98);
        border-bottom: 1px solid rgba(0,0,0,0.06);
        width: 100%;
    }

    .header-left {
        display: none;  /* ocultar título en móvil */
    }

    .header-right {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 0.4rem;
    }

    .filter-btns {
        position: static;
        flex-direction: column;
        width: 100%;
        gap: 0.4rem;
    }

    .filter-btn {
        width: 100%;
    }

    .search-input {
        width: 100%;
        min-width: 0;
    }

    .search-dropdown {
        min-width: unset;
        width: 100%;
        left: 0;
        right: 0;
    }

    /* ══════════════════════════════════════════════════
       LAYOUT DE FONDO:
       Stats bar  →  bottom: 0.5rem  (2 filas)
       Leyenda    →  bottom: 6.2rem  (encima de stats)
       Controles  →  bottom: 6.2rem  derecha, apilados ↑
       Disclaimer →  bottom: 6.2rem  izquierda, abre ↑→
    ══════════════════════════════════════════════════ */

    /* ── Stats wrapper: ancho completo al fondo ── */
    .stats-wrapper {
        left: 0.5rem;
        right: 0.5rem;
        bottom: 0.5rem;
        transform: none;
        align-items: stretch;
        width: auto;
    }

    /* ── Stats bar: grid 3 col / 2 filas ── */
    .stats-bar {
        flex: 1;
        padding: 0.6rem 1rem;
        gap: 0;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        row-gap: 0.15rem;
        border-radius: 10px;
    }

    .stat-item {
        text-align: center;
        padding: 0.2rem 0;
    }

    /* Segunda fila: items 4, 5, 6 */
    .stat-item:nth-child(4),
    .stat-item:nth-child(5),
    .stat-item:nth-child(6) {
        border-top: 1px solid rgba(0,0,0,0.07);
        padding-top: 0.35rem;
        margin-top: 0.15rem;
    }

    /* Monto Total ocupa las 3 columnas de la segunda fila si solo hay 4 items normales… */
    /* En 6-item layout: cada uno ocupa 1 col normalmente */

    .stat-value {
        font-size: 1rem;
        font-weight: 700;
    }

    .stat-label {
        font-size: 0.52rem;
        letter-spacing: 0.05em;
    }

    /* ── Leyenda: franja ancha encima de la stats bar ── */
    .legend {
        bottom: 7.5rem;
        left: 0.5rem;
        right: 0.5rem;
        transform: none;
        padding: 0.55rem 1rem;
        gap: 0.4rem 0.9rem;
        justify-content: space-around;
        flex-wrap: nowrap;
        z-index: 49;
    }

    .legend-item {
        font-size: 0.68rem;
    }

    /* ── Controles: apilados verticalmente en la esquina derecha ── */
    .controls {
        bottom: 10.2rem;
        right: 0.5rem;
        flex-direction: column;
        gap: 0.4rem;
        z-index: 51;
    }

    .control-btn {
        width: 36px;
        height: 36px;
        border-radius: 10px;
        background: #1a1e26;
        border: 1px solid rgba(255,255,255,0.1);
        color: #9ca3af;
    }

    /* ── Disclaimer acordeón: esquina inferior izquierda ──
       Colapsado  → 2 botones compactos [⚠] [^]
       Expandido  → panel crece hacia arriba-derecha    ── */
    .disclaimer-accordion {
        bottom: 10.2rem;
        left: 0.5rem;
        width: auto;        /* se ajusta al contenido cuando colapsado */
        flex-direction: column-reverse;  /* body ENCIMA del header */
        z-index: 51;
    }

    /* Card visual: border-radius en mobile */
    .disclaimer-accordion-card {
        border-radius: 12px;
    }

    /* Ocultar enlace "ver más" en móvil — no aplica en esa UX */
    .disclaimer-ver-mas { /*display: none !important; */}

        .disclaimer-accordion.collapsed{
            width: 57%;
        }

    /* Ocultar título: solo iconos en móvil */
    .disclaimer-accordion .disclaimer-accordion-title {
        /*display: none;*/
        font-size: .9rem;
    }

    /* Header compacto: solo los 2 botones */
    .disclaimer-accordion .disclaimer-accordion-header {
        padding: 0.35rem;
        gap: 0.35rem;
        border-bottom: none;
    }

    /* Línea separadora entre body y header (column-reverse) */
    .disclaimer-accordion:not(.collapsed) .disclaimer-accordion-header {
        border-top: 1px solid rgba(255,255,255,0.08);
        border-bottom: none;
    }

    /* Iconos del header más grandes y cuadrados */
    .disclaimer-accordion .disclaimer-accordion-icon {
        width: 36px;
        height: 36px;
        border-radius: 9px;
        flex-shrink: 0;
    }

    .disclaimer-accordion .disclaimer-accordion-chevron {
        width: 36px;
        height: 36px;
        border-radius: 9px;
        /* Rotar chevron izquierdo (<) a que apunte arriba (^) → indica expansión hacia arriba */
        transform: rotate(90deg);
    }

    /* Colapsado: apunta hacia abajo (v) → indica que hay contenido arriba */
    .disclaimer-accordion.collapsed .disclaimer-accordion-chevron {
        transform: rotate(-90deg);
    }

    /* Body expandido: ancho fijo hacia la derecha */
    .disclaimer-accordion .disclaimer-accordion-body {
        width: 280px;
        max-height: 220px;
        padding: 0.75rem 0.85rem 0.85rem;
        overflow: scroll;
    }

    /* Colapsado: body se oculta */
    .disclaimer-accordion.collapsed .disclaimer-accordion-body {
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
        opacity: 0;
    }

    /* ── Hint label: oculto en móvil ── */
    .hint-label {
        display: none;
    }

    /* ── Tooltip: más compacto ── */
    .tooltip {
        min-width: 220px;
        max-width: min(280px, calc(100vw - 24px));
        padding: 1rem 1.1rem;
    }

    .tooltip-title {
        font-size: 1.1rem;
    }

    /* ── Node panel: bottom sheet ── */
    .node-panel {
        top: auto !important;
        bottom: 0 !important;
        right: 0 !important;
        left: 0 !important;
        width: 100% !important;
        max-height: 55vh;
        border-radius: 16px 16px 0 0 !important;
        transform: translateY(110%) !important;
        opacity: 1 !important;
        transition: transform 0.38s cubic-bezier(0.34,1.1,0.64,1) !important;
        padding: 2rem 1.25rem 1.5rem;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .node-panel::before {
        content: '';
        position: absolute;
        top: 0.6rem;
        left: 50%;
        transform: translateX(-50%);
        width: 36px;
        height: 4px;
        background: rgba(255,255,255,0.2);
        border-radius: 2px;
    }

    .node-panel.visible {
        transform: translateY(0) !important;
    }

    .node-label   { font-size: 9px; }
    .node-sublabel { font-size: 7.5px; }
}

/* =================================================================
   MÓVIL PEQUEÑO (≤ 480px)
================================================================= */
@media (max-width: 480px) {

    .search-input {
        padding: 0.55rem 0.9rem 0.55rem 2.2rem;
        font-size: 0.82rem;
    }

    .legend {
        padding: 0.45rem 0.65rem;
        gap: 0.3rem 0.6rem;
    }

    .legend-item span {
        font-size: 0.63rem;
    }

    .stat-value {
        font-size: 0.8rem;
    }

    .stat-label {
        font-size: 0.48rem;
    }

    .stat-item:nth-child(5) .stat-value {
        font-size: 0.78rem;
        letter-spacing: -0.01em;
    }

    .control-btn {
        width: 34px;
        height: 34px;
    }

    .node-label   { font-size: 8px; }
    .node-sublabel { font-size: 7px; }
}

/* =================================================================
   MÓVIL ULTRA-PEQUEÑO (≤ 360px — Galaxy S8, iPhone SE, etc.)
================================================================= */
@media (max-width: 360px) {

    .stats-bar {
        padding: 0.35rem 0.5rem;
    }

    .stat-value {
        font-size: 0.78rem;
    }

    .stat-item:nth-child(5) .stat-value {
        font-size: 0.72rem;
    }

    .legend {
        /*display: none; */ /* demasiado estrecho — ocultar */
    }
}

/* =================================================================
   LANDSCAPE MÓVIL (altura corta)
================================================================= */
@media (max-height: 500px) and (max-width: 900px) {

    .header {
        padding: 0.4rem 1rem;
    }

    .stats-bar {
        grid-template-columns: repeat(6, 1fr);
        padding: 0.35rem 0.75rem;
        row-gap: 0;
    }

    .stats-wrapper {
        bottom: 0.35rem;
    }

    .stat-item:nth-child(4),
    .stat-item:nth-child(5),
    .stat-item:nth-child(6) {
        grid-column: auto;
        border-top: none;
        padding-top: 0.2rem;
        margin-top: 0;
    }

    .stat-value { font-size: 0.85rem; }
    .stat-label { font-size: 0.48rem; }

    .legend {
        bottom: 2.8rem;
        left: 0.5rem;
        right: 0.5rem;
        transform: none;
        padding: 0.3rem 0.75rem;
        gap: 0.3rem 0.7rem;
    }

    .controls {
        bottom: 2.8rem;
        right: 0.5rem;
        flex-direction: column;
    }

    .disclaimer-accordion {
        bottom: 2.8rem;
    }

    .hint-label { display: none; }
    .node-panel { max-height: 80vw; }
}