        @import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&display=swap');
        
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Space Mono', 'Courier New', monospace;
            font-size: 12px;
            background: #0f172a;
            color: #e2e8f0;
            min-height: 100vh;
        }
        
        /* Simplified backgrounds - solid colors */
        .content {
            background: #0a0e1a;
        }

        .header {
            background: linear-gradient(135deg, #0f172a, #1e293b);
            backdrop-filter: blur(10px);
            color: white;
            padding: 0.5rem 1rem;
            box-shadow: 0 4px 12px rgba(0,0,0,0.5);
            border-bottom: 1px solid rgba(255,102,217,0.25);
        }

        /* h1 inside .header inherits the .xm-logo class for canonical sizing
           (Syne 18px / 0.12em / accent). Reset margins so the trimmed
           header padding actually translates to less vertical real-estate. */
        .header h1 { margin: 0; padding: 0; }

        .nav {
            background: rgba(30, 41, 59, 0.8);
            backdrop-filter: blur(10px);
            border-bottom: 1px solid rgba(255,255,255,0.1);
            padding: 0;
            display: flex;
            overflow-x: auto;
        }

        /* Tighter typography matching the synth banner: Syne, smaller, less
           padding so the canvas/content area gains real estate. The synth's
           own labels are 9–10px Syne with 0.12em tracking — we mirror that
           here for visual consistency across modules. */
        .nav-item {
            padding: 0.45rem 0.95rem;
            cursor: pointer;
            border-bottom: 2px solid transparent;
            white-space: nowrap;
            transition: all 0.2s;
            color: #94a3b8;
            font-size: 10.5px;
            font-weight: 700;
            font-family: 'Syne', 'Space Mono', sans-serif;
            letter-spacing: 0.10em;
            text-transform: uppercase;
        }

        .nav-item:hover {
            background: rgba(255,255,255,0.06);
            color: #e2e8f0;
        }

        .nav-item.active {
            border-bottom-color: #ff66d9;
            font-weight: 800;
            color: #ff66d9;
            background: rgba(255,102,217,0.10);
        }

        .content {
            max-width: 1400px;
            margin: 0 auto;
            padding: 1rem 1.25rem;
            min-height: calc(100vh - 80px);
        }

        /* Make content fill edge-to-edge when showing Input/Output/Performance/Settings/MappingDesigner tabs */
        .content:has(#inputs.active),
        .content:has(#outputs.active),
        .content:has(#performance.active),
        .content:has(#settings.active),
        .content:has(#mappingDesigner.active),
        .content:has(#playback.active),
        .content:has(#liveInput.active) {
            max-width: none;
            margin: 0;
            padding: 1rem 1.25rem;
            min-height: calc(100vh - 80px);
        }

        .view {
            display: none;
            background: transparent;
            backdrop-filter: none;
            border-radius: 0px;
            padding: 0;
            box-shadow: none;
            border: none;
        }

        .view.active {
            display: block;
        }

        #playback.active {
            display: flex;
        }

        .view-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1.5rem;
            padding-bottom: 1rem;
            border-bottom: 1px solid rgba(100, 116, 139, 0.3);
        }

        .view-title {
            font-size: 2.2rem;
            font-weight: 900;
            font-family: 'Orbitron', sans-serif;
            color: #60a5fa;
            text-transform: uppercase;
            letter-spacing: 2px;
            text-shadow: 0 1px 3px rgba(0,0,0,0.5);
        }
        
        /* Output Catalog title in ORANGE */
        #outputs .view-title {
            color: #ff8c00;
            text-shadow: 0 1px 3px rgba(0,0,0,0.5), 0 0 20px rgba(255,140,0,0.3);
        }
        
        /* Playback title smaller */
        #playback .view-title {
            font-size: 1.5rem;
        }
        
        /* Text shadows ONLY for large headings */
        .view h2, .view h3, .view h4 {
            text-shadow: 0 1px 3px rgba(0,0,0,0.5);
            font-family: 'Space Mono', monospace;
            font-size: 0.95rem;
            font-weight: 700;
            color: #94a3b8;
            text-transform: uppercase;
            letter-spacing: 0.1em;
        }
        
        /* NO shadows for body text, data, labels */
        .view p, .view li, .view label, .view div, .view span,
        .view code, .view pre, .view table {
            text-shadow: none;
        }
        
        /* White text for tables (session browser, etc.) */
        .view table th, .view table td {
            color: #e2e8f0;
            text-shadow: none;
        }
        
        /* Code blocks */
        .view code, .view pre {
            color: #c8ff4a;
            background: rgba(20, 25, 35, 0.9);
            padding: 0.2rem 0.4rem;
            border-radius: 3px;
            text-shadow: none;
            font-family: 'Space Mono', monospace;
        }
        
        /* Inline code */
        code {
            color: #c8ff4a !important;
            text-shadow: none !important;
        }
        
        /* Labels and small text */
        .view label, .view input, .view select, .view textarea {
            color: #94a3b8;
            text-shadow: none;
            font-family: 'Space Mono', monospace;
        }
        
        /* Form inputs */
        .view input, .view select, .view textarea {
            background: rgba(20, 25, 35, 0.9) !important;
            backdrop-filter: none;
            border: 1px solid rgba(100, 116, 139, 0.3);
            color: #e2e8f0;
        }

        /* Compact buttons matching the synth's `.btn-sm` look —
           transparent background, thin 1px border, tight padding,
           Space Mono 9px / 0.05em tracking. Variants (.btn-primary,
           .btn-secondary, .btn-danger) just swap the accent colour
           on the border + text; hover lifts the colour without any
           heavy gradient or shadow. */
        .btn {
            background: transparent;
            border: 1px solid rgba(148,163,184,0.25);
            border-radius: 3px;
            color: #cbd5e1;
            font-family: 'Space Mono', monospace;
            font-size: 9px;
            font-weight: 700;
            letter-spacing: 0.05em;
            text-transform: uppercase;
            padding: 4px 10px;
            cursor: pointer;
            transition: border-color 0.12s, color 0.12s, background 0.12s;
            text-shadow: none;
            box-shadow: none;
        }
        .btn:hover {
            border-color: #ff66d9;
            color: #ff66d9;
            background: rgba(255,102,217,0.06);
        }
        .btn:active   { transform: none; }
        .btn:disabled { opacity: 0.4; cursor: not-allowed; border-color: rgba(148,163,184,0.15); color: #475569; }

        .btn-primary {
            border-color: #c8ff4a;
            color: #c8ff4a;
        }
        .btn-primary:hover {
            border-color: #d4ff6a;
            color: #0a0e1a;
            background: #c8ff4a;
        }

        .btn-secondary {
            border-color: rgba(148,163,184,0.35);
            color: #94a3b8;
            background: transparent;
        }
        .btn-secondary:hover {
            border-color: #94a3b8;
            color: #e2e8f0;
            background: rgba(148,163,184,0.08);
        }

        .btn-danger {
            border-color: rgba(239,68,68,0.6);
            color: #ef4444;
            background: transparent;
        }
        .btn-danger:hover {
            border-color: #ef4444;
            color: #fff;
            background: rgba(239,68,68,0.85);
        }
        .btn-danger:disabled {
            background: transparent;
            border-color: rgba(148,163,184,0.15);
            color: #475569;
        }

        /* Role-coloured outline variants — same .btn footprint, just a
           tinted border + text. Used by the node-editor toolbar so each
           "Add X" button is colour-coded without bulky filled styles. */
        .btn-input      { border-color: #3b82f6; color: #93c5fd; }
        .btn-input:hover{ background: rgba(59,130,246,0.12); border-color: #60a5fa; color: #fff; }
        .btn-output     { border-color: #ff8c00; color: #fdba74; }
        .btn-output:hover{ background: rgba(255,140,0,0.12); border-color: #ff8c00; color: #fff; }
        .btn-processing { border-color: #8b5cf6; color: #c4b5fd; }
        .btn-processing:hover{ background: rgba(139,92,246,0.12); border-color: #a78bfa; color: #fff; }
        .btn-accent     { border-color: #00ff88; color: #6ee7b7; }
        .btn-accent:hover{ background: rgba(0,255,136,0.10); border-color: #00ff88; color: #fff; }
        .btn-amber      { border-color: #f59e0b; color: #fbbf24; }
        .btn-amber:hover{ background: rgba(245,158,11,0.10); border-color: #f59e0b; color: #fff; }
        .btn-icon       { padding: 4px 8px; min-width: 0; border-color: rgba(148,163,184,0.2); color: #94a3b8; }
        .btn-icon:hover { border-color: #94a3b8; color: #e2e8f0; background: rgba(148,163,184,0.08); }

        /* ── CATALOG PAGES — synth-style minimal aesthetic ──
           Scopes to #inputCategories / #outputCategories so it can
           override the JS render's inline styles by specificity. */
        #inputCategories, #outputCategories {
            font-family: 'Space Mono', monospace;
            font-size: 11px;
            color: #cbd5e1;
        }
        #inputCategories h3, #outputCategories h3 {
            font-family: 'Syne', sans-serif;
            font-weight: 800;
            font-size: 12px !important;
            letter-spacing: 0.10em;
            text-transform: uppercase;
            margin: 0 !important;
        }
        #inputCategories h4, #outputCategories h4 {
            font-family: 'Space Mono', monospace !important;
            font-weight: 700 !important;
            font-size: 11px !important;
            letter-spacing: 0.04em !important;
            margin: 0 0 4px 0 !important;
        }
        #inputCategories p, #outputCategories p {
            font-size: 9.5px !important;
            line-height: 1.4 !important;
            margin: 2px 0 !important;
            color: #94a3b8 !important;
        }
        #inputCategories code, #outputCategories code {
            font-size: 10px !important;
            padding: 1px 5px !important;
            border-radius: 2px !important;
        }
        #inputCategories strong, #outputCategories strong {
            font-weight: 700 !important;
            font-size: 9px !important;
            letter-spacing: 0.08em;
            text-transform: uppercase;
            color: #64748b !important;
        }
        /* Outer category block — outline only, no big colour-filled header.
           The JS render still sets `border: 2px solid <color>` inline; we
           keep that as the colour cue but trim the radius/padding. */
        #inputCategories > div, #outputCategories > div {
            margin-bottom: 14px !important;
            border-width: 1px !important;
            border-radius: 4px !important;
            overflow: hidden;
        }
        /* Header strip — clickable, with a chevron showing collapse state.
           Background stays the category colour but we boost text contrast
           with text-shadow + slight darkening of the colour itself, so the
           title and description are readable on any hue. The chevron is
           injected via ::before so we don't have to touch the JS render. */
        #inputCategories > div > div:first-child,
        #outputCategories > div > div:first-child {
            padding: 6px 10px !important;
            filter: saturate(0.85) brightness(0.85);
            cursor: pointer;
            position: relative;
            padding-left: 26px !important;
            user-select: none;
            transition: filter 0.12s;
        }
        #inputCategories > div > div:first-child:hover,
        #outputCategories > div > div:first-child:hover {
            filter: saturate(1) brightness(1);
        }
        #inputCategories > div > div:first-child::before,
        #outputCategories > div > div:first-child::before {
            content: '▾';
            position: absolute;
            left: 9px; top: 6px;
            font-size: 11px;
            color: rgba(255,255,255,0.85);
            transition: transform 0.15s;
            transform-origin: 50% 55%;
        }
        #inputCategories > div.collapsed > div:first-child::before,
        #outputCategories > div.collapsed > div:first-child::before {
            transform: rotate(-90deg);
        }
        #inputCategories > div.collapsed > div:last-child,
        #outputCategories > div.collapsed > div:last-child {
            display: none !important;
        }
        /* Crisp white text inside the (now lighter-tinted) header. */
        #inputCategories > div > div:first-child h3,
        #outputCategories > div > div:first-child h3 {
            color: #fff !important;
            text-shadow: 0 1px 2px rgba(0,0,0,0.45);
        }
        #inputCategories > div > div:first-child p,
        #outputCategories > div > div:first-child p {
            color: rgba(255,255,255,0.92) !important;
            text-shadow: 0 1px 2px rgba(0,0,0,0.40);
        }
        /* Inner signal cards — flat, thin border-left accent, tighter padding. */
        #inputCategories > div > div:last-child > div,
        #outputCategories > div > div:last-child > div {
            padding: 6px 10px !important;
            margin-bottom: 4px !important;
            border-radius: 2px !important;
            background: rgba(255,255,255,0.025) !important;
            border-left-width: 2px !important;
        }
        #inputCategories > div > div:last-child,
        #outputCategories > div > div:last-child {
            padding: 6px 8px !important;
        }
        /* Count badge inside the header. */
        #inputCategories > div > div:first-child > span,
        #outputCategories > div > div:first-child > span {
            font-size: 9px !important;
            padding: 1px 8px !important;
            margin-top: 4px !important;
            background: rgba(255,255,255,0.12) !important;
            border-radius: 2px !important;
            letter-spacing: 0.06em;
        }
        /* View headers (the title + search bar row). */
        #inputs .view-header, #outputs .view-header {
            margin-bottom: 8px;
        }
        #inputs .view-title, #outputs .view-title {
            font-family: 'Syne', sans-serif !important;
            font-weight: 800 !important;
            font-size: 13px !important;
            letter-spacing: 0.12em;
            text-transform: uppercase;
            color: #ff66d9;
        }
        #inputs input[type="text"], #outputs input[type="text"],
        #inputs select, #outputs select {
            font-size: 10px !important;
            padding: 4px 8px !important;
            border-color: rgba(148,163,184,0.25) !important;
            background: rgba(15,23,42,0.6) !important;
        }
        
        .session-item:hover {
            background: #e9ecef !important;
        }
        
        #recordingStatus {
            animation: pulse 2s infinite;
        }

        .btn.recording {
            background: #e74c3c;
            animation: pulse 1.5s infinite;
        }

        @keyframes pulse {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.7; }
        }

        .recording-indicator {
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            color: #e74c3c;
            font-weight: 600;
        }

        .recording-dot {
            width: 12px;
            height: 12px;
            background: #e74c3c;
            border-radius: 50%;
            animation: pulse 1.5s infinite;
        }

        .channels-grid {
            display: grid;
            gap: 1rem;
            margin-bottom: 2rem;
        }

        .channel-card {
            background: #f8f9fa;
            border: 1px solid #e0e0e0;
            border-radius: 6px;
            padding: 1rem;
            display: flex;
            flex-direction: column;
        }

        .channel-info {
            flex: 1;
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 0.5rem;
        }

        .channel-name {
            font-weight: 600;
            color: #2c5f8d;
            margin-bottom: 0.25rem;
        }

        .channel-value {
            font-size: 1.5rem;
            font-weight: 700;
            color: #333;
        }

        .channel-units {
            font-size: 0.9rem;
            color: #7f8c8d;
            margin-left: 0.25rem;
        }

        .channel-mode-btn {
            flex: 1;
            background: #e0e0e0;
            color: #666;
            border: 1px solid #ccc;
            padding: 0.4rem 0.5rem;
            border-radius: 4px;
            cursor: pointer;
            font-size: 0.75rem;
            transition: all 0.2s;
            white-space: nowrap;
        }

        .channel-mode-btn:hover:not(.disabled) {
            background: #d0d0d0;
        }

        .channel-mode-btn.active {
            background: #2c5f8d;
            color: white;
            border-color: #2c5f8d;
            font-weight: 600;
        }

        .channel-mode-btn.disabled {
            background: #f5f5f5;
            color: #ccc;
            border-color: #e0e0e0;
            cursor: not-allowed;
            opacity: 0.6;
        }

        .channel-graph {
            /* Was height:60px with overflow:hidden, but the canvas
               inside declared height:80px → the bottom 20 px were
               silently clipped. That's exactly where small-value
               lines (e.g. 0.013 of a 0..1 stream) draw, so the
               curve never reached the user. Match the canvas
               height and drop the clip. */
            width: 100%;
            height: 80px;
            background: #1a1a1a;
            border: 1px solid #333;
            border-radius: 3px;
            position: relative;
            margin-bottom: 0.5rem;
        }

        .channel-graph canvas {
            width: 100%;
            height: 80px;
            display: block;
        }

        .channel-remove {
            background: #e74c3c;
            color: white;
            border: none;
            padding: 0.5rem 1rem;
            border-radius: 4px;
            cursor: pointer;
            font-size: 0.85rem;
            width: 100%;
        }

        .channel-remove:hover {
            background: #c0392b;
        }
        
        /* Mapping Designer Styles */
        .mapping-toolbar {
            background: #f8f9fa;
            padding: 1rem;
            border-bottom: 2px solid #e0e0e0;
            display: flex;
            align-items: center;
            gap: 1rem;
            flex-wrap: wrap;
        }
        
        .mapping-canvas-container {
            position: relative;
            flex: 1;
            height: calc(100vh - 300px);
            min-height: 500px;
            background: #000000;
            border: 2px solid rgba(59, 130, 246, 0.4);
            border-radius: 8px;
            overflow: hidden;
            box-shadow: inset 0 0 50px rgba(0,0,0,0.4);
        }
        
        .mapping-canvas {
            width: 100%;
            height: 100%;
            cursor: grab;
        }
        
        .mapping-canvas:active {
            cursor: grabbing;
        }
        
        .node {
            position: absolute;
            background: white;
            border: 1px solid #2c5f8d;
            border-radius: 4px;
            padding: 6px 8px;
            min-width: 140px;
            cursor: move;
            box-shadow: 0 1px 4px rgba(0,0,0,0.1);
            user-select: none;
            font-size: 9px;
        }
        
        .node.input-node {
            border-color: #2196f3;
        }
        
        .node.output-node {
            border-color: #ff9800;
        }
        
        .node.mapping-node {
            border-color: #9c27b0;
            min-width: 160px;
        }
        
        .node.normalize-node {
            border-color: #00bcd4;
            background: #e0f7fa;
            min-width: 150px;
        }
        
        .node.selected {
            border-width: 2px;
            box-shadow: 0 2px 8px rgba(44, 95, 141, 0.3);
        }
        
        .node-header {
            font-weight: 600;
            margin-bottom: 4px;
            padding-bottom: 4px;
            border-bottom: 1px solid #e0e0e0;
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 9px;
        }
        
        .node-type {
            font-size: 8px;
            color: #666;
            text-transform: uppercase;
        }
        
        .node-port {
            width: 10px;
            height: 10px;
            border-radius: 50%;
            background: #2c5f8d;
            position: absolute;
            cursor: crosshair;
            z-index: 10;
        }
        
        .node-port.input {
            left: -5px;
            top: 50%;
            transform: translateY(-5px);
            background: #2196f3;
        }
        
        .node-port.output {
            right: -5px;
            top: 50%;
            transform: translateY(-5px);
            background: #ff9800;
        }
        
        .node-port:hover {
            transform: scale(1.3);
        }
        
        .node-value {
            font-size: 0.9rem;
            color: #666;
            margin-top: 0.25rem;
        }
        
        /* Status indicator for input nodes */
        .node-status-indicator {
            position: absolute;
            top: 8px;
            right: 8px;
            width: 10px;
            height: 10px;
            border-radius: 50%;
            z-index: 15;
        }
        
        .node-status-indicator.live {
            background: #4caf50;
            box-shadow: 0 0 8px rgba(76, 175, 80, 0.6);
            animation: pulse-green 2s infinite;
        }
        
        .node-status-indicator.playback {
            background: #ff9800;
            box-shadow: 0 0 8px rgba(255, 152, 0, 0.6);
        }
        
        .node-status-indicator.curve-paused {
            background: #9c27b0;
            box-shadow: 0 0 8px rgba(156, 39, 176, 0.6);
        }
        
        .node-status-indicator.inactive {
            background: #bbb;
        }
        
        @keyframes pulse-green {
            0%, 100% {
                opacity: 1;
                box-shadow: 0 0 8px rgba(76, 175, 80, 0.6);
            }
            50% {
                opacity: 0.6;
                box-shadow: 0 0 12px rgba(76, 175, 80, 0.8);
            }
        }
        
        .connection-line {
            stroke: #2c5f8d;
            stroke-width: 2;
            fill: none;
            pointer-events: stroke;
            cursor: pointer;
            stroke-linecap: round;
        }
        
        .connection-line:hover {
            stroke: #e67e22;
            stroke-width: 4;
        }
        
        .connection-line.selected {
            stroke: #e67e22;
            stroke-width: 4;
        }
        
        /* Invisible wider hitbox for easier clicking */
        .connection-hitbox {
            stroke: transparent;
            stroke-width: 20;
            fill: none;
            pointer-events: stroke;
            cursor: pointer;
        }
        
        .connection-hitbox:hover + .connection-line {
            stroke: #e67e22;
            stroke-width: 4;
        }
        
        .sidebar-panel {
            width: 320px;
            background: white;
            border-left: 2px solid #e0e0e0;
            padding: 1.5rem;
            overflow-y: auto;
        }
        
        .mapping-function-editor {
            background: #f8f9fa;
            padding: 1rem;
            border-radius: 4px;
            margin-top: 1rem;
        }
        
        .curve-canvas {
            width: 100%;
            height: 200px;
            background: white;
            border: 1px solid #ccc;
            border-radius: 4px;
            cursor: crosshair;
        }
        
        /* Input/Output Selection Modals */
        .selection-modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.5);
            z-index: 2000;
            align-items: center;
            justify-content: center;
        }
        
        .selection-modal-content {
            background: white;
            border-radius: 8px;
            max-width: 600px;
            max-height: 80vh;
            width: 90%;
            display: flex;
            flex-direction: column;
        }
        
        .selection-modal-header {
            padding: 1.5rem;
            border-bottom: 2px solid #e0e0e0;
        }
        
        .selection-modal-body {
            padding: 1.5rem;
            overflow-y: auto;
            flex: 1;
        }
        
        .selection-item {
            padding: 1rem;
            margin-bottom: 0.5rem;
            border: 2px solid #e0e0e0;
            border-radius: 4px;
            cursor: pointer;
            transition: all 0.2s;
        }
        
        .selection-item:hover {
            border-color: #2c5f8d;
            background: #f8f9fa;
        }
        
        .selection-item-name {
            font-weight: 600;
            color: #2c5f8d;
            margin-bottom: 0.25rem;
        }
        
        .selection-item-details {
            font-size: 0.9rem;
            color: #666;
        }

        .add-channel-section {
            background: #e8f4f8;
            border: 2px dashed #2c5f8d;
            border-radius: 6px;
            padding: 1.5rem;
            text-align: center;
            cursor: pointer;
            transition: all 0.2s;
        }

        .add-channel-section:hover {
            background: #d4e9f3;
        }

        .projects-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
            gap: 1.5rem;
            margin-top: 2rem;
        }

        .project-card {
            background: white;
            border: 1px solid #e0e0e0;
            border-radius: 8px;
            padding: 1.5rem;
            cursor: pointer;
            transition: all 0.2s;
        }

        .project-card:hover {
            box-shadow: 0 4px 12px rgba(0,0,0,0.1);
            transform: translateY(-2px);
        }

        .project-title {
            font-size: 1.2rem;
            font-weight: 600;
            color: #2c5f8d;
            margin-bottom: 0.5rem;
        }

        .project-meta {
            color: #7f8c8d;
            font-size: 0.9rem;
        }

        .sessions-table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 2rem;
        }

        .sessions-table th {
            background: #f8f9fa;
            padding: 1rem;
            text-align: left;
            font-weight: 600;
            border-bottom: 2px solid #e0e0e0;
        }

        .sessions-table td {
            padding: 1rem;
            border-bottom: 1px solid #e0e0e0;
        }

        .sessions-table tr:hover {
            background: #f8f9fa;
        }

        .playback-controls {
            background: #f8f9fa;
            padding: 1.5rem;
            border-radius: 6px;
            margin: 2rem 0;
        }

        .timeline {
            width: 100%;
            height: 40px;
            background: #e0e0e0;
            border-radius: 20px;
            position: relative;
            margin: 1rem 0;
            cursor: pointer;
        }

        .timeline-progress {
            height: 100%;
            background: #e67e22;
            border-radius: 20px;
            width: 30%;
            position: relative;
        }

        .timeline-handle {
            width: 20px;
            height: 20px;
            background: white;
            border: 3px solid #e67e22;
            border-radius: 50%;
            position: absolute;
            right: -10px;
            top: 10px;
            cursor: grab;
        }

        .playback-buttons {
            display: flex;
            gap: 0.5rem;
            justify-content: center;
            margin-bottom: 1rem;
        }

        .playback-time {
            text-align: center;
            color: #7f8c8d;
            font-family: monospace;
        }

        .form-group {
            margin-bottom: 1.5rem;
        }

        .form-label {
            display: block;
            font-weight: 600;
            margin-bottom: 0.5rem;
            color: #2c5f8d;
        }

        .form-input {
            width: 100%;
            padding: 0.75rem;
            border: 1px solid #d0d0d0;
            border-radius: 4px;
            font-size: 1rem;
        }

        .form-input:focus {
            outline: none;
            border-color: #2c5f8d;
        }

        .checkbox-group {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
            gap: 0.75rem;
            margin-top: 0.5rem;
        }

        .checkbox-item {
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        /* Modal styles */
        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.5);
            z-index: 1000;
            align-items: center;
            justify-content: center;
        }

        .modal.active {
            display: flex;
        }

        .modal-content {
            background: white;
            border-radius: 8px;
            padding: 2rem;
            max-width: 600px;
            width: 90%;
            max-height: 80vh;
            overflow-y: auto;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
        }

        .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1.5rem;
            padding-bottom: 1rem;
            border-bottom: 2px solid #e0e0e0;
        }

        .modal-title {
            font-size: 1.5rem;
            font-weight: 600;
            color: #2c5f8d;
        }

        .modal-close {
            background: none;
            border: none;
            font-size: 1.5rem;
            cursor: pointer;
            color: #7f8c8d;
            padding: 0;
            width: 30px;
            height: 30px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .modal-close:hover {
            color: #333;
        }

        .channel-list {
            display: flex;
            flex-direction: column;
            gap: 0.75rem;
        }

        .channel-list-item {
            display: flex;
            align-items: center;
            gap: 1rem;
            padding: 1rem;
            background: #f8f9fa;
            border: 2px solid #e0e0e0;
            border-radius: 6px;
            cursor: pointer;
            transition: all 0.2s;
        }

        .channel-list-item:hover {
            border-color: #2c5f8d;
            background: #e8f4f8;
        }

        .channel-list-item input[type="checkbox"] {
            width: 20px;
            height: 20px;
            cursor: pointer;
        }

        .channel-list-info {
            flex: 1;
        }

        .channel-list-name {
            font-weight: 600;
            color: #2c5f8d;
        }

        .channel-list-category {
            font-size: 0.85rem;
            color: #7f8c8d;
        }

        .channel-category-header {
            font-weight: 700;
            font-size: 0.9rem;
            color: #34495e;
            padding: 0.75rem 0 0.5rem 0;
            margin-top: 1rem;
            border-bottom: 2px solid #e0e0e0;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .channel-category-header:first-child {
            margin-top: 0;
        }

        .project-detail {
            display: none;
            margin-top: 2rem;
            padding: 2rem;
            background: white;
            border: 2px solid #e0e0e0;
            border-radius: 8px;
        }

        .project-detail.active {
            display: block;
        }

        .project-detail-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 2rem;
            padding-bottom: 1rem;
            border-bottom: 2px solid #e0e0e0;
        }

        .back-button {
            background: none;
            border: none;
            color: #2c5f8d;
            font-size: 1rem;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.5rem;
        }

        .back-button:hover {
            color: #1a4060;
        }

        .config-card {
            background: #f8f9fa;
            border: 1px solid #e0e0e0;
            border-radius: 6px;
            padding: 1.5rem;
            margin-bottom: 1.5rem;
        }

        .config-title {
            font-size: 1.1rem;
            font-weight: 600;
            color: #2c5f8d;
            margin-bottom: 1rem;
        }

        .config-channels {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 1.5rem;
        }

        .config-section {
            background: white;
            padding: 1rem;
            border-radius: 4px;
        }

        .config-section-title {
            font-weight: 600;
            color: #e67e22;
            margin-bottom: 0.75rem;
            font-size: 0.9rem;
            text-transform: uppercase;
        }

        .config-channel-list {
            list-style: none;
            padding: 0;
        }

        .config-channel-list li {
            padding: 0.4rem 0;
            color: #333;
            font-size: 0.9rem;
        }

        .config-channel-list li::before {
            content: "▸ ";
            color: #2c5f8d;
            font-weight: bold;
        }

        .session-link {
            color: #2c5f8d;
            text-decoration: none;
            font-weight: 500;
        }

        .session-link:hover {
            text-decoration: underline;
        }

/* =================================================================
   NODE EDITOR STYLES
   ================================================================= */

/* Nodes container */
#nodesContainer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Node base */
.node {
    position: absolute;
    background: rgba(30, 41, 59, 0.9);
    border-radius: 6px;
    padding: 12px;
    min-width: 220px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
    cursor: move;
}

/* Node type borders */
.node.input {
    border: 2px solid #3b82f6;
}

.node.output {
    border: 2px solid #ff8c00;
}

.node.processing {
    border: 2px solid #8b5cf6;
}

.node.selected {
    box-shadow: 0 0 0 3px rgba(200, 255, 74, 0.5);
}

/* Status indicator with tooltip */
.node-status {
    position: absolute;
    top: 35px;
    right: 10px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    box-shadow: 0 0 6px currentColor;
    cursor: help;
}

.status-live { background: #00ff88; }
.status-demo { background: #ffbb00; }
.status-curves { background: #4af0ff; }
.status-ml { background: #a855f7; }

/* Status tooltip */
.node-status::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 120%;
    right: -10px;
    background: rgba(10, 14, 26, 0.95);
    color: #e2e8f0;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 10px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    border: 1px solid rgba(100, 116, 139, 0.5);
    z-index: 100;
}

.node-status:hover::after {
    opacity: 1;
}

/* Node header */
.node-header {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 10px;
}

/* Connection ports */
.port {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #64748b;
    border: 2px solid #1e293b;
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
    margin-top: 2px;
    position: relative;
}

.port:hover {
    background: #c8ff4a;
    box-shadow: 0 0 8px #c8ff4a;
    transform: scale(1.3);
}

.port-input {
    margin-left: -18px;
}

.port-input::after {
    content: 'Input port';
    position: absolute;
    bottom: 120%;
    left: -10px;
    background: rgba(10, 14, 26, 0.95);
    color: #e2e8f0;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 10px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    border: 1px solid rgba(100, 116, 139, 0.5);
    z-index: 100;
}

.port-input:hover::after {
    opacity: 1;
}

.port-output {
    margin-left: auto;
    margin-right: -18px;
}

.port-output::after {
    content: 'Output port';
    position: absolute;
    bottom: 120%;
    right: -10px;
    background: rgba(10, 14, 26, 0.95);
    color: #e2e8f0;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 10px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    border: 1px solid rgba(100, 116, 139, 0.5);
    z-index: 100;
}

.port-output:hover::after {
    opacity: 1;
}

/* Node name */
.node-name {
    flex: 1;
    font-size: 10px;
    line-height: 1.3;
    color: #e2e8f0;
    word-break: break-word;
}

/* Data type label */
.data-type {
    font-size: 9px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 6px;
}

/* Values display */
.node-values {
    background: rgba(10, 14, 26, 0.6);
    border-radius: 4px;
    padding: 8px;
    margin-top: 8px;
}

/* Scalar value */
.value-scalar {
    font-size: 13px;
    font-weight: 700;
    color: #00ff88;
    text-align: center;
}

/* Vector values */
.value-vector {
    display: flex;
    gap: 8px;
    justify-content: center;
    font-size: 11px;
}

.value-component {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.component-label {
    font-size: 9px;
    color: #94a3b8;
}

.component-value {
    font-weight: 700;
    min-width: 50px;
    text-align: right;
}

/* X / Y / Z component value tints — red / green / blue, matching the
   convention used by the oscilloscope curves, splitter ports and
   timeline tracks. Was X-green / Y-red / Z-blue. */
.comp-x { color: #ff4444; }
.comp-y { color: #00ff88; }
.comp-z { color: #4488ff; }

/* Collection indicator */
.value-collection {
    font-size: 10px;
    color: #94a3b8;
    text-align: center;
}

