/* ==================== CSS VARIABLES - B2B Professional Palette ==================== */
:root {
    --primary-color: #1e40af;
    --primary-hover: #1e3a8a;
    --primary-light: #3b82f6;
    --primary-50: #eff6ff;
    --primary-100: #dbeafe;
    --primary-200: #bfdbfe;
    --success-color: #059669;
    --success-hover: #047857;
    --success-light: #10b981;
    --success-50: #ecfdf5;
    --success-100: #d1fae5;
    --danger-color: #dc2626;
    --danger-50: #fef2f2;
    --danger-100: #fee2e2;
    --warning-color: #d97706;
    --warning-50: #fffbeb;
    --warning-100: #fef3c7;
    --background: #f8fafc;
    --surface: #ffffff;
    --surface-elevated: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.03);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.08), 0 8px 10px -6px rgb(0 0 0 / 0.03);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== RESET ====================
   NOTE: Global reset (*, html, body) is in landing.css.
   The rules below only add app-specific enhancements and
   are safe to layer on top when styles.css loads second.
   ================================================ */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==================== APP CONTAINER ==================== */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==================== HEADER ==================== */
.header {
    background: var(--surface);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-icon svg {
    color: white;
}

.logo-text h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.tagline {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.security-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--success-50);
    color: var(--success-color);
    padding: 0.375rem 0.875rem;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid var(--success-100);
}

.shield-icon {
    display: flex;
    align-items: center;
}

.shield-icon svg {
    width: 14px;
    height: 14px;
}

/* ==================== HEADER ACTIONS ==================== */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.get-pro-btn {
    background: linear-gradient(135deg, var(--warning-color), #b45309);
    color: white;
    border: none;
    padding: 0.4rem 0.875rem;
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    transition: all var(--transition);
    box-shadow: 0 1px 3px rgba(217, 119, 6, 0.3);
}

.get-pro-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(217, 119, 6, 0.3);
}

body.pro-version .get-pro-btn {
    display: none;
}

/* ==================== LANGUAGE SWITCHER ==================== */
.lang-switcher {
    display: flex;
    gap: 2px;
    background: var(--background);
    padding: 2px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.lang-btn {
    background: transparent;
    border: none;
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    font-family: inherit;
}

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

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

/* ==================== MAIN CONTENT ==================== */
.main-content {
    flex: 1;
    padding: 1.5rem;
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
}

/* ==================== SECTIONS ==================== */
.hidden {
    display: none !important;
}

/* ==================== UPLOAD SECTION ==================== */
.upload-section {
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.upload-container {
    max-width: 800px;
    margin: 0 auto;
}

.upload-area {
    background: var(--surface);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-xl);
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 2rem;
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--primary-light);
    background: var(--primary-50);
    transform: scale(1.01);
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.upload-icon {
    margin-bottom: 0.75rem;
    color: var(--primary-light);
    display: block;
}

.upload-content h4 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.upload-content p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.upload-formats {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.upload-privacy {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 0.875rem;
    font-size: 0.72rem;
    color: var(--text-muted);
    letter-spacing: 0.01em;
}

.upload-privacy svg {
    opacity: 0.6;
    flex-shrink: 0;
}

.file-types {
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ==================== FEATURES GRID (Upload page) ==================== */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.feature-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
    border: 1px solid var(--border-light);
}

.feature-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-color);
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    color: var(--primary-light);
}

.feature-card h3 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.375rem;
}

.feature-card p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ==================== PROCESSING SECTION ==================== */
.processing-section {
    animation: fadeIn 0.4s ease;
}

.processing-container {
    max-width: 700px;
    margin: 0 auto;
    background: var(--surface);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
}

.file-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: var(--primary-50);
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    border: 1px solid var(--primary-100);
}

.file-icon {
    font-size: 1.25rem;
    color: var(--primary-light);
}

.file-name {
    flex: 1;
    font-weight: 500;
    word-break: break-all;
    font-size: 0.9rem;
}

.btn-remove {
    background: none;
    border: none;
    font-size: 1.1rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.btn-remove:hover {
    background: var(--danger-50);
    color: var(--danger-color);
}

/* ==================== FILE PREVIEW BUTTON ==================== */
.cs-preview-data-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.7rem;
    background: var(--surface);
    border: 1px solid var(--primary-200);
    border-radius: var(--radius-sm);
    color: var(--primary-color);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.cs-preview-data-btn:hover {
    background: var(--primary-50);
    border-color: var(--primary-color);
}

.cs-preview-data-btn svg {
    flex-shrink: 0;
}

/* ==================== FILE PREVIEW MODAL ==================== */
.cs-preview-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1rem;
}

.cs-preview-modal-overlay.visible {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.cs-preview-modal {
    background: var(--surface);
    border-radius: var(--radius-xl, 1rem);
    width: 95vw;
    max-width: 900px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 60px rgba(0,0,0,0.25);
    animation: slideUp 0.3s ease;
    overflow: hidden;
}

.cs-preview-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--background);
    flex-shrink: 0;
}

.cs-preview-modal-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.cs-preview-modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.cs-preview-modal-close:hover {
    background: var(--danger-50);
    color: var(--danger-color);
}

.cs-preview-modal-body {
    flex: 1;
    overflow: auto;
    padding: 1rem;
    -webkit-overflow-scrolling: touch;
}

.cs-preview-modal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
}

.cs-preview-modal-table th,
.cs-preview-modal-table td {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    text-align: left;
    white-space: nowrap;
}

.cs-preview-modal-table th {
    background: var(--background);
    font-weight: 600;
    color: var(--text-secondary);
    position: sticky;
    top: 0;
    z-index: 2;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.cs-preview-modal-table td {
    color: var(--text-primary);
}

.cs-preview-modal-table .row-num {
    color: var(--text-muted);
    font-size: 0.7rem;
    width: 36px;
    text-align: center;
}

.cs-preview-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--border-color);
    background: var(--background);
    flex-shrink: 0;
}

.cs-preview-modal-info {
    font-size: 0.72rem;
    color: var(--text-muted);
}

@media (max-width: 600px) {
    .cs-preview-modal {
        width: 100%;
        max-height: 90vh;
        border-radius: var(--radius-md);
    }
    .cs-preview-modal-header {
        padding: 0.75rem 1rem;
    }
    .cs-preview-modal-body {
        padding: 0.5rem;
    }
    .cs-preview-data-btn span {
        display: none;
    }
}

/* ==================== CLEANING OPTIONS ==================== */
.cleaning-options {
    margin-bottom: 1.5rem;
}

.cleaning-options h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.rounding-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.625rem 0.875rem;
    background: var(--primary-50);
    border-radius: var(--radius-md);
    border: 1px solid var(--primary-100);
}

.rounding-option label {
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    font-size: 0.875rem;
}

.rounding-select {
    flex: 1;
    max-width: 280px;
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--surface);
    font-family: inherit;
    font-size: 0.8rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: border-color var(--transition);
}

.rounding-select:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* ==================== DATE REGION SELECTOR ==================== */
.date-region-option {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.75rem 0.875rem;
    background: var(--warning-50);
    border-radius: var(--radius-md);
    border: 1px solid var(--warning-100);
    transition: all var(--transition);
    animation: regionSlideIn 0.25s ease;
}

@keyframes regionSlideIn {
    from { opacity: 0; max-height: 0; padding-top: 0; padding-bottom: 0; margin-top: 0; }
    to   { opacity: 1; max-height: 200px; }
}

.date-region-option.hidden {
    display: none;
}

.date-region-info {
    flex-basis: 100%;
    display: flex;
    align-items: flex-start;
    gap: 0.25rem;
    margin-bottom: 0.125rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

.date-region-info svg {
    margin-top: 1px;
    color: var(--warning-color);
}

.date-region-option label {
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    font-size: 0.875rem;
    margin-right: 0.5rem;
}

.date-region-select {
    flex: 1;
    max-width: 320px;
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--surface);
    font-family: inherit;
    font-size: 0.8rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: border-color var(--transition);
}

.date-region-select:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* ==================== DATE CONFLICT HIGHLIGHTING ==================== */
.date-conflict-cell {
    background: var(--warning-50) !important;
    border: 1px solid var(--warning-color) !important;
    position: relative;
    cursor: help;
}

.date-conflict-cell .conflict-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    margin-left: 0.25rem;
    color: var(--warning-color);
    vertical-align: middle;
}

/* ==================== DATE CONFLICT ACTION BUTTONS ==================== */
.date-conflict-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 0.625rem 0.75rem;
    margin: 0.25rem 0 0.5rem;
    background: linear-gradient(135deg, rgba(217, 119, 6, 0.06), rgba(217, 119, 6, 0.02));
    border: 1px solid rgba(217, 119, 6, 0.15);
    border-radius: 0.5rem;
    animation: conflictSlideIn 0.3s ease;
}

@keyframes conflictSlideIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.date-conflict-force-btn {
    background: linear-gradient(135deg, #d97706, #b45309) !important;
    color: #fff !important;
    border: none !important;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.4rem 0.875rem;
    border-radius: 0.375rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(217, 119, 6, 0.25);
    white-space: nowrap;
}

.date-conflict-force-btn:hover {
    background: linear-gradient(135deg, #b45309, #92400e) !important;
    box-shadow: 0 2px 8px rgba(217, 119, 6, 0.35);
    transform: translateY(-1px);
}

.date-conflict-force-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(217, 119, 6, 0.2);
}

.date-conflict-force-btn .conflict-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.3rem;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 0.625rem;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
}

.date-conflict-export-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.4rem 0.875rem;
    border-radius: 0.375rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.date-conflict-export-btn:active {
    transform: scale(0.97);
}

/* ==================== DATE CONFLICT TOAST ==================== */
.date-conflict-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(1rem);
    background: linear-gradient(135deg, #065f46, #047857);
    color: #fff;
    padding: 0.75rem 1.25rem;
    border-radius: 0.625rem;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    opacity: 0;
    transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
    max-width: 90vw;
    white-space: nowrap;
}

.date-conflict-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.date-conflict-toast svg {
    flex-shrink: 0;
}

.date-conflict-toast-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.125rem;
    margin-left: 0.25rem;
    flex-shrink: 0;
    transition: color 0.15s;
}

.date-conflict-toast-close:hover {
    color: #fff;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 0.5rem;
}

/* ==================== OPTIONS SECTIONS ==================== */
.options-section {
    margin-bottom: 1rem;
    padding: 0.875rem;
    background: var(--background);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.options-section-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.recommended-badge {
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--success-color);
    background: var(--success-50);
    padding: 0.1rem 0.4rem;
    border-radius: 8px;
}

.option-item {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    padding: 0.5rem 0.75rem;
    background: white;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--transition);
    border: 1px solid transparent;
}

.option-item:hover {
    background: var(--background);
    border-color: var(--border-color);
}

.option-item.featured {
    background: white;
    border: 1px solid var(--primary-light);
}

.option-item.featured:hover {
    background: var(--primary-50);
}

.option-content {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.option-text {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
}

.option-desc {
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--text-muted);
    line-height: 1.4;
}

.option-item input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    min-width: 18px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    flex-shrink: 0;
    margin-top: 1px;
}

.option-item input:checked + .checkmark {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.option-item input:checked + .checkmark::after {
    content: '✓';
    color: white;
    font-size: 0.65rem;
    font-weight: bold;
}

/* ==================== BUTTONS ==================== */
.action-buttons {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    line-height: 1.4;
}

.btn-large {
    padding: 0.75rem 1.75rem;
    font-size: 1rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 1px 3px rgba(30, 64, 175, 0.2);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.25);
}

.btn-success {
    background: var(--success-color);
    color: white;
    box-shadow: 0 1px 3px rgba(5, 150, 105, 0.2);
}

.btn-success:hover {
    background: var(--success-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.25);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--background);
    border-color: var(--primary-light);
    color: var(--primary-color);
}

.btn-icon {
    display: flex;
    align-items: center;
}

/* ==================== PROGRESS ==================== */
.progress-container {
    text-align: center;
    padding: 1rem 0;
}

.progress-bar {
    height: 6px;
    background: var(--background);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.625rem;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    border-radius: 3px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* ==================== RESULTS SECTION ==================== */
.results-section {
    animation: fadeIn 0.4s ease;
}

.results-container {
    max-width: 900px;
    margin: 0 auto;
}

.results-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.results-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--success-color);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* ==================== KPI / STATS GRID - B2B Professional ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1rem;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-light);
}

.stat-card:nth-child(2)::before {
    background: var(--success-light);
}

.stat-card:nth-child(3)::before {
    background: var(--warning-color);
}

.stat-card:nth-child(4)::before {
    background: #8b5cf6;
}

.stat-card.stat-anomalies::before {
    background: var(--danger-color);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-color);
    line-height: 1;
    margin-bottom: 0.375rem;
    font-variant-numeric: tabular-nums;
}

.stat-card:nth-child(2) .stat-number {
    color: var(--success-color);
}

.stat-card:nth-child(3) .stat-number {
    color: var(--warning-color);
}

.stat-card:nth-child(4) .stat-number {
    color: #7c3aed;
}

.stat-card.stat-anomalies {
    background: var(--warning-50);
    border-color: var(--warning-100);
}

.stat-card.stat-anomalies .stat-number {
    color: var(--warning-color);
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

/* ==================== REPORT CARD ==================== */
.report-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.report-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.report-list {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.report-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 0.75rem;
    background: var(--background);
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    border-left: 3px solid transparent;
}

.report-item.success {
    background: var(--success-50);
    color: #065f46;
    border-left-color: var(--success-color);
}

.report-item.info {
    background: var(--primary-50);
    color: #1e40af;
    border-left-color: var(--primary-color);
}

.report-item.warning {
    background: var(--warning-50);
    color: #92400e;
    border-left-color: var(--warning-color);
}

/* ==================== PREVIEW CARD ==================== */
.preview-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.preview-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.table-container {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    -webkit-overflow-scrolling: touch;
}

.preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.preview-table th,
.preview-table td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.preview-table th {
    background: var(--background);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.65rem;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 1;
}

.preview-table tr:last-child td {
    border-bottom: none;
}

.preview-table tr:hover td {
    background: var(--primary-50);
}

/* ==================== DOWNLOAD & EXPORT BUTTONS ==================== */
/* main .download-buttons rule is at the bottom of the file */

#clean-another {
    display: block;
    margin: 0 auto 1.5rem auto;
}

/* ==================== FOOTER ==================== */
.footer {
    background: var(--surface);
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    margin-top: auto;
    text-align: center;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
}

.security-note {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.security-note strong {
    color: var(--text-primary);
}

.copyright {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ==================== PREVIEW TABS ==================== */
.preview-tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab-btn {
    padding: 0.625rem 1rem;
    border: none;
    background: transparent;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    color: var(--text-muted);
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: var(--background);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 600;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* ==================== FULLSCREEN TABLE BUTTON ==================== */
.cs-fullscreen-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    padding: 0.4rem 0.6rem;
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
    flex-shrink: 0;
}

.cs-fullscreen-btn:hover {
    background: var(--primary-50);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* ==================== FULLSCREEN TABLE MODAL ==================== */
.cs-fullscreen-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

.cs-fullscreen-modal {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    background: var(--surface);
}

.cs-fullscreen-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--background);
    flex-shrink: 0;
}

.cs-fullscreen-modal-header h2 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cs-fullscreen-modal-header .esc-hint {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 2px 6px;
    margin-left: 0.5rem;
}

.cs-fullscreen-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
}

.cs-fullscreen-close:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: #fff;
}

.cs-fullscreen-modal-body {
    flex: 1;
    overflow: auto;
    padding: 1rem;
    -webkit-overflow-scrolling: touch;
}

.cs-fullscreen-modal-body .table-container {
    max-height: none;
    overflow: visible;
}

.cs-fullscreen-modal-body .preview-table {
    width: 100%;
    font-size: 0.8rem;
}

.cs-fullscreen-modal-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--background);
    flex-shrink: 0;
}

@media (max-width: 600px) {
    .cs-fullscreen-modal-header {
        padding: 0.75rem 1rem;
    }
    .cs-fullscreen-modal-header h2 {
        font-size: 0.85rem;
    }
    .cs-fullscreen-modal-body {
        padding: 0.5rem;
    }
    .cs-fullscreen-modal-footer {
        padding: 0.5rem 1rem;
    }
}

.tab-content h4 {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

/* ==================== CHANGES LIST ==================== */
.changes-list {
    max-height: 350px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.change-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.75rem;
    background: var(--background);
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    border-left: 3px solid var(--primary-light);
}

.change-item .cell-ref {
    font-weight: 600;
    color: var(--primary-color);
    min-width: 50px;
    font-size: 0.7rem;
}

.change-reason-badge {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.125rem 0.4rem;
    border-radius: 4px;
    background: var(--primary-50);
    color: var(--primary-color);
    white-space: nowrap;
    min-width: 54px;
    text-align: center;
}

.change-item .old-value {
    color: var(--danger-color);
    text-decoration: line-through;
    background: var(--danger-50);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.change-item .arrow {
    color: var(--text-muted);
    font-size: 0.7rem;
}

.change-item .new-value {
    color: var(--success-color);
    background: var(--success-50);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ==================== COLUMN ANALYSIS ==================== */
.column-chip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.75rem;
    background: var(--background);
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    transition: all var(--transition);
    border: 1px solid transparent;
}

.column-chip:hover {
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    border-color: var(--border-color);
}

.column-chip.has-anomalies {
    border-color: var(--warning-100);
    background: var(--warning-50);
}

.column-chip .col-icon {
    font-size: 1rem;
    opacity: 0.7;
}

.column-chip .col-name {
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    font-size: 0.8rem;
}

.col-anomaly-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    background: var(--danger-color);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 50%;
    margin-left: auto;
}

/* ==================== ANALYSIS CARD ==================== */
.analysis-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.analysis-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Collapsible Column Analysis — desktop & mobile */
.analysis-card-toggle {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.25rem 0.35rem;
    margin: -0.25rem -0.35rem;
    border-radius: var(--radius-md, 6px);
    transition: background 0.15s ease;
}

.analysis-card-toggle:hover {
    background: var(--background, #f8fafc);
    opacity: 1;
}

.analysis-card-toggle .analysis-chevron {
    transition: transform 0.25s ease;
}

.analysis-collapsed .analysis-card-toggle .analysis-chevron {
    transform: rotate(-90deg);
}

.collapsible-analysis .column-analysis {
    transition: max-height 0.3s ease, opacity 0.2s ease;
    max-height: 2000px;
    opacity: 1;
}

.collapsible-analysis.analysis-collapsed .column-analysis {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
    transition: max-height 0.3s ease, opacity 0.2s ease;
}

.column-analysis {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

/* ==================== LOADING ==================== */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading {
    animation: pulse 1.5s infinite;
}

/* ==================== DEMO/PRO UPGRADE STYLES ==================== */
.upgrade-modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.2s ease;
}

.upgrade-modal {
    background: var(--surface);
    border-radius: var(--radius-xl);
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: var(--shadow-xl);
    position: relative;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.upgrade-modal .modal-close {
    position: absolute;
    top: 0.75rem; right: 0.75rem;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-muted);
    cursor: pointer;
    width: 28px; height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all var(--transition);
}

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

.upgrade-modal .modal-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.upgrade-modal h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.375rem;
}

.upgrade-modal > p {
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
}

.upgrade-modal .pro-features {
    list-style: none;
    text-align: left;
    margin-bottom: 1.25rem;
    background: var(--background);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
}

.upgrade-modal .pro-features li {
    padding: 0.375rem 0;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.upgrade-modal .pro-features li strong {
    color: var(--primary-color);
}

.upgrade-modal .modal-upgrade-btn {
    display: inline-block;
    background: var(--success-color);
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.75rem 1.75rem;
    border-radius: var(--radius-lg);
    text-decoration: none;
    transition: all var(--transition);
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.3);
}

.upgrade-modal .modal-upgrade-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(5, 150, 105, 0.35);
}

.upgrade-modal .modal-note {
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ==================== UPGRADE BANNER ==================== */
.upgrade-banner {
    background: var(--primary-50);
    border: 1px solid var(--primary-100);
    border-radius: var(--radius-md);
    padding: 0.875rem 1rem;
    margin-bottom: 0.75rem;
}

.upgrade-banner .upgrade-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.upgrade-banner .upgrade-icon { font-size: 1.25rem; }

.upgrade-banner .upgrade-text {
    flex: 1;
    min-width: 180px;
    color: var(--text-primary);
    font-size: 0.85rem;
}

.upgrade-banner .upgrade-text strong { color: var(--primary-color); }

.upgrade-banner .upgrade-btn {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
    font-size: 0.8rem;
    padding: 0.4rem 0.875rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    white-space: nowrap;
    transition: all var(--transition);
}

.upgrade-banner .upgrade-btn:hover {
    background: var(--primary-hover);
}

.upgrade-banner-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-shrink: 0;
}

.upgrade-license-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: transparent;
    border: 1.5px solid var(--primary-color);
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.75rem;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition);
}

.upgrade-license-btn:hover {
    background: var(--primary-color);
    color: white;
}

/* ==================== UPGRADE TOAST ==================== */
.upgrade-toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-primary);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 9998;
    animation: toastSlideUp 0.3s ease;
    font-size: 0.85rem;
    max-width: 90vw;
}

@keyframes toastSlideUp {
    from { opacity: 0; transform: translateX(-50%) translateY(16px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.upgrade-toast .toast-upgrade-link {
    color: #6ee7b7;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.upgrade-toast .toast-upgrade-link:hover {
    color: #a7f3d0;
    text-decoration: underline;
}

.upgrade-toast .toast-close {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0;
    margin-left: 0.25rem;
    line-height: 1;
}

.upgrade-toast .toast-close:hover { color: white; }

/* ==================== DEMO BADGE ==================== */
.demo-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: var(--warning-50);
    color: #92400e;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.625rem;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid var(--warning-100);
}

/* ==================== PRO TAG ==================== */
.pro-tag {
    display: inline-block;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #1e293b;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    margin-left: 0.375rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    vertical-align: middle;
}

/* ==================== SMART DETECTION STYLES ==================== */
.options-section.smart-section {
    background: linear-gradient(135deg, var(--primary-50) 0%, var(--success-50) 100%);
    border: 1px solid var(--primary-200);
}

.options-section.smart-section .options-section-title {
    color: var(--primary-color);
}

.pro-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color), #7c3aed);
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    margin-left: 0.375rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==================== SMART FIXES TAB ==================== */
.smart-fixes-list { padding: 0.75rem; }

.smart-fixes-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-secondary);
}

.smart-fixes-empty .empty-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.75rem;
}

.smart-fixes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.fixes-count {
    font-weight: 600;
    color: var(--warning-color);
    font-size: 1rem;
}

.fixes-actions {
    display: flex;
    gap: 0.375rem;
}

.btn-small {
    padding: 0.3rem 0.625rem;
    font-size: 0.75rem;
}

/* ==================== SMART FIXES TABLE ==================== */
.smart-fixes-table {
    overflow-x: auto;
    margin-bottom: 0.75rem;
    -webkit-overflow-scrolling: touch;
}

.smart-fixes-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
    min-width: 900px;
}

.smart-fixes-table th {
    background: var(--background);
    padding: 0.4rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
    font-size: 0.7rem;
    position: sticky;
    top: 0;
    z-index: 10;
}

.smart-fixes-table td {
    padding: 0.4rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.fix-row { transition: background var(--transition); }
.fix-row:hover { background: var(--background); }
.fix-row.accepted { background: var(--success-50); }
.fix-row.rejected { background: var(--danger-50); opacity: 0.6; }
.fix-row.rejected .fix-suggested-value { text-decoration: line-through; }

.fix-row-num {
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.fix-col-name {
    font-weight: 500;
    white-space: nowrap;
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.7rem;
}

.fix-current-value {
    color: var(--danger-color);
    font-family: 'SF Mono', 'Fira Code', monospace;
    background: var(--danger-50);
    padding: 0.15rem 0.3rem;
    border-radius: 3px;
    font-size: 0.7rem;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
}

.fix-arrow {
    color: var(--text-muted);
    font-weight: bold;
    text-align: center;
    padding: 0 0.2rem;
}

.fix-suggested-value {
    color: var(--success-color);
    font-family: 'SF Mono', 'Fira Code', monospace;
    background: var(--success-50);
    padding: 0.15rem 0.3rem;
    border-radius: 3px;
    font-size: 0.7rem;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
}

.confidence-badge {
    display: inline-block;
    padding: 0.1rem 0.35rem;
    border-radius: 8px;
    font-size: 0.65rem;
    font-weight: 600;
    min-width: 44px;
    text-align: center;
}

.confidence-badge.high { background: var(--success-50); color: #15803d; }
.confidence-badge.medium { background: var(--warning-50); color: #a16207; }
.confidence-badge.low { background: var(--danger-50); color: var(--danger-color); }

/* Confidence label (generated by renderConfidenceLabel) */
.confidence-label {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.68rem;
    font-weight: 600;
    white-space: nowrap;
}
.confidence-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}
.confidence-high { color: #15803d; }
.confidence-high .confidence-dot { background: #22c55e; }
.confidence-medium { color: #a16207; }
.confidence-medium .confidence-dot { background: #f59e0b; }
.confidence-low { color: var(--danger-color); }
.confidence-low .confidence-dot { background: var(--danger-color); }

/* ==================== EXPLANATION COLUMN ==================== */
.fix-explanation {
    max-width: 280px;
    min-width: 160px;
    font-size: 0.68rem;
    color: var(--text-secondary);
    line-height: 1.4;
    vertical-align: middle;
}

.explanation-text {
    display: block;
    word-break: break-word;
    line-height: 1.45;
}

.fix-actions { display: flex; gap: 0.25rem; }

.btn-fix-accept,
.btn-fix-reject {
    width: 22px; height: 22px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.btn-fix-accept { background: var(--success-50); color: #15803d; }
.btn-fix-accept:hover { background: var(--success-color); color: white; }
.btn-fix-reject { background: var(--danger-50); color: var(--danger-color); }
.btn-fix-reject:hover { background: var(--danger-color); color: white; }

/* ==================== SMART FIXES FOOTER ==================== */
.smart-fixes-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
    gap: 0.75rem;
}

.fixes-selected {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.fixes-selected-group {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.fixes-hint {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-style: italic;
}

.smart-fixes-footer .btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Review-only footer (no fixable anomalies) */
.smart-fixes-footer-review-only {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    background: var(--background);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-top: 0.75rem;
}

.smart-fixes-footer-review-only .fixes-hint {
    font-style: normal;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* No auto-fix hint bar */
.smart-fixes-no-auto-fix-hint {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.65rem 1rem;
    background: linear-gradient(135deg, #fff7ed, #fffbeb);
    border: 1px solid var(--warning-100);
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
    font-size: 0.78rem;
    color: #92400e;
    line-height: 1.5;
}

.smart-fixes-no-auto-fix-hint svg {
    flex-shrink: 0;
    margin-top: 1px;
    color: var(--warning-color);
}

/* ==================== SUCCESS BANNER (post-apply) ==================== */
.smart-fixes-success-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border: 1px solid #a7f3d0;
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
    animation: successBannerSlideIn 0.4s ease;
}

@keyframes successBannerSlideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.success-banner-icon {
    flex-shrink: 0;
    margin-top: 2px;
}

.success-banner-text {
    flex: 1;
}

.success-banner-text strong {
    font-size: 0.9rem;
    color: #065f46;
    display: block;
    margin-bottom: 0.25rem;
}

.success-banner-text p {
    font-size: 0.78rem;
    color: #047857;
    margin: 0;
    line-height: 1.45;
}

.success-banner-actions {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    flex-shrink: 0;
}

.success-banner-actions .btn-small {
    white-space: nowrap;
    font-size: 0.72rem;
}

/* "All done" state */
.smart-review-all-done {
    text-align: center;
    padding: 2rem 1.5rem;
    animation: fadeIn 0.4s ease;
}

.smart-review-all-done svg {
    display: block;
    margin: 0 auto 0.75rem;
}

.smart-review-all-done h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--success-color);
    margin: 0 0 0.375rem;
}

.smart-review-all-done p {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin: 0;
}

/* ==================== SMART FIXES SUMMARY ==================== */

/* Preview message bar */
.smart-fixes-preview-msg {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: linear-gradient(135deg, #eff6ff, #eef2ff);
    border: 1px solid #c7d2fe;
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
    font-size: 0.8rem;
    color: #4338ca;
    font-weight: 500;
}

.smart-fixes-preview-msg svg {
    flex-shrink: 0;
    color: #6366f1;
}

.smart-fixes-preview-msg span {
    flex: 1;
}

.smart-fixes-preview-msg .btn-small {
    flex-shrink: 0;
    white-space: nowrap;
}

/* View All bar */
.smart-fixes-view-all-bar {
    display: flex;
    justify-content: center;
    padding: 0.75rem 0;
    margin-bottom: 0.5rem;
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1.25rem;
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* ==================== ORIGINAL ROW PREVIEW POPOVER ==================== */
/* Click-to-pin popover so user can scroll inside it */
.row-preview-tooltip {
    position: fixed;
    z-index: 20000;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 12px 36px rgba(0,0,0,0.18);
    padding: 0;
    max-width: 460px;
    min-width: 240px;
    pointer-events: auto;
    animation: fadeIn 0.15s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.row-preview-tooltip-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
    background: var(--background);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.row-preview-tooltip-close {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    padding: 0;
    flex-shrink: 0;
    transition: all 0.15s;
}

.row-preview-tooltip-close:hover {
    background: var(--danger-50);
    color: var(--danger-color);
}

.row-preview-tooltip-body {
    padding: 0.5rem 0.75rem;
    max-height: 50vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.row-preview-tooltip-body table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.68rem;
}

.row-preview-tooltip-body th {
    text-align: left;
    color: var(--text-muted);
    font-weight: 600;
    padding: 0.2rem 0.5rem 0.2rem 0;
    white-space: nowrap;
    width: 40%;
    vertical-align: top;
}

.row-preview-tooltip-body td {
    color: var(--text-primary);
    padding: 0.2rem 0;
    word-break: break-word;
}

.row-preview-tooltip-body tr.highlight-col td {
    color: var(--primary-color);
    font-weight: 600;
}

.row-preview-tooltip-body tr.highlight-col th {
    color: var(--primary-color);
}

/* Backdrop overlay when popover is open */
.row-preview-backdrop {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 19999;
    background: rgba(0, 0, 0, 0.15);
}

/* ---- Mobile: Convert tooltip to centered modal ---- */
@media (max-width: 600px) {
    .row-preview-backdrop {
        background: rgba(0, 0, 0, 0.5);
    }

    .row-preview-tooltip {
        /* Override JS positioning — center on screen */
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%);
        width: calc(100vw - 2rem);
        max-width: none;
        min-width: 0;
        max-height: calc(100vh - 4rem);
        border-radius: var(--radius-lg);
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    }

    .row-preview-tooltip-header {
        padding: 0.75rem 1rem;
        font-size: 0.8rem;
    }

    .row-preview-tooltip-close {
        width: 32px;
        height: 32px;
    }

    .row-preview-tooltip-body {
        padding: 0.75rem 1rem;
        max-height: calc(100vh - 10rem);
    }

    .row-preview-tooltip-body table {
        font-size: 0.78rem;
    }

    .row-preview-tooltip-body th {
        padding: 0.35rem 0.5rem 0.35rem 0;
    }

    .row-preview-tooltip-body td {
        padding: 0.35rem 0;
    }
}

/* Eye icon button on fix rows — always visible on desktop & mobile */
.fix-row-preview-btn {
    background: var(--primary-50, #eff6ff);
    border: 1px solid var(--primary-color, #2563eb);
    border-radius: 4px;
    color: var(--primary-color, #2563eb);
    cursor: pointer;
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
    transition: all 0.15s;
    opacity: 0.75;
}

.fix-row-preview-btn:hover {
    background: var(--primary-color, #2563eb);
    border-color: var(--primary-color, #2563eb);
    color: #fff;
    opacity: 1;
    transform: scale(1.08);
}

/* ==================== FULLSCREEN ANOMALIES MODAL ==================== */
.anomalies-fullscreen-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
    padding: 1rem;
}

.anomalies-fullscreen-content {
    background: var(--surface);
    border-radius: var(--radius-xl, 1rem);
    width: 95vw;
    max-width: 1200px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 60px rgba(0,0,0,0.3);
    animation: slideUp 0.3s ease;
    overflow: hidden;
}

.anomalies-fullscreen-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--background);
    flex-shrink: 0;
}

.anomalies-fullscreen-header h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.fullscreen-count {
    color: var(--text-secondary);
    font-weight: 500;
}

.anomalies-fullscreen-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.anomalies-fullscreen-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.anomalies-fullscreen-close:hover {
    background: var(--danger-50);
    color: var(--danger-color);
}

.anomalies-fullscreen-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: auto;
    padding: 1rem 1.5rem;
    -webkit-overflow-scrolling: touch;
}

.anomalies-fullscreen-body .smart-fixes-table {
    margin-bottom: 0;
}

.anomalies-fullscreen-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--background);
    flex-shrink: 0;
    gap: 1rem;
}

.anomalies-fullscreen-footer-btns {
    display: flex;
    gap: 0.5rem;
}

/* ==================== LICENSE BUTTON IN HEADER ==================== */
.license-activate-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.85rem;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.license-activate-btn:hover {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

/* License input field in modal */
.license-key-input {
    width: 100%;
    padding: 0.85rem 1rem;
    font-size: 1.15rem;
    text-align: center;
    border: 2px solid var(--border-color, #e0e0e0);
    border-radius: var(--radius-md, 0.5rem);
    font-family: 'SF Mono', 'Fira Code', monospace;
    text-transform: uppercase;
    letter-spacing: 3px;
    outline: none;
    transition: border-color 0.2s ease;
    background: var(--background, #f8fafc);
    color: var(--text-primary, #1e293b);
}

.license-key-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.license-error-msg {
    color: #dc2626;
    font-size: 0.8rem;
    font-weight: 500;
    margin-top: 0.5rem;
    min-height: 1.25rem;
    text-align: center;
}

.license-success-msg {
    color: #16a34a;
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 0.5rem;
    min-height: 1.25rem;
    text-align: center;
}

/* Upgrade modal - dual action buttons */
.upgrade-modal-dual-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: stretch;
    margin-top: 1rem;
}

.modal-license-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.65rem 1.25rem;
    background: transparent;
    border: 2px solid var(--primary-color, #6366f1);
    color: var(--primary-color, #6366f1);
    border-radius: var(--radius-md, 0.5rem);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition, 0.2s ease);
    text-decoration: none;
}

.modal-license-btn:hover {
    background: var(--primary-color, #6366f1);
    color: white;
}

/* ==================== ANIMATIONS ==================== */
@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.smart-fixes-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: var(--background);
    border-radius: var(--radius-md);
}

.summary-badge {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: var(--surface);
    border-radius: var(--radius-md);
    border-left: 3px solid;
    box-shadow: var(--shadow-sm);
}

.summary-icon { font-size: 0.95rem; }
.summary-count { font-weight: 700; font-size: 1.1rem; }
.summary-label { font-size: 0.7rem; color: var(--text-secondary); }

.fix-reason { min-width: 120px; }

.reason-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.15rem 0.4rem;
    border-radius: 16px;
    font-size: 0.65rem;
    font-weight: 600;
    white-space: nowrap;
}

.no-suggestion {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.7rem;
}

/* ==================== APP TOAST ==================== */
.app-toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 9998;
    animation: toastSlideUp 0.3s ease;
    font-size: 0.85rem;
    font-weight: 500;
    max-width: 90vw;
}

.app-toast-success { background: var(--success-color); color: white; }
.app-toast-info { background: var(--primary-color); color: white; }
.app-toast-warning { background: var(--warning-color); color: white; }
.app-toast-error { background: var(--danger-color); color: white; }

.app-toast .toast-message { flex: 1; }
.app-toast .toast-close {
    background: none; border: none;
    color: rgba(255,255,255,0.8);
    font-size: 1.1rem; cursor: pointer;
    padding: 0; line-height: 1;
}
.app-toast .toast-close:hover { color: white; }

/* ==================== PATTERN ICONS ==================== */
.pattern-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px; height: 22px;
    border-radius: 50%;
    background: var(--background);
    font-size: 0.75rem;
    margin-right: 0.375rem;
}

/* ==================== SMART FEATURES LIST ==================== */
.smart-features-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(59, 130, 246, 0.15);
}

.smart-feature {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.25rem 0.5rem;
    background: white;
    border-radius: 16px;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--primary-color);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* ==================== COLUMN TYPE BADGES ==================== */
.column-chip .col-type.type-email { background: var(--warning-50); color: #92400e; }
.column-chip .col-type.type-phone { background: var(--primary-50); color: #1e40af; }
.column-chip .col-type.type-url { background: #e0e7ff; color: #4338ca; }
.column-chip .col-type.type-percentage { background: var(--success-50); color: #166534; }

/* ==================== RESPONSIVE - MOBILE FIRST ==================== */
@media (max-width: 600px) {
    .header {
        padding: 0.5rem 0.75rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .logo-text h1 { font-size: 1rem; }

    .header-actions {
        gap: 0.375rem;
        flex-wrap: wrap;
    }

    .security-badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }

    .security-badge span[data-i18n] {
        display: none;
    }

    .main-content {
        padding: 0.75rem;
    }

    .upload-area {
        padding: 2rem 1rem;
    }

    .upload-content h4 { font-size: 1.05rem; }

    .processing-container {
        padding: 1rem;
    }

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

    .rounding-option {
        flex-direction: column;
        align-items: stretch;
        gap: 0.375rem;
    }

    .rounding-select {
        max-width: 100%;
    }

    .date-region-option {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .date-region-select {
        max-width: 100%;
    }

    .date-region-info {
        font-size: 0.72rem;
        line-height: 1.4;
    }

    .date-region-info svg {
        display: none;
    }

    /* Date conflict actions — stack vertically on mobile */
    .date-conflict-actions {
        flex-direction: column;
        gap: 0.375rem;
        padding: 0.5rem 0.625rem;
    }

    .date-conflict-force-btn,
    .date-conflict-export-btn {
        width: 100%;
        justify-content: center;
        font-size: 0.75rem;
        padding: 0.5rem 0.75rem;
    }

    .date-conflict-force-btn svg,
    .date-conflict-export-btn svg {
        width: 12px;
        height: 12px;
        flex-shrink: 0;
    }

    /* Date conflict cell highlighting — ensure readable on narrow tables */
    .date-conflict-cell {
        font-size: 0.7rem;
        padding: 0.25rem 0.375rem !important;
    }

    .date-conflict-cell .conflict-indicator {
        font-size: 0.55rem;
        margin-left: 0.15rem;
    }

    /* Toast — full-width, wrap text on mobile */
    .date-conflict-toast {
        left: 0.75rem;
        right: 0.75rem;
        bottom: 1rem;
        transform: translateY(1rem);
        white-space: normal;
        text-align: center;
        font-size: 0.78rem;
        padding: 0.625rem 0.875rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .date-conflict-toast.show {
        transform: translateY(0);
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .stat-card {
        padding: 0.875rem 0.625rem;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .stat-label {
        font-size: 0.6rem;
    }

    .download-buttons {
        grid-template-columns: 1fr;
    }

    .download-buttons .btn {
        width: 100%;
    }

    .preview-tabs {
        gap: 0;
    }

    .tab-btn {
        padding: 0.5rem 0.625rem;
        font-size: 0.7rem;
    }

    .report-item {
        font-size: 0.75rem;
        padding: 0.5rem;
    }

    .change-item {
        flex-wrap: wrap;
        gap: 0.25rem;
        font-size: 0.7rem;
    }

    .change-item .old-value,
    .change-item .new-value {
        max-width: 100px;
    }

    .change-reason-badge {
        font-size: 0.55rem;
        min-width: 44px;
        padding: 0.1rem 0.3rem;
    }

    .upgrade-modal {
        padding: 1.25rem;
        margin: 0.75rem;
    }

    .upgrade-banner .upgrade-content {
        flex-direction: column;
        text-align: center;
    }

    .upgrade-banner .upgrade-btn {
        width: 100%;
        text-align: center;
    }

    .upgrade-toast {
        left: 0.75rem; right: 0.75rem;
        transform: none;
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
    }

    .smart-fixes-header {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .smart-fixes-summary {
        justify-content: center;
    }

    .smart-fixes-table {
        margin: 0 -0.75rem;
        padding: 0 0.75rem;
    }

    .smart-fixes-footer {
        flex-direction: column;
        text-align: center;
    }

    .smart-fixes-footer-review-only {
        text-align: left;
    }

    .smart-fixes-no-auto-fix-hint {
        font-size: 0.72rem;
    }

    /* Success banner responsive */
    .smart-fixes-success-banner {
        flex-direction: column;
        text-align: center;
        padding: 0.875rem 1rem;
    }

    .success-banner-icon {
        margin: 0 auto;
    }

    .success-banner-actions {
        flex-direction: row;
        justify-content: center;
        width: 100%;
    }

    .success-banner-actions .btn-small {
        flex: 1;
        text-align: center;
        font-size: 0.68rem;
    }

    /* All done state responsive */
    .smart-review-all-done {
        padding: 1.5rem 1rem;
    }

    .smart-review-all-done h4 {
        font-size: 0.9rem;
    }

    /* Fullscreen modal responsive */
    .anomalies-fullscreen-content {
        width: 100vw;
        max-height: 100vh;
        border-radius: 0;
    }

    .anomalies-fullscreen-overlay {
        padding: 0;
    }

    .anomalies-fullscreen-header {
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .anomalies-fullscreen-header h2 {
        font-size: 0.95rem;
    }

    .anomalies-fullscreen-footer {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.75rem 1rem;
    }

    .anomalies-fullscreen-footer-btns {
        width: 100%;
        flex-direction: column;
    }

    .anomalies-fullscreen-footer-btns .btn {
        width: 100%;
    }

    /* Preview message responsive */
    .smart-fixes-preview-msg {
        flex-wrap: wrap;
        font-size: 0.75rem;
        gap: 0.35rem;
    }

    /* License button responsive */
    .license-activate-btn {
        font-size: 0.65rem;
        padding: 0.25rem 0.5rem;
    }

    .btn-large {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
    }

    .features-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .feature-card {
        padding: 0.875rem;
    }

    .feature-card h3 { font-size: 0.8rem; }
    .feature-card p { font-size: 0.7rem; }

    /* ====== MOBILE: Collapsible Results Sub-Sections ====== */

    /* Results container tighter on mobile */
    .results-container {
        padding: 0;
    }

    /* Phase indicator compact */
    .phase-indicator {
        margin-bottom: 1rem;
        padding: 0 0.25rem;
    }

    .phase-step {
        padding: 0.375rem 0.625rem;
        font-size: 0.7rem;
    }

    .phase-step .phase-number {
        width: 20px;
        height: 20px;
        font-size: 0.6rem;
    }

    .phase-connector {
        width: 24px;
    }

    /* Auto-clean section compact */
    .auto-clean-section .section-divider-title {
        font-size: 0.875rem;
        flex-wrap: wrap;
    }

    .auto-clean-section .section-divider-desc {
        font-size: 0.75rem;
    }

    /* Collapsible result cards on mobile */
    .report-card,
    .preview-card,
    .analysis-card,
    .data-preview-section {
        margin-bottom: 0.75rem;
    }

    /* Report card, preview card, analysis card: collapsible headers */
    .report-card > h3,
    .preview-card > .preview-tabs,
    .analysis-card > h3 {
        cursor: pointer;
        user-select: none;
    }

    /* Smart review section compact */
    .smart-review-header {
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .smart-review-header .review-icon {
        width: 28px;
        height: 28px;
    }

    .smart-review-header .review-title h3 {
        font-size: 0.875rem;
    }

    .smart-review-header .review-title p {
        font-size: 0.7rem;
    }

    .smart-review-body {
        padding: 0.75rem;
    }

    /* Download section compact */
    .download-buttons {
        gap: 0.5rem;
        margin-top: 1rem;
        padding-top: 1rem;
    }

    .download-buttons .btn {
        padding: 0.75rem 1rem;
        font-size: 0.8rem;
    }

    #clean-another {
        margin-bottom: 1rem;
        width: 100%;
    }

    /* Guidance callout compact */
    .guidance-callout {
        margin-bottom: 0.75rem;
        padding: 0.75rem;
    }

    .guidance-callout .guidance-icon {
        width: 28px;
        height: 28px;
    }

    .guidance-callout .guidance-content strong {
        font-size: 0.8rem;
    }

    .guidance-callout .guidance-content p {
        font-size: 0.72rem;
    }

    /* Row limit notice compact */
    .row-limit-notice {
        padding: 0.625rem 0.75rem;
        gap: 0.5rem;
    }

    /* Table containers: horizontal scroll hint */
    .table-container {
        position: relative;
    }

    .table-container::after {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: 24px;
        background: linear-gradient(to left, rgba(255,255,255,0.95), transparent);
        pointer-events: none;
        border-radius: 0 var(--radius-md) var(--radius-md) 0;
    }

    /* Column analysis chips stacked */
    .column-analysis {
        gap: 0.25rem;
    }

    .column-chip {
        padding: 0.5rem 0.625rem;
        font-size: 0.75rem;
    }

    /* Clean Another File button: prominent on mobile */
    #clean-another {
        font-size: 0.875rem;
    }
}

/* ...existing code... */

/* ==================== COLLAPSIBLE SECTIONS (mobile) ==================== */
.options-section-title {
    cursor: pointer;
    user-select: none;
    position: relative;
}

.options-section-title::after {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
    transform: rotate(45deg);
    transition: transform 0.25s ease;
    margin-left: auto;
    flex-shrink: 0;
}

.options-section.collapsed .options-section-title::after {
    transform: rotate(-45deg);
}

.options-section .options-grid {
    transition: max-height 0.35s ease, opacity 0.25s ease;
    overflow: hidden;
}

.options-section.collapsed .options-grid,
.options-section.collapsed .smart-features-list {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

/* ==================== MOBILE COLLAPSIBLE RESULT CARDS ==================== */
.mobile-collapsed .report-list,
.mobile-collapsed .column-analysis,
.mobile-collapsed .tab-content,
.mobile-collapsed .table-container,
.mobile-collapsed .changes-list {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.2s ease;
}

.report-card .report-list,
.analysis-card .column-analysis,
.preview-card .tab-content,
.preview-card .table-container {
    transition: max-height 0.3s ease, opacity 0.2s ease;
}

/* Download buttons grid for 4 items */
.download-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

@media (max-width: 640px) {
    .download-buttons {
        grid-template-columns: 1fr;
    }
}

/* ==================== PRINT STYLES ==================== */
@media print {
    .header, .footer, .download-buttons, #clean-another,
    .upgrade-banner, .upgrade-toast, .get-pro-btn, .lang-switcher {
        display: none !important;
    }

    .results-section {
        display: block !important;
    }

    .stat-card {
        break-inside: avoid;
    }
}

/* ==================== TWO-PHASE WORKFLOW ==================== */

/* Phase Indicator - Step tracker at top of results */
.phase-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 1.75rem;
    padding: 0 1rem;
}

.phase-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
    transition: all var(--transition);
    white-space: nowrap;
}

.phase-step .phase-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 700;
    background: var(--border-color);
    color: var(--text-muted);
    flex-shrink: 0;
    transition: all var(--transition);
}

.phase-step.completed .phase-number {
    background: var(--success-color);
    color: white;
}

.phase-step.active .phase-number {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.15);
}

.phase-step.completed {
    color: var(--success-color);
}

.phase-step.active {
    color: var(--primary-color);
    background: var(--primary-50);
}

.phase-connector {
    width: 48px;
    height: 2px;
    background: var(--border-color);
    flex-shrink: 0;
    transition: background var(--transition);
}

.phase-connector.completed {
    background: var(--success-color);
}

/* Phase 1: Auto-Clean Complete Section */
.auto-clean-section {
    margin-bottom: 2rem;
}

.auto-clean-section .section-divider-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--success-color);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--success-100);
}

.auto-clean-section .section-divider-title svg {
    flex-shrink: 0;
}

.auto-clean-section .section-divider-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.5;
}

/* Phase 2: Smart Review Section */
.smart-review-section {
    margin-bottom: 2rem;
    border: 2px solid var(--primary-100);
    border-radius: var(--radius-xl);
    overflow: hidden;
    background: var(--surface);
}

.smart-review-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, var(--primary-50), #eef2ff);
    border-bottom: 1px solid var(--primary-100);
}

.smart-review-header .review-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: var(--primary-color);
    color: white;
    flex-shrink: 0;
}

.smart-review-header .review-title {
    flex: 1;
}

.smart-review-header .review-title h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.125rem;
}

.smart-review-header .review-title p {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.smart-review-header .review-count-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 0.75rem;
    background: var(--warning-color);
    color: white;
    font-size: 0.9rem;
    font-weight: 700;
    border-radius: 100px;
    flex-shrink: 0;
}

.smart-review-body {
    padding: 1rem 1.25rem;
}

.smart-review-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-secondary);
}

.smart-review-empty svg {
    display: block;
    margin: 0 auto 0.75rem;
}

.smart-review-empty p {
    font-size: 0.875rem;
    font-weight: 500;
}

.smart-review-empty .empty-detail {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Row Limit Notice */
.row-limit-notice {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: var(--warning-50);
    border: 1px solid var(--warning-100);
    border-radius: var(--radius-md);
    margin-bottom: 1.25rem;
}

.row-limit-notice .notice-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--warning-color);
    color: white;
    border-radius: 50%;
    flex-shrink: 0;
    font-size: 0.8rem;
    font-weight: 700;
}

.row-limit-notice .notice-content {
    flex: 1;
}

.row-limit-notice .notice-content strong {
    display: block;
    font-size: 0.8rem;
    color: #92400e;
    margin-bottom: 0.125rem;
}

.row-limit-notice .notice-content p {
    font-size: 0.75rem;
    color: #a16207;
    line-height: 1.5;
    margin: 0;
}

.row-limit-notice .notice-actions {
    display: flex;
    gap: 0.375rem;
    flex-shrink: 0;
}

@media (max-width: 600px) {
    .row-limit-notice {
        flex-direction: column;
    }

    .row-limit-notice .notice-actions {
        width: 100%;
    }
}

/* ==================== PHASE TAGS ==================== */
.phase-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 100px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
}

.phase-tag-done {
    background: var(--success-50);
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.phase-tag-optional {
    background: #eff6ff;
    color: var(--primary-color);
    border: 1px solid #bfdbfe;
}

.phase-tag-action {
    background: var(--warning-50);
    color: #92400e;
    border: 1px solid #fed7aa;
    animation: gentle-pulse 2s ease-in-out infinite;
}

@keyframes gentle-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.75; }
}

/* ==================== GUIDANCE CALLOUTS ==================== */
.guidance-callout {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    border: 1.5px solid #bfdbfe;
    background: linear-gradient(135deg, #eff6ff, #f0f9ff);
}

.guidance-callout .guidance-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    flex-shrink: 0;
}

.guidance-callout .guidance-icon-success {
    background: var(--success-color);
}

.guidance-callout .guidance-content {
    flex: 1;
}

.guidance-callout .guidance-content strong {
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.guidance-callout .guidance-content p {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

.guidance-callout .guidance-content .guidance-steps {
    margin-top: 0.5rem;
    padding: 0;
    list-style: none;
}

.guidance-callout .guidance-content .guidance-steps li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    color: var(--text-secondary);
    padding: 0.25rem 0;
}

.guidance-callout .guidance-content .guidance-steps li .step-marker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 0.65rem;
    font-weight: 700;
    flex-shrink: 0;
}

.guidance-callout .guidance-content .guidance-steps .step-mandatory .step-marker {
    background: var(--primary-color);
    color: white;
}

.guidance-callout .guidance-content .guidance-steps .step-optional .step-marker {
    background: var(--border-color);
    color: var(--text-muted);
}

.guidance-callout .guidance-content .guidance-steps li strong {
    display: inline;
    font-size: 0.78rem;
    margin-bottom: 0;
}

.guidance-callout .guidance-content .guidance-steps li .step-desc {
    color: var(--text-muted);
    font-size: 0.72rem;
}

/* Download guidance variant */
.guidance-download {
    border-color: #bbf7d0;
    background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
}

/* Skip review CTA */
.guidance-callout .guidance-skip-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.5rem;
    padding: 0.35rem 0.75rem;
    background: white;
    color: var(--primary-color);
    border: 1px solid #bfdbfe;
    border-radius: var(--radius-md);
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.guidance-callout .guidance-skip-btn:hover {
    background: var(--primary-50);
    border-color: var(--primary-color);
}

@media (max-width: 600px) {
    .guidance-callout {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.875rem 1rem;
    }

    .phase-tag {
        font-size: 0.6rem;
        padding: 0.15rem 0.5rem;
    }
}
