:root {
    --bg-color: #1e1e1e;
    --grid-color: #2a2a2a;
    --node-bg: #2b2b2b;
    --wire-color: #888;
    --wire-glow: #10b981;
}

body.ml-bg {
    background-color: var(--bg-color);
    margin: 0;
    overflow: hidden;
    font-family: 'Roboto Mono', monospace;
    color: #e2e8f0;
}

.toolbox {
    position: absolute;
    top: 80px;
    left: 20px;
    width: 250px;
    background: rgba(30, 30, 30, 0.9);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 15px;
    border-radius: 8px;
    z-index: 100;
}

.canvas-container {
    position: absolute;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background-image: 
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 20px 20px;
    z-index: 0;
    overflow: hidden;
}

.wires-svg {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 10;
}

.wire-path {
    fill: none;
    stroke: var(--wire-color);
    stroke-width: 3;
    pointer-events: stroke;
    cursor: pointer;
    transition: stroke 0.2s;
}
.wire-path:hover {
    stroke: #ef4444;
}

.pulse-dot {
    fill: var(--wire-glow);
    filter: drop-shadow(0 0 5px var(--wire-glow));
    opacity: 0;
}

/* Nodes */
.ml-node {
    position: absolute;
    background: var(--node-bg);
    border: 1px solid #444;
    border-radius: 8px;
    width: 160px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    z-index: 20;
    user-select: none;
}
.ml-node.selected { border-color: #3b82f6; box-shadow: 0 0 10px rgba(59,130,246,0.3); }

.node-header {
    background: #333;
    padding: 8px 10px;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    font-size: 0.8rem;
    font-weight: bold;
    cursor: grab;
    border-bottom: 1px solid #444;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.node-header:active { cursor: grabbing; }

.node-body {
    padding: 10px;
    display: flex;
    justify-content: space-between;
}

.port-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.port-out { align-items: flex-end; }

.port {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.7rem;
    color: #aaa;
}

.port-dot {
    width: 12px; height: 12px;
    background: #555;
    border-radius: 50%;
    cursor: crosshair;
    border: 2px solid #222;
    transition: background 0.2s;
}
.port-dot:hover { background: #fff; }

/* Colors by type */
.ml-node[data-type="input"] .node-header { background: #064e3b; color: #a7f3d0; }
.ml-node[data-type="dense"] .node-header { background: #1e3a8a; color: #bfdbfe; }
.ml-node[data-type="relu"] .node-header { background: #701a75; color: #fbcfe8; }
.ml-node[data-type="output"] .node-header { background: #7f1d1d; color: #fecaca; }
