                    .plans-layout {
                        display: grid;
                        grid-template-columns: 260px 1fr;
                        grid-template-rows: auto 1fr;
                        height: 100%;
                        gap: 0;
                    }
                    .plans-layout.with-detail {
                        grid-template-columns: 260px 1fr 320px;
                    }
                    .plans-list { grid-row: span 2; }
                    .plans-stats {
                        grid-column: span 1;
                        display: flex;
                        gap: 10px;
                        padding: 10px 16px;
                        background: var(--bg-surface);
                        border-bottom: 1px solid var(--border);
                    }
                    .plans-layout.with-detail .plans-stats {
                        grid-column: span 2;
                    }
                    .stat-card {
                        flex: 1;
                        background: var(--bg-elevated);
                        border-radius: 8px;
                        padding: 10px 14px;
                        border: 1px solid var(--border);
                    }
                    .stat-label { font-size: var(--text-xs); color: var(--text-tertiary); }
                    .stat-value { font-size: var(--text-2xl); font-weight: 600; margin-top: 2px; }
                    .stat-bar { height: 3px; background: var(--bg-tertiary); border-radius: 2px; margin-top: 6px; overflow: hidden; }
                    .stat-bar-fill { height: 100%; border-radius: 2px; transition: width 0.3s; }

                    .plans-graph {
                        position: relative;
                        overflow: hidden;
                        background: var(--bg-primary);
                        background-image: radial-gradient(circle, var(--border) 1px, transparent 1px);
                        background-size: 20px 20px;
                        touch-action: none; /* Allow custom touch handling for panning */
                        -webkit-user-select: none;
                        user-select: none;
                    }
                    .plans-world { position: absolute; transform-origin: 0 0; }
                    .plans-edges { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; }
                    .plans-nodes { position: relative; }

                    .plan-step {
                        position: absolute;
                        background: var(--bg-elevated);
                        border: 1px solid var(--border);
                        border-radius: 8px;
                        min-width: 160px;
                        max-width: 240px;
                        cursor: pointer;
                        transition: box-shadow 0.2s, border-color 0.2s;
                        overflow: hidden;
                    }
                    .plan-step:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.2); }
                    .plan-step.selected { border-color: var(--accent-cyan); box-shadow: 0 0 0 2px var(--accent-cyan); }
                    .plan-step.completed { opacity: 0.7; }
                    .plan-step.completed .step-header { background: var(--accent-green) !important; }
                    .plan-step.dragging { opacity: 0.8; z-index: 1000; box-shadow: 0 8px 24px rgba(0,0,0,0.4); }
                    .plan-step .step-header { cursor: grab; }
                    .plan-step.dragging .step-header { cursor: grabbing; }

                    .step-header {
                        padding: 8px 12px;
                        color: white;
                        font-size: var(--text-xs);
                        text-transform: uppercase;
                        display: flex;
                        justify-content: space-between;
                        align-items: center;
                    }
                    .step-icon { width: 20px; height: 20px; border-radius: 4px; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.2); margin-right: 8px; }
                    .step-type-label { flex: 1; font-weight: 500; }
                    .step-status-dot { width: 8px; height: 8px; border-radius: 50%; }
                    .step-status-dot.pending { background: var(--text-tertiary); }
                    .step-status-dot.in_progress { background: var(--accent-cyan); animation: pulse 1.5s infinite; }
                    .step-status-dot.completed { background: var(--accent-green); }
                    @keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

                    .step-body { padding: 10px 12px; }
                    .step-title { font-weight: 500; font-size: var(--text-sm); line-height: 1.4; margin-bottom: 4px; word-wrap: break-word; overflow-wrap: break-word; }
                    .step-agent { font-size: var(--text-xs); color: var(--text-tertiary); }

                    .step-ports { display: flex; justify-content: space-between; padding: 8px 12px; background: var(--bg-secondary); border-top: 1px solid var(--border); font-size: var(--text-xs); }
                    .port { display: flex; align-items: center; gap: 4px; padding: 2px 6px; border-radius: 4px; background: var(--bg-elevated); }
                    .port-dot { width: 6px; height: 6px; border-radius: 50%; }
                    .port.input .port-dot { background: var(--accent-blue); }
                    .port.output .port-dot { background: var(--accent-green); }
                    .port-dot { cursor: crosshair; transition: transform 0.15s; }
                    .port-dot:hover { transform: scale(1.5); }

                    /* Edge styling */
                    .plans-edges { pointer-events: auto !important; }
                    .plan-edge { transition: stroke 0.15s, stroke-width 0.15s; pointer-events: stroke; cursor: pointer; }
                    .plan-edge:hover { stroke: #ef4444 !important; stroke-width: 3px !important; }

                    /* Edge creation mode */
                    .plans-nodes.edge-creation-mode .plan-step { opacity: 0.7; }
                    .plans-nodes.edge-creation-mode .port-dot { animation: port-pulse 1s infinite; background: var(--accent-blue) !important; }
                    @keyframes port-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.5); } }

                    .plans-detail {
                        background: var(--bg-surface);
                        border-left: 1px solid var(--border);
                        overflow-y: auto;
                    }
                    .detail-panel-header {
                        display: none;
                    }
                    .detail-panel-back { display: none; }
                    .detail-panel-close {
                        width: 32px;
                        height: 32px;
                        display: flex;
                        align-items: center;
                        justify-content: center;
                        background: var(--bg-tertiary);
                        border: none;
                        border-radius: 8px;
                        color: var(--text-primary);
                        font-size: var(--text-2xl);
                        cursor: pointer;
                    }
                    .detail-panel-close:hover {
                        background: var(--bg-elevated);
                    }
                    @media (max-width: 768px) {
                        .detail-panel-header {
                            display: flex;
                            align-items: center;
                            gap: 12px;
                            padding: 12px 16px;
                            border-bottom: 1px solid var(--border);
                            background: var(--bg-surface);
                            position: sticky;
                            top: 0;
                            z-index: 10001;
                        }
                        .detail-panel-back {
                            display: flex;
                            align-items: center;
                            justify-content: center;
                            width: 36px;
                            height: 36px;
                            background: none;
                            border: none;
                            color: var(--text-primary);
                            cursor: pointer;
                            flex-shrink: 0;
                        }
                        .detail-panel-title {
                            font-size: var(--text-lg);
                            font-weight: 600;
                            color: var(--text-primary);
                            flex: 1;
                        }
                        .detail-panel-close {
                            flex-shrink: 0;
                        }
                    }
                    .detail-section { padding: 16px; border-bottom: 1px solid var(--border); }
                    .detail-section-title { font-size: var(--text-xs); text-transform: uppercase; color: var(--text-tertiary); margin-bottom: 12px; }
                    .detail-field { margin-bottom: 12px; }
                    .detail-label { font-size: var(--text-xs); color: var(--text-tertiary); margin-bottom: 4px; }
                    .detail-value { font-size: var(--text-sm); }
                    .detail-select { width: 100%; padding: 8px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 6px; color: var(--text-primary); font-size: var(--text-sm); }

                    .plans-toolbar {
                        display: flex;
                        flex-wrap: wrap;
                        gap: 8px;
                        padding: 12px 16px;
                        background: var(--bg-surface);
                        border-bottom: 1px solid var(--border);
                        position: relative;
                        z-index: 10;
                    }
                    .plans-toolbar .btn { font-size: var(--text-sm); }
                    .plans-toolbar .btn.disabled { opacity: 0.5; cursor: not-allowed; background: var(--bg-tertiary); }

                    .plans-zoom-controls {
                        position: absolute;
                        left: 16px;
                        bottom: 16px;
                        display: flex;
                        flex-direction: column;
                        gap: 2px;
                        z-index: 20;
                        border-radius: 10px;
                        overflow: hidden;
                        box-shadow: 0 2px 12px rgba(0,0,0,0.4);
                    }
                    .plans-zoom-btn {
                        width: 40px;
                        height: 40px;
                        display: flex;
                        align-items: center;
                        justify-content: center;
                        background: var(--bg-elevated);
                        border: none;
                        color: var(--text-secondary);
                        font-size: var(--text-xl);
                        font-weight: 500;
                        cursor: pointer;
                        transition: background 0.15s, color 0.15s;
                    }
                    .plans-zoom-btn:hover {
                        background: var(--bg-tertiary);
                        color: var(--text-primary);
                    }
                    .plans-zoom-btn:active {
                        background: var(--accent-cyan);
                        color: white;
                    }
                    .plans-minimap {
                        position: absolute;
                        right: 16px;
                        bottom: 16px;
                        width: 200px;
                        height: 60px;
                        border-radius: 8px;
                        background: var(--bg-elevated);
                        border: 1px solid var(--border);
                        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
                        overflow: hidden;
                        z-index: 21;
                        cursor: grab;
                    }
                    .plans-minimap:active { cursor: grabbing; }
                    .plans-minimap-content {
                        position: absolute;
                        inset: 0;
                        padding: 4px;
                        box-sizing: border-box;
                        pointer-events: none;
                    }
                    .plans-minimap-node {
                        position: absolute;
                        border-radius: 2px;
                        background: var(--accent-cyan);
                        border: none;
                        opacity: 0.6;
                    }
                    .plans-minimap-viewport {
                        position: absolute;
                        border: 2px solid var(--accent-cyan);
                        background: rgba(86, 176, 170, 0.2);
                        border-radius: 4px;
                        pointer-events: none;
                    }

                    /* QA step special styling */
                    .plan-step[data-step-type='qa'] {
                        border: 2px solid #dc2626;
                        box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2);
                    }
                    .plan-step[data-step-type='qa'].completed {
                        border-color: #10b981;
                        box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
                    }
                    .plan-step[data-step-type='qa'].blocked {
                        border-color: #dc2626;
                        animation: qa-blocked 1.5s infinite;
                    }
                    @keyframes qa-blocked {
                        0%, 100% { box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2); }
                        50% { box-shadow: 0 0 0 5px rgba(220, 38, 38, 0.4); }
                    }

                    /* QA badge for approval steps */
                    .qa-badge {
                        display: inline-flex;
                        align-items: center;
                        gap: 4px;
                        padding: 2px 6px;
                        border-radius: 4px;
                        font-size: var(--text-xs);
                        font-weight: 600;
                        text-transform: uppercase;
                    }
                    .qa-badge.pass { background: rgba(16, 185, 129, 0.2); color: #10b981; }
                    .qa-badge.fail { background: rgba(220, 38, 38, 0.2); color: #dc2626; }
                    .qa-badge.pending { background: rgba(139, 92, 246, 0.2); color: #8b5cf6; }
                    .qa-badge.needs_changes { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }

                    /* QA Report in detail panel */
                    .qa-findings-list, .qa-actions-list {
                        display: flex;
                        flex-direction: column;
                        gap: 8px;
                        margin-top: 8px;
                    }
                    .qa-finding {
                        padding: 8px 10px;
                        border-radius: 6px;
                        font-size: var(--text-sm);
                        border-left: 3px solid;
                    }
                    .qa-finding.high {
                        background: rgba(220, 38, 38, 0.1);
                        border-color: #dc2626;
                    }
                    .qa-finding.medium {
                        background: rgba(245, 158, 11, 0.1);
                        border-color: #f59e0b;
                    }
                    .qa-finding.low {
                        background: rgba(59, 130, 246, 0.1);
                        border-color: #3b82f6;
                    }
                    .qa-finding-header {
                        display: flex;
                        justify-content: space-between;
                        align-items: center;
                        margin-bottom: 4px;
                    }
                    .qa-finding-severity {
                        font-size: var(--text-xs);
                        font-weight: 600;
                        text-transform: uppercase;
                        padding: 2px 6px;
                        border-radius: 4px;
                    }
                    .qa-finding-severity.high { background: #dc2626; color: white; }
                    .qa-finding-severity.medium { background: #f59e0b; color: white; }
                    .qa-finding-severity.low { background: #3b82f6; color: white; }
                    .qa-finding-file { font-size: var(--text-xs); color: var(--text-tertiary); font-family: var(--font-mono); }
                    .qa-finding-issue { font-weight: 500; margin-bottom: 4px; }
                    .qa-finding-recommendation { font-size: var(--text-xs); color: var(--text-secondary); }
                    .qa-action-item {
                        padding: 6px 10px;
                        background: var(--bg-elevated);
                        border-radius: 4px;
                        font-size: var(--text-sm);
                        display: flex;
                        align-items: center;
                        gap: 6px;
                    }
                    .qa-action-item::before {
                        content: '';
                        width: 6px;
                        height: 6px;
                        border-radius: 50%;
                        background: #f59e0b;
                    }
                    .qa-no-findings {
                        padding: 12px;
                        text-align: center;
                        color: var(--text-tertiary);
                        font-size: var(--text-sm);
                        background: var(--bg-elevated);
                        border-radius: 6px;
                    }

                    /* Explain Popover */
                    .explain-popover {
                        position: fixed;
                        z-index: 10000;
                        background: var(--bg-surface);
                        border: 1px solid var(--border-primary);
                        border-radius: 10px;
                        padding: 14px 16px;
                        min-width: 280px;
                        max-width: 360px;
                        box-shadow: 0 8px 32px rgba(0,0,0,0.3);
                        display: none;
                        pointer-events: none;
                    }
                    .explain-popover.visible {
                        display: block;
                    }
                    .explain-popover-title {
                        font-size: var(--text-xs);
                        text-transform: uppercase;
                        letter-spacing: 0.5px;
                        color: var(--text-tertiary);
                        margin-bottom: 10px;
                        display: flex;
                        justify-content: space-between;
                        align-items: center;
                    }
                    .explain-popover-speaker {
                        cursor: pointer;
                        opacity: 0.6;
                        transition: opacity 0.15s;
                        pointer-events: auto;
                    }
                    .explain-popover-speaker:hover {
                        opacity: 1;
                    }
                    .explain-row {
                        display: flex;
                        gap: 10px;
                        margin-bottom: 8px;
                        font-size: var(--text-sm);
                        line-height: 1.5;
                    }
                    .explain-row:last-child {
                        margin-bottom: 0;
                    }
                    .explain-label {
                        font-weight: 600;
                        color: var(--accent-cyan);
                        min-width: 45px;
                        flex-shrink: 0;
                    }
                    .explain-value {
                        color: var(--text-primary);
                    }

                    /* Mobile Plans Toggle Button */
                    .plans-mobile-toggle {
                        display: none;
                        position: fixed;
                        bottom: 20px;
                        right: 16px;
                        z-index: 100;
                        background: var(--accent-cyan);
                        color: white;
                        border: none;
                        border-radius: 50%;
                        width: 56px;
                        height: 56px;
                        font-size: var(--text-2xl);
                        cursor: pointer;
                        box-shadow: 0 4px 12px rgba(0,0,0,0.3);
                    }
                    .plans-mobile-toggle:active {
                        transform: scale(0.95);
                    }

                    /* Mobile Plans List Overlay */
                    .plans-mobile-overlay {
                        display: none;
                    }

                    /* Mobile Responsive Styles */
                    @media (max-width: 768px) {
                        .plans-layout {
                            display: flex;
                            flex-direction: column;
                            height: calc(100vh - 60px);
                            grid-template-columns: unset;
                            grid-template-rows: unset;
                        }
                        .plans-layout.with-detail {
                            grid-template-columns: unset;
                        }

                        /* Hide sidebar list by default on mobile */
                        .plans-list {
                            display: none;
                            position: fixed;
                            top: 0;
                            left: 0;
                            right: 0;
                            bottom: 0;
                            z-index: 200;
                            background: var(--bg-surface);
                            grid-row: unset;
                        }
                        .plans-list.mobile-visible {
                            display: flex;
                            flex-direction: column;
                        }
                        .plans-list .list-header {
                            display: flex;
                            justify-content: space-between;
                            align-items: center;
                            padding: 16px;
                            border-bottom: 1px solid var(--border);
                        }
                        .plans-list .list-items {
                            flex: 1;
                            overflow-y: auto;
                        }
                        .plans-list .nav-item {
                            padding: 16px;
                            border-bottom: 1px solid var(--border);
                        }

                        /* Mobile close button in list */
                        .plans-list-close {
                            background: transparent;
                            border: none;
                            color: var(--text-primary);
                            font-size: var(--text-2xl);
                            cursor: pointer;
                            padding: 8px;
                        }

                        /* Show mobile toggle button */
                        .plans-mobile-toggle {
                            display: flex;
                            align-items: center;
                            justify-content: center;
                        }

                        /* Stats bar - make scrollable */
                        .plans-stats {
                            flex-shrink: 0;
                            overflow-x: auto;
                            padding: 12px;
                            gap: 8px;
                            grid-column: unset;
                        }
                        .plans-layout.with-detail .plans-stats {
                            grid-column: unset;
                        }
                        .stat-card {
                            min-width: 100px;
                            padding: 10px;
                            flex: 0 0 auto;
                        }
                        .stat-label { font-size: var(--text-xs); }
                        .stat-value { font-size: var(--text-xl); }

                        /* Graph takes remaining space */
                        .plans-graph {
                            flex: 1;
                            min-height: 0;
                        }

                        /* Toolbar - make scrollable */
                        .plans-toolbar {
                            overflow-x: auto;
                            white-space: nowrap;
                            padding: 8px 12px;
                            gap: 6px;
                            -webkit-overflow-scrolling: touch;
                        }
                        .plans-toolbar .btn {
                            flex-shrink: 0;
                            font-size: var(--text-xs);
                            padding: 6px 10px;
                        }
                        .plans-minimap {
                            width: 185px;
                            height: 58px;
                            right: 12px;
                            bottom: 80px;
                        }

                        .plans-zoom-controls {
                            left: 12px;
                            bottom: 80px;
                        }

                        /* Plan nodes - constrained on mobile */
                        .plan-step {
                            min-width: 140px;
                            max-width: 220px;
                        }
                        .step-header {
                            padding: 6px 10px;
                            font-size: var(--text-xs);
                        }
                        .step-body {
                            padding: 8px 10px;
                        }
                        .step-title {
                            font-size: var(--text-sm);
                        }
                        .step-agent {
                            font-size: var(--text-xs);
                        }
                        .step-ports {
                            padding: 6px 10px;
                            font-size: 9px;
                        }

                        /* Detail panel as full-screen overlay on mobile */
                        .plans-detail {
                            display: none;
                            position: fixed;
                            top: 56px;
                            left: 0;
                            right: 0;
                            bottom: 0;
                            z-index: 199;
                            border-left: none;
                        }
                        .plans-detail[style*="display: block"] {
                            display: block !important;
                        }

                        /* Hide explain popover on mobile - info shown in detail panel */
                        .explain-popover {
                            display: none !important;
                        }
                    }

                    /* Extra small mobile */
                    @media (max-width: 480px) {
                        .plans-stats {
                            display: none;
                        }
                        .plans-toolbar .btn {
                            font-size: var(--text-xs);
                            padding: 5px 8px;
                        }
                        .plan-step {
                            min-width: 120px;
                        }
                        .plans-minimap {
                            width: 155px;
                            height: 50px;
                            bottom: 80px;
                        }
                    }
