    :root {
        --bg: #12161d;
        --panel: #1a2029;
        --panel-2: #202836;
        --border: #2c3646;
        --text: #dbe4f0;
        --muted: #8493a8;
        --accent: #4d8bfd;
        --green: #3fb96b;
        --red: #e05555;
        --yellow: #e0b23f;
        --purple: #a06bfa;
    }
    * { margin: 0; padding: 0; box-sizing: border-box; }
    html, body { height: 100%; }
    body {
        font-family: 'Segoe UI', system-ui, sans-serif;
        background: var(--bg); color: var(--text);
        display: grid;
        grid-template-rows: auto 1fr var(--console-h, 240px);
        grid-template-columns: 1fr 330px;
        grid-template-areas: "toolbar toolbar" "canvas sidebar" "console sidebar";
        overflow: hidden;
    }

    /* ---------- Toolbar ---------- */
    #toolbar {
        grid-area: toolbar;
        display: flex; align-items: center; gap: 8px;
        padding: 10px 14px;
        background: var(--panel); border-bottom: 1px solid var(--border);
        flex-wrap: wrap;
    }
    #toolbar .brand { font-weight: 800; font-size: 1.05rem; margin-right: 14px; }
    #toolbar .brand span { color: var(--accent); }
    .btn {
        background: var(--panel-2); color: var(--text);
        border: 1px solid var(--border); border-radius: 8px;
        padding: 7px 14px; cursor: pointer; font-size: .85rem; font-weight: 600;
        transition: background .12s, border-color .12s;
    }
    .btn:hover { background: #28324344; border-color: var(--accent); }
    .btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
    .btn.primary:hover { background: #3a76e8; }
    .btn.danger:hover { border-color: var(--red); color: var(--red); }
    .btn:disabled { opacity: .5; cursor: wait; }
    .sep { width: 1px; height: 24px; background: var(--border); margin: 0 6px; }

    /* ---------- Canvas ---------- */
    #canvas-wrap {
        grid-area: canvas; overflow: auto; position: relative;
        background: var(--bg);
    }
    #canvas {
        position: relative; width: 3000px; height: 2000px;
        background-image: radial-gradient(circle, #2b3547 1px, transparent 1px);
        background-size: 26px 26px;
        transform-origin: 0 0;
    }
    #zoom-label {
        min-width: 52px; text-align: center; font-size: .82rem; font-weight: 700;
        color: var(--muted); cursor: pointer; user-select: none;
    }
    #zoom-label:hover { color: var(--accent); }
    #links-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
    #links-svg g { pointer-events: auto; }
    .link-visible { stroke: var(--accent); stroke-width: 2.5; fill: none; opacity: .85; }
    .link-hit { stroke: transparent; stroke-width: 14; fill: none; cursor: pointer; }
    g.link-g:hover .link-visible { stroke: var(--yellow); }
    .temp-link { stroke: var(--yellow); stroke-width: 2; stroke-dasharray: 6 5; fill: none; }

    /* ---------- Nodos ---------- */
    .node { position: absolute; cursor: grab; user-select: none; }
    .node:active { cursor: grabbing; }
    .node .shape {
        width: 100%; height: 100%;
        background: linear-gradient(155deg, #26303f, #1d2530);
        border: 1.5px solid var(--border);
        display: flex; flex-direction: column; align-items: center; justify-content: center;
        text-align: center; padding: 10px; gap: 3px;
        box-shadow: 0 6px 18px rgba(0,0,0,.35);
        transition: border-color .12s, box-shadow .12s;
    }
    /* Cada método HTTP tiene su forma: GET=círculo, POST=rectángulo, PUT=rombo, PATCH=hexágono, DELETE=octágono */
    .node.rect { width: 190px; height: 84px; }
    .node.rect .shape { border-radius: 10px; }
    .node.rombo { width: 200px; height: 120px; }
    .node.rombo .shape { clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); border: none; outline: 1.5px solid var(--border); outline-offset: -1px; }
    .node.circulo { width: 140px; height: 140px; }
    .node.circulo .shape { border-radius: 50%; }
    .node.hexagono { width: 210px; height: 100px; }
    .node.hexagono .shape { clip-path: polygon(22% 0, 78% 0, 100% 50%, 78% 100%, 22% 100%, 0 50%); border: none; outline: 1.5px solid var(--border); outline-offset: -1px; }
    .node.octagono { width: 160px; height: 120px; }
    .node.octagono .shape { clip-path: polygon(30% 0, 70% 0, 100% 28%, 100% 72%, 70% 100%, 30% 100%, 0 72%, 0 28%); border: none; outline: 1.5px solid var(--border); outline-offset: -1px; }
    .node.selected .shape { border-color: var(--accent); box-shadow: 0 0 0 3px #4d8bfd44, 0 6px 18px rgba(0,0,0,.35); }
    .node.rombo.selected .shape, .node.hexagono.selected .shape, .node.octagono.selected .shape { outline-color: var(--accent); }
    .node .n-name { font-weight: 700; font-size: .88rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .node .n-info { font-size: .7rem; color: var(--muted); max-width: 92%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .node .n-method { font-weight: 800; font-size: .68rem; letter-spacing: .5px; }
    .m-GET { color: var(--green); } .m-POST { color: var(--yellow); }
    .m-PUT { color: var(--accent); } .m-PATCH { color: var(--purple); } .m-DELETE { color: var(--red); }
    .n-status {
        position: absolute; top: -9px; right: 14px;
        font-size: .66rem; font-weight: 800; padding: 2px 8px; border-radius: 999px;
        background: var(--panel-2); border: 1px solid var(--border); color: var(--muted);
    }
    .node.circulo .n-status, .node.rombo .n-status, .node.hexagono .n-status, .node.octagono .n-status { right: 50%; transform: translateX(50%); }
    .n-status.ok { color: #fff; background: var(--green); border-color: var(--green); }
    .n-status.err { color: #fff; background: var(--red); border-color: var(--red); }
    .n-status.run { color: #111; background: var(--yellow); border-color: var(--yellow); }

    /* Nodo en ejecución: contorno resaltado para depurar el flujo */
    .node.running .shape {
        border-color: var(--yellow);
        animation: exec-glow .7s ease-in-out infinite alternate;
    }
    .node.rombo.running .shape, .node.hexagono.running .shape, .node.octagono.running .shape { outline-color: var(--yellow); }
    @keyframes exec-glow {
        from { box-shadow: 0 0 0 3px #e0b23f55, 0 6px 18px rgba(0,0,0,.35); }
        to   { box-shadow: 0 0 0 7px #e0b23f22, 0 0 22px #e0b23fa0; }
    }

    .port {
        position: absolute; width: 15px; height: 15px; border-radius: 50%;
        background: var(--panel-2); border: 2px solid var(--muted);
        top: 50%; transform: translateY(-50%); z-index: 5; cursor: crosshair;
        transition: transform .1s, border-color .1s, background .1s;
    }
    .port-in  { left: -8px; }
    .port-out { right: -8px; border-color: var(--accent); }
    .port:hover { transform: translateY(-50%) scale(1.35); }
    .port-out:hover { background: var(--accent); }
    body.connecting .port-in { border-color: var(--yellow); animation: pulse 1s infinite; }
    body.connecting .port-in:hover { background: var(--yellow); }
    @keyframes pulse { 50% { box-shadow: 0 0 0 5px #e0b23f33; } }

    .n-run {
        position: absolute; bottom: -13px; right: 14px;
        width: 28px; height: 28px; border-radius: 50%;
        background: var(--green); color: #fff; border: 2px solid var(--bg); cursor: pointer;
        font-size: .7rem; line-height: 1; z-index: 5;
        display: flex; align-items: center; justify-content: center;
        box-shadow: 0 2px 8px rgba(0,0,0,.4);
        transition: transform .1s, background .1s;
    }
    .n-run:hover { background: #35a05c; transform: scale(1.15); }
    .node.circulo .n-run:hover, .node.rombo .n-run:hover, .node.hexagono .n-run:hover, .node.octagono .n-run:hover { transform: translateX(50%) scale(1.15); }
    .node.circulo .n-run, .node.rombo .n-run, .node.hexagono .n-run, .node.octagono .n-run { right: 50%; transform: translateX(50%); }

    /* ---------- Sidebar ---------- */
    #sidebar {
        grid-area: sidebar; background: var(--panel);
        border-left: 1px solid var(--border);
        padding: 16px; overflow-y: auto;
    }
    #sidebar h2 { font-size: .95rem; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
    #sidebar label { display: block; font-size: .72rem; font-weight: 700; color: var(--muted); margin: 12px 0 4px; text-transform: uppercase; letter-spacing: .5px; }
    #sidebar input[type=text], #sidebar select, #sidebar textarea {
        width: 100%; background: var(--panel-2); color: var(--text);
        border: 1px solid var(--border); border-radius: 7px;
        padding: 8px 10px; font-size: .85rem; font-family: Consolas, monospace;
    }
    #sidebar input:focus, #sidebar select:focus, #sidebar textarea:focus { outline: none; border-color: var(--accent); }
    #sidebar textarea { resize: vertical; min-height: 70px; }
    #sidebar .row { display: flex; gap: 8px; }
    #sidebar .row > * { flex: 1; }
    #sidebar .actions { margin-top: 18px; display: flex; gap: 8px; }
    .help { font-size: .8rem; color: var(--muted); line-height: 1.55; }
    .help code { background: var(--panel-2); padding: 1px 5px; border-radius: 4px; font-size: .75rem; color: var(--yellow); }
    .help h3 { color: var(--text); font-size: .85rem; margin: 14px 0 6px; }
    .help ul { margin-left: 16px; }
    .help li { margin-bottom: 5px; }

    /* ---------- Consola ---------- */
    #console-panel {
        grid-area: console; background: #0d1117;
        border-top: 1px solid var(--border);
        display: flex; flex-direction: column; min-height: 0;
        position: relative;
    }
    #console-resizer {
        position: absolute; top: -4px; left: 0; right: 0; height: 8px;
        cursor: ns-resize; z-index: 50;
    }
    #console-resizer:hover, body.resizing-console #console-resizer { background: #4d8bfd55; }
    body.resizing-console { cursor: ns-resize; user-select: none; }
    #console-head {
        display: flex; align-items: center; justify-content: space-between;
        padding: 6px 14px; border-bottom: 1px solid var(--border);
        font-size: .78rem; font-weight: 700; color: var(--muted);
    }
    #console { flex: 1; overflow-y: auto; padding: 8px 14px; font-family: Consolas, 'Courier New', monospace; font-size: .78rem; line-height: 1.5; }
    .log { margin-bottom: 4px; word-break: break-all; }
    .log .t { color: #566378; margin-right: 8px; }
    .log.req  { color: var(--accent); }
    .log.ok   { color: var(--green); }
    .log.err  { color: var(--red); }
    .log.info { color: var(--muted); }
    .log details { margin: 3px 0 6px 22px; color: #b8c4d6; }
    .log summary { cursor: pointer; color: var(--muted); font-size: .72rem; }
    .log pre { white-space: pre-wrap; background: #131a24; border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; margin-top: 4px; max-height: 260px; overflow: auto; }

/* ---------- Reemplazo de estilos inline del HTML ---------- */
.hidden { display: none; }
#console-head .btn { padding: 3px 10px; font-size: .72rem; }