
        /* ========================================
           DESIGN TOKENS
           ======================================== */
        /* Page-scoped layout vars (sidebar/header dimensions unique to v2) */
        .app {
            --sidebar-w: 380px;
            --header-h: 52px;
        }

        *,
        *::before,
        *::after {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }

        body {
            font-family: var(--font-body);
            font-weight: 400;
            background: var(--surface-base);
            color: var(--text-primary);
            line-height: var(--lh-normal);
            -webkit-font-smoothing: antialiased;
            overflow: hidden;
            height: 100vh;
        }

        ::selection {
            background: rgba(99, 102, 241, 0.3);
        }

        a {
            color: var(--accent);
            text-decoration: none;
        }

        a:hover {
            text-decoration: underline;
        }

        /* Noise texture */
        body::before {
            content: '';
            position: fixed;
            inset: 0;
            z-index: 9999;
            pointer-events: none;
            opacity: 0.018;
            background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
            background-repeat: repeat;
            background-size: 256px 256px;
        }

        /* ========================================
           APP LAYOUT
           ======================================== */
        .app {
            display: grid;
            grid-template-rows: var(--header-h) 1fr;
            grid-template-columns: var(--sidebar-w) 1fr;
            height: 100vh;
            overflow: hidden;
        }

        /* ========================================
           HEADER
           ======================================== */
        .header {
            grid-column: 1 / -1;
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 var(--sp-5);
            background: var(--surface-0);
            border-bottom: 1px solid var(--border-subtle);
            z-index: 100;
        }

        .header-left {
            display: flex;
            align-items: center;
            gap: var(--sp-5);
        }

        .wordmark {
            font-family: var(--font-display);
            font-size: var(--text-2xl);
            font-style: italic;
            color: var(--text-primary);
            letter-spacing: -0.01em;
            user-select: none;
        }

        .wordmark span {
            color: var(--text-tertiary);
            font-style: normal;
            font-family: var(--font-body);
            font-size: var(--text-xs);
            font-weight: 500;
            letter-spacing: 0.08em;
            text-transform: uppercase;
            margin-left: var(--sp-3);
            position: relative;
            top: -1px;
        }

        .header-nav {
            display: flex;
            gap: 0;
        }

        .header-nav a {
            font-size: var(--text-sm);
            font-weight: 500;
            color: var(--text-tertiary);
            padding: var(--sp-3) var(--sp-4);
            border-radius: var(--r-sm);
            transition: color var(--t-fast), background var(--t-fast);
            text-decoration: none;
        }

        .header-nav a:hover {
            color: var(--text-secondary);
            background: var(--surface-2);
            text-decoration: none;
        }

        .header-nav a.active {
            color: var(--text-primary);
            background: var(--surface-2);
        }

        .header-right {
            display: flex;
            align-items: center;
            gap: var(--sp-4);
        }

        .live-badge {
            display: none;
            align-items: center;
            gap: var(--sp-2);
            font-size: var(--text-xs);
            font-weight: 600;
            letter-spacing: 0.06em;
            text-transform: uppercase;
            color: var(--live);
            padding: var(--sp-1) var(--sp-3);
            border: 1px solid rgba(0, 212, 255, 0.2);
            border-radius: var(--r-sm);
            background: rgba(0, 212, 255, 0.05);
        }

        .live-badge.visible {
            display: flex;
        }

        .live-dot {
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: var(--live);
            animation: pulse-live 2s ease infinite;
        }

        @keyframes pulse-live {

            0%,
            100% {
                opacity: 1;
                box-shadow: 0 0 0 0 rgba(0, 212, 255, 0.4);
            }

            50% {
                opacity: 0.7;
                box-shadow: 0 0 0 4px rgba(0, 212, 255, 0);
            }
        }

        .api-key-btn {
            font-family: var(--font-mono);
            font-size: var(--text-xs);
            color: var(--text-tertiary);
            background: var(--surface-2);
            border: 1px solid var(--border-subtle);
            border-radius: var(--r-sm);
            padding: var(--sp-1) var(--sp-3);
            cursor: pointer;
            transition: all var(--t-fast);
        }

        .api-key-btn:hover {
            border-color: var(--border-default);
            color: var(--text-secondary);
        }

        .api-key-btn.connected {
            border-color: rgba(0, 214, 126, 0.2);
            color: var(--trust-high);
        }

        /* ========================================
           SIDEBAR
           ======================================== */
        .sidebar {
            display: flex;
            flex-direction: column;
            background: var(--surface-0);
            border-right: 1px solid var(--border-subtle);
            overflow-y: auto;
            overflow-x: hidden;
        }

        .sidebar::-webkit-scrollbar {
            width: 4px;
        }

        .sidebar::-webkit-scrollbar-track {
            background: transparent;
        }

        .sidebar::-webkit-scrollbar-thumb {
            background: var(--border-subtle);
            border-radius: 2px;
        }

        .sidebar-section {
            padding: var(--sp-5);
            border-bottom: 1px solid var(--border-faint);
        }

        .sidebar-section:last-child {
            border-bottom: none;
        }

        .section-label {
            font-size: var(--text-xs);
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.1em;
            color: var(--text-muted);
            margin-bottom: var(--sp-3);
        }

        .question-input {
            width: 100%;
            background: var(--surface-1);
            border: 1px solid var(--border-subtle);
            border-radius: var(--r-md);
            color: var(--text-primary);
            font-family: var(--font-body);
            font-size: var(--text-sm);
            line-height: var(--lh-normal);
            padding: var(--sp-4);
            resize: vertical;
            min-height: 120px;
            transition: border-color var(--t-base);
        }

        .question-input::placeholder {
            color: var(--text-muted);
        }

        .question-input:focus-visible {
            outline: 2px solid var(--accent);
            outline-offset: 2px;
            border-color: var(--accent);
        }

        /* Mode Pills */
        .mode-pills {
            display: flex;
            flex-direction: column;
            gap: var(--sp-2);
        }

        .mode-pill {
            display: flex;
            align-items: center;
            gap: var(--sp-3);
            padding: var(--sp-3) var(--sp-4);
            background: transparent;
            border: 1px solid var(--border-subtle);
            border-radius: var(--r-md);
            cursor: pointer;
            transition: all var(--t-fast);
            color: var(--text-secondary);
            font-family: var(--font-body);
            font-size: var(--text-sm);
            text-align: left;
            width: 100%;
        }

        .mode-pill:hover {
            background: var(--surface-2);
            border-color: var(--border-default);
            color: var(--text-primary);
        }

        .mode-pill.active {
            background: rgba(99, 102, 241, 0.08);
            border-color: rgba(99, 102, 241, 0.3);
            color: var(--text-primary);
        }

        .mode-pill-premium {
            border-color: rgba(168, 85, 247, 0.4);
            background: linear-gradient(135deg, rgba(168, 85, 247, 0.05) 0%, rgba(236, 72, 153, 0.05) 100%);
        }

        .mode-pill-premium:hover {
            border-color: rgba(168, 85, 247, 0.6);
            background: linear-gradient(135deg, rgba(168, 85, 247, 0.1) 0%, rgba(236, 72, 153, 0.1) 100%);
        }

        .mode-pill-premium.active {
            border-color: rgba(168, 85, 247, 0.8);
            background: linear-gradient(135deg, rgba(168, 85, 247, 0.15) 0%, rgba(236, 72, 153, 0.15) 100%);
        }

        .mode-pill-icon {
            font-size: var(--text-base);
            width: 24px;
            text-align: center;
            flex-shrink: 0;
        }

        .mode-pill-text {
            flex: 1;
            display: flex;
            flex-direction: column;
        }

        .mode-pill-name {
            font-weight: 600;
            font-size: var(--text-sm);
        }

        .mode-pill-desc {
            font-size: var(--text-xs);
            color: var(--text-tertiary);
            margin-top: 1px;
            font-weight: 400;
        }

        .mode-pill.active .mode-pill-desc {
            color: var(--text-secondary);
        }

        .mode-pill-credits {
            font-family: var(--font-mono);
            font-size: var(--text-xs);
            color: var(--text-muted);
            background: var(--surface-2);
            padding: 2px 6px;
            border-radius: var(--r-sm);
            flex-shrink: 0;
        }

        .mode-pill.active .mode-pill-credits {
            background: rgba(99, 102, 241, 0.15);
            color: var(--accent);
        }

        /* Options */
        .option-row {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            justify-content: space-between;
            padding: var(--sp-3) 0;
            gap: var(--sp-1);
        }

        .option-row+.option-row {
            border-top: 1px solid var(--border-faint);
        }

        .option-left {
            display: flex;
            align-items: center;
            gap: var(--sp-2);
            flex: 1;
            min-width: 0;
        }

        .option-label {
            font-size: var(--text-sm);
            color: var(--text-secondary);
            font-weight: 500;
        }

        .option-desc {
            width: 100%;
            font-size: var(--text-xs);
            color: var(--text-muted);
            line-height: var(--lh-normal);
            margin-top: 2px;
            padding-right: 44px;
            font-weight: 400;
        }

        /* Image Upload Area */
        .image-upload-area {
            margin-top: var(--sp-3);
            padding: var(--sp-3);
            background: var(--surface-1);
            border: 1px dashed var(--border-default);
            border-radius: var(--r-md);
        }

        .upload-btn {
            width: 100%;
            padding: var(--sp-3);
            background: var(--surface-2);
            border: 1px solid var(--border-subtle);
            border-radius: var(--r-md);
            color: var(--text-secondary);
            font-size: var(--text-sm);
            cursor: pointer;
            transition: all var(--t-fast);
        }

        .upload-btn:hover {
            background: var(--surface-3);
            border-color: var(--accent);
            color: var(--text-primary);
        }

        .uploaded-files {
            margin-top: var(--sp-2);
            display: flex;
            flex-wrap: wrap;
            gap: var(--sp-2);
        }

        .uploaded-file {
            display: flex;
            align-items: center;
            gap: 4px;
            padding: 4px 8px;
            background: var(--surface-2);
            border-radius: var(--r-sm);
            font-size: var(--text-xs);
            color: var(--text-secondary);
        }

        .uploaded-file .remove-file {
            cursor: pointer;
            color: var(--text-muted);
            margin-left: 4px;
        }

        .uploaded-file .remove-file:hover {
            color: var(--trust-low);
        }

        .upload-hint {
            margin-top: var(--sp-2);
            font-size: var(--text-xs);
            color: var(--text-muted);
        }

        /* Tooltip trigger */
        .tip {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 15px;
            height: 15px;
            font-size: var(--text-xs);
            font-weight: 700;
            color: var(--text-muted);
            background: var(--surface-2);
            border: 1px solid var(--border-subtle);
            border-radius: 50%;
            cursor: help;
            flex-shrink: 0;
            position: relative;
        }

        .tip:hover {
            color: var(--text-secondary);
            border-color: var(--border-default);
            background: var(--surface-3);
        }

        .tip .tip-content {
            display: none;
            position: absolute;
            bottom: calc(100% + 8px);
            left: 50%;
            transform: translateX(-50%);
            width: 280px;
            padding: var(--sp-3) var(--sp-4);
            background: var(--surface-3);
            border: 1px solid var(--border-default);
            border-radius: var(--r-md);
            font-size: var(--text-xs);
            font-weight: 400;
            color: var(--text-secondary);
            line-height: var(--lh-normal);
            z-index: 200;
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
            pointer-events: none;
        }

        .tip .tip-content::after {
            content: '';
            position: absolute;
            top: 100%;
            left: 50%;
            transform: translateX(-50%);
            border: 5px solid transparent;
            border-top-color: var(--border-default);
        }

        .tip:hover .tip-content {
            display: block;
        }

        .tip-content strong {
            color: var(--text-primary);
            font-weight: 600;
            display: block;
            margin-bottom: 4px;
        }

        .tip-content em {
            color: var(--accent);
            font-style: normal;
            font-family: var(--font-mono);
            font-size: var(--text-xs);
        }

        .toggle {
            position: relative;
            width: 36px;
            height: 20px;
            cursor: pointer;
        }

        .toggle input {
            opacity: 0;
            width: 0;
            height: 0;
        }

        .toggle-track {
            position: absolute;
            inset: 0;
            background: var(--surface-3);
            border-radius: 10px;
            transition: background var(--t-base);
        }

        .toggle-track::after {
            content: '';
            position: absolute;
            top: 2px;
            left: 2px;
            width: 16px;
            height: 16px;
            background: var(--text-secondary);
            border-radius: 50%;
            transition: transform var(--t-base), background var(--t-base);
        }

        .toggle input:checked+.toggle-track {
            background: var(--accent);
        }

        .toggle input:checked+.toggle-track::after {
            transform: translateX(16px);
            background: white;
        }

        /* File Upload */
        /* Model Presets */
        .model-presets {
            display: flex;
            flex-wrap: wrap;
            gap: var(--sp-2);
        }

        .preset-pill {
            flex: 1 1 calc(25% - var(--sp-2));
            min-width: 70px;
            max-width: calc(25% - var(--sp-2));
            background: var(--surface-1);
            border: 1px solid var(--border-subtle);
            border-radius: var(--r-md);
            padding: var(--sp-2) var(--sp-3);
            cursor: pointer;
            transition: all var(--t-base);
            text-align: center;
            color: var(--text-secondary);
        }

        @media (max-width: 400px) {
            .preset-pill {
                flex: 1 1 calc(50% - var(--sp-2));
                max-width: calc(50% - var(--sp-2));
            }
        }

        .preset-pill:hover {
            border-color: var(--border-strong);
            background: var(--surface-2);
        }

        .preset-pill.active {
            border-color: var(--accent);
            background: rgba(99, 102, 241, 0.08);
            color: var(--text-primary);
        }

        .preset-pill-name {
            font-size: var(--text-sm);
            font-weight: 600;
            display: block;
        }

        .preset-pill-cost {
            font-size: var(--text-xs);
            color: var(--text-tertiary);
            font-family: var(--font-mono);
            margin-top: 1px;
            display: block;
        }

        .preset-pill.active .preset-pill-cost {
            color: var(--accent);
        }

        .preset-models {
            margin-top: var(--sp-2);
            padding: var(--sp-2) var(--sp-3);
            background: var(--surface-1);
            border: 1px solid var(--border-faint);
            border-radius: var(--r-sm);
            font-size: var(--text-xs);
            color: var(--text-tertiary);
            line-height: var(--lh-normal);
        }

        .preset-models .model-tag {
            display: inline-block;
            padding: 1px 5px;
            border-radius: 3px;
            font-size: var(--text-xs);
            font-weight: 500;
            margin: 1px 2px;
        }

        .preset-models .model-tag.openai {
            background: rgba(0, 214, 126, 0.1);
            color: var(--openai);
        }

        .preset-models .model-tag.anthropic {
            background: rgba(232, 149, 106, 0.1);
            color: var(--anthropic);
        }

        .preset-models .model-tag.google {
            background: rgba(77, 142, 247, 0.1);
            color: var(--google);
        }

        .preset-models .model-tag.meta {
            background: rgba(59, 130, 246, 0.1);
            color: var(--meta);
        }

        /* Custom Model Picker */
        .customize-link {
            display: block;
            margin-top: var(--sp-2);
            font-size: var(--text-xs);
            color: var(--accent);
            cursor: pointer;
            text-align: right;
        }

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

        .model-picker {
            display: none;
            margin-top: var(--sp-2);
            padding: var(--sp-3);
            background: var(--surface-1);
            border: 1px solid var(--border-subtle);
            border-radius: var(--r-md);
        }

        .model-picker.open {
            display: block;
        }

        .model-picker-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: var(--sp-2);
            padding-bottom: var(--sp-2);
            border-bottom: 1px solid var(--border-faint);
        }

        .model-picker-title {
            font-size: var(--text-xs);
            font-weight: 600;
            color: var(--text-secondary);
        }

        .model-picker-count {
            font-size: var(--text-xs);
            color: var(--text-muted);
        }

        .model-grid {
            display: grid;
            grid-template-columns: 1fr;
            gap: var(--sp-1);
            max-height: 300px;
            overflow-y: auto;
            scrollbar-width: thin;
            scrollbar-color: var(--accent) var(--surface-1);
            padding-right: 4px;
        }

        .model-grid::-webkit-scrollbar {
            width: 6px;
        }

        .model-grid::-webkit-scrollbar-track {
            background: var(--surface-1);
            border-radius: 3px;
        }

        .model-grid::-webkit-scrollbar-thumb {
            background: var(--accent);
            border-radius: 3px;
        }

        .model-grid::-webkit-scrollbar-thumb:hover {
            background: var(--accent-light, #818cf8);
        }

        .model-option {
            display: flex;
            align-items: center;
            gap: var(--sp-2);
            padding: var(--sp-2);
            border-radius: var(--r-sm);
            cursor: pointer;
            transition: background 0.15s;
        }

        .model-option:hover {
            background: var(--surface-2);
        }

        .model-option.selected {
            background: rgba(99, 102, 241, 0.08);
        }

        .model-option-checkbox {
            width: 14px;
            height: 14px;
            border: 1.5px solid var(--border-strong);
            border-radius: 3px;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }

        .model-option.selected .model-option-checkbox {
            background: var(--accent);
            border-color: var(--accent);
        }

        .model-option.selected .model-option-checkbox::after {
            content: '✓';
            color: white;
            font-size: var(--text-xs);
            font-weight: bold;
        }

        .model-option-info {
            flex: 1;
            min-width: 0;
        }

        .model-option-name {
            font-size: var(--text-xs);
            font-weight: 500;
            color: var(--text-primary);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .model-option-provider {
            font-size: var(--text-xs);
            color: var(--text-muted);
        }

        .model-option-badge {
            font-size: var(--text-xs);
            padding: 1px 4px;
            border-radius: 3px;
            background: rgba(99, 102, 241, 0.1);
            color: var(--accent);
        }

        .model-option-badge.free {
            background: rgba(34, 197, 94, 0.1);
            color: #22c55e;
        }

        .chairman-select {
            margin-top: var(--sp-2);
            padding-top: var(--sp-2);
            border-top: 1px solid var(--border-faint);
        }

        .chairman-select label {
            display: block;
            font-size: var(--text-xs);
            color: var(--text-muted);
            margin-bottom: var(--sp-1);
        }

        .chairman-select select {
            width: 100%;
            padding: var(--sp-2);
            background: var(--surface-2);
            border: 1px solid var(--border-subtle);
            border-radius: var(--r-sm);
            color: var(--text-primary);
            font-size: var(--text-xs);
        }

        .file-drop {
            border: 1px dashed var(--border-subtle);
            border-radius: var(--r-md);
            padding: var(--sp-4);
            text-align: center;
            color: var(--text-muted);
            font-size: var(--text-sm);
            cursor: pointer;
            transition: all var(--t-base);
        }

        .file-drop:hover,
        .file-drop.dragover {
            border-color: var(--accent);
            color: var(--text-secondary);
            background: rgba(99, 102, 241, 0.03);
        }

        .file-list {
            display: flex;
            flex-direction: column;
            gap: var(--sp-2);
            margin-top: var(--sp-3);
        }

        .file-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: var(--sp-2) var(--sp-3);
            background: var(--surface-1);
            border-radius: var(--r-sm);
            font-size: var(--text-sm);
            color: var(--text-secondary);
        }

        .file-remove {
            background: none;
            border: none;
            color: var(--text-muted);
            cursor: pointer;
            font-size: var(--text-sm);
            padding: 2px 4px;
        }

        .file-remove:hover {
            color: var(--trust-low);
        }

        /* Submit */
        .submit-btn {
            width: 100%;
            padding: var(--sp-4);
            background: var(--accent);
            color: white;
            border: none;
            border-radius: var(--r-md);
            font-family: var(--font-body);
            font-size: var(--text-sm);
            font-weight: 600;
            cursor: pointer;
            transition: all var(--t-base);
        }

        .submit-btn:hover:not(:disabled) {
            background: #7577f5;
            transform: translateY(-1px);
            box-shadow: 0 4px 20px rgba(99, 102, 241, 0.25);
        }

        .submit-btn:active:not(:disabled) {
            transform: scale(0.98);
        }

        .submit-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        .submit-btn.processing {
            background: var(--surface-3);
            color: var(--text-secondary);
        }

        /* ========================================
           ARENA
           ======================================== */
        .arena {
            display: flex;
            flex-direction: column;
            overflow-y: auto;
            padding: var(--sp-7);
            gap: var(--sp-6);
        }

        .arena::-webkit-scrollbar {
            width: 6px;
        }

        .arena::-webkit-scrollbar-track {
            background: transparent;
        }

        .arena::-webkit-scrollbar-thumb {
            background: var(--border-subtle);
            border-radius: 3px;
        }

        .arena-empty {
            flex: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            text-align: center;
            gap: var(--sp-5);
        }

        .arena-empty-icon {
            font-size: var(--text-4xl);
            opacity: 0.15;
        }

        .arena-empty h2 {
            font-family: var(--font-display);
            font-size: var(--text-3xl);
            font-weight: 400;
            font-style: italic;
            color: var(--text-secondary);
        }

        .arena-empty p {
            font-size: var(--text-sm);
            color: var(--text-tertiary);
            max-width: 400px;
            line-height: var(--lh-normal);
        }

        /* Pipeline Stage */
        .pipeline-stage {
            animation: stage-enter 0.4s var(--t-slow) both;
        }

        @keyframes stage-enter {
            from {
                opacity: 0;
                transform: translateY(12px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .stage-label {
            display: flex;
            align-items: center;
            gap: var(--sp-3);
            margin-bottom: var(--sp-4);
        }

        .stage-number {
            font-family: var(--font-mono);
            font-size: var(--text-xs);
            font-weight: 700;
            color: var(--text-muted);
            background: var(--surface-2);
            width: 22px;
            height: 22px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }

        .stage-number.active {
            color: var(--live);
            background: rgba(0, 212, 255, 0.1);
            border: 1px solid rgba(0, 212, 255, 0.2);
        }

        .stage-number.done {
            color: var(--trust-high);
            background: rgba(0, 214, 126, 0.1);
        }

        .stage-title {
            font-size: var(--text-sm);
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.06em;
            color: var(--text-tertiary);
        }

        .stage-title.active {
            color: var(--live);
        }

        .stage-title.done {
            color: var(--trust-high);
        }

        .stage-time {
            font-family: var(--font-mono);
            font-size: var(--text-xs);
            color: var(--text-muted);
            margin-left: auto;
        }

        /* Stage Transition Indicator */
        .stage-transition {
            display: flex;
            align-items: center;
            gap: var(--sp-3);
            padding: var(--sp-3) var(--sp-4);
            margin: var(--sp-3) 0;
            background: linear-gradient(90deg, rgba(99, 102, 241, 0.05) 0%, transparent 100%);
            border-left: 2px solid var(--accent);
            border-radius: 0 var(--r-sm) var(--r-sm) 0;
            animation: transition-pulse 2s ease-in-out infinite;
        }

        @keyframes transition-pulse {

            0%,
            100% {
                opacity: 0.7;
            }

            50% {
                opacity: 1;
            }
        }

        .stage-transition-dots {
            display: flex;
            gap: 4px;
        }

        .stage-transition-dots span {
            width: 6px;
            height: 6px;
            background: var(--accent);
            border-radius: 50%;
            animation: dot-bounce 1.4s ease-in-out infinite;
        }

        .stage-transition-dots span:nth-child(1) {
            animation-delay: 0s;
        }

        .stage-transition-dots span:nth-child(2) {
            animation-delay: 0.2s;
        }

        .stage-transition-dots span:nth-child(3) {
            animation-delay: 0.4s;
        }

        @keyframes dot-bounce {

            0%,
            80%,
            100% {
                transform: scale(0.6);
                opacity: 0.4;
            }

            40% {
                transform: scale(1);
                opacity: 1;
            }
        }

        .stage-transition-text {
            font-size: var(--text-xs);
            color: var(--text-tertiary);
            font-style: italic;
        }

        /* Model Cards */
        .model-cards {
            display: flex;
            flex-direction: column;
            gap: var(--sp-3);
        }

        .model-card {
            background: var(--surface-1);
            border: 1px solid var(--border-subtle);
            border-left: 3px solid var(--model-color, var(--text-muted));
            border-radius: var(--r-md);
            padding: var(--sp-4) var(--sp-5);
            animation: card-enter 0.35s var(--t-slow) both;
        }

        @keyframes card-enter {
            from {
                opacity: 0;
                transform: translateX(-8px);
            }

            to {
                opacity: 1;
                transform: translateX(0);
            }
        }

        .model-card.thinking {
            border-left-style: dashed;
        }

        .model-card-header {
            display: flex;
            align-items: center;
            gap: var(--sp-3);
            margin-bottom: var(--sp-3);
        }

        .model-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: var(--model-color, var(--text-muted));
            flex-shrink: 0;
        }

        .model-dot.thinking {
            animation: dot-pulse 1.5s ease infinite;
        }

        @keyframes dot-pulse {

            0%,
            100% {
                opacity: 1;
                transform: scale(1);
            }

            50% {
                opacity: 0.4;
                transform: scale(0.8);
            }
        }

        .model-name {
            font-size: var(--text-sm);
            font-weight: 600;
            color: var(--text-primary);
        }

        .model-provider {
            font-size: var(--text-xs);
            color: var(--text-muted);
            font-family: var(--font-mono);
        }

        .model-meta {
            display: flex;
            align-items: center;
            gap: var(--sp-3);
            margin-left: auto;
            font-family: var(--font-mono);
            font-size: var(--text-xs);
            color: var(--text-muted);
        }

        .model-content {
            font-size: var(--text-sm);
            line-height: var(--lh-relaxed);
            color: var(--text-secondary);
            font-weight: 400;
            max-height: 300px;
            overflow-y: auto;
            padding-right: var(--sp-2);
        }

        .model-content::-webkit-scrollbar {
            width: 4px;
        }

        .model-content::-webkit-scrollbar-track {
            background: var(--surface-1);
            border-radius: 2px;
        }

        .model-content::-webkit-scrollbar-thumb {
            background: var(--border-strong);
            border-radius: 2px;
        }

        .model-content::-webkit-scrollbar-thumb:hover {
            background: var(--accent);
        }

        .model-content p {
            margin-bottom: var(--sp-3);
        }

        .model-content p:last-child {
            margin-bottom: 0;
        }

        /* Consistent text sizing for all elements inside model cards */
        .model-content h1,
        .model-content h2,
        .model-content h3,
        .model-content h4,
        .model-content h5,
        .model-content h6 {
            font-size: var(--text-sm);
            font-weight: 600;
            color: var(--text-primary);
            margin: var(--sp-3) 0 var(--sp-2) 0;
        }

        .model-content h1:first-child,
        .model-content h2:first-child,
        .model-content h3:first-child {
            margin-top: 0;
        }

        .model-content ul,
        .model-content ol {
            font-size: var(--text-sm);
            margin: var(--sp-2) 0;
            padding-left: var(--sp-4);
        }

        .model-content li {
            font-size: var(--text-sm);
            margin-bottom: var(--sp-1);
        }

        .model-content strong {
            color: var(--text-primary);
        }

        .model-content code {
            font-family: var(--font-mono);
            font-size: var(--text-sm);
            background: var(--surface-3);
            padding: 1px 4px;
            border-radius: 3px;
        }

        /* Devil's Advocate Badge */
        .devils-advocate-badge {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            padding: 2px 8px;
            background: rgba(239, 68, 68, 0.1);
            border: 1px solid rgba(239, 68, 68, 0.3);
            border-radius: var(--r-sm);
            font-size: var(--text-xs);
            font-weight: 600;
            color: #ef4444;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        /* Active Features Indicator */
        .active-features {
            display: flex;
            flex-wrap: wrap;
            gap: var(--sp-2);
            margin-bottom: var(--sp-3);
            padding: var(--sp-2) var(--sp-3);
            background: var(--surface-1);
            border-radius: var(--r-sm);
            border: 1px solid var(--border-faint);
        }

        .feature-badge {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            padding: 3px 8px;
            background: rgba(99, 102, 241, 0.1);
            border-radius: var(--r-sm);
            font-size: var(--text-xs);
            color: var(--accent);
        }

        .feature-badge.active {
            background: rgba(0, 214, 126, 0.1);
            color: var(--trust-high);
        }

        .feature-badge .badge-dot {
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: currentColor;
            animation: badge-pulse 1.5s ease-in-out infinite;
        }

        @keyframes badge-pulse {

            0%,
            100% {
                opacity: 1;
            }

            50% {
                opacity: 0.4;
            }
        }

        /* Session Progress Bar */
        .session-progress {
            position: sticky;
            top: 0;
            z-index: 50;
            background: var(--surface-0);
            padding: var(--sp-3) var(--sp-4);
            border-bottom: 1px solid var(--border-subtle);
            margin-bottom: var(--sp-4);
        }

        .progress-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: var(--sp-2);
        }

        .progress-title {
            font-size: var(--text-xs);
            font-weight: 600;
            color: var(--text-tertiary);
            text-transform: uppercase;
            letter-spacing: 0.06em;
        }

        .progress-percent {
            font-family: var(--font-mono);
            font-size: var(--text-sm);
            font-weight: 700;
            color: var(--accent);
        }

        .progress-track {
            height: 6px;
            background: var(--surface-3);
            border-radius: 3px;
            overflow: hidden;
        }

        .progress-fill {
            height: 100%;
            background: linear-gradient(90deg, var(--accent), #818cf8);
            border-radius: 3px;
            transition: width 0.5s ease-out;
            position: relative;
        }

        .progress-fill::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
            animation: progress-shimmer 1.5s infinite;
        }

        @keyframes progress-shimmer {
            0% {
                transform: translateX(-100%);
            }

            100% {
                transform: translateX(100%);
            }
        }

        .progress-stages {
            display: flex;
            justify-content: space-between;
            margin-top: var(--sp-2);
        }

        .progress-stage {
            display: flex;
            align-items: center;
            gap: 4px;
            font-size: var(--text-xs);
            color: var(--text-muted);
        }

        .progress-stage.active {
            color: var(--accent);
        }

        .progress-stage.done {
            color: var(--trust-high);
        }

        .progress-stage-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: var(--surface-3);
            border: 1px solid var(--border-subtle);
        }

        .progress-stage.active .progress-stage-dot {
            background: var(--accent);
            border-color: var(--accent);
            animation: progress-dot-pulse 1s ease-in-out infinite;
        }

        .progress-stage.done .progress-stage-dot {
            background: var(--trust-high);
            border-color: var(--trust-high);
        }

        @keyframes progress-dot-pulse {

            0%,
            100% {
                transform: scale(1);
            }

            50% {
                transform: scale(1.2);
            }
        }

        .session-progress.complete {
            background: linear-gradient(90deg, rgba(0, 214, 126, 0.08), rgba(0, 214, 126, 0.02));
        }

        .session-progress.complete .progress-fill {
            background: linear-gradient(90deg, var(--trust-high), #34d399);
        }

        .session-progress.complete .progress-fill::after {
            animation: none;
        }

        .session-progress.complete .progress-percent {
            color: var(--trust-high);
        }

        .typing-cursor {
            display: inline-block;
            width: 2px;
            height: 1em;
            background: var(--model-color, var(--accent));
            animation: blink 0.8s step-end infinite;
            vertical-align: text-bottom;
            margin-left: 2px;
        }

        @keyframes blink {
            50% {
                opacity: 0;
            }
        }

        /* ========================================
           SYNTHESIS (Chairman's Final Answer)
           ======================================== */
        .synthesis {
            background: linear-gradient(135deg, var(--surface-1) 0%, rgba(99, 102, 241, 0.03) 100%);
            border: 2px solid var(--accent);
            border-radius: var(--r-lg);
            overflow: hidden;
            animation: synthesis-enter 0.5s var(--t-slow) both;
            box-shadow: 0 0 20px rgba(99, 102, 241, 0.15), 0 4px 24px rgba(0, 0, 0, 0.3);
            margin-top: var(--sp-5);
        }

        @keyframes synthesis-enter {
            from {
                opacity: 0;
                transform: translateY(16px);
                box-shadow: 0 0 0 rgba(99, 102, 241, 0);
            }

            to {
                opacity: 1;
                transform: translateY(0);
                box-shadow: 0 0 20px rgba(99, 102, 241, 0.15), 0 4px 24px rgba(0, 0, 0, 0.3);
            }
        }

        .synthesis-header {
            display: flex;
            align-items: center;
            gap: var(--sp-3);
            padding: var(--sp-4) var(--sp-5);
            background: linear-gradient(90deg, rgba(99, 102, 241, 0.12) 0%, rgba(99, 102, 241, 0.05) 100%);
            border-bottom: 1px solid rgba(99, 102, 241, 0.2);
        }

        .synthesis-icon {
            font-size: var(--text-xl);
            filter: drop-shadow(0 0 4px rgba(99, 102, 241, 0.5));
        }

        .synthesis-title {
            font-family: var(--font-display);
            font-size: var(--text-lg);
            font-style: italic;
            color: var(--text-primary);
            text-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
        }

        .synthesis-header::after {
            content: '✨ Chairman\'s Answer';
            margin-left: auto;
            font-size: var(--text-xs);
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            color: var(--accent);
            background: rgba(99, 102, 241, 0.1);
            padding: 4px 10px;
            border-radius: var(--r-sm);
            border: 1px solid rgba(99, 102, 241, 0.2);
        }

        .synthesis-body {
            padding: var(--sp-6);
        }

        .synthesis-content {
            font-size: var(--text-sm);
            line-height: var(--lh-relaxed);
            color: var(--text-primary);
        }

        .synthesis-content h2,
        .synthesis-content h3 {
            font-family: var(--font-display);
            font-weight: 400;
            font-style: italic;
            color: var(--text-primary);
            margin: var(--sp-5) 0 var(--sp-3);
        }

        .synthesis-content h2 {
            font-size: var(--text-xl);
        }

        .synthesis-content h3 {
            font-size: var(--text-base);
        }

        .synthesis-content ul,
        .synthesis-content ol {
            margin: var(--sp-3) 0;
            padding-left: var(--sp-6);
        }

        .synthesis-content li {
            margin-bottom: var(--sp-2);
        }

        .synthesis-content strong {
            color: var(--text-primary);
            font-weight: 600;
        }

        .synthesis-content code {
            font-family: var(--font-mono);
            font-size: var(--text-sm);
            background: var(--surface-3);
            padding: 1px 5px;
            border-radius: var(--r-sm);
        }

        /* ========================================
           TRUST BAR
           ======================================== */
        .trust-bar {
            display: none;
            background: var(--surface-1);
            border: 1px solid var(--border-subtle);
            border-radius: var(--r-lg);
            padding: var(--sp-5);
            animation: stage-enter 0.4s var(--t-slow) both;
        }

        .trust-bar.visible {
            display: block;
        }

        .trust-header {
            display: flex;
            align-items: center;
            gap: var(--sp-5);
            margin-bottom: var(--sp-4);
        }

        .trust-score-display {
            display: flex;
            align-items: baseline;
            gap: var(--sp-2);
        }

        .trust-score-value {
            font-family: var(--font-mono);
            font-size: var(--text-3xl);
            font-weight: 700;
            line-height: 1;
        }

        .trust-score-value.high {
            color: var(--trust-high);
        }

        .trust-score-value.medium {
            color: var(--trust-med);
        }

        .trust-score-value.low {
            color: var(--trust-low);
        }

        .trust-score-label {
            font-size: var(--text-xs);
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.08em;
        }

        .trust-score-label.high {
            color: var(--trust-high);
        }

        .trust-score-label.medium {
            color: var(--trust-med);
        }

        .trust-score-label.low {
            color: var(--trust-low);
        }

        .trust-progress {
            flex: 1;
            height: 4px;
            background: var(--surface-3);
            border-radius: 2px;
            overflow: hidden;
        }

        .trust-progress-fill {
            height: 100%;
            border-radius: 2px;
            transition: width 1s cubic-bezier(0.16, 1, 0.3, 1);
            width: 0%;
        }

        .trust-progress-fill.high {
            background: var(--trust-high);
        }

        .trust-progress-fill.medium {
            background: var(--trust-med);
        }

        .trust-progress-fill.low {
            background: var(--trust-low);
        }

        .trust-details {
            display: flex;
            gap: var(--sp-6);
            flex-wrap: wrap;
        }

        .trust-detail {
            display: flex;
            align-items: center;
            gap: var(--sp-2);
            font-size: var(--text-sm);
            color: var(--text-secondary);
        }

        .disagreement-alert {
            display: none;
            background: rgba(239, 68, 68, 0.06);
            border: 1px solid rgba(239, 68, 68, 0.15);
            border-radius: var(--r-md);
            padding: var(--sp-4);
            margin-top: var(--sp-4);
        }

        .disagreement-alert.visible {
            display: block;
        }

        .disagreement-alert-title {
            font-size: var(--text-sm);
            font-weight: 600;
            color: var(--trust-low);
            margin-bottom: var(--sp-2);
        }

        .disagreement-alert-text {
            font-size: var(--text-sm);
            color: var(--text-secondary);
            line-height: var(--lh-normal);
        }

        /* ========================================
           EXPORT MODAL
           ======================================== */
        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.7);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 200;
            opacity: 0;
            visibility: hidden;
            transition: all var(--t-fast);
        }

        .modal-overlay.visible {
            opacity: 1;
            visibility: visible;
        }

        .export-modal {
            background: var(--surface-1);
            border: 1px solid var(--border-default);
            border-radius: var(--r-lg);
            width: 90%;
            max-width: 500px;
            max-height: 90vh;
            overflow-y: auto;
            transform: translateY(20px);
            transition: transform var(--t-fast);
        }

        .modal-overlay.visible .export-modal {
            transform: translateY(0);
        }

        .export-modal-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: var(--sp-4);
            border-bottom: 1px solid var(--border-default);
        }

        .export-modal-header h3 {
            font-size: var(--text-lg);
            font-weight: 600;
            color: var(--text-primary);
            margin: 0;
        }

        .export-modal-close {
            width: 32px;
            height: 32px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: transparent;
            border: none;
            border-radius: var(--r-sm);
            color: var(--text-tertiary);
            font-size: var(--text-2xl);
            cursor: pointer;
            transition: all var(--t-fast);
        }

        .export-modal-close:hover {
            background: var(--surface-2);
            color: var(--text-primary);
        }

        .export-modal-body {
            padding: var(--sp-4);
        }

        .export-section {
            margin-bottom: var(--sp-5);
        }

        .export-section-title {
            font-size: var(--text-xs);
            font-weight: 600;
            color: var(--text-secondary);
            text-transform: uppercase;
            letter-spacing: 0.05em;
            margin-bottom: var(--sp-3);
        }

        .format-options {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: var(--sp-2);
        }

        .format-option {
            display: flex;
            align-items: center;
            gap: var(--sp-2);
            padding: var(--sp-3);
            background: var(--surface-0);
            border: 2px solid var(--border-default);
            border-radius: var(--r-md);
            cursor: pointer;
            transition: all var(--t-fast);
        }

        .format-option:hover {
            border-color: var(--border-strong);
            background: var(--surface-2);
        }

        .format-option.selected {
            border-color: var(--accent);
            background: rgba(99, 102, 241, 0.1);
        }

        .format-option input[type="radio"] {
            display: none;
        }

        .format-icon {
            font-size: var(--text-2xl);
        }

        .format-details {
            flex: 1;
        }

        .format-name {
            font-weight: 500;
            color: var(--text-primary);
            font-size: var(--text-sm);
        }

        .format-desc {
            font-size: var(--text-xs);
            color: var(--text-tertiary);
        }

        .content-options {
            display: flex;
            flex-direction: column;
            gap: var(--sp-2);
        }

        .content-option {
            display: flex;
            align-items: center;
            gap: var(--sp-3);
            padding: var(--sp-2);
            cursor: pointer;
        }

        .content-option input[type="checkbox"] {
            width: 18px;
            height: 18px;
            accent-color: var(--accent);
        }

        .content-option label {
            font-size: var(--text-sm);
            color: var(--text-secondary);
            cursor: pointer;
            flex: 1;
        }

        .export-modal-footer {
            display: flex;
            justify-content: flex-end;
            gap: var(--sp-3);
            padding: var(--sp-4);
            border-top: 1px solid var(--border-default);
            background: var(--surface-2);
        }

        .export-modal-footer .btn {
            padding: var(--sp-2) var(--sp-5);
        }

        .export-progress {
            display: none;
            align-items: center;
            gap: var(--sp-2);
            color: var(--text-secondary);
            font-size: var(--text-sm);
        }

        .export-progress.visible {
            display: flex;
        }

        .export-spinner {
            width: 16px;
            height: 16px;
            border: 2px solid var(--border-default);
            border-top-color: var(--accent);
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
        }

        @keyframes spin {
            to {
                transform: rotate(360deg);
            }
        }

        .btn {
            font-family: var(--font-body);
            font-weight: 500;
            border-radius: var(--r-md);
            cursor: pointer;
            transition: all var(--t-fast);
            border: none;
            font-size: var(--text-sm);
        }

        .btn-ghost {
            background: transparent;
            color: var(--text-secondary);
            border: 1px solid var(--border-default);
        }

        .btn-ghost:hover {
            background: var(--surface-2);
            color: var(--text-primary);
        }

        .btn-primary {
            background: var(--accent);
            color: white;
        }

        .btn-primary:hover {
            background: #5558e8;
        }

        .btn-primary:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        /* ========================================
           SOURCES
           ======================================== */
        .sources-section {
            display: none;
            animation: stage-enter 0.4s var(--t-slow) both;
        }

        .sources-section.visible {
            display: block;
        }

        .sources-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: var(--sp-3);
        }

        .source-card {
            display: flex;
            gap: var(--sp-3);
            padding: var(--sp-3) var(--sp-4);
            background: var(--surface-1);
            border: 1px solid var(--border-subtle);
            border-radius: var(--r-md);
            transition: border-color var(--t-fast);
            text-decoration: none;
        }

        .source-card:hover {
            border-color: var(--border-default);
            text-decoration: none;
        }

        .source-num {
            font-family: var(--font-mono);
            font-size: var(--text-xs);
            font-weight: 700;
            color: var(--accent);
            flex-shrink: 0;
            margin-top: 2px;
        }

        .source-info {
            flex: 1;
            min-width: 0;
        }

        .source-title {
            font-size: var(--text-sm);
            font-weight: 500;
            color: var(--text-primary);
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .source-domain {
            font-size: var(--text-xs);
            color: var(--text-muted);
            font-family: var(--font-mono);
        }

        /* ========================================
           SESSION META
           ======================================== */
        .session-meta {
            display: none;
            padding: var(--sp-4) var(--sp-5);
            background: var(--surface-1);
            border: 1px solid var(--border-subtle);
            border-radius: var(--r-md);
            animation: stage-enter 0.4s var(--t-slow) both;
        }

        .session-meta.visible {
            display: block;
        }

        .meta-grid {
            display: flex;
            gap: var(--sp-6);
            flex-wrap: wrap;
        }

        .meta-item {
            display: flex;
            flex-direction: column;
            gap: 2px;
        }

        .meta-label {
            font-size: var(--text-xs);
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.1em;
            color: var(--text-muted);
        }

        .meta-value {
            font-family: var(--font-mono);
            font-size: var(--text-sm);
            color: var(--text-secondary);
        }

        .session-actions {
            display: none;
            gap: var(--sp-3);
            padding: var(--sp-4) 0;
        }

        .session-actions.visible {
            display: flex;
        }

        .action-btn {
            padding: var(--sp-2) var(--sp-4);
            background: var(--surface-2);
            border: 1px solid var(--border-subtle);
            border-radius: var(--r-md);
            color: var(--text-secondary);
            font-family: var(--font-body);
            font-size: var(--text-sm);
            cursor: pointer;
            transition: all var(--t-fast);
        }

        .action-btn:hover {
            border-color: var(--border-default);
            color: var(--text-primary);
            background: var(--surface-3);
        }

        .action-btn.selected {
            border-color: rgba(99, 102, 241, 0.3);
            background: rgba(99, 102, 241, 0.08);
            color: var(--accent);
        }

        .action-btn.shared {
            border-color: var(--trust-high);
            color: var(--trust-high);
        }

        /* ========================================
           MODAL
           ======================================== */
        .modal-overlay {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.6);
            backdrop-filter: blur(4px);
            z-index: 1000;
            align-items: center;
            justify-content: center;
        }

        .modal-overlay.visible {
            display: flex;
        }

        .modal {
            background: var(--surface-1);
            border: 1px solid var(--border-default);
            border-radius: var(--r-lg);
            padding: var(--sp-7);
            width: 420px;
            max-width: 90vw;
        }

        .modal h3 {
            font-family: var(--font-display);
            font-style: italic;
            font-size: var(--text-xl);
            margin-bottom: var(--sp-4);
        }

        .modal input {
            width: 100%;
            padding: var(--sp-3) var(--sp-4);
            background: var(--surface-2);
            border: 1px solid var(--border-subtle);
            border-radius: var(--r-md);
            color: var(--text-primary);
            font-family: var(--font-mono);
            font-size: var(--text-sm);
            margin-bottom: var(--sp-4);
        }

        .modal input:focus-visible {
            outline: 2px solid var(--accent);
            outline-offset: 2px;
            border-color: var(--accent);
        }

        .modal-actions {
            display: flex;
            gap: var(--sp-3);
            justify-content: flex-end;
        }

        .modal-btn {
            padding: var(--sp-2) var(--sp-5);
            border-radius: var(--r-md);
            font-family: var(--font-body);
            font-size: var(--text-sm);
            font-weight: 500;
            cursor: pointer;
            border: 1px solid var(--border-subtle);
            background: var(--surface-2);
            color: var(--text-secondary);
            transition: all var(--t-fast);
        }

        .modal-btn:hover {
            background: var(--surface-3);
            color: var(--text-primary);
        }

        .modal-btn.primary {
            background: var(--accent);
            border-color: var(--accent);
            color: white;
        }

        .modal-btn.primary:hover {
            background: #7577f5;
        }

        /* ========================================
           RESPONSIVE
           ======================================== */
        @media (max-width: 900px) {
            .app {
                grid-template-columns: 1fr;
                grid-template-rows: var(--header-h) auto 1fr;
                max-width: 100%;
                overflow-x: hidden;
            }

            .sidebar {
                border-right: none;
                border-bottom: 1px solid var(--border-subtle);
                max-height: 40vh;
                max-width: 100%;
            }

            .arena {
                padding: var(--sp-5);
                max-width: 100%;
            }

            .header-nav {
                display: none;
            }

            .header-right {
                flex-wrap: wrap;
                gap: var(--sp-2);
                max-width: 60%;
            }
        }

        @media (max-width: 600px) {
            .sidebar-section {
                padding: var(--sp-4);
            }

            .question-input {
                min-height: 80px;
                font-size: var(--text-sm);
            }

            .arena {
                padding: var(--sp-4);
                gap: var(--sp-4);
            }

            .model-card {
                padding: var(--sp-3) var(--sp-4);
            }

            .synthesis-body {
                padding: var(--sp-4);
            }

            .sources-grid {
                grid-template-columns: 1fr;
            }
        }

        @media (max-width: 480px) {
            .header-right {
                gap: var(--sp-1);
                max-width: 55%;
            }

            .live-badge {
                display: none;
            }

            .sources-grid {
                grid-template-columns: 1fr;
            }
        }

        @media (prefers-reduced-motion: reduce) {

            *,
            *::before,
            *::after {
                animation-duration: 0.01ms !important;
                transition-duration: 0.01ms !important;
            }
        }

        /* ========================================
           SKIP-TO-CONTENT (WCAG 2.1 AA)
           ======================================== */
        .skip-to-content {
            position: absolute;
            top: -100%;
            left: var(--sp-4);
            z-index: 10000;
            padding: var(--sp-2) var(--sp-4);
            background: var(--accent);
            color: #fff;
            border-radius: var(--r-md);
            font-size: var(--text-sm);
            font-family: var(--font-body);
            text-decoration: none;
            transition: top var(--t-fast);
        }

        .skip-to-content:focus {
            top: var(--sp-2);
            outline: 2px solid var(--accent);
            outline-offset: 2px;
        }

        /* ========================================
           FEATURE SURFACE: SCREEN-READER UTILITY
           ======================================== */
        .sr-only {
            position: absolute;
            width: 1px;
            height: 1px;
            padding: 0;
            margin: -1px;
            overflow: hidden;
            clip: rect(0, 0, 0, 0);
            white-space: nowrap;
            border: 0;
        }

        /* ========================================
           FEATURE SURFACE: CONFIDENCE BADGE
           ======================================== */
        .qr-confidence-badge {
            display: flex;
            align-items: center;
            gap: var(--sp-2);
            padding: var(--sp-2) var(--sp-3);
            border-radius: var(--radius-md);
            border: 1px solid currentColor;
            font-size: var(--text-sm);
            font-family: var(--font-body);
            min-height: 36px;
            margin-bottom: var(--sp-3);
        }
        .qr-confidence-badge--high   { color: var(--trust-high); }
        .qr-confidence-badge--medium { color: var(--trust-med);  }
        .qr-confidence-badge--low    { color: var(--trust-low);  }
        .qr-badge-level {
            font-weight: 600;
            text-transform: capitalize;
        }

        /* ========================================
           FEATURE SURFACE: ATTRIBUTION CHIPS
           ======================================== */
        .qr-attribution-chip {
            display: inline;
            padding: 1px var(--sp-2);
            border-radius: var(--radius-full);
            font-size: var(--text-xs);
            font-weight: 600;
            white-space: nowrap;
            vertical-align: baseline;
            line-height: 1.6;
        }
        .qr-attribution-chip--openai    { background: var(--openai);    color: #000; }
        .qr-attribution-chip--anthropic { background: var(--anthropic); color: #000; }
        .qr-attribution-chip--google    { background: var(--google);    color: #fff; }
        .qr-attribution-chip--meta      { background: var(--meta);      color: #fff; }
        .qr-attribution-chip--mistral   { background: var(--mistral);   color: #000; }
        .qr-attribution-chip--deepseek  { background: var(--deepseek);  color: #fff; }
        .qr-attribution-chip--xai       { background: var(--xai);       color: #000; }

        /* ========================================
           FEATURE SURFACE: VERIFICATION DETAILS
           ======================================== */
        .qr-verification-details {
            border-top: 1px solid var(--border-faint);
            margin-top: var(--sp-4);
        }
        .qr-verification-details summary {
            list-style: none;
            cursor: pointer;
            padding: var(--sp-3) 0;
            color: var(--text-secondary);
            font-size: var(--text-sm);
        }
        .qr-verification-details summary::-webkit-details-marker { display: none; }
        .qr-verification-summary-inner {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: var(--sp-2);
        }
        .qr-verification-body {
            padding: var(--sp-3) 0 var(--sp-4);
            display: flex;
            flex-direction: column;
            gap: var(--sp-2);
        }
        .qr-verification-row {
            display: flex;
            justify-content: space-between;
            font-size: var(--text-sm);
        }
        .qr-verification-label { color: var(--text-tertiary); }
        .qr-verification-value { color: var(--text-secondary); }
