        /* Nav tabs */
        .nav-tab.active {
            color: white !important;
            background: rgba(255,255,255,0.15);
            box-shadow: inset 0 -3px 0 white;
        }
        .step-active { @apply bg-blue-600 text-white; }
        .step-completed { @apply bg-green-600 text-white; }
        .step-pending { @apply bg-gray-300 text-gray-600; }
        /* Selected case study card */
        .selected-case-study-card {
            background: white;
            border: 1px solid #e5e7eb;
            border-radius: 0.75rem;
            padding: 1.25rem;
            margin-bottom: 1rem;
        }
        .selected-case-study-card .relevance-badge {
            display: inline-block;
            padding: 0.25rem 0.75rem;
            border-radius: 9999px;
            font-size: 0.75rem;
            font-weight: 600;
        }
        .selected-case-study-card .relevance-high { background: #dcfce7; color: #166534; }
        .selected-case-study-card .relevance-medium { background: #fef3c7; color: #92400e; }
        .selected-case-study-card .relevance-low { background: #fee2e2; color: #991b1b; }
        .loading { animation: pulse 1.5s infinite; }
        @keyframes pulse {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.5; }
        }
        /* Quill Editor Custom Styles */
        .prompt-editor-container {
            border: 1px solid #e5e7eb;
            border-radius: 0.5rem;
            overflow: hidden;
            background: white;
        }
        .prompt-editor-container .ql-toolbar {
            border: none;
            border-bottom: 1px solid #e5e7eb;
            background: #f9fafb;
        }
        .prompt-editor-container .ql-container {
            border: none;
            font-size: 14px;
            min-height: 200px;
            max-height: 350px;
            overflow-y: auto;
        }
        .prompt-editor-container .ql-editor {
            min-height: 200px;
        }
        .prompt-editor-container .ql-editor pre.ql-syntax {
            background-color: #1f2937;
            color: #e5e7eb;
            border-radius: 0.375rem;
            padding: 0.75rem;
        }
        .prompt-section {
            background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
            border: 1px solid #bae6fd;
            border-radius: 0.75rem;
            padding: 1rem;
            margin-bottom: 1rem;
        }
        .prompt-section-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 0.75rem;
        }
        .prompt-section-title {
            display: flex;
            align-items: center;
            font-weight: 600;
            color: #0369a1;
        }
        .prompt-section-title i {
            margin-right: 0.5rem;
        }
        .variable-tag {
            display: inline-block;
            background: #dbeafe;
            color: #1e40af;
            padding: 0.125rem 0.5rem;
            border-radius: 0.25rem;
            font-size: 0.75rem;
            font-family: monospace;
            margin-right: 0.25rem;
            margin-bottom: 0.25rem;
        }
        /* Debug Mode Styles */
        .debug-btn {
            position: fixed;
            bottom: 1rem;
            right: 1rem;
            z-index: 40;
            background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
            color: white;
            border: none;
            border-radius: 0.5rem;
            padding: 0.5rem 1rem;
            font-size: 0.75rem;
            font-weight: 600;
            cursor: pointer;
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
            transition: all 0.2s;
        }
        .debug-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
        }
        .debug-btn.active {
            background: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
        }
        /* Landing Page Styles */
        .landing-page {
            display: none;
            min-height: calc(100vh - 56px);
            background: #f3f4f6;
            padding: 2rem;
        }
        .landing-page.active {
            display: block;
        }
        .project-page {
            display: none;
        }
        .project-page.active {
            display: block;
        }
        .project-card {
            background: white;
            border-radius: 0.75rem;
            border: 1px solid #e5e7eb;
            padding: 1.25rem;
            cursor: pointer;
            transition: all 0.2s;
        }
        .project-card:hover {
            box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
            border-color: #3b82f6;
        }
        .project-card .delete-btn {
            opacity: 0;
            transition: opacity 0.2s;
        }
        .project-card:hover .delete-btn {
            opacity: 1;
        }
        .completion-bar {
            background: #e5e7eb;
            border-radius: 9999px;
            height: 0.5rem;
            overflow: hidden;
        }
        .completion-bar-fill {
            background: linear-gradient(90deg, #3b82f6 0%, #10b981 100%);
            height: 100%;
            border-radius: 9999px;
            transition: width 0.3s ease;
        }
        .completion-badge {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 0.25rem 0.5rem;
            border-radius: 9999px;
            font-size: 0.75rem;
            font-weight: 600;
        }
        .completion-badge.low { background: #fee2e2; color: #991b1b; }
        .completion-badge.medium { background: #fef3c7; color: #92400e; }
        .completion-badge.high { background: #dcfce7; color: #166534; }
        .project-header {
            background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
            border: 1px solid #bfdbfe;
            border-radius: 0.75rem;
            padding: 1rem 1.5rem;
            margin-bottom: 1.5rem;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }
        .project-header-title {
            font-size: 1.125rem;
            font-weight: 600;
            color: #1e40af;
        }
        .back-to-projects {
            display: inline-flex;
            align-items: center;
            color: #3b82f6;
            font-weight: 500;
            cursor: pointer;
            transition: color 0.2s;
        }
        .back-to-projects:hover {
            color: #1d4ed8;
        }
        /* Settings Page Styles (Full Page) */
        .settings-page {
            display: none;
            position: fixed;
            inset: 0;
            background: #f3f4f6;
            z-index: 100;
            flex-direction: column;
        }
        .settings-page.active {
            display: flex;
        }
        .settings-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 1rem 2rem;
            background: white;
            border-bottom: 1px solid #e5e7eb;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        }
        .settings-header-left {
            display: flex;
            align-items: center;
            gap: 1rem;
        }
        .settings-back-btn {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.5rem 1rem;
            color: #4b5563;
            background: #f3f4f6;
            border: 1px solid #e5e7eb;
            border-radius: 0.5rem;
            cursor: pointer;
            transition: all 0.2s;
        }
        .settings-back-btn:hover {
            background: #e5e7eb;
            color: #1f2937;
        }
        .settings-main {
            display: flex;
            flex: 1;
            overflow: hidden;
        }
        .settings-sidebar {
            width: 240px;
            background: white;
            border-right: 1px solid #e5e7eb;
            padding: 1.5rem 0;
            overflow-y: auto;
        }
        .settings-nav-item {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            padding: 0.875rem 1.5rem;
            color: #4b5563;
            cursor: pointer;
            transition: all 0.2s;
            border-left: 3px solid transparent;
        }
        .settings-nav-item:hover {
            background: #f9fafb;
            color: #1f2937;
        }
        .settings-nav-item.active {
            background: #eff6ff;
            color: #2563eb;
            border-left-color: #2563eb;
            font-weight: 500;
        }
        .settings-content {
            flex: 1;
            overflow-y: auto;
            padding: 2rem;
        }
        .settings-tab-content {
            display: none;
            max-width: 1400px;
        }
        .settings-tab-content.active {
            display: block;
        }
        /* Side Navigation Menu */
        .app-layout {
            display: flex;
            min-height: calc(100vh - 56px);
        }
        .side-menu {
            width: 280px;
            min-width: 280px;
            background: white;
            border-right: 1px solid #e5e7eb;
            overflow-y: auto;
            position: sticky;
            top: 0;
            height: calc(100vh - 56px);
        }
        .side-menu-header {
            padding: 1rem 1.25rem;
            border-bottom: 1px solid #e5e7eb;
            font-weight: 600;
            color: #374151;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        .branch-item {
            border-bottom: 1px solid #f3f4f6;
        }
        .branch-header {
            display: flex;
            align-items: center;
            padding: 0.875rem 1.25rem;
            cursor: pointer;
            transition: all 0.2s;
            user-select: none;
        }
        .branch-header:hover {
            background: #f9fafb;
        }
        .branch-header.active {
            background: #eff6ff;
        }
        .branch-header.active-purple {
            background: #f5f3ff;
        }
        .branch-icon {
            width: 32px;
            height: 32px;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-right: 0.75rem;
            flex-shrink: 0;
        }
        .branch-icon.blue {
            background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
            color: white;
        }
        .branch-icon.purple {
            background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
            color: white;
        }
        .branch-title {
            flex: 1;
            font-weight: 500;
            color: #374151;
        }
        .branch-chevron {
            color: #9ca3af;
            transition: transform 0.2s;
        }
        .branch-chevron.open {
            transform: rotate(90deg);
        }
        .step-list {
            display: none;
            padding: 0.5rem 0;
            background: #f9fafb;
        }
        .step-list.open {
            display: block;
        }
        .step-item {
            display: flex;
            align-items: center;
            padding: 0.625rem 1.25rem 0.625rem 3.5rem;
            cursor: pointer;
            transition: all 0.2s;
            color: #6b7280;
            font-size: 0.875rem;
        }
        .step-item:hover {
            background: #f3f4f6;
            color: #374151;
        }
        .step-item.active {
            background: #dbeafe;
            color: #1d4ed8;
            font-weight: 500;
        }
        .step-item.active-purple {
            background: #ede9fe;
            color: #6d28d9;
            font-weight: 500;
        }
        .step-item.completed {
            color: #059669;
        }
        .step-item.disabled {
            color: #d1d5db;
            cursor: not-allowed;
        }
        .step-item.disabled:hover {
            background: transparent;
            color: #d1d5db;
        }
        .step-indicator {
            width: 24px;
            height: 24px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-right: 0.75rem;
            font-size: 0.75rem;
            font-weight: 600;
            flex-shrink: 0;
        }
        .step-indicator.pending {
            background: #e5e7eb;
            color: #6b7280;
        }
        .step-indicator.active {
            background: #3b82f6;
            color: white;
        }
        .step-indicator.active-purple {
            background: #8b5cf6;
            color: white;
        }
        .step-indicator.completed {
            background: #10b981;
            color: white;
        }
        .step-indicator.locked {
            background: #f3f4f6;
            color: #d1d5db;
        }
        .main-content {
            flex: 1;
            overflow-y: auto;
        }
        .prerequisite-error {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: white;
            border-radius: 12px;
            box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
            padding: 1.5rem;
            z-index: 1000;
            max-width: 400px;
            text-align: center;
        }
        .prerequisite-error-overlay {
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.5);
            z-index: 999;
        }
        @media (max-width: 1024px) {
            .side-menu {
                width: 240px;
                min-width: 240px;
            }
        }
        @media (max-width: 768px) {
            .app-layout {
                flex-direction: column;
            }
            .side-menu {
                width: 100%;
                min-width: 100%;
                height: auto;
                position: relative;
                border-right: none;
                border-bottom: 1px solid #e5e7eb;
            }
        }
        /* Case Study Cards */
        .case-study-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
            gap: 1rem;
        }
        .case-study-card {
            background: white;
            border: 1px solid #e5e7eb;
            border-radius: 0.75rem;
            padding: 1.25rem;
            transition: all 0.2s;
        }
        .case-study-card:hover {
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
            border-color: #d1d5db;
        }
        .case-study-card .title {
            font-weight: 600;
            color: #1f2937;
            margin-bottom: 0.5rem;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }
        .case-study-card .client {
            font-size: 0.875rem;
            color: #6b7280;
            margin-bottom: 0.75rem;
        }
        .case-study-card .tags {
            display: flex;
            flex-wrap: wrap;
            gap: 0.375rem;
            margin-bottom: 0.75rem;
        }
        .case-study-card .tag {
            display: inline-block;
            background: #dbeafe;
            color: #1e40af;
            padding: 0.125rem 0.5rem;
            border-radius: 9999px;
            font-size: 0.75rem;
        }
        .case-study-card .tag.tech {
            background: #dcfce7;
            color: #166534;
        }
        .case-study-card .tag.sector {
            background: #fef3c7;
            color: #92400e;
        }
        .case-study-card .actions {
            display: flex;
            gap: 0.5rem;
            margin-top: 0.75rem;
            padding-top: 0.75rem;
            border-top: 1px solid #f3f4f6;
        }
        .case-study-card .action-btn {
            flex: 1;
            padding: 0.5rem;
            font-size: 0.75rem;
            border-radius: 0.375rem;
            border: 1px solid #e5e7eb;
            background: white;
            cursor: pointer;
            transition: all 0.2s;
        }
        .case-study-card .action-btn:hover {
            background: #f9fafb;
        }
        .case-study-card .completion-badge {
            position: absolute;
            top: 0.75rem;
            right: 0.75rem;
            padding: 0.25rem 0.5rem;
            border-radius: 9999px;
            font-size: 0.7rem;
            font-weight: 600;
        }
        .case-study-card {
            position: relative;
        }
        .case-study-card .action-btn.delete:hover {
            background: #fef2f2;
            border-color: #fecaca;
            color: #dc2626;
        }
        /* Upload Zone */
        .upload-zone {
            border: 2px dashed #d1d5db;
            border-radius: 0.75rem;
            padding: 2rem;
            text-align: center;
            transition: all 0.2s;
            cursor: pointer;
        }
        .upload-zone:hover, .upload-zone.dragover {
            border-color: #2563eb;
            background: #eff6ff;
        }
        .upload-zone.uploading {
            pointer-events: none;
            opacity: 0.7;
        }
        /* Metadata Viewer */
        .metadata-viewer {
            background: #1f2937;
            color: #e5e7eb;
            border-radius: 0.5rem;
            padding: 1rem;
            font-family: monospace;
            font-size: 0.8rem;
            max-height: 500px;
            overflow-y: auto;
            white-space: pre-wrap;
            word-break: break-all;
        }
        /* Case Study Detail Modal */
        .case-study-detail-modal {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.5);
            z-index: 110;
            align-items: center;
            justify-content: center;
        }
        .case-study-detail-modal.active {
            display: flex;
        }
        .case-study-detail-container {
            background: white;
            border-radius: 1rem;
            width: 95%;
            max-width: 800px;
            max-height: 90vh;
            overflow-y: auto;
            box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
        }
        .debug-panel {
            position: fixed;
            bottom: 4rem;
            right: 1rem;
            z-index: 40;
            background: white;
            border-radius: 0.75rem;
            box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
            padding: 1rem;
            width: 320px;
            max-height: 70vh;
            overflow-y: auto;
            border: 2px solid #6366f1;
        }
        .debug-panel-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 1rem;
            padding-bottom: 0.75rem;
            border-bottom: 1px solid #e5e7eb;
        }
        .debug-step-btn {
            width: 100%;
            text-align: left;
            padding: 0.75rem;
            margin-bottom: 0.5rem;
            border-radius: 0.5rem;
            border: 1px solid #e5e7eb;
            background: #f9fafb;
            cursor: pointer;
            transition: all 0.2s;
        }
        .debug-step-btn:hover {
            background: #eef2ff;
            border-color: #6366f1;
        }
        .debug-step-btn .step-number {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 1.5rem;
            height: 1.5rem;
            border-radius: 50%;
            background: #6366f1;
            color: white;
            font-size: 0.75rem;
            font-weight: 600;
            margin-right: 0.5rem;
        }
        /* Auto-run Progress Overlay */
        .auto-run-overlay {
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.75);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 9999;
        }
        .auto-run-panel {
            background: white;
            border-radius: 1rem;
            padding: 2rem;
            max-width: 500px;
            width: 90%;
            box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
        }
        .auto-run-step {
            display: flex;
            align-items: center;
            padding: 0.75rem;
            border-radius: 0.5rem;
            margin-bottom: 0.5rem;
            transition: all 0.3s;
        }
        .auto-run-step.pending {
            background: #f3f4f6;
            color: #6b7280;
        }
        .auto-run-step.active {
            background: #dbeafe;
            color: #1e40af;
            border: 1px solid #93c5fd;
        }
        .auto-run-step.completed {
            background: #dcfce7;
            color: #166534;
        }
        .auto-run-step.error {
            background: #fee2e2;
            color: #991b1b;
        }
        .auto-run-step-number {
            width: 2rem;
            height: 2rem;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            font-weight: 600;
            margin-right: 0.75rem;
            font-size: 0.875rem;
        }
        .auto-run-step.pending .auto-run-step-number {
            background: #e5e7eb;
        }
        .auto-run-step.active .auto-run-step-number {
            background: #3b82f6;
            color: white;
        }
        .auto-run-step.completed .auto-run-step-number {
            background: #22c55e;
            color: white;
        }
        .auto-run-step.error .auto-run-step-number {
            background: #ef4444;
            color: white;
        }
        @keyframes pulse-ring {
            0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7); }
            70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(59, 130, 246, 0); }
            100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
        }
        .auto-run-step.active .auto-run-step-number {
            animation: pulse-ring 2s infinite;
        }

        /* Test Runner Styles */
        .test-row-pass { border-left: 3px solid #16a34a; }
        .test-row-fail { border-left: 3px solid #dc2626; background: #fef2f2; }
        .test-row-skip { border-left: 3px solid #9ca3af; opacity: 0.6; }
        .test-spinner {
            width: 16px; height: 16px;
            border: 2px solid #e5e7eb;
            border-top: 2px solid #2563eb;
            border-radius: 50%;
            animation: spin 0.6s linear infinite;
        }
        @keyframes spin {
            to { transform: rotate(360deg); }
        }
