body {
    font-family: 'Segoe UI', sans-serif;
    background: #f4f6f9;
    text-align: center;
    margin: 0;

    /* 🔥 SCROLL TOTAL */
    overflow: auto;
}

/* 🔥 CONTENEDOR DINÁMICO REAL */
#contenedor {
    position: relative;

    width: fit-content;     /* 🔥 mejor que max-content */
    min-width: 100%;

    min-height: 100vh;      /* 🔥 ocupa toda la pantalla mínimo */
    margin: auto;
    padding: 40px;          /* 🔥 más espacio para que no se pegue */
}

/* 🔥 SVG AJUSTADO AL CONTENEDOR REAL */
#lineas {
    position: absolute;
    top: 0;
    left: 0;

    width: 100%;
    height: 100%;

    pointer-events: none;
}

/* 🔥 NODOS */
.nodo {
    position: absolute;
    transform: translate(-50%, -50%);
    background: white;
    border: 2px solid #3498db;
    border-radius: 12px;
    padding: 10px 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;

    min-width: 70px;         /* 🔥 más espacio */
    max-width: 200px;        /* 🔥 evita que se hagan gigantes */

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 🔥 HOVER */
.nodo:hover {
    background: #3498db;
    color: white;
    transform: translate(-50%, -50%) scale(1.08);
}

.nombre {
    font-weight: bold;
}

.dn {
    font-size: 11px;
    color: #777;
}

/* 🔥 BOTÓN */
.btn-subir {
    background: #2ecc71;
    color: white;
    padding: 10px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

/* 🔥 PANEL */
.panel {
    margin: 20px;
}

.panel input {
    padding: 8px;
}

.panel button {
    padding: 8px 12px;
    cursor: pointer;
}

/* 🔥 CARD INFO */
.card-info {
    background: white;
    border-radius: 12px;
    padding: 15px;
    width: 280px;
    margin: 15px auto;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    text-align: left;
}

.fila {
    display: flex;
    justify-content: space-between;
    margin: 5px 0;
}

hr {
    border: none;
    border-top: 1px solid #eee;
}