#statusbar {
    display: flex;
    align-items: center;
    height: 24px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 0 12px;
    gap: 16px;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text3);
    flex-shrink: 0;
}

.sb-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.sb-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.sb-item span {
    color: var(--text2);
}

#ctx-menu {
    position: fixed;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 4px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    z-index: 1000;
    display: none;
    min-width: 140px;
}

.ctx-item {
    padding: 6px 10px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text);
    cursor: pointer;
    border-radius: 3px;
    transition: all .15s;
}

    .ctx-item:hover {
        background: var(--surface3);
        color: var(--accent);
    }

    .ctx-item.danger:hover {
        background: rgba(224, 80, 80, 0.15);
        color: var(--red);
    }

.ctx-sep {
    height: 1px;
    background: var(--border);
    margin: 3px 0;
}

.node {
    cursor: move;
    transition: filter .15s;
}

    .node:hover {
        filter: brightness(1.1);
    }

    .node.selected rect,
    .node.selected circle,
    .node.selected ellipse,
    .node.selected path {
        stroke: var(--accent);
        stroke-width: 2;
    }

.node-label {
    font-family: var(--font-mono);
    font-size: 11px;
    fill: #d8d8d8;
    pointer-events: none;
    user-select: none;
}

.node-card {
    stroke: #363636;
}

.node-selected .node-card {
    stroke: #e8a020;
}

.node-symbol-body {
    transition: stroke .15s;
}

.node-selected .node-symbol-body {
    stroke: #e8a020 !important;
}

.node-text-g text {
    user-select: none;
}

.frame-badge.has-cam {
    position: relative;
}

    .frame-badge.has-cam::after {
        content: '';
        position: absolute;
        top: 2px;
        right: 2px;
        width: 5px;
        height: 5px;
        border-radius: 50%;
        background: #e8a020;
    }

.frame-cam-block {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border, #2c2c2c);
}

.frame-cam-header {
    font-size: 9px;
    letter-spacing: 1.5px;
    color: var(--text3, #5c5a56);
    font-family: var(--font-mono);
    margin-bottom: 5px;
}

.ss-btn.cam-on {
    color: #e8a020;
}

.node-port {
    fill: #fff;
    stroke: #fff;
    stroke-width: 1.5;
    cursor: crosshair;
    transition: all .15s;
}

    .node-port:hover {
        fill: #e8a020;
        stroke: #e8a020;
        r: 5;
    }

[data-theme="light"] .node-port {
    fill: #666 !important;
    stroke: #999 !important;
}

    [data-theme="light"] .node-port:hover {
        fill: #e8a020 !important;
        stroke: #e8a020 !important;
    }

.edge {
    fill: none;
    stroke: #ccc;
    stroke-width: 2;
    cursor: pointer;
    transition: stroke .15s;
}

    .edge:hover {
        stroke: #fff;
    }

    .edge.selected {
        stroke: #e8a020;
        stroke-width: 2.5;
    }

.edge-label {
    font-family: var(--font-mono);
    font-size: 10px;
    fill: #999;
    pointer-events: none;
    user-select: none;
}

.edge-label-bg {
    fill: #1a1a1a;
    stroke: #3a3a3a;
    stroke-width: 1;
}

.arrow-marker {
    fill: #ccc;
}

.arrow-marker-selected {
    fill: #e8a020;
}

.node-fo-inner {
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
    overflow: hidden;
    padding: 4px 6px;
}

.node-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    color: #e0e0e0;
    line-height: 1.3;
    word-break: break-word;
    overflow-wrap: break-word;
}

.node-desc {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    font-weight: 400;
    color: #888;
    line-height: 1.3;
    margin-top: 2px;
    word-break: break-word;
    overflow-wrap: break-word;
}

    .node-desc ul,
    .node-desc ol {
        margin: 1px 0;
        padding-left: 13px;
    }

    .node-desc li {
        margin: 0;
    }

    .node-desc p,
    .node-desc div {
        margin: 0;
    }

    .node-desc .node-code,
    .node-desc-traditional .node-code {
        display: inline-block;
        font-family: 'JetBrains Mono', monospace;
        font-size: 0.95em;
        background: #0f0f0f;
        border: 1px solid #333;
        border-radius: 3px;
        padding: 1px 5px;
        margin: 1px 0;
        color: #d4d4d4;
        white-space: pre-wrap;
        word-break: break-word;
        max-width: 100%;
        text-align: left;
    }

.node-desc-traditional {
    font-family: 'JetBrains Mono', monospace;
    font-size: 8.5px;
    font-weight: 400;
    color: #777;
    line-height: 1.3;
    text-align: center;
    word-break: break-word;
    overflow-wrap: break-word;
    overflow: hidden;
    pointer-events: none;
}

    .node-desc-traditional ul,
    .node-desc-traditional ol {
        margin: 1px 0;
        padding-left: 13px;
        text-align: left;
    }

    .node-desc-traditional li {
        margin: 0;
    }

    .node-desc-traditional p,
    .node-desc-traditional div {
        margin: 0;
    }

[data-theme="light"] .node-desc-traditional {
    color: #555;
}

[data-theme="light"] .node-title {
    color: #1a1a1a;
}

[data-theme="light"] .node-desc {
    color: #555;
}

[data-theme="light"] .node rect:first-child,
[data-theme="light"] .node-group:not(.bg-node-group) rect:first-child {
    fill: #f8f8f8 !important;
}

[data-theme="light"] .node rect,
[data-theme="light"] .node-group:not(.bg-node-group) rect {
    stroke: #aaa !important;
}

[data-theme="light"] .node-label {
    fill: #1a1a1a;
}

[data-theme="light"] .node-card {
    stroke: #bbb !important;
}

[data-theme="light"] .node-selected .node-card {
    stroke: #d87800 !important;
    stroke-width: 2.5 !important;
}

[data-theme="light"] .node-selected .node-symbol-body {
    stroke: #d87800 !important;
    stroke-width: 2.5 !important;
}

[data-theme="light"] .edge-label {
    fill: #555;
}

[data-theme="light"] .edge-label-bg {
    fill: #f5f5f5;
    stroke: #ccc;
}

[data-theme="light"] .arrow-marker {
    fill: #666;
}

.resize-handle {
    fill: #999;
    stroke: #aaa;
    stroke-width: 1.2;
    cursor: nwse-resize;
}

    .resize-handle:hover {
        fill: #e8a020;
        stroke: #e8a020;
    }

[data-theme="light"] .resize-handle {
    fill: #888 !important;
    stroke: #aaa !important;
}

    [data-theme="light"] .resize-handle:hover {
        fill: #e8a020 !important;
        stroke: #e8a020 !important;
    }

[data-theme="light"] .edge {
    stroke: #666;
}

    [data-theme="light"] .edge:hover {
        stroke: #333;
    }

    [data-theme="light"] .edge.selected {
        stroke: #e8a020;
    }
