/* =================================================== */
/* VeraCita - Configure Sources BASE Styles           */
/* File 1 of 6: Variables, Layout, Stats, Categories  */
/* =================================================== */

/* --- CSS Variables --- */
:root {
    --brand-blue: #4384ff;
    --brand-purple: #7b42ff;
    --brand-green: var(--vc-status-supported);
    --brand-gold: var(--vc-status-partial);
    --bg-dark: var(--vc-bg-base);
    --glass-bg: rgba(10, 10, 15, 0.7);
    --border-subtle: var(--vc-border-emphasis);
    --text-primary: var(--vc-text-primary);
    --text-secondary: var(--vc-text-secondary);
    --text-muted: var(--vc-text-muted);
    --success-green: var(--vc-status-supported);
}

/* --- Page Layout & Foundation --- */
.cs-main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 70px 40px 24px;
    display: none;
    animation: fadeIn 0.3s ease-out;
    /* Fixed height to keep navigation visible */
    height: 100vh;
    box-sizing: border-box;
    position: relative;
    /* Flexbox layout to push nav to bottom */
    flex-direction: column;
    overflow: visible;  /* Changed from hidden to visible so nav is not cut off */
}

.cs-main-container.active {
    display: flex !important;
}

/* Navigation container - stays at bottom, MUST be visible */
#screen2Navigation {
    flex-shrink: 0;
    padding: 16px 0;
    background: transparent;
}

/* --- Stepper Wrapper (Option C: Above Content Card) --- */
.cs-stepper-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: -22px;  /* Overlap the card border */
    position: relative;
    z-index: 10;  /* Sit above the card */
}

.cs-stepper-wrapper + .cs-config-section {
    margin-top: 0;
}

.cs-page-header {
    text-align: center;
    margin-bottom: 16px;
}

.cs-page-title {
    font-size: 48px;
    font-weight: 200;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.cs-page-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* --- Progress Tracker (Step Progression) --- */
.cs-progress-tracker {
    padding: 32px 0;
    margin-bottom: 24px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.cs-progress-timeline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.cs-progress-timeline::before {
    content: '';
    position: absolute;
    top: 24px;
    left: 10%;
    right: 10%;
    height: 2px;
    background: linear-gradient(to right, var(--brand-blue) 25%, var(--brand-purple) 100%);
    opacity: 0.3;
    z-index: 1;
}

.cs-step-item {
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 2;
}

.cs-step-item:not(.active):not(.completed) .cs-step-title,
.cs-step-item:not(.active):not(.completed) .cs-step-desc {
    opacity: 0.6;
}

.cs-step-number {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--brand-blue), var(--brand-purple));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-weight: 600;
    font-size: 18px;
    color: white;
    position: relative;
}

.cs-step-number::before {
    content: '';
    position: absolute;
    width: 60px;
    height: 60px;
    background: var(--bg-dark);
    border-radius: 50%;
    z-index: -1;
    transform: translate(-50%, -50%);
    top: 50%;
    left: 50%;
}

.cs-step-item.completed .cs-step-number,
.cs-step-item.active .cs-step-number {
    box-shadow: 0 4px 12px rgba(67, 132, 255, 0.3);
}

.cs-step-title {
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.cs-step-desc {
    font-size: 13px;
    color: var(--text-muted);
}

.cs-config-section {
    background: linear-gradient(145deg, var(--vc-bg-surface), var(--vc-bg-body));
    backdrop-filter: none;
    border: 1px solid var(--vc-border-emphasis);
    border-radius: 24px;
    padding: 0;
    margin-top: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-width: 100%;
    /* Critical: constrain height to leave room for navigation footer */
    min-height: 0;
    max-height: calc(100vh - 280px);  /* Leave ~280px for header + footer + padding */
}

/* Prism wrapper at top of config section - full width */
.cs-config-section > .prism-wrapper {
    margin: 0;
    padding: 0;
}

/* Content area below prism bar gets the padding */
.cs-config-section > .cs-content-area {
    padding: 24px 32px;
}

/* Content area below the prism stepper */
.cs-unified-bar {
    margin: 20px 32px 16px;  /* Add horizontal margins */
}

/* NOTE: Document filter dropdown removed - use sidebar Documents Panel instead */

/* Hidden class for filtered cards */
.cs-filtered-hidden {
    display: none !important;
}

.cs-working-space {
    padding: 0 32px 24px;  /* Horizontal and bottom padding */
}

/* --- Stats Progress Container (Premium Design) --- */
.cs-stats-progress-container {
    background: var(--vc-glass-bg);
    border: 1px solid var(--vc-border-default);
    border-radius: 16px;
    padding: 16px 24px;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
}

/* Remove the animated background gradient */
.cs-stats-progress-container::before {
    display: none;
}

@keyframes pulseGlow {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.1); }
}

.cs-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);  /* 3 equal columns for 3 stats */
    gap: 32px;
    margin-bottom: 24px;
    align-items: center;
    position: relative;
    z-index: 1;
}

.cs-stat-item {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    text-align: center;
    position: relative;
}

/* Add decorative dividers between stats */
.cs-stat-item:not(:last-child)::after {
    content: '';
    position: absolute;
    right: -24px;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 60px;
    background: linear-gradient(to bottom,
        transparent,
        var(--vc-border-emphasis) 20%,
        var(--vc-border-emphasis) 80%,
        transparent
    );
}

/* Enhanced center stat prominence with gradient flow animation */
.cs-stat-item.cs-stat-primary {
    transform: scale(1.05);
}

.cs-stat-item.cs-stat-primary .cs-stat-number {
    font-size: 48px;
    font-weight: 700;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #4384ff 0%, #6b5aff 50%, #7b42ff 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: centerStatGradientFlow 3s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(67, 132, 255, 0.4));
}

/* Gradient flow animation for center stat - matches progress bar */
@keyframes centerStatGradientFlow {
    0%, 100% { 
        background-position: 0% 50%;
        filter: drop-shadow(0 0 24px rgba(67, 132, 255, 0.5));
    }
    50% { 
        background-position: 100% 50%;
        filter: drop-shadow(0 0 32px rgba(67, 132, 255, 0.7));
    }
}

/* When center stat is complete (0), use green gradient flow */
.cs-stat-item.cs-stat-primary .cs-stat-number.cs-complete {
    background: linear-gradient(135deg, var(--vc-status-supported) 0%, #059669 50%, var(--vc-status-supported) 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: centerStatGradientFlowComplete 3s ease-in-out infinite;
}

@keyframes centerStatGradientFlowComplete {
    0%, 100% { 
        background-position: 0% 50%;
        filter: drop-shadow(0 0 28px rgba(16, 185, 129, 0.6));
    }
    50% { 
        background-position: 100% 50%;
        filter: drop-shadow(0 0 36px rgba(16, 185, 129, 0.9));
    }
}

.cs-stat-number {
    font-size: 40px;
    font-weight: 700;
    line-height: 1;
    background: linear-gradient(135deg, #4384ff 0%, #7b42ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.03em;
    position: relative;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 0 16px rgba(67, 132, 255, 0.25));
}

.cs-stat-number:hover {
    transform: scale(1.05);
}

/* Add glow effect to complete state */
.cs-stat-number.cs-complete {
    background: linear-gradient(135deg, var(--vc-status-supported) 0%, #059669 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 24px rgba(16, 185, 129, 0.5));
}

.cs-stat-text {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--vc-text-muted);
    text-transform: uppercase;
    position: relative;
}

/* Add subtle underline to labels */
.cs-stat-text::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(67, 132, 255, 0.3), transparent);
    border-radius: 2px;
}

/* Progress Bar - Premium Refinements */
.cs-progress-bar-wrapper {
    margin: 20px 0 16px 0;
    position: relative;
    z-index: 1;
}

.cs-progress-bar-track {
    width: 100%;
    height: 12px;
    background: var(--vc-bg-input);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--vc-border-default);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.3);
}

.cs-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #4384ff 0%, #6b5aff 50%, #7b42ff 100%);
    background-size: 200% 100%;
    border-radius: 16px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1), 
                background 0.3s ease,
                box-shadow 0.3s ease;
    position: relative;
    box-shadow: 
        0 0 30px rgba(67, 132, 255, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
    animation: gradientFlow 3s ease-in-out infinite;
}

/* Animated gradient flow */
@keyframes gradientFlow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Add glowing edge effect */
.cs-progress-bar-fill::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 40px;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4));
    border-radius: 0 16px 16px 0;
    animation: edgePulse 2s ease-in-out infinite;
}

@keyframes edgePulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.cs-progress-bar-fill.cs-complete {
    background: linear-gradient(90deg, var(--vc-status-supported) 0%, #059669 100%);
    background-size: 100% 100%;
    box-shadow: 
        0 0 40px rgba(16, 185, 129, 0.8),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
    animation: completePulse 2s ease-in-out infinite;
}

@keyframes completePulse {
    0%, 100% { 
        box-shadow: 
            0 0 30px rgba(16, 185, 129, 0.6),
            inset 0 1px 0 rgba(255, 255, 255, 0.3),
            inset 0 -1px 0 rgba(0, 0, 0, 0.2);
    }
    50% { 
        box-shadow: 
            0 0 50px rgba(16, 185, 129, 1),
            inset 0 1px 0 rgba(255, 255, 255, 0.4),
            inset 0 -1px 0 rgba(0, 0, 0, 0.2);
    }
}

/* Enhanced shimmer effect - only when incomplete */
.cs-progress-bar-fill.cs-incomplete::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent,
        rgba(255, 255, 255, 0.4) 40%,
        rgba(255, 255, 255, 0.6) 50%,
        rgba(255, 255, 255, 0.4) 60%,
        transparent
    );
    animation: shimmer 2.5s ease-in-out infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Stop shimmer when complete */
.cs-progress-bar-fill.cs-complete::after {
    display: none;
}

/* Add percentage indicator on hover */
.cs-progress-bar-fill::after {
    content: attr(data-progress) '%';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    font-weight: 700;
    color: var(--vc-text-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    pointer-events: none;
}

.cs-progress-bar-track:hover .cs-progress-bar-fill::after {
    opacity: 1;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .cs-stats-progress-container {
        padding: 36px 28px;
    }
    
    .cs-stats-row {
        gap: 32px;
        margin-bottom: 32px;
    }
    
    .cs-stat-item:not(:last-child)::after {
        display: none;
    }
    
    .cs-stat-number {
        font-size: 42px;
    }
    
    .cs-stat-item.cs-stat-primary .cs-stat-number {
        font-size: 52px;
    }
    
    .cs-progress-bar-track {
        height: 14px;
    }
}

@media (max-width: 480px) {
    .cs-stats-row {
        gap: 24px;
    }
    
    .cs-stat-number {
        font-size: 36px;
    }
    
    .cs-stat-item.cs-stat-primary .cs-stat-number {
        font-size: 44px;
    }
}

/* ======================================================================== */
/* --- Category Buttons - STYLED LIKE LANDING PAGE TABS (SURGICAL FIX) --- */
/* ======================================================================== */

/* Main container for the buttons */
.cs-category-grid {
    display: flex; /* This creates the horizontal bar */
    gap: 8px;
    padding: 4px;
    background: var(--vc-bg-input);
    border-radius: 12px;
    margin-bottom: 32px;
}

/* Individual Category Button */
.cs-category-card {
    flex: 1; /* Each button takes equal space */
    padding: 12px 20px; /* Sizing identical to landing page tabs */
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.3s ease, color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px; /* Space between elements inside */
    text-align: left;
    box-shadow: none; /* Remove original card shadow */
    transform: none; /* Remove original card transform */
}

/* NO hover effect, as requested */
.cs-category-card:hover {
    background: transparent;
    transform: none;
    box-shadow: none;
}

/* Active Category Button */
.cs-category-card.cs-category-active {
    background: linear-gradient(135deg, #4384ff, #7b42ff);
    color: white;
}

/* Category Title Text */
.cs-category-title {
    font-size: 18px; /* Adjusted for better fit */
    font-weight: 500;
    color: var(--text-primary);
    margin: 0;
    flex: 1; /* This is key: it pushes the count to the right end */
}

.cs-category-active .cs-category-title {
    color: white;
}

/* Category Count (Number on the right) */
.cs-category-count {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    background-color: var(--vc-border-emphasis);
    padding: 4px 10px;
    border-radius: 7px;
    min-width: 20px;
    text-align: center;
}

.cs-category-active .cs-category-count {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    box-shadow: none;
}

/* Hide the original description paragraph from the 2x2 layout */
.cs-category-desc {
    display: none;
}

/* --- Icon Badge Styling (Using Original Icons) --- */
.cs-icon-badge {
    width: auto;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: transparent;
}

.cs-icon-badge svg {
    width: 26px;
    height: 26px;
}

/* UNSELECTED STATE is now handled by the inline SVG gradient. No CSS rule needed. */

/* SELECTED STATE:
   When the parent card is active, we must directly target the shapes
   inside the SVG to override their inline `stroke` attribute.
*/
.cs-category-active .cs-icon-badge svg * {
    stroke: white;
}

/* --- Working Space for Category Content --- */
.cs-working-space {
    position: relative;
    flex: 1;
    min-height: 0;  /* Critical: allows flex item to shrink */
    overflow-y: auto;
    background: var(--vc-glass-bg);
    border: 1px solid var(--vc-border-default);
    border-radius: 20px;
    padding: 24px;
    margin: 16px 32px 24px;
    display: flex;
    flex-direction: column;
}

/* Category content containers - expand to fill available space */
.cs-category-content {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* Scrollable list inside category content - expand to fill */
.cs-scrollable-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.cs-working-space::-webkit-scrollbar {
    width: 8px;
}

.cs-working-space::-webkit-scrollbar-track {
    background: var(--vc-glass-bg);
    border-radius: 4px;
}

.cs-working-space::-webkit-scrollbar-thumb {
    background: var(--vc-border-emphasis);
    border-radius: 4px;
}

.cs-working-space::-webkit-scrollbar-thumb:hover {
    background: var(--vc-border-emphasis);
}

/* --- Section Structure --- */
.cs-section {
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 24px;
}

.cs-section-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.cs-section-icon {
    font-size: 32px;
    line-height: 1;
}

.cs-section-header h3 {
    font-size: 24px;
    font-weight: 500;
    margin: 0;
    color: var(--text-primary);
}

.cs-section-desc {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.6;
}

/* --- Content Headers --- */
.cs-content-header {
    margin-bottom: 24px;
}

.cs-content-header h4 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.cs-content-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

/* --- Empty State Styling --- */
.cs-empty-state {
    text-align: center;
    padding: 60px 20px;
}

.cs-empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.cs-empty-state h4 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.cs-empty-state p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

/* ============================================================================
   SOURCE TYPE TOGGLE - Landing Page Style
   ============================================================================ */

.cs-source-type-toggle {
    margin-bottom: 24px;
}

/* Horizontal Bar Container */
.cs-source-tabs {
    display: flex;
    gap: 8px;
    padding: 4px;
    background: var(--vc-bg-input);
    border-radius: 12px;
    margin-bottom: 16px;
}

/* Individual Tab Buttons */
.cs-source-tab {
    flex: 1;
    padding: 16px 24px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 20px;  /* Changed from 16px to 18px */
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

/* Tab Icon */
.cs-source-tab-icon {
    width: 24px;
    height: 24px;
    opacity: 0.8;
    flex-shrink: 0;
}

/* Hover State */
.cs-source-tab:hover:not(.cs-source-tab-disabled):not([disabled]) {
    color: var(--text-primary);
    background: var(--vc-border-default);
}

/* Active State - Purple Gradient like Landing Page */
.cs-source-tab.cs-source-tab-active {
    background: linear-gradient(135deg, #4384ff, #7b42ff);
    color: white;
    box-shadow: 0 4px 12px rgba(67, 132, 255, 0.3);
}

.cs-source-tab.cs-source-tab-active .cs-source-tab-icon {
    opacity: 1;
}

/* Disabled State */
.cs-source-tab.cs-source-tab-disabled,
.cs-source-tab[disabled] {
    cursor: not-allowed;
    opacity: 0.5;
    color: var(--vc-text-disabled);
}

.cs-source-tab.cs-source-tab-disabled:hover,
.cs-source-tab[disabled]:hover {
    background: transparent;
}

/* Secondary Info Badge */
.cs-secondary-info {
    margin-top: 16px;
}

.cs-info-badge {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    background: rgba(67, 132, 255, 0.08);
    border: 1px solid rgba(67, 132, 255, 0.2);
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.85);
}

.cs-info-badge svg {
    flex-shrink: 0;
    margin-top: 2px;
    color: #4384ff;
}

/* Responsive */
@media (max-width: 768px) {
    .cs-source-tabs {
        flex-direction: column;
        gap: 8px;
    }
    
    .cs-source-tab {
        width: 100%;
        font-size: 15px;
        padding: 14px 20px;
    }
}

.cs-toggle-info-message {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 24px;
    background: rgba(67, 132, 255, 0.08);
    border: 1px solid rgba(67, 132, 255, 0.2);
    border-radius: 12px;
    font-size: 16px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
}

.cs-toggle-info-message svg {
    flex-shrink: 0;
    margin-top: 3px;
    color: #4384ff;
    width: 24px;
    height: 24px;
}
/* Success state for info message */
.cs-toggle-info-message span:has(✓) {
    color: var(--success-green);
    font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
    .cs-toggle-info-message {
        font-size: 13px;
        padding: 14px 16px;
    }
}

/* --- Continue Button Section --- */
.cs-continue-section {
    text-align: center;
    margin-top: 48px;
    margin-bottom: 48px;
    padding-bottom: 40px;
    position: relative;
    z-index: 10;
}

.cs-continue-btn {
    background: linear-gradient(135deg, var(--brand-blue), var(--brand-purple));
    color: white;
    border: none;
    padding: 16px 48px;
    font-size: 16px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cs-continue-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(67, 132, 255, 0.3);
}

.cs-continue-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

/* --- Loading State --- */
.cs-loading {
    text-align: center;
    padding: 80px;
}

.cs-loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-subtle);
    border-top-color: var(--brand-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 24px;
}

/* --- Error State --- */
.cs-error-state {
    text-align: center;
    padding: 80px 40px;
}

.cs-error-icon {
    font-size: 64px;
    margin-bottom: 24px;
    opacity: 0.6;
}

.cs-error-state h3 {
    font-size: 28px;
    font-weight: 400;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.cs-error-state p {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

/* --- Animations --- */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInContent {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- Responsive Design (Base) --- */
@media (max-width: 768px) {
    .cs-main-container {
        padding: 20px;
        padding-top: 60px;
    }

    .cs-config-section {
        max-height: calc(100vh - 240px);
    }

    .cs-working-space {
        margin: 12px 16px 16px;
        padding: 16px;
    }

    .cs-page-title {
        font-size: 36px;
    }

    .cs-stats-summary {
        flex-direction: column;
        gap: 24px;
        padding: 24px;
    }

    .cs-stat-item {
        padding: 16px;
        background: var(--vc-glass-bg);
        border-radius: 8px;
    }

    .cs-section {
        padding: 20px;
    }

    .cs-continue-btn {
        width: 100%;
        padding: 16px;
    }

    .cs-category-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .cs-stats-summary-clean {
        grid-template-columns: 1fr;
    }
    
    .cs-stat-block:not(:last-child) {
        border-right: none;
        border-bottom: 1px solid var(--vc-border-default);
        padding-bottom: 16px;
        margin-bottom: 16px;
    }
}

/* ============================================= */
/* UNIFIED STATS + CATEGORIES BAR               */
/* ============================================= */

.cs-unified-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--vc-glass-bg);
    border: 1px solid var(--vc-border-default);
    border-radius: 14px;
    padding: 6px;
    margin-bottom: 0;
    gap: 6px;
}

/* Category Tabs Section */
.cs-unified-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
}

.cs-unified-tab {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    justify-content: center;
}

.cs-unified-tab:hover:not(.cs-unified-tab-active) {
    background: var(--vc-border-subtle);
}

.cs-unified-tab-active {
    background: linear-gradient(135deg, rgba(67, 132, 255, 0.15), rgba(123, 66, 255, 0.15));
    border: 1px solid rgba(123, 66, 255, 0.3);
}

.cs-unified-tab-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    flex-shrink: 0;
}

.cs-unified-tab-icon svg {
    width: 18px;
    height: 18px;
}

.cs-unified-tab-label {
    font-size: 17px;
    font-weight: 600;
    color: var(--vc-text-secondary);
    white-space: nowrap;
}

.cs-unified-tab-active .cs-unified-tab-label {
    color: var(--vc-text-primary);
}

.cs-unified-tab-count {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    background: var(--vc-border-default);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--vc-text-secondary);
}

.cs-unified-tab-active .cs-unified-tab-count {
    background: var(--vc-border-emphasis);
    color: var(--vc-text-primary);
}

/* Ready tab - green accent when active */
.cs-unified-tab[data-category="ready"].cs-unified-tab-active {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(16, 185, 129, 0.06));
    border-color: rgba(16, 185, 129, 0.3);
}

.cs-unified-tab[data-category="ready"].cs-unified-tab-active .cs-unified-tab-count {
    background: rgba(16, 185, 129, 0.2);
    color: var(--vc-status-supported);
}

/* Links tab - amber accent when active */
.cs-unified-tab[data-category="links"].cs-unified-tab-active {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(245, 158, 11, 0.06));
    border-color: rgba(245, 158, 11, 0.3);
}

.cs-unified-tab[data-category="links"].cs-unified-tab-active .cs-unified-tab-count {
    background: rgba(245, 158, 11, 0.2);
    color: var(--vc-status-partial);
}

/* Docs tab - blue accent when active */
.cs-unified-tab[data-category="pdfs"].cs-unified-tab-active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(59, 130, 246, 0.06));
    border-color: rgba(59, 130, 246, 0.3);
}

.cs-unified-tab[data-category="pdfs"].cs-unified-tab-active .cs-unified-tab-count {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

/* Uncited tab - gray accent when active */
.cs-unified-tab[data-category="uncited"].cs-unified-tab-active {
    background: linear-gradient(135deg, rgba(148, 163, 184, 0.12), rgba(148, 163, 184, 0.06));
    border-color: rgba(148, 163, 184, 0.3);
}

.cs-unified-tab[data-category="uncited"].cs-unified-tab-active .cs-unified-tab-count {
    background: rgba(148, 163, 184, 0.2);
    color: var(--vc-text-secondary);
}

/* Progress Section */
.cs-unified-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px 8px 12px;
    background: var(--vc-bg-input);
    border-radius: 10px;
    border: 1px solid var(--vc-border-default);
    min-width: 140px;
}

.cs-unified-progress-bar {
    flex: 1;
    height: 8px;
    background: var(--vc-border-default);
    border-radius: 4px;
    overflow: hidden;
    min-width: 80px;
}

.cs-unified-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--vc-status-supported), #34d399);
    border-radius: 4px;
    transition: width 0.4s ease;
}

.cs-unified-progress-fill.incomplete {
    background: linear-gradient(90deg, #4384ff, #7b42ff);
}

.cs-unified-progress-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--vc-status-supported);
    white-space: nowrap;
}

.cs-unified-progress-text.incomplete {
    color: var(--vc-text-secondary);
}

/* Privacy Mode Indicators */
.privacy-mode-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.privacy-mode-badge.private {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
}

.privacy-mode-badge.public {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

.secondary-count-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, var(--vc-status-supported), #059669);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    margin-left: 8px;
}

/* Privacy toggle in source card */
.privacy-toggle-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding: 8px 12px;
    background: var(--vc-bg-input);
    border-radius: 8px;
}

.privacy-toggle-label {
    font-size: 12px;
    color: var(--text-secondary, var(--vc-text-tertiary));
}

.privacy-toggle-options {
    display: flex;
    gap: 4px;
}

.privacy-option {
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.privacy-option.private {
    background: rgba(139, 92, 246, 0.1);
    color: #a78bfa;
    border-color: rgba(139, 92, 246, 0.3);
}

.privacy-option.private:hover,
.privacy-option.private.selected {
    background: rgba(139, 92, 246, 0.2);
    border-color: #8b5cf6;
}

.privacy-option.public {
    background: rgba(59, 130, 246, 0.1);
    color: #93c5fd;
    border-color: rgba(59, 130, 246, 0.3);
}

.privacy-option.public:hover,
.privacy-option.public.selected {
    background: rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
}

/* ============================================= */
/* RESPONSIVE DESIGN FOR UNIFIED BAR            */
/* ============================================= */

@media (max-width: 900px) {
    .cs-unified-bar {
        flex-wrap: wrap;
    }
    
    .cs-unified-tabs {
        order: 2;
        flex: 100%;
        margin-top: 8px;
    }
    
    .cs-unified-progress {
        order: 1;
        flex: 100%;
        justify-content: center;
    }
    
    .cs-unified-tab {
        padding: 10px 14px;
    }
    
    .cs-unified-tab-label {
        font-size: 13px;
    }
}

@media (max-width: 600px) {
    .cs-unified-tabs {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    
    .cs-unified-tab {
        padding: 10px 12px;
    }
    
    .cs-unified-tab-label {
        font-size: 12px;
    }
    
    .cs-unified-tab-count {
        font-size: 12px;
        min-width: 22px;
        height: 22px;
        padding: 0 6px;
    }
    
    .cs-unified-progress {
        min-width: auto;
        width: 100%;
    }
}

/* ============================================= */
/* LIGHT THEME SUPPORT FOR UNIFIED BAR          */
/* ============================================= */

[data-theme="light"] .cs-unified-bar {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(15, 23, 42, 0.1);
}

[data-theme="light"] .cs-unified-tab:hover:not(.cs-unified-tab-active) {
    background: rgba(15, 23, 42, 0.04);
}

[data-theme="light"] .cs-unified-tab-label {
    color: rgba(15, 23, 42, 0.7);
}

[data-theme="light"] .cs-unified-tab-active .cs-unified-tab-label {
    color: rgba(15, 23, 42, 0.95);
}

[data-theme="light"] .cs-unified-tab-count {
    background: rgba(15, 23, 42, 0.08);
    color: rgba(15, 23, 42, 0.8);
}

[data-theme="light"] .cs-unified-tab-active .cs-unified-tab-count {
    background: rgba(15, 23, 42, 0.12);
    color: rgba(15, 23, 42, 0.95);
}

[data-theme="light"] .cs-unified-progress {
    background: rgba(15, 23, 42, 0.03);
    border-color: rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .cs-unified-progress-bar {
    background: rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .cs-unified-progress-text.incomplete {
    color: rgba(15, 23, 42, 0.7);
}

/* Content area below the prism stepper */
.cs-content-area {
    padding: 20px 32px 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}