* {
    box-sizing: border-box;
}

body {
    margin: 0;
    display: flex;
    height: 100vh;
    font-family: system-ui, sans-serif;
}

#panel-grafo {
    position: relative;
    width: 55%;
    height: 100%;
    border-right: 1px solid #ccc;
    overflow: hidden;
}

#grafo {
    width: 100%;
    height: 100%;
}

#panel-nodo {
    width: 45%;
    height: 100%;
    overflow-y: auto;
    padding: 2rem;
    line-height: 1.5;
}

#contenido-nodo .aviso {
    color: #888;
    font-style: italic;
}

/* Aristas y nodos: color/grosor/trazo vienen de datos/config-visual.json,
   aplicados como atributos SVG desde grafo.js. Aquí solo lo que no depende
   de esa configuración. */

.nodo {
    cursor: pointer;
}

.nodo text {
    fill: #333;
}

.fondo-etiqueta {
    fill: #fff;
    opacity: 0.85;
}

.nodo-seleccionado circle {
    filter: drop-shadow(0 0 var(--halo-radio, 6px) var(--halo-color, #f1c40f));
}

/* Nodo de inicio (config-visual.json → nodoInicio): fijo en el centro,
   con halo dorado permanente para distinguirlo del resto. */
.nodo-inicio circle {
    filter: drop-shadow(0 0 6px gold);
}

.nodo-inicio text {
    font-weight: 600;
}

/* Leyenda */

#leyenda {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #ccc;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    font-size: 12px;
    max-width: 260px;
}

#leyenda-toggle {
    width: 100%;
    text-align: left;
    padding: 0.5rem 0.75rem;
    background: none;
    border: none;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

#leyenda-cuerpo {
    padding: 0 0.75rem 0.75rem;
    max-height: 50vh;
    overflow-y: auto;
}

.leyenda-colapsada #leyenda-cuerpo {
    display: none;
}

.leyenda-seccion h3 {
    margin: 0.5rem 0 0.25rem;
    font-size: 11px;
    text-transform: uppercase;
    color: #777;
}

.leyenda-fila {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.15rem 0;
}

.leyenda-punto {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.leyenda-anillo {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border-style: solid;
    background: #fff;
    flex-shrink: 0;
}

.leyenda-linea {
    flex-shrink: 0;
}
