:root {
            --bg-gradient: linear-gradient(135deg, #0f0c1b 0%, #15102a 50%, #06040a 100%);
            --panel-bg: rgba(25, 20, 45, 0.45);
            --panel-border: rgba(255, 255, 255, 0.08);
            --primary: #8b5cf6;
            --primary-glow: rgba(139, 92, 246, 0.4);
            --accent: #d946ef;
            --text-main: #f3f4f6;
            --text-muted: #9ca3af;
            --success: #10b981;
            --success-bg: rgba(16, 185, 129, 0.15);
            --danger: #ef4444;
            --danger-bg: rgba(239, 68, 68, 0.15);
            --warning: #f59e0b;
            --font-main: 'Plus Jakarta Sans', 'Outfit', sans-serif;
            --font-code: 'JetBrains Mono', monospace;
        }
        * { box-sizing: border-box; margin: 0; padding: 0; }
        body {
            font-family: var(--font-main);
            background: var(--bg-gradient);
            color: var(--text-main);
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 2.5rem 1.5rem;
            overflow-x: hidden;
        }
        .ambient-glow-1 { position: absolute; top: -10%; left: -10%; width: 50vw; height: 50vw; background: radial-gradient(circle, rgba(139, 92, 246, 0.15) 0%, transparent 70%); z-index: -1; pointer-events: none; }
        .ambient-glow-2 { position: absolute; bottom: -10%; right: -10%; width: 50vw; height: 50vw; background: radial-gradient(circle, rgba(217, 70, 239, 0.1) 0%, transparent 70%); z-index: -1; pointer-events: none; }
        .container { width: 100%; max-width: 1100px; display: flex; flex-direction: column; gap: 2rem; z-index: 10; }
        header { text-align: center; margin-bottom: 0.5rem; }
        h1 { font-family: 'Outfit', sans-serif; font-size: 3.2rem; font-weight: 800; letter-spacing: -0.05em; background: linear-gradient(to right, #ffffff, #d8b4fe, #f472b6); -webkit-background-clip: text; -webkit-text-fill-color: transparent; margin-bottom: 0.5rem; filter: drop-shadow(0 2px 8px rgba(139, 92, 246, 0.2)); }
        header p { color: var(--text-muted); font-size: 1.1rem; font-weight: 400; }
        .glass-panel { background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: 20px; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); padding: 2.2rem; box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37); transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
        
        /* Role Matrix Grid */
        .role-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.2rem; margin-bottom: 1.5rem; }
        .role-card { background: rgba(0,0,0,0.2); border: 1px solid var(--panel-border); border-radius: 15px; padding: 1.2rem; display: flex; flex-direction: column; gap: 0.8rem; }
        .role-card h4 { font-size: 0.9rem; color: var(--primary); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.3rem; }
        .role-card label { font-size: 0.75rem; color: var(--text-muted); display: block; margin-bottom: 0.2rem; }
        .role-card select { width: 100%; background: rgba(15, 10, 30, 0.6); border: 1px solid var(--panel-border); border-radius: 8px; color: #ffffff; padding: 0.6rem; font-size: 0.85rem; outline: none; transition: border-color 0.2s; }
        .role-card select:focus { border-color: var(--primary); }

        .dropzone-container { display: flex; flex-direction: column; align-items: center; justify-content: center; border: 2px dashed rgba(139, 92, 246, 0.3); border-radius: 16px; padding: 3rem 2rem; background: rgba(15, 10, 30, 0.3); cursor: pointer; transition: all 0.25s ease; text-align: center; }
        .dropzone-container:hover { border-color: var(--primary); background: rgba(139, 92, 246, 0.08); }
        .dropzone-container.dragover { border-color: var(--success); background: rgba(16, 185, 129, 0.1); }
        .dropzone-icon { font-size: 3.5rem; margin-bottom: 1.2rem; color: var(--primary); transition: transform 0.2s ease; }
        .dropzone-container.dragover .dropzone-icon { transform: scale(1.1); }
        .selected-file-badge { display: none; align-items: center; gap: 0.8rem; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 30px; padding: 0.6rem 1.2rem; margin-top: 1.5rem; }
        .controls { display: flex; justify-content: center; gap: 1.2rem; margin-top: 1.5rem; }
        .btn { font-family: var(--font-main); font-size: 1rem; font-weight: 600; padding: 0.8rem 2.2rem; border-radius: 12px; border: none; cursor: pointer; transition: all 0.2s ease; display: flex; align-items: center; gap: 0.6rem; outline: none; }
        .btn:disabled { opacity: 0.5; cursor: not-allowed; }
        .btn-primary { background: linear-gradient(135deg, var(--primary) 0%, #6d28d9 100%); color: white; box-shadow: 0 4px 15px var(--primary-glow); }
        .btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 20px var(--primary-glow); }
        .btn-secondary { background: rgba(255, 255, 255, 0.08); color: white; border: 1px solid rgba(255, 255, 255, 0.1); }
        .btn-secondary:hover:not(:disabled) { background: rgba(255, 255, 255, 0.12); }
        .btn-danger { background: linear-gradient(135deg, var(--danger) 0%, #b91c1c 100%); color: white; }
        
        /* Model cards and discovery panel */
        .model-discovery { margin-top: 1.5rem; display: none; transition: max-height 0.3s ease; }
        .model-discovery.visible { display: block; animation: fadeIn 0.4s ease; }
        @keyframes fadeIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
        .server-section { background: rgba(0,0,0,0.15); border-radius: 12px; padding: 1rem; margin-bottom: 1rem; }
        .server-header { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 0.8rem; }
        .server-status { width: 8px; height: 8px; border-radius: 50%; }
        .server-status.online { background: var(--success); box-shadow: 0 0 6px var(--success); }
        .server-status.offline { background: var(--danger); }
        .model-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0.8rem; }
        .model-card { background: rgba(255,255,255,0.03); border: 1px solid var(--panel-border); border-radius: 10px; padding: 0.8rem; display: flex; flex-direction: column; gap: 0.4rem; transition: background 0.2s; }
        .model-card:hover { background: rgba(255,255,255,0.05); }
        .model-name { font-weight: 600; font-size: 0.9rem; }
        .model-desc { font-size: 0.75rem; color: var(--text-muted); margin: 0.3rem 0; line-height: 1.4; }
        .model-meta { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.3rem; }
        .meta-badge { font-size: 0.65rem; padding: 0.15rem 0.5rem; border-radius: 6px; font-weight: 600; }
        .badge-params { background: rgba(139, 92, 246, 0.2); color: var(--primary); }
        .badge-size { background: rgba(255, 255, 255, 0.08); color: var(--text-muted); }
        .badge-quant { background: rgba(217, 70, 239, 0.15); color: #d946ef; }
        .badge-main { background: rgba(139, 92, 246, 0.25); color: #a78bfa; }
        .badge-embed { background: rgba(59, 130, 246, 0.25); color: #60a5fa; }
        .badge-vision { background: rgba(234, 179, 8, 0.25); color: #fbbf24; }
        .badge-chat { background: rgba(16, 185, 129, 0.25); color: #34d399; }

        /* Progress and Phases */
        .progress-section { }
        .progress-bar-wrapper { width: 100%; height: 12px; background: rgba(255, 255, 255, 0.06); border-radius: 10px; overflow: hidden; margin-bottom: 2rem; }
        .progress-bar-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%); transition: width 0.4s ease; }
        .phases-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.2rem; }
        .phase-card { background: rgba(255, 255, 255, 0.02); border: 1px solid rgba(255, 255, 255, 0.04); border-radius: 12px; padding: 1.2rem; display: flex; align-items: flex-start; flex-direction: column; transition: all 0.3s ease; }
        .phase-header { display: flex; justify-content: space-between; width: 100%; align-items: center; }
        .phase-card.active { border-color: var(--warning); background: rgba(245, 158, 11, 0.05); animation: glowPulse 2s infinite; }
        .phase-card.completed { border-color: var(--success); background: rgba(16, 185, 129, 0.05); }
        .phase-card.failed { border-color: var(--danger); background: rgba(239, 68, 68, 0.08); }
        .phase-status-badge { font-size: 0.7rem; padding: 0.3rem 0.6rem; border-radius: 10px; text-transform: uppercase; font-weight: 700; }
        .status-running { background: var(--warning); color: black; }
        .status-completed { background: var(--success); color: white; }
        .status-pending { background: rgba(255,255,255,0.1); color: var(--text-muted); }
        .status-failed { background: var(--danger); color: white; }
        
        .phase-error-msg { font-size: 0.75rem; color: var(--danger); margin-top: 0.5rem; font-family: var(--font-code); background: rgba(0,0,0,0.2); padding: 0.5rem; border-radius: 6px; width: 100%; }
        .phase-actions { display: flex; gap: 0.5rem; margin-top: 0.8rem; width: 100%; }
        
        /* Retry/Resume buttons */
        .btn-sm { font-size: 0.75rem; padding: 0.4rem 0.8rem; border-radius: 8px; cursor: pointer; transition: all 0.2s; outline: none; font-weight: 600; display: inline-flex; align-items: center; gap: 0.3rem;}
        .btn-retry { background: rgba(139, 92, 246, 0.2); color: var(--primary); border: 1px solid var(--primary); }
        .btn-resume { background: rgba(16, 185, 129, 0.2); color: var(--success); border: 1px solid var(--success); }
        .btn-rerun { background: rgba(255, 255, 255, 0.05); color: var(--text-muted); border: 1px solid var(--panel-border); }
        .btn-retry:hover { background: rgba(139, 92, 246, 0.4); }
        .btn-resume:hover { background: rgba(16, 185, 129, 0.4); }
        .btn-rerun:hover { background: rgba(255, 255, 255, 0.1); color: white; }

        @keyframes glowPulse { 0%, 100% { box-shadow: 0 0 5px rgba(245, 158, 11, 0.2); } 50% { box-shadow: 0 0 15px rgba(245, 158, 11, 0.4); } }
        
        /* Console */
        .console-section { display: none; }
        .console-window { background: rgba(5, 3, 10, 0.85); border: 1px solid var(--panel-border); border-radius: 0 0 12px 12px; height: 320px; overflow-y: auto; padding: 1.2rem; font-family: var(--font-code); font-size: 0.85rem; color: #d1d5db; white-space: pre-wrap; line-height: 1.5; }
        .console-title-bar { background: rgba(10, 5, 20, 0.6); border: 1px solid var(--panel-border); border-radius: 12px 12px 0 0; padding: 0.8rem 1.2rem; display: flex; justify-content: space-between; align-items: center; font-family: var(--font-code); }
        
        /* Results */
        .results-section { display: none; grid-template-columns: 1fr 1fr; gap: 1.8rem; }
        .files-list { display: flex; flex-direction: column; gap: 0.8rem; margin-top: 1rem; }
        .file-item { background: rgba(255, 255, 255, 0.02); border: 1px solid rgba(255, 255, 255, 0.05); border-radius: 10px; padding: 0.9rem 1.2rem; display: flex; justify-content: space-between; align-items: center; transition: background 0.2s; }
        .file-item:hover { background: rgba(255, 255, 255, 0.05); }
        .summary-viewer { background: rgba(5, 3, 10, 0.4); border: 1px solid var(--panel-border); border-radius: 12px; padding: 1.2rem; font-size: 0.95rem; line-height: 1.7; color: #e5e7eb; overflow-y: auto; max-height: 480px; white-space: pre-wrap; }
        
        .status-banner { display: flex; align-items: center; gap: 0.8rem; background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.05); border-radius: 12px; padding: 1rem 1.5rem; margin-bottom: 0.5rem; font-weight: 500; transition: all 0.3s; }
        .status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--text-muted); }
        .status-banner.running .status-dot { background: var(--warning); animation: pulse 1s infinite alternate; }
        .status-banner.completed { border-color: var(--success); background: rgba(16, 185, 129, 0.1); }
        .status-banner.completed .status-dot { background: var(--success); }
        @keyframes pulse { from { opacity: 0.5; } to { opacity: 1; } }

        /* Toast notifications */
        .toast-container { position: fixed; top: 1.5rem; right: 1.5rem; z-index: 9999; display: flex; flex-direction: column; gap: 0.5rem; pointer-events: none; }
        .toast { padding: 0.8rem 1.2rem; border-radius: 10px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.7s forwards; font-size: 0.9rem; font-weight: 600; box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
        .toast-success { background: rgba(16, 185, 129, 0.9); color: white; border: 1px solid rgba(255,255,255,0.2); }
        .toast-error { background: rgba(239, 68, 68, 0.9); color: white; border: 1px solid rgba(255,255,255,0.2); }
        @keyframes slideIn { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
        @keyframes fadeOut { to { opacity: 0; transform: translateY(-10px); } }