/* ============================================================
   LeadSplitter — Styles
   Modern, clean wizard UI with light/dark theme support
   ============================================================ */

/* ---------- CSS Variables ---------- */
:root {
    /* Light theme */
    --bg-primary: #f8f9fb;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f3f7;
    --bg-hover: #e8eaf0;
    --text-primary: #1a1d26;
    --text-secondary: #5a6178;
    --text-muted: #9098b1;
    --border: #e2e5ee;
    --border-light: #eef0f5;
    --accent: #4f6ef7;
    --accent-hover: #3b5ae0;
    --accent-light: #eef1ff;
    --accent-dark: #3548c9;
    --success: #22c55e;
    --success-light: #ecfdf5;
    --warning: #f59e0b;
    --warning-light: #fefce8;
    --danger: #ef4444;
    --danger-light: #fef2f2;
    --info: #3b82f6;
    --info-light: #eff6ff;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --transition: 0.2s ease;
}

[data-theme="dark"] {
    --bg-primary: #0f1117;
    --bg-secondary: #1a1d28;
    --bg-tertiary: #242736;
    --bg-hover: #2d3145;
    --text-primary: #e8eaf0;
    --text-secondary: #9098b1;
    --text-muted: #5a6178;
    --border: #2d3145;
    --border-light: #242736;
    --accent: #6b85fa;
    --accent-hover: #5a74f0;
    --accent-light: #1c2240;
    --accent-dark: #8da0ff;
    --success: #34d399;
    --success-light: #0d2818;
    --warning: #fbbf24;
    --warning-light: #2a2008;
    --danger: #f87171;
    --danger-light: #2a0f0f;
    --info: #60a5fa;
    --info-light: #0f1f3a;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.5);
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    transition: background var(--transition), color var(--transition);
}

/* ---------- Theme Toggle ---------- */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
}

.theme-toggle:hover {
    background: var(--bg-hover);
    box-shadow: var(--shadow-md);
    transform: scale(1.05);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
}

[data-theme="light"] .icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }

/* ---------- App Container ---------- */
.app-container {
    max-width: 860px;
    margin: 0 auto;
    padding: 24px 20px 120px;
}

/* ---------- Header ---------- */
.app-header {
    text-align: center;
    margin-bottom: 32px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    color: var(--accent);
}

.logo h1 {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

.tagline {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* ---------- Progress Bar ---------- */
.progress-bar {
    margin-bottom: 36px;
    position: relative;
}

.progress-track {
    position: absolute;
    top: 18px;
    left: 40px;
    right: 40px;
    height: 3px;
    background: var(--border);
    border-radius: 10px;
    z-index: 0;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 10px;
    transition: width 0.4s ease;
    width: 0%;
}

.steps {
    display: flex;
    justify-content: space-between;
    position: relative;
    z-index: 1;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 1;
}

.step-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    border: 2px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.step.active .step-circle {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
    box-shadow: 0 0 0 4px var(--accent-light);
}

.step.completed .step-circle {
    border-color: var(--success);
    background: var(--success);
    color: #fff;
}

.step.completed .step-circle::after {
    content: '✓';
    font-size: 0.9rem;
}

.step.completed .step-circle {
    font-size: 0;
}

.step-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: color var(--transition);
}

.step.active .step-label { color: var(--accent); font-weight: 600; }
.step.completed .step-label { color: var(--success); }

/* ---------- Wizard Content ---------- */
.wizard-content {
    position: relative;
    min-height: 400px;
}

.wizard-step {
    display: none;
    animation: fadeSlideIn 0.35s ease;
}

.wizard-step.active {
    display: block;
}

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

.step-header {
    text-align: center;
    margin-bottom: 28px;
}

.step-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.step-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ---------- Upload Zone ---------- */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 48px 24px;
    text-align: center;
    background: var(--bg-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--accent);
    background: var(--accent-light);
}

.upload-zone.drag-over {
    transform: scale(1.01);
}

.upload-icon svg {
    width: 56px;
    height: 56px;
    color: var(--accent);
    margin-bottom: 12px;
}

.upload-zone h3 {
    font-size: 1.1rem;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.upload-zone p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.file-hint {
    font-size: 0.8rem !important;
    color: var(--text-muted) !important;
    margin-top: 8px !important;
}

/* ---------- File Info Card ---------- */
.file-info-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    overflow: hidden;
    margin-top: 20px;
    box-shadow: var(--shadow-sm);
}

.file-info-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
}

.file-icon svg {
    width: 32px;
    height: 32px;
    color: var(--accent);
}

.file-details h4 {
    font-size: 0.95rem;
    font-weight: 600;
}

.file-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    gap: 6px;
}

.separator { color: var(--text-muted); }

.file-details { flex: 1; }

.file-stats {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border-light);
}

.stat {
    flex: 1;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-right: 1px solid var(--border-light);
}

.stat:last-child { border-right: none; }

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
}

.stat-label {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.preview-section {
    padding: 16px 20px;
}

.preview-section h4 {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
    font-weight: 600;
}

.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
}

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

.preview-table th {
    background: var(--bg-tertiary);
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    border-bottom: 1px solid var(--border);
}

.preview-table td {
    padding: 8px 14px;
    border-bottom: 1px solid var(--border-light);
    white-space: nowrap;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-secondary);
}

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

.preview-table tr:hover td {
    background: var(--bg-tertiary);
}

/* ---------- Option Cards ---------- */
.option-cards {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.option-card {
    flex: 1;
    padding: 20px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    transition: all 0.2s ease;
    background: var(--bg-secondary);
}

.option-card:hover {
    border-color: var(--accent);
    background: var(--accent-light);
}

.option-card.selected {
    border-color: var(--accent);
    background: var(--accent-light);
}

.option-radio {
    width: 20px;
    height: 20px;
    min-width: 20px;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
    transition: all 0.2s ease;
}

.option-card.selected .option-radio {
    border-color: var(--accent);
    background: var(--accent);
    box-shadow: inset 0 0 0 3px var(--bg-secondary);
}

.option-content h4 {
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.option-content p {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ---------- Header Preview ---------- */
.header-preview-section {
    margin-top: 16px;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}

.header-preview-section h4 {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-weight: 600;
}

.column-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.column-tag {
    padding: 6px 14px;
    background: var(--accent-light);
    color: var(--accent);
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 500;
    border: 1px solid var(--accent);
    opacity: 0.8;
}

/* ---------- Columns Section ---------- */
.columns-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.section-block {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    padding: 20px;
}

.section-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
}

.section-block-header h4 {
    font-size: 0.95rem;
    font-weight: 600;
}

.section-block-header .hint {
    font-size: 0.82rem;
    color: var(--text-secondary);
    width: 100%;
}

.select-actions {
    display: flex;
    gap: 4px;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    cursor: pointer;
    transition: all 0.15s ease;
    background: var(--bg-primary);
}

.checkbox-item:hover {
    border-color: var(--accent);
    background: var(--accent-light);
}

.checkbox-item.checked {
    border-color: var(--accent);
    background: var(--accent-light);
}

.checkbox-item input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    min-width: 18px;
    border: 2px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    transition: all 0.15s ease;
}

.checkbox-item input[type="checkbox"]:checked {
    background: var(--accent);
    border-color: var(--accent);
}

.checkbox-item input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

.checkbox-item label {
    font-size: 0.85rem;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------- Filter Options ---------- */
.filter-options {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}

.filter-option h4 {
    font-size: 0.9rem;
    margin-bottom: 2px;
}

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

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    min-width: 44px;
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--border);
    border-radius: 24px;
    transition: 0.3s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    left: 3px;
    bottom: 3px;
    background: white;
    transition: 0.3s;
}

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

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

.required-cols-section {
    padding: 16px 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}

.required-cols-section h4 {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

/* Filter Results */
.filter-results {
    margin-top: 24px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}

.filter-results h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 14px;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.result-card {
    text-align: center;
    padding: 14px 10px;
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
}

.result-card.accent { background: var(--accent-light); }
.result-card.warn { background: var(--warning-light); }
.result-card.info { background: var(--info-light); }

.result-value {
    font-size: 1.3rem;
    font-weight: 700;
    display: block;
    color: var(--text-primary);
}

.result-card.accent .result-value { color: var(--accent); }
.result-card.warn .result-value { color: var(--warning); }
.result-card.info .result-value { color: var(--info); }

.result-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ---------- Config Section ---------- */
.config-section {
    max-width: 480px;
    margin: 0 auto;
}

.input-group {
    margin-bottom: 24px;
}

.input-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.input-field {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: border-color 0.2s ease;
    font-family: inherit;
}

.input-field:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.input-field.error {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px var(--danger-light);
}

.input-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 6px;
}

.input-hint.error {
    color: var(--danger);
}

.chunk-preview {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    padding: 20px;
}

.chunk-preview h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 14px;
}

.chunk-visual {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.chunk-block {
    padding: 8px 14px;
    background: var(--accent-light);
    border: 1px solid var(--accent);
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--accent);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 80px;
}

.chunk-block .chunk-label {
    font-size: 0.72rem;
    font-weight: 400;
    opacity: 0.8;
}

.chunk-block:last-child {
    background: var(--warning-light);
    border-color: var(--warning);
    color: var(--warning);
}

.chunk-block:only-child {
    background: var(--accent-light);
    border-color: var(--accent);
    color: var(--accent);
}

.chunk-summary {
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.chunk-summary strong {
    color: var(--accent);
}

/* ---------- Summary Section ---------- */
.summary-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.summary-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.summary-card h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}

.summary-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.summary-item.highlight {
    padding: 12px 16px;
    background: var(--accent-light);
    border-radius: var(--radius-sm);
    margin-top: 4px;
}

.summary-key {
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.summary-val {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
}

.summary-item.highlight .summary-val {
    color: var(--accent);
    font-size: 1.05rem;
}

/* Chunk Cards */
.chunk-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}

.chunk-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.chunk-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-sm);
}

.chunk-card-info h5 {
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.chunk-card-info p {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.chunk-card .btn-download {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-primary);
    color: var(--accent);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.chunk-card .btn-download:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.chunk-card .btn-preview-chunk {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-primary);
    color: var(--info);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin-right: 8px;
}

.chunk-card .btn-preview-chunk:hover {
    background: var(--info);
    color: #fff;
    border-color: var(--info);
}

.chunk-card-actions {
    display: flex;
    align-items: center;
}

/* Download Actions */
.download-actions {
    text-align: center;
}

.download-hint {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 10px;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    border: none;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    white-space: nowrap;
}

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

.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }

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

.btn-primary:hover:not(:disabled) {
    background: var(--accent-hover);
    box-shadow: 0 4px 12px rgba(79, 110, 247, 0.3);
}

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

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-hover);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 8px 12px;
}

.btn-ghost:hover:not(:disabled) {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.upload-btn {
    cursor: pointer;
}

/* ---------- Footer ---------- */
.wizard-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 50;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.nav-buttons {
    display: flex;
    gap: 12px;
}

/* ---------- Loading Overlay ---------- */
.loading-overlay {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(var(--bg-primary), 0.85);
    background: var(--bg-secondary);
    opacity: 0.95;
    z-index: 20;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    gap: 16px;
}

.loading-overlay.active {
    display: flex;
}

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

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

.loading-text {
    font-weight: 600;
    color: var(--text-secondary);
}

.loading-progress-bar {
    width: 200px;
    height: 4px;
    background: var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.loading-progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 10px;
    transition: width 0.3s ease;
    width: 0%;
}

/* ---------- Toast ---------- */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toastIn 0.3s ease, toastOut 0.3s ease 3.5s forwards;
    pointer-events: auto;
    max-width: 400px;
}

.toast.success {
    background: var(--success);
    color: #fff;
}

.toast.error {
    background: var(--danger);
    color: #fff;
}

.toast.warning {
    background: var(--warning);
    color: #1a1d26;
}

.toast.info {
    background: var(--info);
    color: #fff;
}

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

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

/* ---------- Utility ---------- */
.hidden { display: none !important; }

/* ---------- Modal ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

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

.modal {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    max-width: 700px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
}

.modal-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.modal-body {
    padding: 16px 20px;
    overflow-y: auto;
    flex: 1;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

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

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
    .app-container {
        padding: 16px 12px 120px;
    }

    .steps {
        gap: 4px;
    }

    .step-label {
        font-size: 0.65rem;
    }

    .step-circle {
        width: 30px;
        height: 30px;
        font-size: 0.75rem;
    }

    .option-cards {
        flex-direction: column;
    }

    .results-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .upload-zone {
        padding: 32px 16px;
    }

    .file-stats {
        flex-direction: column;
    }

    .stat {
        border-right: none;
        border-bottom: 1px solid var(--border-light);
    }

    .stat:last-child {
        border-bottom: none;
    }

    .wizard-footer {
        padding: 12px 16px;
    }

    .btn-lg {
        padding: 12px 20px;
        font-size: 0.9rem;
    }

    .chunk-cards {
        grid-template-columns: 1fr;
    }

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

/* ---------- SEO Content Section ---------- */
.seo-content {
    margin-top: 40px;
    padding: 40px 0;
    border-top: 1px solid var(--border-light);
}

.seo-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 20px;
}

.seo-content h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.seo-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 24px;
    margin-bottom: 10px;
}

.seo-content p {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 12px;
}

.seo-content ul,
.seo-content ol {
    padding-left: 24px;
    margin-bottom: 12px;
}

.seo-content li {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

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