/* ───────────────────────────────────────────────
   Design Tokens
   ─────────────────────────────────────────────── */
:root {
    /* Brand */
    --color-primary: #635bff;
    --color-primary-hover: #5046e5;
    --color-primary-light: #ededff;
    --color-primary-ghost: rgba(99,91,255,.08);

    /* Neutrals */
    --color-bg: #f7f8fa;
    --color-surface: #ffffff;
    --color-border: #e3e8ef;
    --color-border-strong: #c9d1db;
    --color-text: #1a1d26;
    --color-text-secondary: #5e6578;
    --color-text-tertiary: #8b95a5;

    /* Semantic */
    --color-success: #16a34a;
    --color-success-light: #f0fdf4;
    --color-warning: #d97706;
    --color-warning-light: #fffbeb;
    --color-danger: #dc2626;
    --color-danger-light: #fef2f2;
    --color-info: #2563eb;
    --color-info-light: #eff6ff;

    /* Spacing (8px grid) */
    --sp-1: 4px;
    --sp-2: 8px;
    --sp-3: 12px;
    --sp-4: 16px;
    --sp-5: 20px;
    --sp-6: 24px;
    --sp-8: 32px;
    --sp-10: 40px;
    --sp-12: 48px;
    --sp-16: 64px;

    /* Type */
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --text-xs: 0.75rem;
    --text-sm: 0.8125rem;
    --text-base: 0.9375rem;
    --text-lg: 1.125rem;
    --text-xl: 1.375rem;
    --text-2xl: 1.75rem;

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-full: 100px;

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0,0,0,.05);
    --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,.07), 0 1px 3px rgba(0,0,0,.04);
    --shadow-lg: 0 12px 40px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.04);

    /* Transitions */
    --ease: cubic-bezier(.4,0,.2,1);
}

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

html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
    font-family: var(--font);
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
}

/* ───────────────────────────────────────────────
   Nav
   ─────────────────────────────────────────────── */
.nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    backdrop-filter: blur(12px);
    background: rgba(255,255,255,.85);
}

.nav-inner {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--sp-3) var(--sp-6);
    height: 56px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    font-weight: 700;
    font-size: var(--text-lg);
    color: var(--color-text);
    letter-spacing: -0.02em;
}

.nav-logo {
    width: 22px;
    height: 22px;
    color: var(--color-primary);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    background: var(--color-primary-light);
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: var(--text-xs);
}

.user-email-display {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
}

/* ───────────────────────────────────────────────
   Main
   ─────────────────────────────────────────────── */
.main {
    max-width: 720px;
    margin: 0 auto;
    padding: var(--sp-8) var(--sp-6) var(--sp-16);
}

/* ───────────────────────────────────────────────
   Auth
   ─────────────────────────────────────────────── */
.auth-container {
    display: flex;
    justify-content: center;
    padding-top: var(--sp-12);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: var(--sp-10);
    border: 1px solid var(--color-border);
}

.auth-header {
    text-align: center;
    margin-bottom: var(--sp-8);
}

.auth-icon {
    width: 36px;
    height: 36px;
    color: var(--color-primary);
    margin-bottom: var(--sp-4);
}

.auth-title {
    font-size: var(--text-2xl);
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: var(--sp-2);
}

.auth-subtitle {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    line-height: 1.5;
}

/* Tabs */
.tabs {
    display: flex;
    background: var(--color-bg);
    border-radius: var(--radius-sm);
    padding: 3px;
    margin-bottom: var(--sp-6);
}

.tab {
    flex: 1;
    background: none;
    border: none;
    padding: var(--sp-2) var(--sp-4);
    font-family: var(--font);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text-secondary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all .15s var(--ease);
}

.tab.active {
    background: var(--color-surface);
    color: var(--color-text);
    box-shadow: var(--shadow-xs);
}

.tab:hover:not(.active) {
    color: var(--color-text);
}

.auth-form { display: flex; flex-direction: column; gap: var(--sp-4); }

.field-error {
    font-size: var(--text-sm);
    color: var(--color-danger);
    margin-top: var(--sp-1);
}

/* ───────────────────────────────────────────────
   Card
   ─────────────────────────────────────────────── */
.card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--sp-6);
    overflow: hidden;
}

.card--highlight {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md), 0 0 0 1px var(--color-primary-ghost);
}

.card-header {
    padding: var(--sp-6) var(--sp-6) 0;
}

.card-title {
    font-size: var(--text-xl);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: var(--sp-1);
}

.card-desc {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    line-height: 1.5;
}

.card-body {
    padding: var(--sp-6);
    display: flex;
    flex-direction: column;
    gap: var(--sp-5);
}

/* ───────────────────────────────────────────────
   Fields
   ─────────────────────────────────────────────── */
.field {
    display: flex;
    flex-direction: column;
    gap: var(--sp-1);
}

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

.field-optional {
    font-weight: 400;
    color: var(--color-text-tertiary);
    font-size: var(--text-xs);
}

.field input[type="text"],
.field input[type="email"],
.field input[type="password"] {
    width: 100%;
    padding: var(--sp-2) var(--sp-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: var(--text-base);
    color: var(--color-text);
    background: var(--color-surface);
    transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
    height: 40px;
}

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

.field input::placeholder {
    color: var(--color-text-tertiary);
}

.field input:disabled {
    background: var(--color-bg);
    color: var(--color-text-tertiary);
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-4);
}

@media (max-width: 600px) {
    .field-row { grid-template-columns: 1fr; }
}

/* Checkbox */
.checkbox {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-3);
    cursor: pointer;
    font-size: var(--text-sm);
    line-height: 1.5;
    color: var(--color-text-secondary);
}

.checkbox input { position: absolute; opacity: 0; width: 0; height: 0; }

.checkbox-indicator {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--color-border-strong);
    border-radius: 4px;
    margin-top: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s var(--ease);
    background: var(--color-surface);
}

.checkbox input:checked + .checkbox-indicator {
    background: var(--color-primary);
    border-color: var(--color-primary);
}

.checkbox input:checked + .checkbox-indicator::after {
    content: '';
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-bottom: 2px;
}

.checkbox input:focus-visible + .checkbox-indicator {
    box-shadow: 0 0 0 3px var(--color-primary-ghost);
}

/* ───────────────────────────────────────────────
   Notices
   ─────────────────────────────────────────────── */
.notice {
    display: flex;
    gap: var(--sp-3);
    padding: var(--sp-3) var(--sp-4);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    line-height: 1.5;
}

.notice p { margin-top: var(--sp-1); color: inherit; opacity: .85; }
.notice strong { font-weight: 600; }

.notice-icon { flex-shrink: 0; width: 18px; height: 18px; margin-top: 1px; }

.notice--warn {
    background: var(--color-warning-light);
    border: 1px solid #fde68a;
    color: #92400e;
}

.notice--info {
    background: var(--color-info-light);
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

.notice--danger {
    background: var(--color-danger-light);
    border: 1px solid #fecaca;
    color: #991b1b;
}

/* ───────────────────────────────────────────────
   Buttons
   ─────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    padding: 0 var(--sp-4);
    height: 40px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all .15s var(--ease);
    white-space: nowrap;
    text-decoration: none;
}

.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

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

.btn--primary {
    background: var(--color-primary);
    color: white;
}
.btn--primary:hover:not(:disabled) { background: var(--color-primary-hover); }

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

.btn--outline {
    background: var(--color-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}
.btn--outline:hover:not(:disabled) { background: var(--color-bg); border-color: var(--color-border-strong); }

.btn--danger-ghost {
    background: transparent;
    color: var(--color-danger);
}
.btn--danger-ghost:hover:not(:disabled) { background: var(--color-danger-light); }

.btn--record {
    background: var(--color-danger);
    color: white;
}
.btn--record:hover:not(:disabled) { background: #b91c1c; }

.btn--stop {
    background: var(--color-text);
    color: white;
}
.btn--stop:hover:not(:disabled) { background: #374151; }

.btn--full { width: 100%; }
.btn--lg { height: 48px; font-size: var(--text-base); font-weight: 600; }
.btn--sm { height: 32px; padding: 0 var(--sp-3); font-size: var(--text-xs); }

/* ───────────────────────────────────────────────
   Record
   ─────────────────────────────────────────────── */
.record-controls { display: flex; gap: var(--sp-3); }

.recording-indicator {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-3) var(--sp-4);
    background: var(--color-danger-light);
    border: 1px solid #fecaca;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: var(--text-sm);
    color: var(--color-danger);
}

.rec-dot {
    width: 10px;
    height: 10px;
    background: var(--color-danger);
    border-radius: 50%;
    animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .3; transform: scale(.85); }
}

/* Preview */
.preview { display: flex; flex-direction: column; gap: var(--sp-3); }
.preview-title { font-size: var(--text-sm); font-weight: 600; color: var(--color-text-secondary); }

.preview video {
    width: 100%;
    max-height: 400px;
    border-radius: var(--radius-md);
    background: #000;
    border: 1px solid var(--color-border);
}

.preview-actions { display: flex; gap: var(--sp-3); }
.preview-actions .btn { flex: 1; }

/* File upload */
.file-upload { margin-bottom: var(--sp-3); }

.file-upload input[type="file"] {
    width: 100%;
    padding: var(--sp-2);
    font-family: var(--font);
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
}

.file-hint {
    font-size: var(--text-xs);
    color: var(--color-text-tertiary);
    margin-top: var(--sp-1);
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    font-size: var(--text-xs);
    color: var(--color-text-tertiary);
    text-transform: uppercase;
    letter-spacing: .05em;
    font-weight: 500;
}

.divider::before, .divider::after {
    content: '';
    flex: 1;
    border-top: 1px solid var(--color-border);
}

/* ───────────────────────────────────────────────
   Progress
   ─────────────────────────────────────────────── */
.progress { display: flex; flex-direction: column; gap: var(--sp-2); }

.progress-track {
    width: 100%;
    height: 6px;
    background: var(--color-bg);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--color-primary);
    border-radius: var(--radius-full);
    width: 0%;
    transition: width .4s var(--ease);
}

.progress-text {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    text-align: center;
}

/* ───────────────────────────────────────────────
   Results
   ─────────────────────────────────────────────── */
.results-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--sp-6);
    flex-wrap: wrap;
    gap: var(--sp-3);
}

.results-toolbar-right { display: flex; gap: var(--sp-2); }

/* Result cards */
.result-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-xs);
    padding: var(--sp-6);
    margin-bottom: var(--sp-4);
}

.result-card h3 {
    font-size: var(--text-lg);
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: var(--sp-4);
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: var(--sp-2);
}

.summary-text {
    font-size: var(--text-base);
    line-height: 1.7;
    color: var(--color-text-secondary);
}

/* SOP */
.sop-step {
    padding: var(--sp-4);
    margin-bottom: var(--sp-3);
    background: var(--color-bg);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--color-primary);
}

.sop-step .step-number {
    font-weight: 600;
    color: var(--color-primary);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.sop-step .step-title {
    font-weight: 600;
    font-size: var(--text-base);
    margin: var(--sp-1) 0;
}

.sop-step .step-desc {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    line-height: 1.5;
}

.sop-step .tools-used {
    margin-top: var(--sp-2);
    font-size: var(--text-xs);
    color: var(--color-text-tertiary);
}

/* Bottlenecks */
.bottleneck-item {
    padding: var(--sp-4);
    margin-bottom: var(--sp-3);
    border-radius: var(--radius-md);
    border-left: 3px solid;
}

.bottleneck-item.severity-High { background: var(--color-danger-light); border-color: var(--color-danger); }
.bottleneck-item.severity-Medium { background: var(--color-warning-light); border-color: var(--color-warning); }
.bottleneck-item.severity-Low { background: var(--color-success-light); border-color: var(--color-success); }

.severity-badge {
    display: inline-block;
    padding: 2px var(--sp-2);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
    margin-bottom: var(--sp-2);
}

.severity-High .severity-badge { background: var(--color-danger); color: white; }
.severity-Medium .severity-badge { background: var(--color-warning); color: white; }
.severity-Low .severity-badge { background: var(--color-success); color: white; }

.bottleneck-item .bottleneck-desc {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    margin-top: var(--sp-1);
}

/* Quick Wins */
.quick-win {
    display: flex;
    gap: var(--sp-3);
    padding: var(--sp-4);
    margin-bottom: var(--sp-3);
    background: var(--color-success-light);
    border-radius: var(--radius-md);
    border: 1px solid #bbf7d0;
}

.quick-win-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }

.quick-win-meta {
    font-size: var(--text-xs);
    color: var(--color-text-tertiary);
    margin-top: var(--sp-1);
}

/* Automation Ideas */
.automation-idea {
    padding: var(--sp-4);
    margin-bottom: var(--sp-3);
    background: #faf5ff;
    border-radius: var(--radius-md);
    border: 1px solid #e9d5ff;
}

.automation-idea .idea-title {
    font-weight: 600;
    font-size: var(--text-base);
    margin-bottom: var(--sp-1);
}

.automation-idea .idea-explanation {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    line-height: 1.5;
    margin-bottom: var(--sp-3);
}

.idea-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
}

.idea-meta span {
    padding: 2px var(--sp-2);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 500;
    background: #ede9fe;
    color: #6d28d9;
}

/* Privacy warnings */
.privacy-warning {
    padding: var(--sp-3) var(--sp-4);
    margin-bottom: var(--sp-3);
    border-radius: var(--radius-md);
    background: var(--color-warning-light);
    border: 1px solid #fde68a;
    font-size: var(--text-sm);
    color: #92400e;
}

/* Questions */
.question-item {
    padding: var(--sp-3) 0;
    border-bottom: 1px solid var(--color-border);
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    line-height: 1.5;
}

.question-item:last-child { border-bottom: none; }

/* ───────────────────────────────────────────────
   Workflow List
   ─────────────────────────────────────────────── */
.workflow-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--sp-4) var(--sp-6);
    border-top: 1px solid var(--color-border);
    cursor: pointer;
    transition: background .12s var(--ease);
}

.workflow-item:first-child { border-top: none; }

.workflow-item:hover { background: var(--color-bg); }

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

.workflow-info .name {
    font-weight: 500;
    font-size: var(--text-sm);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.workflow-info .meta {
    font-size: var(--text-xs);
    color: var(--color-text-tertiary);
    margin-top: 2px;
}

.status-badge {
    flex-shrink: 0;
    padding: 2px var(--sp-3);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 500;
}

.status-PendingUpload, .status-Uploaded { background: var(--color-info-light); color: var(--color-info); }
.status-Processing { background: var(--color-warning-light); color: var(--color-warning); }
.status-Complete { background: var(--color-success-light); color: var(--color-success); }
.status-Failed { background: var(--color-danger-light); color: var(--color-danger); }

.empty-state {
    text-align: center;
    color: var(--color-text-tertiary);
    padding: var(--sp-10) var(--sp-6);
    font-size: var(--text-sm);
}

/* ───────────────────────────────────────────────
   Documents
   ─────────────────────────────────────────────── */
.doc-upload-area {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    flex-wrap: wrap;
}

.doc-upload-area input[type="file"] {
    font-family: var(--font);
    font-size: var(--text-sm);
}

.doc-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--sp-3) 0;
    border-bottom: 1px solid var(--color-border);
}

.doc-item:last-child { border-bottom: none; }

.doc-info {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    min-width: 0;
}

.doc-icon { flex-shrink: 0; color: var(--color-primary); }

.doc-name {
    font-size: var(--text-sm);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.doc-meta {
    font-size: var(--text-xs);
    color: var(--color-text-tertiary);
    margin-top: 1px;
}

/* ───────────────────────────────────────────────
   Tool Cards
   ─────────────────────────────────────────────── */
.tool-cards {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
    margin-top: var(--sp-3);
    padding-top: var(--sp-3);
    border-top: 1px solid var(--color-border);
}

.tool-card {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-2) var(--sp-3);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all .15s var(--ease);
}

.tool-card:hover {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-ghost);
}

.tool-card--generic { cursor: default; opacity: .7; }
.tool-card--generic:hover { border-color: var(--color-border); box-shadow: none; }

.tool-card-info { font-size: var(--text-sm); }
.tool-card-info strong { font-weight: 500; }

.price-badge {
    background: var(--color-success-light) !important;
    color: var(--color-success) !important;
    font-weight: 600 !important;
}

/* ───────────────────────────────────────────────
   Business Analysis
   ─────────────────────────────────────────────── */
.ba-count {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    margin-bottom: var(--sp-1);
}

.ba-included {
    font-size: var(--text-sm);
    color: var(--color-text-tertiary);
    padding: var(--sp-3) var(--sp-4);
    background: var(--color-bg);
    border-radius: var(--radius-md);
    margin-bottom: var(--sp-4);
    line-height: 1.5;
}

.ba-history-list {
    margin-top: var(--sp-4);
    border-top: 1px solid var(--color-border);
}

/* Score */
.score-header {
    display: flex;
    align-items: center;
    gap: var(--sp-6);
}

.score-circle {
    flex-shrink: 0;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    border: 4px solid;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.score-number {
    font-size: var(--text-2xl);
    font-weight: 700;
    line-height: 1;
}

.score-label {
    font-size: var(--text-xs);
    opacity: .6;
}

.score-details { flex: 1; }
.score-details h3 { margin-bottom: var(--sp-2); }

/* Savings */
.savings-card { background: var(--color-success-light); border-color: #bbf7d0; }

.savings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-4);
}

.savings-item { text-align: center; }

.savings-value {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--color-success);
}

.savings-label {
    font-size: var(--text-xs);
    color: var(--color-text-secondary);
    margin-top: var(--sp-1);
}

@media (max-width: 640px) {
    .score-header { flex-direction: column; text-align: center; }
    .score-circle { width: 72px; height: 72px; }
    .score-number { font-size: var(--text-xl); }
}

/* ───────────────────────────────────────────────
   Nav Tabs
   ─────────────────────────────────────────────── */
.nav-tabs {
    display: flex;
    gap: var(--sp-1);
    background: var(--color-bg);
    border-radius: var(--radius-sm);
    padding: 3px;
}

.nav-tab {
    background: none;
    border: none;
    padding: var(--sp-1) var(--sp-4);
    font-family: var(--font);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text-secondary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all .15s var(--ease);
    height: 32px;
}

.nav-tab.active {
    background: var(--color-surface);
    color: var(--color-text);
    box-shadow: var(--shadow-xs);
}

.nav-tab:hover:not(.active) { color: var(--color-text); }

/* ───────────────────────────────────────────────
   Process Map (Mermaid)
   ─────────────────────────────────────────────── */
.mermaid-container {
    overflow-x: auto;
    padding: var(--sp-4);
    background: var(--color-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
}

.mermaid-container svg { max-width: 100%; height: auto; }

/* ───────────────────────────────────────────────
   Summary Scores
   ─────────────────────────────────────────────── */
.summary-scores {
    display: flex;
    gap: var(--sp-6);
    margin-top: var(--sp-4);
    padding-top: var(--sp-4);
    border-top: 1px solid var(--color-border);
}

.summary-score-item { display: flex; flex-direction: column; gap: var(--sp-1); }
.summary-score-value { font-size: var(--text-xl); font-weight: 700; }
.summary-score-label { font-size: var(--text-xs); color: var(--color-text-tertiary); }

/* ───────────────────────────────────────────────
   ROI & Tech Badges
   ─────────────────────────────────────────────── */
.roi-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 22px;
    padding: 0 var(--sp-2);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 700;
    color: white;
    margin-left: var(--sp-2);
    vertical-align: middle;
}

.tech-badge {
    padding: 2px var(--sp-2);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
}

.tech-badge--RPA { background: #dbeafe; color: #1d4ed8; }
.tech-badge--AIGenAI { background: #ede9fe; color: #6d28d9; }
.tech-badge--NoCode { background: #d1fae5; color: #047857; }
.tech-badge--Script { background: #ffedd5; color: #c2410c; }
.tech-badge--IDPOCR { background: #fce7f3; color: #be185d; }
.tech-badge--ManualImprovement { background: #f3f4f6; color: #4b5563; }

/* ───────────────────────────────────────────────
   Dashboard
   ─────────────────────────────────────────────── */
.dashboard-header { margin-bottom: var(--sp-6); }

.dashboard-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--sp-4);
    margin-bottom: var(--sp-6);
}

.dash-stat-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--sp-5);
    text-align: center;
    box-shadow: var(--shadow-xs);
}

.dash-stat-card--success { background: var(--color-success-light); border-color: #bbf7d0; }

.dash-stat-value {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: var(--sp-1);
}

.dash-stat-card--success .dash-stat-value { color: var(--color-success); }

.dash-stat-label {
    font-size: var(--text-xs);
    color: var(--color-text-tertiary);
}

.dash-score-group {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    flex-shrink: 0;
}

.dash-minutes {
    font-size: var(--text-xs);
    color: var(--color-text-secondary);
}

.dash-score-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 24px;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 700;
    color: white;
}

/* ───────────────────────────────────────────────
   Kanban / Progress
   ─────────────────────────────────────────────── */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--sp-4);
    margin-top: var(--sp-6);
}

.kanban-column {
    background: var(--color-bg);
    border-radius: var(--radius-lg);
    min-height: 200px;
}

.kanban-column-header {
    padding: var(--sp-3) var(--sp-4);
    border-top: 3px solid;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kanban-column-title {
    font-size: var(--text-sm);
    font-weight: 600;
}

.kanban-column-count {
    font-size: var(--text-xs);
    background: var(--color-surface);
    padding: 1px var(--sp-2);
    border-radius: var(--radius-full);
    color: var(--color-text-secondary);
}

.kanban-column-body { padding: var(--sp-3); }

.kanban-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--sp-3);
    margin-bottom: var(--sp-3);
    box-shadow: var(--shadow-xs);
}

.kanban-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--sp-2);
    margin-bottom: var(--sp-2);
}

.kanban-card-title {
    font-size: var(--text-sm);
    font-weight: 600;
    line-height: 1.3;
}

.kanban-card-desc {
    font-size: var(--text-xs);
    color: var(--color-text-secondary);
    line-height: 1.4;
    margin-bottom: var(--sp-2);
}

.kanban-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-1);
    margin-bottom: var(--sp-2);
}

.kanban-card-meta span {
    font-size: 10px;
    padding: 1px var(--sp-1);
    background: var(--color-bg);
    border-radius: var(--radius-sm);
    color: var(--color-text-tertiary);
}

.kanban-card-source {
    font-size: 10px;
    color: var(--color-text-tertiary);
    margin-bottom: var(--sp-2);
}

.kanban-card-actions {
    display: flex;
    gap: var(--sp-2);
    align-items: center;
}

.kanban-empty {
    text-align: center;
    font-size: var(--text-xs);
    color: var(--color-text-tertiary);
    padding: var(--sp-6) var(--sp-3);
}

.field-select--sm {
    height: 28px;
    font-size: var(--text-xs);
    padding: 0 var(--sp-2);
    flex: 1;
}

.field-input--sm {
    height: 28px;
    font-size: var(--text-xs);
    padding: 0 var(--sp-2);
    width: 80px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-family: var(--font);
}

@media (max-width: 900px) {
    .kanban-board { grid-template-columns: repeat(2, 1fr); }
}

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

/* ───────────────────────────────────────────────
   Compare
   ─────────────────────────────────────────────── */
.field-select {
    width: 100%;
    padding: var(--sp-2) var(--sp-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: var(--text-sm);
    color: var(--color-text);
    background: var(--color-surface);
    height: 40px;
}

.field-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-ghost);
}

.compare-step {
    padding: var(--sp-4);
    margin-bottom: var(--sp-3);
    border-radius: var(--radius-md);
    border-left: 3px solid;
}

.compare-step--shared { background: var(--color-info-light); border-color: var(--color-info); }
.compare-step--variant { background: var(--color-warning-light); border-color: var(--color-warning); }

.compare-step-label {
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--color-text-tertiary);
    margin-bottom: var(--sp-1);
}

.compare-step-detail {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    margin-top: var(--sp-1);
}

.compare-efficiency {
    padding: var(--sp-4);
    margin-bottom: var(--sp-3);
    background: var(--color-bg);
    border-radius: var(--radius-md);
}

.compare-efficiency-area {
    font-weight: 600;
    margin-bottom: var(--sp-3);
}

.compare-efficiency-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-4);
    margin-bottom: var(--sp-3);
}

.compare-efficiency-label {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--color-text-tertiary);
    margin-bottom: var(--sp-1);
}

.compare-efficiency-col { font-size: var(--text-sm); color: var(--color-text-secondary); }

.compare-efficiency-winner {
    font-size: var(--text-sm);
    color: var(--color-success);
    font-weight: 500;
    padding-top: var(--sp-2);
    border-top: 1px solid var(--color-border);
}

/* ───────────────────────────────────────────────
   Audit Intake
   ─────────────────────────────────────────────── */
.field-select, .field-textarea {
    width: 100%;
    padding: var(--sp-2) var(--sp-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: var(--text-base);
    color: var(--color-text);
    background: var(--color-surface);
    height: 40px;
}

.field-textarea { height: auto; resize: vertical; }

.field-select:focus, .field-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-ghost);
}

.chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
}

.chip {
    display: flex;
    align-items: center;
    gap: var(--sp-1);
    padding: var(--sp-1) var(--sp-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    cursor: pointer;
    transition: all .15s var(--ease);
    font-weight: normal;
}

.chip:has(input:checked) {
    background: var(--color-primary-light);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.chip input { display: none; }

.checklist-category { margin-bottom: var(--sp-6); }

.checklist-category-title {
    font-size: var(--text-base);
    font-weight: 600;
    margin-bottom: var(--sp-3);
    padding-bottom: var(--sp-2);
    border-bottom: 1px solid var(--color-border);
}

.checklist-item {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
    padding: var(--sp-3) var(--sp-4);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    margin-bottom: var(--sp-2);
    transition: border-color .15s var(--ease);
}

.checklist-item--uploaded, .checklist-item--complete {
    border-color: var(--color-success);
    background: var(--color-success-light);
}

.checklist-item--skipped {
    opacity: .6;
    border-style: dashed;
}

.checklist-item-header {
    display: flex;
    gap: var(--sp-3);
    align-items: flex-start;
}

.checklist-status { font-size: 1.1rem; flex-shrink: 0; margin-top: 2px; }
.checklist-item-info { flex: 1; min-width: 0; }
.checklist-item-title { font-weight: 500; font-size: var(--text-sm); }
.checklist-item-desc { font-size: var(--text-xs); color: var(--color-text-secondary); margin-top: 2px; line-height: 1.4; }

.checklist-item-meta {
    display: flex;
    gap: var(--sp-2);
    margin-top: var(--sp-2);
    flex-wrap: wrap;
}

.priority-badge {
    padding: 1px var(--sp-2);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.priority--required { background: var(--color-danger-light); color: var(--color-danger); }
.priority--recommended { background: var(--color-warning-light); color: var(--color-warning); }
.priority--optional { background: var(--color-bg); color: var(--color-text-tertiary); }

.effort-badge {
    padding: 1px var(--sp-2);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    background: var(--color-bg);
    color: var(--color-text-secondary);
}

.checklist-why {
    font-size: var(--text-xs);
    color: var(--color-primary);
    cursor: help;
    text-decoration: underline dotted;
}

.checklist-example {
    font-size: var(--text-xs);
    color: var(--color-text-tertiary);
    margin-top: var(--sp-1);
    font-style: italic;
}

.checklist-item-actions {
    display: flex;
    gap: var(--sp-2);
    padding-left: calc(1.1rem + var(--sp-3));
}

.checklist-skip-reason {
    font-size: var(--text-xs);
    color: var(--color-text-tertiary);
    padding-left: calc(1.1rem + var(--sp-3));
    font-style: italic;
}

.hidden-file-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Audit mode selector */
.audit-mode-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--sp-4);
}

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

.audit-mode-card {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--sp-6);
    cursor: pointer;
    transition: all .2s var(--ease);
    text-align: center;
}

.audit-mode-card:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md), 0 0 0 2px var(--color-primary-ghost);
    transform: translateY(-2px);
}

.audit-mode-icon { font-size: 2rem; margin-bottom: var(--sp-3); }

.audit-mode-card h3 {
    font-size: var(--text-lg);
    font-weight: 600;
    margin-bottom: var(--sp-2);
}

.audit-mode-card p {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    margin-bottom: var(--sp-3);
    line-height: 1.4;
}

.audit-mode-features {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--sp-3);
    font-size: var(--text-xs);
    color: var(--color-text-secondary);
}

.audit-mode-features li::before {
    content: '\2713 ';
    color: var(--color-success);
    font-weight: 700;
}

.audit-mode-time {
    font-size: var(--text-xs);
    color: var(--color-text-tertiary);
    font-style: italic;
}

.audit-actions {
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
    margin: var(--sp-6) 0;
}

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

/* ───────────────────────────────────────────────
   Mobile
   ─────────────────────────────────────────────── */
@media (max-width: 640px) {
    .main { padding: var(--sp-4) var(--sp-4) var(--sp-12); }
    .card-header, .card-body { padding-left: var(--sp-4); padding-right: var(--sp-4); }
    .card-body { gap: var(--sp-4); }
    .result-card { padding: var(--sp-4); }
    .auth-card { padding: var(--sp-6); }
    .workflow-item { padding: var(--sp-3) var(--sp-4); }
    .results-toolbar { flex-direction: column; align-items: stretch; }
    .results-toolbar-right { justify-content: flex-end; }
    .nav-inner { padding: var(--sp-3) var(--sp-4); }
    .user-email-display { display: none; }
    .dashboard-summary-grid { grid-template-columns: repeat(2, 1fr); }
    .summary-scores { flex-direction: column; gap: var(--sp-3); }
}
