/* ============================================
   SPEAKUP - MAIN STYLESHEET
   Light Mode + Dark Mode (Web3 Glassmorphism)
   ============================================ */

/* ── LIGHT MODE (default) ── */
:root {
    --primary: #4F46E5;
    --primary-dark: #3730A3;
    --primary-light: #EEF2FF;
    --secondary: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg: #F8FAFC;
    --surface: #FFFFFF;
    --border: #E2E8F0;
    --text: #1E293B;
    --text-muted: #64748B;
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --radius: 12px;
    --radius-sm: 8px;
    --font: 'Plus Jakarta Sans', sans-serif;
    --font-mono: 'Space Mono', monospace;
    /* Dark mode extras (unused in light) */
    --glass: rgba(255,255,255,0.85);
    --glass-border: rgba(255,255,255,0.6);
    --neon-primary: #4F46E5;
    --neon-glow: rgba(79,70,229,0.15);
    --bg-mesh: none;
}

/* ── DARK MODE — Web3 Glassmorphism ── */
[data-theme="dark"] {
    --primary: #818cf8;
    --primary-dark: #6366f1;
    --primary-light: rgba(99,102,241,0.15);
    --secondary: #34d399;
    --danger: #f87171;
    --warning: #fbbf24;
    --bg: #080b14;
    --surface: rgba(15,20,40,0.8);
    --border: rgba(99,102,241,0.2);
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --shadow: 0 1px 3px rgba(0,0,0,0.4);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.5);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.6);
    --glass: rgba(15,20,40,0.7);
    --glass-border: rgba(99,102,241,0.25);
    --neon-primary: #818cf8;
    --neon-glow: rgba(129,140,248,0.2);
    --bg-mesh: radial-gradient(ellipse at 20% 50%, rgba(99,102,241,0.08) 0%, transparent 60%),
               radial-gradient(ellipse at 80% 20%, rgba(139,92,246,0.07) 0%, transparent 50%),
               radial-gradient(ellipse at 60% 80%, rgba(16,185,129,0.05) 0%, transparent 50%);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background 0.4s ease, color 0.3s ease;
}

/* Dark mode mesh background */
[data-theme="dark"] body {
    background: var(--bg);
    background-image: var(--bg-mesh);
    background-attachment: fixed;
}

/* ── DARK MODE: Global surface/card glass effect ── */
[data-theme="dark"] .card,
[data-theme="dark"] .result-card,
[data-theme="dark"] .record-card,
[data-theme="dark"] .auth-card,
[data-theme="dark"] .setup-card,
[data-theme="dark"] .iw-setup-card,
[data-theme="dark"] .iw-how-card,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .step-card,
[data-theme="dark"] .session-item,
[data-theme="dark"] .session-row,
[data-theme="dark"] .proc-step,
[data-theme="dark"] .playback-section,
[data-theme="dark"] .category-card,
[data-theme="dark"] .category-card-large,
[data-theme="dark"] .agent-chat,
[data-theme="dark"] .iw-modal,
[data-theme="dark"] .iw-sidebar,
[data-theme="dark"] .iw-main,
[data-theme="dark"] .cta-box {
    background: var(--glass) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border) !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4),
                inset 0 1px 0 rgba(255,255,255,0.05) !important;
}

/* ── DARK MODE: Neon glow on cards hover ── */
[data-theme="dark"] .card:hover,
[data-theme="dark"] .stat-card:hover,
[data-theme="dark"] .step-card:hover,
[data-theme="dark"] .category-card:hover,
[data-theme="dark"] .category-card-large:hover {
    border-color: var(--neon-primary) !important;
    box-shadow: 0 0 0 1px var(--neon-primary),
                0 0 20px var(--neon-glow),
                0 8px 32px rgba(0,0,0,0.4) !important;
}

/* ── DARK MODE: Navbar glassmorphism ── */
[data-theme="dark"] .navbar {
    background: rgba(8,11,20,0.8) !important;
    border-bottom: 1px solid var(--glass-border) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(99,102,241,0.15),
                0 4px 20px rgba(0,0,0,0.3) !important;
}

/* ── DARK MODE: Buttons neon ── */
[data-theme="dark"] .btn-primary {
    background: linear-gradient(135deg, #6366f1, #818cf8) !important;
    box-shadow: 0 0 15px rgba(99,102,241,0.35) !important;
}
[data-theme="dark"] .btn-primary:hover {
    box-shadow: 0 0 25px rgba(99,102,241,0.55),
                0 4px 15px rgba(0,0,0,0.3) !important;
    transform: translateY(-2px);
}
[data-theme="dark"] .btn-auth {
    background: linear-gradient(135deg, #6366f1, #818cf8) !important;
    box-shadow: 0 0 20px rgba(99,102,241,0.4) !important;
}

/* ── DARK MODE: Input fields ── */
[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] .ac-textarea,
[data-theme="dark"] .form-group input {
    background: rgba(15,20,40,0.6) !important;
    border-color: rgba(99,102,241,0.3) !important;
    color: var(--text) !important;
    backdrop-filter: blur(10px);
}
[data-theme="dark"] input:focus,
[data-theme="dark"] textarea:focus,
[data-theme="dark"] .ac-textarea:focus,
[data-theme="dark"] .form-group input:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(129,140,248,0.2),
                0 0 15px rgba(129,140,248,0.1) !important;
    background: rgba(15,20,40,0.8) !important;
}
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder { color: var(--text-muted) !important; }

/* ── DARK MODE: Score bars neon ── */
[data-theme="dark"] .fill-high { background: linear-gradient(90deg, #34d399, #6ee7b7) !important; }
[data-theme="dark"] .fill-mid  { background: linear-gradient(90deg, #fbbf24, #fcd34d) !important; }
[data-theme="dark"] .fill-low  { background: linear-gradient(90deg, #f87171, #fca5a5) !important; }
[data-theme="dark"] .bar-track { background: rgba(99,102,241,0.1) !important; }

/* ── DARK MODE: Hero section ── */
[data-theme="dark"] .hero {
    background: linear-gradient(135deg, rgba(8,11,20,0.95) 0%, rgba(15,20,40,0.9) 100%) !important;
}
[data-theme="dark"] .hero-circle { opacity: 0.06; }

/* ── DARK MODE: Primary light areas ── */
[data-theme="dark"] .primary-light,
[data-theme="dark"] .ac-chips,
[data-theme="dark"] .iw-q-item,
[data-theme="dark"] .iw-timer-box,
[data-theme="dark"] .tips-box,
[data-theme="dark"] .iw-how-card {
    background: rgba(99,102,241,0.08) !important;
    border-color: rgba(99,102,241,0.2) !important;
}

/* ── DARK MODE: Badge/chip ── */
[data-theme="dark"] .badge-category {
    background: rgba(99,102,241,0.2) !important;
    color: var(--primary) !important;
}
[data-theme="dark"] .tip-tag {
    background: rgba(99,102,241,0.15) !important;
    color: var(--primary) !important;
}

/* ── DARK MODE: Flash messages ── */
[data-theme="dark"] .flash-success { background: rgba(16,185,129,0.15) !important; border-color: rgba(52,211,153,0.3) !important; }
[data-theme="dark"] .flash-danger  { background: rgba(239,68,68,0.15) !important; border-color: rgba(248,113,113,0.3) !important; }
[data-theme="dark"] .flash-info    { background: rgba(99,102,241,0.15) !important; border-color: rgba(129,140,248,0.3) !important; }
[data-theme="dark"] .flash-warning { background: rgba(245,158,11,0.15) !important; border-color: rgba(251,191,36,0.3) !important; }

/* ── DARK MODE: Transcript ── */
[data-theme="dark"] .transcript {
    background: rgba(8,11,20,0.8) !important;
    border-color: rgba(99,102,241,0.2) !important;
    color: var(--text) !important;
}

/* ── DARK MODE: Score rings / grades ── */
[data-theme="dark"] .grade-A { border-color: #34d399; background: rgba(52,211,153,0.12); color: #34d399; }
[data-theme="dark"] .grade-B { border-color: #818cf8; background: rgba(129,140,248,0.12); color: #818cf8; }
[data-theme="dark"] .grade-C { border-color: #fbbf24; background: rgba(251,191,36,0.12); color: #fbbf24; }
[data-theme="dark"] .grade-D { border-color: #fb923c; background: rgba(251,146,60,0.12); color: #fb923c; }
[data-theme="dark"] .grade-E { border-color: #f87171; background: rgba(248,113,113,0.12); color: #f87171; }

/* ── DARK MODE: Counter cards ── */
[data-theme="dark"] .cc-good { background: rgba(52,211,153,0.1) !important; border-color: rgba(52,211,153,0.25) !important; }
[data-theme="dark"] .cc-ok   { background: rgba(251,191,36,0.1) !important; border-color: rgba(251,191,36,0.25) !important; }
[data-theme="dark"] .cc-bad  { background: rgba(248,113,113,0.1) !important; border-color: rgba(248,113,113,0.25) !important; }

/* ── DARK MODE: Prose items ── */
[data-theme="dark"] .prose-item.good { background: rgba(52,211,153,0.08) !important; border-left-color: #34d399 !important; }
[data-theme="dark"] .prose-item.warn { background: rgba(251,191,36,0.08) !important; border-left-color: #fbbf24 !important; }

/* ── DARK MODE: Suggest items ── */
[data-theme="dark"] .suggest-item {
    background: rgba(99,102,241,0.1) !important;
}

/* ── DARK MODE: Audio analysis ── */
[data-theme="dark"] .audio-card {
    border-top-color: #818cf8 !important;
}
[data-theme="dark"] .char-item {
    background: rgba(15,20,40,0.6) !important;
    border-color: rgba(99,102,241,0.2) !important;
}

/* ── DARK MODE: FAB Button ── */
[data-theme="dark"] .agent-fab {
    background: linear-gradient(135deg, #6366f1, #818cf8) !important;
    box-shadow: 0 4px 20px rgba(99,102,241,0.4),
                0 0 40px rgba(99,102,241,0.15) !important;
}

/* ── DARK MODE: AI Chat ── */
[data-theme="dark"] .ac-header {
    background: linear-gradient(135deg, rgba(99,102,241,0.9), rgba(139,92,246,0.9)) !important;
}
[data-theme="dark"] .msg-bubble {
    background: rgba(25,30,55,0.8) !important;
    border: 1px solid rgba(99,102,241,0.15) !important;
}
[data-theme="dark"] .chip {
    background: rgba(25,30,55,0.7) !important;
    border-color: rgba(99,102,241,0.25) !important;
    color: var(--text) !important;
}
[data-theme="dark"] .chip:hover {
    background: rgba(99,102,241,0.2) !important;
    border-color: var(--primary) !important;
}

/* ── DARK MODE: Interview ── */
[data-theme="dark"] .iw-ans-header { background: rgba(15,20,40,0.6) !important; }
[data-theme="dark"] .iw-ans-header:hover { background: rgba(99,102,241,0.1) !important; }
[data-theme="dark"] .iw-ans-body   { background: rgba(8,11,20,0.5) !important; }
[data-theme="dark"] .iw-ans-transcript { background: rgba(15,20,40,0.6) !important; }
[data-theme="dark"] .iw-ans-highlight  { background: rgba(251,191,36,0.1) !important; }
[data-theme="dark"] .bubble-content    { background: rgba(25,30,55,0.8) !important; }
[data-theme="dark"] .iw-topbar {
    background: rgba(8,11,20,0.85) !important;
    border-color: rgba(99,102,241,0.2) !important;
    backdrop-filter: blur(20px);
}
[data-theme="dark"] .iw-input-area {
    background: rgba(8,11,20,0.85) !important;
    border-color: rgba(99,102,241,0.2) !important;
    backdrop-filter: blur(20px);
}
[data-theme="dark"] .iw-chat { background: transparent !important; }

/* ── DARK MODE: scrollbar ── */
[data-theme="dark"] ::-webkit-scrollbar { width: 6px; height: 6px; }
[data-theme="dark"] ::-webkit-scrollbar-track { background: rgba(15,20,40,0.5); }
[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: rgba(99,102,241,0.4);
    border-radius: 3px;
}
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: rgba(99,102,241,0.7); }

/* ── DARK MODE: Footer ── */
[data-theme="dark"] .footer {
    background: rgba(8,11,20,0.9) !important;
    border-top-color: rgba(99,102,241,0.15) !important;
}

/* ============ NAVBAR ============ */
.navbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 100;
    box-shadow: var(--shadow);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    display: flex; align-items: center; gap: 8px;
    text-decoration: none; color: var(--text);
    font-weight: 800; font-size: 1.3rem;
}

.brand-icon { font-size: 1.5rem; }
.brand-name { color: var(--primary); }

.nav-links { display: flex; align-items: center; gap: 24px; }

.nav-link {
    text-decoration: none; color: var(--text-muted);
    font-weight: 500; font-size: 0.9rem;
    transition: color 0.2s;
}
.nav-link:hover, .nav-link.active { color: var(--primary); }

.nav-user { display: flex; align-items: center; gap: 16px; }
.user-greeting { font-size: 0.85rem; color: var(--text-muted); }

.btn-logout {
    text-decoration: none; color: var(--text-muted);
    font-size: 0.85rem; padding: 6px 12px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    transition: all 0.2s;
}
.btn-logout:hover { border-color: var(--danger); color: var(--danger); }

/* ============ DARK MODE TOGGLE BUTTON ============ */
.theme-toggle {
    position: relative;
    display: flex; align-items: center;
    cursor: pointer;
    padding: 0;
    background: none;
    border: none;
    flex-shrink: 0;
}

.toggle-track {
    width: 52px; height: 28px;
    background: #e2e8f0;
    border-radius: 100px;
    position: relative;
    transition: all 0.4s cubic-bezier(.4,0,.2,1);
    border: 2px solid #cbd5e1;
    overflow: hidden;
}

[data-theme="dark"] .toggle-track {
    background: linear-gradient(135deg, #3730a3, #6366f1);
    border-color: #818cf8;
    box-shadow: 0 0 12px rgba(129,140,248,0.5);
}

.toggle-thumb {
    position: absolute;
    top: 2px; left: 2px;
    width: 20px; height: 20px;
    background: white;
    border-radius: 50%;
    transition: all 0.4s cubic-bezier(.34,1.56,.64,1);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

[data-theme="dark"] .toggle-thumb {
    transform: translateX(24px);
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    box-shadow: 0 2px 8px rgba(251,191,36,0.5);
}

/* Stars in track (dark mode decoration) */
.toggle-track::before {
    content: '☀️';
    position: absolute;
    right: 5px; top: 50%;
    transform: translateY(-50%);
    font-size: 0.65rem;
    transition: opacity 0.3s;
    opacity: 1;
}
[data-theme="dark"] .toggle-track::before {
    content: '🌙';
    left: 5px; right: auto;
    opacity: 1;
}

.toggle-label {
    margin-left: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: color 0.3s;
    white-space: nowrap;
}

/* ── Transition semua elemen saat toggle ── */
*, *::before, *::after {
    transition-property: background-color, border-color, color, box-shadow, backdrop-filter;
    transition-duration: 0.3s;
    transition-timing-function: ease;
}
/* Override untuk animasi/transform agar tidak kena transition global */
.btn-resume, .status-dot, .iw-dot, .seg-dot,
.proc-spinner, .typing-dots span, .iw-waiting-anim span,
.agent-fab, .toggle-thumb, .iw-prog-fill, .bar-fill {
    transition: all 0.3s ease !important;
}
.flash-container { position: fixed; top: 70px; right: 20px; z-index: 999; }

.flash {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; border-radius: var(--radius-sm);
    margin-bottom: 8px; box-shadow: var(--shadow-md);
    font-size: 0.875rem; font-weight: 500;
    animation: slideIn 0.3s ease;
}
.flash-success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.flash-danger  { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.flash-info    { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }
.flash-warning { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.flash-close { background: none; border: none; cursor: pointer; font-size: 1.2rem; color: inherit; }

@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ============ LAYOUT ============ */
.main-content { flex: 1; }

.page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px;
}

.page-container.narrow { max-width: 640px; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

.page-header {
    display: flex; align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}

.page-title { font-size: 1.75rem; font-weight: 800; }
.page-subtitle { color: var(--text-muted); margin-top: 4px; }

/* ============ BUTTONS ============ */
.btn-primary {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--primary); color: white;
    padding: 10px 20px; border-radius: var(--radius-sm);
    font-weight: 600; font-size: 0.9rem;
    text-decoration: none; border: none; cursor: pointer;
    transition: all 0.2s;
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-primary-sm { @extend .btn-primary; padding: 6px 14px; font-size: 0.8rem; }

.btn-secondary {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--surface); color: var(--text);
    padding: 10px 20px; border-radius: var(--radius-sm);
    font-weight: 600; font-size: 0.9rem;
    text-decoration: none; border: 1.5px solid var(--border); cursor: pointer;
    transition: all 0.2s;
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }

.btn-outline {
    display: inline-flex; align-items: center; gap: 6px;
    background: transparent; color: var(--primary);
    padding: 10px 20px; border-radius: var(--radius-sm);
    font-weight: 600; font-size: 0.9rem;
    text-decoration: none; border: 1.5px solid var(--primary); cursor: pointer;
    transition: all 0.2s;
}
.btn-outline:hover { background: var(--primary-light); }

.btn-sm {
    display: inline-flex; align-items: center;
    background: var(--primary-light); color: var(--primary);
    padding: 6px 14px; border-radius: 6px;
    font-weight: 600; font-size: 0.8rem;
    text-decoration: none; border: none; cursor: pointer;
    transition: all 0.2s;
}
.btn-sm:hover { background: var(--primary); color: white; }

.btn-danger { background: #fee2e2; color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: white; }

.btn-full { width: 100%; justify-content: center; padding: 14px; font-size: 1rem; }

/* ============ FORMS ============ */
.form-group { margin-bottom: 20px; }

.form-group label {
    display: block; font-weight: 600;
    margin-bottom: 8px; font-size: 0.875rem;
}

.form-group input {
    width: 100%; padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font); font-size: 0.95rem;
    transition: border-color 0.2s;
    background: var(--surface);
}
.form-group input:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}

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

.form-check { margin-bottom: 20px; font-size: 0.875rem; }
.form-check label { display: flex; align-items: center; gap: 8px; cursor: pointer; }

/* ============ AUTH PAGES ============ */
.auth-page {
    min-height: calc(100vh - 130px);
    display: flex; align-items: center; justify-content: center;
    padding: 32px 24px;
}

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

.auth-header { text-align: center; margin-bottom: 24px; }
.auth-icon   { font-size: 3rem; margin-bottom: 12px; }
.auth-header h1 { font-size: 1.5rem; font-weight: 800; }
.auth-header p  { color: var(--text-muted); margin-top: 4px; }

/* ── Google Login Button ── */
.btn-google-login {
    display: flex; align-items: center; justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 12px 20px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text);
    font-weight: 600; font-size: 0.9rem;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}
.btn-google-login:hover {
    border-color: #4285F4;
    box-shadow: 0 2px 8px rgba(66,133,244,0.2);
    transform: translateY(-1px);
    color: #4285F4;
}
.btn-google-login svg { flex-shrink: 0; }

[data-theme="dark"] .btn-google-login {
    background: rgba(15,20,40,0.7) !important;
    border-color: rgba(99,102,241,0.3) !important;
    color: var(--text) !important;
}
[data-theme="dark"] .btn-google-login:hover {
    border-color: #4285F4 !important;
    background: rgba(66,133,244,0.08) !important;
    color: #60a5fa !important;
    box-shadow: 0 0 15px rgba(66,133,244,0.2) !important;
}

/* ── Auth Divider ── */
.auth-divider {
    display: flex; align-items: center; gap: 12px;
    margin: 8px 0 16px;
    color: var(--text-muted);
    font-size: 0.78rem;
}
.auth-divider::before,
.auth-divider::after {
    content: ''; flex: 1; height: 1px; background: var(--border);
}
[data-theme="dark"] .auth-divider::before,
[data-theme="dark"] .auth-divider::after {
    background: rgba(99,102,241,0.2);
}

/* ── Auth form button ── */
.btn-auth {
    width: 100%; padding: 14px;
    background: var(--primary); color: white;
    border: none; border-radius: var(--radius-sm);
    font-family: var(--font); font-size: 1rem; font-weight: 700;
    cursor: pointer; transition: all 0.2s; margin-top: 8px;
}
.btn-auth:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79,70,229,0.3);
}
[data-theme="dark"] .btn-auth {
    background: linear-gradient(135deg, #6366f1, #818cf8) !important;
    box-shadow: 0 0 15px rgba(99,102,241,0.3) !important;
}

.auth-footer {
    text-align: center; margin-top: 20px;
    font-size: 0.875rem; color: var(--text-muted);
}
.auth-footer a { color: var(--primary); font-weight: 600; text-decoration: none; }
.auth-footer a:hover { text-decoration: underline; }

.form-check { margin-bottom: 16px; font-size: 0.875rem; }
.form-check label { display: flex; align-items: center; gap: 8px; cursor: pointer; }

/* ============ HERO (Landing Page) ============ */
.hero {
    position: relative; overflow: hidden;
    padding: 80px 24px 60px;
    text-align: center;
    background: linear-gradient(135deg, #f0f4ff 0%, #fafafa 100%);
}

.hero-bg { position: absolute; inset: 0; pointer-events: none; }
.hero-circle {
    position: absolute; border-radius: 50%; opacity: 0.15;
}
.c1 { width: 600px; height: 600px; background: var(--primary); top: -200px; left: -150px; }
.c2 { width: 400px; height: 400px; background: var(--secondary); bottom: -100px; right: -100px; }
.c3 { width: 300px; height: 300px; background: var(--warning); top: 50%; left: 50%; transform: translate(-50%,-50%); }

.hero-content { position: relative; max-width: 700px; margin: 0 auto; }

.hero-badge {
    display: inline-block; padding: 6px 16px;
    background: var(--primary-light); color: var(--primary);
    border-radius: 100px; font-size: 0.8rem; font-weight: 700;
    margin-bottom: 20px; letter-spacing: 0.5px;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800; line-height: 1.2;
    margin-bottom: 20px;
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-desc {
    font-size: 1.1rem; color: var(--text-muted);
    line-height: 1.7; margin-bottom: 32px;
}

.hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-bottom: 48px; }

.btn-hero-primary {
    display: inline-block;
    background: var(--primary); color: white;
    padding: 14px 32px; border-radius: var(--radius-sm);
    font-weight: 700; font-size: 1rem;
    text-decoration: none; transition: all 0.2s;
    box-shadow: 0 4px 14px rgba(79,70,229,0.4);
}
.btn-hero-primary:hover { background: var(--primary-dark); transform: translateY(-2px); }

.btn-hero-secondary {
    display: inline-block;
    background: var(--surface); color: var(--text);
    padding: 14px 32px; border-radius: var(--radius-sm);
    font-weight: 600; font-size: 1rem;
    text-decoration: none; border: 1.5px solid var(--border);
    transition: all 0.2s;
}
.btn-hero-secondary:hover { border-color: var(--primary); color: var(--primary); }

.hero-stats {
    display: flex; align-items: center;
    justify-content: center; gap: 32px;
    flex-wrap: wrap;
}

.stat-item { text-align: center; }
.stat-num { display: block; font-size: 1.5rem; font-weight: 800; color: var(--primary); }
.stat-label { font-size: 0.75rem; color: var(--text-muted); }
.stat-divider { width: 1px; height: 40px; background: var(--border); }

/* ============ FEATURES ============ */
.features { padding: 80px 0; }

.section-title {
    font-size: 1.75rem; font-weight: 800;
    text-align: center; margin-bottom: 48px;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.step-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
}
.step-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.step-num {
    font-family: var(--font-mono);
    font-size: 0.75rem; font-weight: 700;
    color: var(--primary); opacity: 0.5;
    margin-bottom: 12px;
}

.step-icon { font-size: 2rem; margin-bottom: 12px; }
.step-card h3 { font-weight: 700; margin-bottom: 8px; }
.step-card p { color: var(--text-muted); font-size: 0.875rem; line-height: 1.6; }

/* ============ CTA SECTION ============ */
.cta-section { padding: 60px 0; }

.cta-box {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: var(--radius);
    padding: 60px 40px;
    text-align: center; color: white;
}
.cta-box h2 { font-size: 1.75rem; font-weight: 800; margin-bottom: 12px; }
.cta-box p { opacity: 0.85; margin-bottom: 28px; }
.cta-box .btn-hero-primary { background: white; color: var(--primary); }
.cta-box .btn-hero-primary:hover { background: #f0f4ff; }

/* ============ DASHBOARD STATS ============ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px; margin-bottom: 40px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    display: flex; align-items: center; gap: 16px;
    box-shadow: var(--shadow);
}

.stat-card-icon { font-size: 2rem; }
.stat-card-num { font-size: 1.75rem; font-weight: 800; color: var(--primary); }
.stat-card-label { font-size: 0.8rem; color: var(--text-muted); }

/* ============ CATEGORY GRID ============ */
.section { margin-bottom: 40px; }
.section-heading { font-size: 1.25rem; font-weight: 700; margin-bottom: 16px; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.link-more { font-size: 0.875rem; color: var(--primary); text-decoration: none; font-weight: 600; }

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

.category-card {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-decoration: none; color: var(--text);
    display: flex; flex-direction: column; gap: 6px;
    transition: all 0.2s; position: relative; overflow: hidden;
}
.category-card::before {
    content: ''; position: absolute; top: 0; left: 0;
    width: 4px; height: 100%;
    background: var(--cat-color, var(--primary));
    transition: width 0.2s;
}
.category-card:hover { border-color: var(--cat-color, var(--primary)); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.category-card:hover::before { width: 6px; }

.cat-icon { font-size: 1.5rem; }
.cat-name { font-weight: 700; font-size: 0.9rem; }
.cat-desc { font-size: 0.75rem; color: var(--text-muted); line-height: 1.4; }
.cat-arrow { margin-top: auto; color: var(--cat-color, var(--primary)); font-weight: 700; }

/* ============ CATEGORY LARGE GRID ============ */
.category-grid-large {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.category-card-large {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-decoration: none; color: var(--text);
    display: flex; flex-direction: column; gap: 12px;
    transition: all 0.2s;
    border-top: 4px solid var(--cat-color, var(--primary));
}
.category-card-large:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.cat-l-icon { font-size: 2.5rem; }
.cat-l-name { font-size: 1.1rem; font-weight: 800; }
.cat-l-desc { color: var(--text-muted); font-size: 0.875rem; line-height: 1.5; }

.cat-tips { list-style: none; }
.cat-tips li { font-size: 0.8rem; color: var(--text-muted); padding: 2px 0; }

.cat-l-cta {
    margin-top: auto;
    color: var(--cat-color, var(--primary));
    font-weight: 700; font-size: 0.875rem;
}

/* ============ SESSION ITEMS ============ */
.sessions-list { display: flex; flex-direction: column; gap: 10px; }

.session-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    display: flex; align-items: center; gap: 16px;
}

.session-info { flex: 1; }
.session-title { font-weight: 600; margin-bottom: 4px; }
.session-meta { display: flex; gap: 12px; align-items: center; }
.session-date { font-size: 0.8rem; color: var(--text-muted); }

.badge-category {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary);
    padding: 2px 10px;
    border-radius: 100px;
    font-size: 0.75rem; font-weight: 600;
}

.score-circle {
    width: 48px; height: 48px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; font-weight: 800;
    flex-shrink: 0;
}
.score-high { background: #d1fae5; color: #065f46; }
.score-mid  { background: #fef3c7; color: #92400e; }
.score-low  { background: #fee2e2; color: #991b1b; }

/* ============ EMPTY STATE ============ */
.empty-state {
    text-align: center; padding: 60px 20px;
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}
.empty-icon { font-size: 4rem; margin-bottom: 16px; }
.empty-state h3 { font-size: 1.25rem; font-weight: 700; margin-bottom: 8px; }
.empty-state p { color: var(--text-muted); margin-bottom: 24px; }

/* ============ SETUP CARD ============ */
.setup-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow-md);
}

.setup-header {
    text-align: center;
    padding-bottom: 24px;
    border-bottom: 3px solid;
    margin-bottom: 24px;
}

.setup-icon { font-size: 3rem; margin-bottom: 12px; }
.setup-header h1 { font-size: 1.5rem; font-weight: 800; }
.setup-header p { color: var(--text-muted); margin-top: 8px; }

.tips-box {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    margin-bottom: 24px;
}

.tips-box h3 { font-size: 0.9rem; font-weight: 700; margin-bottom: 10px; }
.tips-box ul { list-style: none; }
.tips-box li { font-size: 0.85rem; color: var(--text-muted); padding: 4px 0; }

.setup-form { margin-top: 16px; }
.setup-back { text-align: center; margin-top: 20px; }
.setup-back a { color: var(--text-muted); font-size: 0.875rem; text-decoration: none; }
.setup-back a:hover { color: var(--primary); }

/* ============ RECORD PAGE ============ */
.record-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow-md);
    text-align: center;
}

.record-header { margin-bottom: 24px; }
.record-badge {
    display: inline-block;
    padding: 6px 16px; border-radius: 100px;
    font-size: 0.8rem; font-weight: 700;
    margin-bottom: 12px;
}
.record-title    { font-size: 1.25rem; font-weight: 800; margin-bottom: 8px; }
.record-subtitle { color: var(--text-muted); font-size: 0.875rem; }

.tips-mini {
    display: flex; flex-wrap: wrap; gap: 6px;
    justify-content: center; margin-bottom: 20px;
}
.tip-tag {
    background: var(--primary-light); color: var(--primary);
    padding: 4px 12px; border-radius: 100px;
    font-size: 0.75rem; font-weight: 600;
}

/* Timer */
.timer-display { margin-bottom: 12px; }

.timer-circle {
    width: 120px; height: 120px;
    border: 4px solid var(--primary);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 12px;
    font-family: var(--font-mono);
    font-size: 1.5rem; font-weight: 700;
    color: var(--primary);
    transition: all 0.3s;
}
.timer-circle.recording {
    border-color: var(--danger); color: var(--danger);
    animation: rec-pulse 2s infinite;
}
@keyframes rec-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.35); }
    50%       { box-shadow: 0 0 0 10px rgba(239,68,68,0); }
}
.timer-circle.paused {
    border-color: var(--warning); color: var(--warning);
    border-style: dashed;
}

.status-idle      { color: var(--text-muted); font-size: 0.875rem; }
.status-recording { color: var(--danger);     font-size: 0.875rem; font-weight: 600; }
.status-paused    { color: var(--warning);    font-size: 0.875rem; font-weight: 600; }
.status-done      { color: var(--secondary);  font-size: 0.875rem; font-weight: 600; }

/* Segment info */
.segment-info {
    display: flex; align-items: center; gap: 8px;
    justify-content: center;
    font-size: 0.8rem; color: var(--text-muted);
    margin-bottom: 12px;
    background: #f8fafc;
    padding: 5px 16px; border-radius: 100px;
    border: 1px solid var(--border);
    width: fit-content; margin-left: auto; margin-right: auto;
}
.seg-icon { font-size: 0.9rem; }
.seg-dot  { width: 4px; height: 4px; background: var(--text-muted); border-radius: 50%; }

/* Visualizer */
.visualizer-container {
    margin-bottom: 20px;
    background: #f8fafc;
    border-radius: var(--radius-sm);
    overflow: hidden;
    height: 80px;
    display: flex; align-items: center; justify-content: center;
}
#audio-visualizer { width: 100%; }

/* Record Controls */
.record-controls {
    display: flex; gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.btn-record, .btn-pause, .btn-resume, .btn-stop {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 11px 22px; border-radius: var(--radius-sm);
    font-family: var(--font); font-weight: 700; font-size: 0.875rem;
    cursor: pointer; border: 2px solid transparent;
    transition: all 0.2s; min-width: 130px; justify-content: center;
}
.btn-record {
    background: #fee2e2; color: var(--danger); border-color: #fca5a5;
}
.btn-record:not(:disabled):hover {
    background: var(--danger); color: white; border-color: var(--danger);
    transform: translateY(-2px); box-shadow: 0 4px 12px rgba(239,68,68,0.3);
}
.btn-pause {
    background: #fef3c7; color: #92400e; border-color: #fcd34d;
}
.btn-pause:not(:disabled):hover {
    background: #f59e0b; color: white; border-color: #f59e0b;
    transform: translateY(-2px);
}
.btn-resume {
    background: #d1fae5; color: #065f46; border-color: #6ee7b7;
    animation: resume-pulse 1.5s infinite;
}
@keyframes resume-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16,185,129,0.4); }
    50%       { box-shadow: 0 0 0 8px rgba(16,185,129,0); }
}
.btn-resume:not(:disabled):hover {
    background: #10b981; color: white; border-color: #10b981;
    transform: translateY(-2px); animation: none;
}
.btn-stop {
    background: #f1f5f9; color: var(--text); border-color: var(--border);
}
.btn-stop:not(:disabled):hover {
    background: #334155; color: white; border-color: #334155;
    transform: translateY(-2px);
}
.btn-record:disabled, .btn-pause:disabled,
.btn-resume:disabled, .btn-stop:disabled {
    opacity: 0.4; cursor: not-allowed;
    transform: none; box-shadow: none; animation: none;
}

/* Shortcut hint */
.rec-shortcut-hint {
    font-size: 0.72rem; color: var(--text-muted);
    margin-bottom: 12px;
}
.rec-shortcut-hint kbd {
    background: #f1f5f9; border: 1px solid var(--border);
    border-radius: 4px; padding: 2px 7px;
    font-size: 0.7rem; font-family: var(--font-mono);
}

/* Pause overlay */
.pause-overlay {
    display: flex; flex-direction: column;
    align-items: center; gap: 6px;
    padding: 16px;
    background: #fffbeb;
    border: 2px dashed #fcd34d;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    animation: fadeIn 0.3s ease;
}
@keyframes fadeIn { from { opacity:0; transform:scale(0.97); } to { opacity:1; transform:scale(1); } }
.pause-icon { font-size: 1.8rem; }
.pause-text { font-weight: 700; color: #92400e; font-size: 0.95rem; }
.pause-sub  { font-size: 0.78rem; color: var(--text-muted); }

/* Playback */
.playback-section {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 20px;
    margin-top: 12px;
    display: flex; flex-direction: column;
    align-items: center; gap: 12px;
}
.playback-section h3    { margin: 0; font-size: 1rem; }
.playback-section audio { width: 100%; }
.playback-meta {
    display: flex; gap: 12px; flex-wrap: wrap;
    justify-content: center;
    font-size: 0.75rem; color: var(--text-muted);
}
.playback-meta span {
    background: white; border: 1px solid var(--border);
    padding: 3px 10px; border-radius: 100px;
}
.playback-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

/* Processing */
.processing-section { padding: 20px 0; text-align: center; }
.processing-animation { display: flex; justify-content: center; margin-bottom: 20px; }
.proc-spinner {
    width: 56px; height: 56px;
    border: 4px solid #e2e8f0;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.processing-section h3 { margin-bottom: 8px; font-size: 1.1rem; }
.processing-section p  { color: var(--text-muted); margin-bottom: 24px; font-size: 0.875rem; }
.proc-steps {
    display: flex; flex-direction: column; gap: 10px;
    max-width: 360px; margin: 0 auto;
}
.proc-step {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem; transition: all 0.3s;
}
.proc-step .step-icon { font-size: 1.2rem; }
.step-status { margin-left: auto; font-size: 1rem; }
.step-done   { background: #d1fae5; border-color: #6ee7b7; }
.step-loading{ background: var(--primary-light); border-color: #a5b4fc; }

/* ============ RESULT PAGE ============ */
.result-header { margin-bottom: 28px; }
.result-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.result-date { font-size: 0.875rem; color: var(--text-muted); }
.result-title { font-size: 1.5rem; font-weight: 800; }

.result-score-hero {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    display: flex; align-items: center; gap: 32px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
}

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

.grade-A { border-color: #10b981; background: #d1fae5; color: #065f46; }
.grade-B { border-color: #3b82f6; background: #dbeafe; color: #1e40af; }
.grade-C { border-color: #f59e0b; background: #fef3c7; color: #92400e; }
.grade-D { border-color: #f97316; background: #ffedd5; color: #9a3412; }
.grade-E { border-color: #ef4444; background: #fee2e2; color: #991b1b; }

.score-num { font-size: 2.5rem; font-weight: 800; line-height: 1; }
.score-label { font-size: 0.8rem; font-weight: 600; }

.grade-badge {
    display: inline-block;
    padding: 6px 20px; border-radius: 100px;
    font-weight: 800; font-size: 1.1rem;
    margin-bottom: 8px;
}

.grade-text { font-size: 1rem; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; }
.duration-info { font-size: 0.8rem; color: var(--text-muted); }

.result-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 20px; margin-bottom: 20px;
}

.result-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.result-card h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 20px; }

/* Aspect bars */
.aspect-list { display: flex; flex-direction: column; gap: 16px; }

.aspect-item {}

.aspect-label {
    display: flex; justify-content: space-between;
    font-size: 0.875rem; font-weight: 600;
    margin-bottom: 6px;
}
.aspect-score { color: var(--text-muted); }

.aspect-bar {
    height: 10px; background: #f1f5f9;
    border-radius: 100px; overflow: hidden;
}

.aspect-fill {
    height: 100%; border-radius: 100px;
    transition: width 1s ease;
}

.fill-high { background: linear-gradient(90deg, #10b981, #34d399); }
.fill-mid  { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.fill-low  { background: linear-gradient(90deg, #ef4444, #f87171); }

/* Feedback grid */
.feedback-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px; margin-bottom: 20px;
}

.strengths-card { border-top: 3px solid var(--secondary); }
.weaknesses-card { border-top: 3px solid var(--warning); }
.suggestions-card { margin-bottom: 20px; border-top: 3px solid var(--primary); }

.strengths-card p, .weaknesses-card p {
    color: var(--text-muted);
    line-height: 1.7; font-size: 0.9rem;
}

.suggestions-content {
    color: var(--text-muted);
    line-height: 1.8; font-size: 0.9rem;
}

/* Feedback detail */
.feedback-details { display: flex; flex-direction: column; gap: 12px; }

.feedback-detail-item {
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--primary);
}

.feedback-detail-label {
    font-weight: 700; font-size: 0.85rem;
    margin-bottom: 4px;
}

.feedback-detail-text {
    color: var(--text-muted); font-size: 0.85rem;
    line-height: 1.6;
}

/* Transcript */
.transcript-box {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 20px;
    font-size: 0.9rem; line-height: 1.8;
    color: var(--text); white-space: pre-wrap;
    max-height: 300px; overflow-y: auto;
}

.result-actions {
    display: flex; gap: 12px; flex-wrap: wrap;
    justify-content: center; padding: 24px 0;
}

/* Chart card */
.chart-card { display: flex; flex-direction: column; align-items: center; }
.chart-big-card { margin-bottom: 24px; }

.chart-loading { padding: 40px; color: var(--text-muted); text-align: center; }

.chart-stats {
    display: flex; gap: 24px;
    justify-content: center; flex-wrap: wrap;
    margin-top: 20px; padding-top: 20px;
    border-top: 1px solid var(--border);
}

.cs-item { text-align: center; }
.cs-num { font-size: 1.5rem; font-weight: 800; color: var(--primary); }
.cs-label { font-size: 0.75rem; color: var(--text-muted); }

/* ============ HISTORY ============ */
.filter-bar {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 20px; flex-wrap: wrap;
    font-size: 0.875rem; color: var(--text-muted);
}

.filter-btn {
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 100px;
    text-decoration: none; color: var(--text);
    font-size: 0.8rem; font-weight: 500;
    transition: all 0.2s;
}
.filter-btn:hover, .filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.sessions-table { display: flex; flex-direction: column; gap: 10px; }

.session-row {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    display: flex; align-items: center; gap: 16px;
}

.sr-score { text-align: center; }

.score-circle-sm {
    width: 48px; height: 48px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.9rem; font-weight: 800;
    border: 2px solid;
}

.grade-label {
    font-size: 0.7rem; font-weight: 700;
    margin-top: 2px; text-align: center;
}

.sr-info { flex: 1; }
.sr-title { font-weight: 700; margin-bottom: 4px; }
.sr-meta {
    display: flex; gap: 12px; align-items: center;
    font-size: 0.8rem; color: var(--text-muted);
    flex-wrap: wrap; margin-bottom: 6px;
}

.sr-scores-mini {
    display: flex; gap: 12px;
    font-size: 0.75rem; color: var(--text-muted);
}

.sr-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* Pagination */
.pagination {
    display: flex; align-items: center; gap: 16px;
    justify-content: center; margin-top: 24px;
    font-size: 0.875rem; color: var(--text-muted);
}

.page-btn {
    padding: 8px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-decoration: none; color: var(--text);
    font-weight: 600; transition: all 0.2s;
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); }

/* ============ RESULT PAGE — NEW DESIGN ============ */

/* Breadcrumb */
.breadcrumb {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.8rem; color: var(--text-muted);
    margin-bottom: 24px;
}
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--primary); }

/* Hero Result */
.hero-result {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
}

.hero-left { flex: 1; }

.hero-meta {
    display: flex; align-items: center; gap: 10px;
    flex-wrap: wrap; margin-bottom: 12px;
}
.hero-date, .hero-duration {
    font-size: 0.8rem; color: var(--text-muted);
}

.hero-topic {
    font-size: 1.4rem; font-weight: 800;
    line-height: 1.3; margin-bottom: 12px;
    color: var(--text);
}

.hero-ai-tag {
    display: inline-flex; align-items: center; gap: 6px;
    background: linear-gradient(135deg, #4285f420, #ea433520);
    border: 1px solid #4285f440;
    color: #4285f4;
    padding: 5px 14px; border-radius: 100px;
    font-size: 0.75rem; font-weight: 600;
}

/* Score Ring */
.hero-score-block {
    text-align: center; flex-shrink: 0;
}

.big-score-ring {
    position: relative;
    width: 140px; height: 140px;
    margin: 0 auto 12px;
}

.ring-svg {
    width: 100%; height: 100%;
    transform: rotate(-90deg);
}

.ring-bg  { fill: none; stroke: #f1f5f9; stroke-width: 10; }
.ring-fill {
    fill: none; stroke-width: 10;
    stroke-linecap: round;
    transition: stroke-dasharray 1s ease;
}

.grade-A .ring-fill { stroke: #10b981; }
.grade-B .ring-fill { stroke: #3b82f6; }
.grade-C .ring-fill { stroke: #f59e0b; }
.grade-D .ring-fill { stroke: #f97316; }
.grade-E .ring-fill { stroke: #ef4444; }

.ring-content {
    position: absolute; inset: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
}
.ring-num   { font-size: 2.5rem; font-weight: 900; line-height: 1; }
.ring-label { font-size: 0.75rem; color: var(--text-muted); }

.grade-A .ring-num { color: #10b981; }
.grade-B .ring-num { color: #3b82f6; }
.grade-C .ring-num { color: #f59e0b; }
.grade-D .ring-num { color: #f97316; }
.grade-E .ring-num { color: #ef4444; }

.grade-tag {
    display: inline-block;
    padding: 4px 16px; border-radius: 100px;
    font-weight: 800; font-size: 1rem;
    margin-bottom: 4px;
}
.grade-A.grade-tag { background: #d1fae5; color: #065f46; }
.grade-B.grade-tag { background: #dbeafe; color: #1e40af; }
.grade-C.grade-tag { background: #fef3c7; color: #92400e; }
.grade-D.grade-tag { background: #ffedd5; color: #9a3412; }
.grade-E.grade-tag { background: #fee2e2; color: #991b1b; }

.grade-desc { font-size: 0.85rem; color: var(--text-muted); }

/* Cards */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.card-header {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 16px; flex-wrap: wrap;
}
.card-header h2 {
    font-size: 1rem; font-weight: 700; flex: 1;
    margin: 0;
}
.card-icon { font-size: 1.2rem; }
.card-desc {
    color: var(--text-muted); font-size: 0.85rem;
    line-height: 1.6; margin-bottom: 20px;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--primary);
}

/* Gemini pill */
.gemini-pill {
    background: linear-gradient(135deg, #4285f4, #ea4335);
    color: white; padding: 3px 12px;
    border-radius: 100px; font-size: 0.7rem; font-weight: 700;
}

/* Two col grid */
.two-col-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px; margin-bottom: 20px;
}
.two-col-grid .card { margin-bottom: 0; }

/* Score bars */
.score-bars { display: flex; flex-direction: column; gap: 14px; }

.score-bar-row {}

.bar-label-row {
    display: flex; align-items: center; gap: 6px;
    margin-bottom: 6px; flex-wrap: wrap;
}
.bar-icon  { font-size: 1rem; }
.bar-name  { font-weight: 600; font-size: 0.875rem; }
.bar-hint  { font-size: 0.75rem; color: var(--text-muted); flex: 1; }
.bar-val   {
    font-size: 0.875rem; font-weight: 800;
    padding: 2px 8px; border-radius: 6px;
    min-width: 36px; text-align: center;
}
.val-high { background: #d1fae5; color: #065f46; }
.val-mid  { background: #fef3c7; color: #92400e; }
.val-low  { background: #fee2e2; color: #991b1b; }

.bar-track {
    height: 8px; background: #f1f5f9;
    border-radius: 100px; overflow: hidden;
}
.bar-fill {
    height: 100%; border-radius: 100px;
    width: 0; /* animated via JS */
}
.fill-high { background: linear-gradient(90deg, #10b981, #34d399); }
.fill-mid  { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.fill-low  { background: linear-gradient(90deg, #ef4444, #f87171); }

/* Radar */
.chart-card { display: flex; flex-direction: column; }
.radar-wrap {
    flex: 1;
    display: flex; align-items: center; justify-content: center;
    padding: 8px;
}

/* Audio counters */
.audio-counters {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px; margin-bottom: 16px;
}

.counter-card {
    border-radius: var(--radius-sm);
    padding: 16px;
    border: 1.5px solid;
    text-align: center;
}
.cc-good { background: #f0fdf4; border-color: #bbf7d0; }
.cc-ok   { background: #fffbeb; border-color: #fde68a; }
.cc-bad  { background: #fef2f2; border-color: #fecaca; }

.cc-icon  { font-size: 1.5rem; margin-bottom: 4px; }
.cc-num   { font-size: 2rem; font-weight: 900; line-height: 1; color: var(--text); }
.cc-title { font-size: 0.8rem; font-weight: 700; margin: 4px 0 2px; }
.cc-sub   { font-size: 0.7rem; color: var(--text-muted); margin-bottom: 8px; }
.cc-detail{
    font-size: 0.75rem; color: var(--text-muted);
    line-height: 1.4;
    background: rgba(255,255,255,0.7);
    border-radius: 6px; padding: 6px 8px;
    text-align: left;
}

/* Audio characteristics */
.audio-chars {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.char-item {
    display: flex; align-items: center; gap: 12px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
}
.char-icon  { font-size: 1.5rem; flex-shrink: 0; }
.char-label { font-size: 0.75rem; color: var(--text-muted); font-weight: 600; }
.char-value { font-size: 0.9rem; font-weight: 700; color: var(--text); }

/* Strength / weakness */
.strength-card { border-top: 3px solid #10b981; }
.weakness-card { border-top: 3px solid #f59e0b; }

.prose-content { display: flex; flex-direction: column; gap: 8px; }
.prose-item {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem; line-height: 1.6;
}
.prose-item.good { background: #f0fdf4; border-left: 3px solid #10b981; }
.prose-item.warn { background: #fffbeb; border-left: 3px solid #f59e0b; }

/* Suggestions */
.suggest-card { border-top: 3px solid var(--primary); }
.suggest-list  { display: flex; flex-direction: column; gap: 10px; }
.suggest-item  {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 12px 16px;
    background: var(--primary-light);
    border-radius: var(--radius-sm);
    font-size: 0.875rem; line-height: 1.6;
}
.suggest-bullet {
    color: var(--primary); font-weight: 800;
    flex-shrink: 0; margin-top: 1px;
}

/* Detail grid */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.detail-item {
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: #f8fafc;
    border-left: 4px solid var(--primary);
}
.detail-clarity    { border-left-color: #6366f1; }
.detail-structure  { border-left-color: #8b5cf6; }
.detail-confidence { border-left-color: #10b981; }
.detail-relevance  { border-left-color: #f59e0b; }
.detail-vocabulary { border-left-color: #3b82f6; }
.detail-fluency    { border-left-color: #06b6d4; }

.detail-head {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 8px; font-size: 0.875rem;
}
.detail-item p {
    font-size: 0.85rem; color: var(--text-muted);
    line-height: 1.6; margin: 0;
}

/* Tabs */
.tab-row { display: flex; gap: 6px; margin-bottom: 16px; }
.tab {
    padding: 7px 18px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font-family: var(--font); font-size: 0.8rem;
    font-weight: 600; cursor: pointer;
    color: var(--text-muted); transition: all 0.2s;
}
.tab.active, .tab:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Transcript */
.transcript {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 20px;
    font-size: 0.9rem; line-height: 1.9;
    color: var(--text); white-space: pre-wrap;
    max-height: 320px; overflow-y: auto;
}
.transcript-dark {
    background: #1e1e2e;
    color: #cdd6f4;
    font-family: var(--font-mono);
    font-size: 0.85rem;
}
.trans-legend {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex; gap: 20px; flex-wrap: wrap;
    font-size: 0.75rem; color: #a6adc8;
}
.trans-legend code {
    background: rgba(255,255,255,0.1);
    padding: 1px 6px; border-radius: 4px;
}

/* Action row */
.action-row {
    display: flex; gap: 12px; flex-wrap: wrap;
    justify-content: center; padding: 24px 0;
}

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

/* ============================================
   AI AGENT CHATBOX
   ============================================ */

/* FAB Button */
.agent-fab {
    position: fixed;
    bottom: 28px; right: 28px;
    z-index: 1000;
    display: flex; align-items: center; gap: 8px;
    background: linear-gradient(135deg, #4F46E5, #7C3AED);
    color: white;
    border: none; border-radius: 100px;
    padding: 14px 20px;
    font-family: var(--font); font-size: 0.875rem; font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(79,70,229,0.45);
    transition: all 0.3s cubic-bezier(.4,0,.2,1);
}
.agent-fab:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(79,70,229,0.5);
}
.agent-fab.active {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    box-shadow: 0 4px 20px rgba(220,38,38,0.4);
}

.fab-icon  { font-size: 1.1rem; }
.fab-label { white-space: nowrap; }

.fab-notif {
    position: absolute; top: -6px; right: -6px;
    width: 18px; height: 18px;
    background: #ef4444; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.65rem; font-weight: 800; color: white;
    border: 2px solid white;
}

/* Chat Window */
.agent-chat {
    position: fixed;
    bottom: 90px; right: 28px;
    z-index: 999;
    width: 420px;
    max-height: 620px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.18);
    display: flex; flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.96);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(.4,0,.2,1);
    transform-origin: bottom right;
}
.agent-chat.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Header */
.ac-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 18px;
    background: linear-gradient(135deg, #4F46E5, #7C3AED);
    color: white; flex-shrink: 0;
}
.ac-header-left { display: flex; align-items: center; gap: 10px; }

.ac-avatar {
    width: 40px; height: 40px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
}

.ac-name   { font-weight: 700; font-size: 0.95rem; }
.ac-status {
    font-size: 0.72rem; opacity: 0.85;
    display: flex; align-items: center; gap: 4px;
}
.status-dot {
    width: 7px; height: 7px;
    background: #4ade80; border-radius: 50%;
    animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
}

.ac-header-actions { display: flex; gap: 4px; }
.ac-btn {
    background: rgba(255,255,255,0.15);
    border: none; border-radius: 8px;
    color: white; padding: 6px 10px;
    cursor: pointer; font-size: 0.85rem;
    transition: background 0.2s;
}
.ac-btn:hover { background: rgba(255,255,255,0.25); }

/* Quick Chips */
.ac-chips {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    background: #fafafa;
}
.chips-label {
    font-size: 0.72rem; font-weight: 700;
    color: var(--text-muted); margin-bottom: 8px;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.chips-row { display: flex; flex-wrap: wrap; gap: 6px; }

.chip {
    background: white;
    border: 1.5px solid var(--border);
    border-radius: 100px;
    padding: 5px 12px;
    font-family: var(--font); font-size: 0.78rem; font-weight: 600;
    cursor: pointer; color: var(--text);
    transition: all 0.2s;
}
.chip:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
    transform: translateY(-1px);
}

/* Messages Area */
.ac-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex; flex-direction: column; gap: 14px;
    scroll-behavior: smooth;
}

.ac-messages::-webkit-scrollbar { width: 4px; }
.ac-messages::-webkit-scrollbar-track { background: transparent; }
.ac-messages::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 2px; }

/* Individual Messages */
.ac-msg {
    display: flex; gap: 8px; align-items: flex-end;
    opacity: 0; transform: translateY(8px);
    transition: all 0.3s ease;
}
.ac-msg.visible {
    opacity: 1; transform: translateY(0);
}
.ac-msg.user { flex-direction: row-reverse; }

.msg-avatar {
    width: 32px; height: 32px;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; flex-shrink: 0;
}
.user-av { background: #fef3c7; }

/* Bubbles */
.msg-bubble {
    max-width: 80%;
    background: #f1f5f9;
    border-radius: 18px 18px 18px 4px;
    padding: 12px 14px;
    font-size: 0.85rem; line-height: 1.6;
    color: var(--text);
    word-wrap: break-word;
}

.msg-bubble p   { margin: 0 0 8px; }
.msg-bubble p:last-of-type { margin-bottom: 0; }
.msg-bubble ul  { margin: 6px 0; padding-left: 18px; }
.msg-bubble li  { margin: 3px 0; }
.msg-bubble h2,
.msg-bubble h3,
.msg-bubble h4  { margin: 10px 0 6px; font-size: 0.9rem; color: var(--primary); }
.msg-bubble strong { color: var(--text); }

.user-bubble {
    background: linear-gradient(135deg, #4F46E5, #7C3AED);
    color: white;
    border-radius: 18px 18px 4px 18px;
}
.user-bubble strong { color: white; }

.error-bubble {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

/* Message Actions */
.msg-actions {
    display: flex; gap: 6px;
    margin-top: 10px; padding-top: 8px;
    border-top: 1px solid rgba(0,0,0,0.06);
}
.msg-action-btn {
    background: white;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.72rem; font-weight: 600;
    cursor: pointer; color: var(--text-muted);
    transition: all 0.2s;
}
.msg-action-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.msg-time {
    font-size: 0.65rem; color: var(--text-muted);
    margin-top: 6px; text-align: right;
}

/* Typing Indicator */
.typing-bubble {
    padding: 14px 16px;
    display: flex; flex-direction: column; gap: 6px;
}
.typing-dots {
    display: flex; gap: 5px; align-items: center;
}
.typing-dots span {
    width: 8px; height: 8px;
    background: var(--primary);
    border-radius: 50%;
    animation: bounce-dot 1.4s infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce-dot {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
    40%           { transform: translateY(-6px); opacity: 1; }
}

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

/* Input Area */
.ac-input-area {
    border-top: 1px solid var(--border);
    padding: 12px 14px;
    flex-shrink: 0;
    background: var(--surface);
}

.ac-input-row {
    display: flex; align-items: flex-end; gap: 8px;
}

.ac-textarea {
    flex: 1;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    padding: 10px 14px;
    font-family: var(--font); font-size: 0.875rem;
    resize: none; outline: none;
    max-height: 120px; min-height: 44px;
    background: #f8fafc;
    color: var(--text);
    transition: border-color 0.2s;
    line-height: 1.5;
}
.ac-textarea:focus {
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}
.ac-textarea::placeholder { color: var(--text-muted); }

.ac-send {
    width: 44px; height: 44px;
    background: linear-gradient(135deg, #4F46E5, #7C3AED);
    border: none; border-radius: 12px;
    color: white; font-size: 1rem;
    cursor: pointer; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}
.ac-send:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79,70,229,0.4);
}
.ac-send:active { transform: translateY(0); }

.ac-footer-note {
    font-size: 0.68rem; color: var(--text-muted);
    text-align: center; margin-top: 8px;
}

/* Responsive Mobile */
@media (max-width: 480px) {
    .agent-fab { bottom: 16px; right: 16px; padding: 12px 16px; }
    .fab-label { display: none; }

    .agent-chat {
        right: 0; bottom: 0;
        width: 100vw;
        max-height: 85vh;
        border-radius: 20px 20px 0 0;
        border-bottom: none;
    }
}

/* ============================================
   INTERVIEW — SETUP PAGE
   ============================================ */
.iw-setup-header {
    text-align: center; margin-bottom: 28px;
}
.iw-setup-icon { font-size: 3rem; margin-bottom: 12px; }
.iw-setup-header h1 { font-size: 1.6rem; font-weight: 800; margin-bottom: 8px; }
.iw-setup-header p  { color: var(--text-muted); line-height: 1.7; max-width: 480px; margin: 0 auto; }

.iw-how-card {
    background: var(--primary-light);
    border: 1px solid #c7d2fe;
    border-radius: var(--radius);
    padding: 20px 24px; margin-bottom: 20px;
}
.iw-how-card h3 { font-size: 0.9rem; font-weight: 700; margin-bottom: 14px; color: var(--primary); }
.iw-steps { display: flex; flex-direction: column; gap: 8px; }
.iw-step {
    display: flex; align-items: center; gap: 12px;
    font-size: 0.875rem;
}
.iw-step-num {
    width: 24px; height: 24px; flex-shrink: 0;
    background: var(--primary); color: white;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem; font-weight: 800;
}

.iw-setup-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px; margin-bottom: 20px;
}
.iw-setup-card h2 { font-size: 1rem; font-weight: 700; margin-bottom: 20px; }

/* Position grid */
.position-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
}
.position-card {
    display: flex; flex-direction: column; align-items: center;
    gap: 6px; padding: 14px 10px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer; text-align: center;
    transition: all 0.2s; background: var(--surface);
}
.position-card input { display: none; }
.position-card:hover { border-color: var(--primary); background: var(--primary-light); }
.position-card.selected { border-color: var(--primary); background: var(--primary-light); }
.pos-icon  { font-size: 1.5rem; }
.pos-label { font-size: 0.78rem; font-weight: 600; color: var(--text); }

/* Qty cards */
.qty-row { display: flex; gap: 10px; }
.qty-card {
    flex: 1; padding: 14px 10px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    text-align: center; cursor: pointer;
    transition: all 0.2s;
}
.qty-card input { display: none; }
.qty-card:hover, .qty-card.selected { border-color: var(--primary); background: var(--primary-light); }
.qty-num   { display: block; font-size: 1.5rem; font-weight: 800; color: var(--primary); }
.qty-label { display: block; font-size: 0.8rem; font-weight: 700; }
.qty-dur   { display: block; font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }

/* Lang row */
.lang-row { display: flex; gap: 10px; }
.lang-card {
    flex: 1; padding: 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    text-align: center; cursor: pointer;
    font-size: 0.875rem; font-weight: 600;
    transition: all 0.2s;
}
.lang-card input { display: none; }
.lang-card:hover, .lang-card.selected { border-color: var(--primary); background: var(--primary-light); }

.btn-start-iw { font-size: 1rem; padding: 14px; margin-top: 8px; }
.label-opt { font-weight: 400; color: var(--text-muted); font-size: 0.8rem; }

/* ============================================
   INTERVIEW — SESSION PAGE
   ============================================ */
.iw-session-wrap {
    display: flex; height: calc(100vh - 64px);
    overflow: hidden;
}

/* Sidebar */
.iw-sidebar {
    width: 280px; flex-shrink: 0;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    padding: 20px 16px; gap: 16px;
    overflow-y: auto;
}

.iw-sidebar-header {
    display: flex; align-items: center; gap: 10px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.iw-sidebar-icon { font-size: 1.8rem; }
.iw-pos-name  { font-weight: 800; font-size: 0.9rem; }
.iw-company   { font-size: 0.78rem; color: var(--text-muted); }

/* Progress */
.iw-progress-box {}
.iw-prog-label {
    display: flex; justify-content: space-between;
    font-size: 0.78rem; font-weight: 600; margin-bottom: 6px;
    color: var(--text-muted);
}
.iw-prog-track {
    height: 8px; background: #f1f5f9;
    border-radius: 100px; overflow: hidden;
}
.iw-prog-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #7c3aed);
    border-radius: 100px;
    transition: width 0.6s ease;
}

/* Q list */
.iw-q-list { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.iw-q-item {
    display: flex; align-items: flex-start; gap: 8px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    background: #f8fafc;
}
.iw-q-dot {
    width: 10px; height: 10px; flex-shrink: 0;
    border-radius: 50%; margin-top: 4px;
}
.iw-q-dot.pending  { background: #e2e8f0; }
.iw-q-dot.active   { background: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,0.25); animation: pulse-dot 1.5s infinite; }
.iw-q-dot.done     { background: #10b981; }
.iw-q-dot.skipped  { background: #f59e0b; }

.iw-q-num     { font-size: 0.72rem; font-weight: 700; color: var(--text-muted); }
.iw-q-preview { font-size: 0.75rem; color: var(--text); line-height: 1.4; }

/* Timer box */
.iw-timer-box {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 14px;
    background: #f8fafc;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}
.iw-timer-icon { font-size: 1.2rem; }
.iw-timer-val  { font-family: var(--font-mono); font-size: 1.1rem; font-weight: 700; color: var(--primary); }
.iw-timer-label{ font-size: 0.72rem; color: var(--text-muted); }

.btn-end-session {
    width: 100%; padding: 10px;
    background: #fee2e2; color: var(--danger);
    border: 1.5px solid #fca5a5;
    border-radius: var(--radius-sm);
    font-family: var(--font); font-weight: 700;
    font-size: 0.85rem; cursor: pointer;
    transition: all 0.2s;
}
.btn-end-session:not(:disabled):hover { background: var(--danger); color: white; }
.btn-end-session:disabled { opacity: 0.4; cursor: not-allowed; }

/* Main Chat Area */
.iw-main {
    flex: 1; display: flex; flex-direction: column;
    overflow: hidden;
}

.iw-topbar {
    padding: 14px 20px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.iw-topbar-left { display: flex; align-items: center; gap: 10px; }
.iw-ai-avatar {
    width: 38px; height: 38px;
    background: linear-gradient(135deg, #4F46E5, #7C3AED);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
}
.iw-ai-name   { font-weight: 700; font-size: 0.9rem; }
.iw-ai-status {
    display: flex; align-items: center; gap: 5px;
    font-size: 0.75rem; color: var(--text-muted);
}
.iw-dot {
    width: 7px; height: 7px; background: #10b981;
    border-radius: 50%; animation: pulse-dot 2s infinite;
}
.iw-q-counter {
    background: var(--primary-light); color: var(--primary);
    padding: 4px 14px; border-radius: 100px;
    font-size: 0.85rem; font-weight: 700;
}

/* Chat messages */
.iw-chat {
    flex: 1; overflow-y: auto;
    padding: 20px; display: flex;
    flex-direction: column; gap: 16px;
}

.iw-bubble {
    display: flex; gap: 10px; align-items: flex-start;
    opacity: 0; transform: translateY(8px);
    transition: all 0.35s ease;
    max-width: 80%;
}
.iw-bubble.visible { opacity: 1; transform: translateY(0); }
.iw-bubble.ai-bubble { align-self: flex-start; }
.iw-bubble.user-bubble { align-self: flex-end; flex-direction: row-reverse; }
.iw-bubble.sys-bubble {
    align-self: center; max-width: 90%;
    background: #fef3c7; border-radius: var(--radius-sm);
    padding: 8px 14px; font-size: 0.8rem;
    color: #92400e; opacity: 1; transform: none;
}

.bubble-avatar {
    width: 36px; height: 36px; flex-shrink: 0;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
}
.user-av { background: #fef3c7; }

.bubble-content {
    background: #f1f5f9;
    border-radius: 16px 16px 16px 4px;
    padding: 12px 16px;
    font-size: 0.875rem; line-height: 1.7;
    max-width: 100%;
}
.user-content {
    background: linear-gradient(135deg, #059669, #047857);
    color: white;
    border-radius: 16px 16px 4px 16px;
}

.bubble-q-label {
    font-size: 0.7rem; font-weight: 700;
    color: var(--primary); margin-bottom: 6px;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.bubble-meta {
    font-size: 0.72rem; color: rgba(255,255,255,0.7);
    margin-top: 6px;
}
.skipped-tag {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    border-radius: 4px; padding: 2px 8px;
    font-size: 0.72rem; margin-bottom: 6px;
}

.bubble-tts-btn {
    background: none; border: none;
    cursor: pointer; font-size: 0.9rem;
    opacity: 0.5; transition: opacity 0.2s;
    padding: 0; margin-top: 6px;
}
.bubble-tts-btn:hover { opacity: 1; }

.intro-bubble .bubble-content { background: linear-gradient(135deg, var(--primary), #7c3aed); color: white; }
.intro-bubble .bubble-content p { color: white; }

/* Input area states */
.iw-input-area {
    border-top: 1px solid var(--border);
    padding: 20px;
    flex-shrink: 0;
    min-height: 130px;
    display: flex; align-items: center;
    background: var(--surface);
}

.iw-state {
    width: 100%;
    display: flex; flex-direction: column;
    align-items: center; gap: 10px;
    text-align: center;
}

/* Waiting animation */
.iw-waiting-anim {
    display: flex; gap: 6px;
}
.iw-waiting-anim span {
    width: 10px; height: 10px;
    background: var(--primary);
    border-radius: 50%;
    animation: bounce-dot 1.4s infinite;
}
.iw-waiting-anim span:nth-child(2) { animation-delay: 0.2s; }
.iw-waiting-anim span:nth-child(3) { animation-delay: 0.4s; }

/* Answer state */
.iw-answer-info {
    display: flex; align-items: center; gap: 16px;
    font-size: 0.875rem;
}
.iw-answer-timer {
    display: flex; align-items: center; gap: 6px;
    font-family: var(--font-mono); font-weight: 700;
    font-size: 1.1rem; color: var(--primary);
}
.ans-timer-icon { animation: pulse-dot 1s infinite; }

.iw-answer-btns { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

.btn-rec-start {
    padding: 12px 24px;
    background: #fee2e2; color: var(--danger);
    border: 1.5px solid #fca5a5;
    border-radius: var(--radius-sm);
    font-family: var(--font); font-weight: 700;
    cursor: pointer; transition: all 0.2s;
}
.btn-rec-start:not(:disabled):hover { background: var(--danger); color: white; }
.btn-rec-start:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-rec-stop {
    padding: 12px 24px;
    background: #d1fae5; color: #065f46;
    border: 1.5px solid #6ee7b7;
    border-radius: var(--radius-sm);
    font-family: var(--font); font-weight: 700;
    cursor: pointer; transition: all 0.2s;
}
.btn-rec-stop:not(:disabled):hover { background: #10b981; color: white; }
.btn-rec-stop:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-skip {
    padding: 12px 20px;
    background: #f8fafc; color: var(--text-muted);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font); font-weight: 600;
    cursor: pointer; font-size: 0.875rem;
    transition: all 0.2s;
}
.btn-skip:hover { border-color: var(--warning); color: var(--warning); }

.btn-rec-pause {
    padding: 12px 20px;
    background: #fef3c7; color: #92400e;
    border: 1.5px solid #fcd34d;
    border-radius: var(--radius-sm);
    font-family: var(--font); font-weight: 700;
    cursor: pointer; transition: all 0.2s;
    display: inline-flex; align-items: center; gap: 6px;
}
.btn-rec-pause:not(:disabled):hover { background: #f59e0b; color: white; border-color: #f59e0b; }

.btn-rec-resume {
    padding: 12px 20px;
    background: #d1fae5; color: #065f46;
    border: 1.5px solid #6ee7b7;
    border-radius: var(--radius-sm);
    font-family: var(--font); font-weight: 700;
    cursor: pointer; transition: all 0.2s;
    display: inline-flex; align-items: center; gap: 6px;
    animation: resume-pulse 1.5s infinite;
}
.btn-rec-resume:not(:disabled):hover { background: #10b981; color: white; border-color: #10b981; animation: none; }

.btn-rec-pause:disabled, .btn-rec-resume:disabled { opacity: 0.4; cursor: not-allowed; animation: none; }

.iw-rec-hint {
    font-size: 0.72rem; color: var(--text-muted); max-width: 400px;
}
.iw-rec-hint kbd {
    background: #f1f5f9; border: 1px solid var(--border);
    border-radius: 4px; padding: 1px 6px;
    font-size: 0.68rem; font-family: var(--font-mono);
}

/* Processing */
.iw-proc-anim { display: flex; justify-content: center; }
.proc-ring {
    width: 44px; height: 44px;
    border: 4px solid #e2e8f0;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Done state */
.iw-done-icon { font-size: 3rem; }
.btn-see-result { font-size: 1rem; padding: 12px 28px; }

/* Modal */
.iw-modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    display: flex; align-items: center; justify-content: center;
}
.iw-modal {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 32px 36px;
    text-align: center;
    max-width: 420px; width: 90%;
    box-shadow: var(--shadow-lg);
}
.iw-modal-icon { font-size: 2.5rem; margin-bottom: 12px; }
.iw-modal h3   { font-size: 1.2rem; font-weight: 800; margin-bottom: 8px; }
.iw-modal p    { color: var(--text-muted); font-size: 0.875rem; line-height: 1.6; margin-bottom: 20px; }
.iw-modal-btns { display: flex; gap: 10px; justify-content: center; }

/* ============================================
   INTERVIEW — RESULT PAGE
   ============================================ */
.iw-summary-card { border-top: 3px solid #059669; }
.iw-summary-text {
    font-size: 0.95rem; line-height: 1.8;
    color: var(--text); padding: 4px 0;
}

/* Hiring recommendation */
.hire-rec-badge {
    display: inline-flex; align-items: center; gap: 8px;
    margin-top: 12px; padding: 8px 18px;
    border-radius: var(--radius-sm);
    font-weight: 700; font-size: 0.875rem;
}
.hire-great { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.hire-good  { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }
.hire-ok    { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.hire-no    { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.hire-reason{ font-size: 0.8rem; color: var(--text-muted); margin-top: 6px; }

/* Per answer accordion */
.iw-per-ans-list { display: flex; flex-direction: column; gap: 10px; }

.iw-ans-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.iw-ans-header {
    display: flex; align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    cursor: pointer;
    background: #f8fafc;
    transition: background 0.2s;
}
.iw-ans-header:hover { background: var(--primary-light); }

.iw-ans-left  { display: flex; align-items: center; gap: 12px; flex: 1; }
.iw-ans-num   {
    width: 32px; height: 32px; flex-shrink: 0;
    background: var(--primary); color: white;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem; font-weight: 800;
}
.iw-ans-q   { font-size: 0.875rem; font-weight: 600; }
.iw-ans-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.iw-ans-score {
    width: 40px; height: 40px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.85rem; font-weight: 800;
}
.ans-high { background: #d1fae5; color: #065f46; }
.ans-mid  { background: #fef3c7; color: #92400e; }
.ans-low  { background: #fee2e2; color: #991b1b; }

.iw-ans-toggle { color: var(--text-muted); font-size: 0.75rem; }

.iw-ans-body {
    display: none;
    padding: 16px 18px;
    border-top: 1px solid var(--border);
    background: white;
    display: none; flex-direction: column; gap: 12px;
}

.iw-ans-transcript {
    background: #f8fafc;
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-size: 0.85rem;
}
.iw-ans-transcript strong { display: block; margin-bottom: 6px; font-size: 0.78rem; color: var(--text-muted); }
.iw-ans-transcript p { margin: 0; line-height: 1.6; }

.iw-ans-highlight {
    background: #fef3c7;
    border-left: 3px solid #f59e0b;
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 0.85rem; font-style: italic;
}

.iw-ans-feedback {
    font-size: 0.85rem; line-height: 1.6;
}
.iw-ans-feedback strong { display: block; margin-bottom: 4px; color: var(--text-muted); font-size: 0.78rem; }

.iw-transcript {
    white-space: pre-wrap;
    font-size: 0.85rem; line-height: 2;
}

/* Responsive */
@media (max-width: 768px) {
    .iw-session-wrap { flex-direction: column; height: auto; }
    .iw-sidebar { width: 100%; height: auto; border-right: none; border-bottom: 1px solid var(--border); }
    .iw-main { min-height: 60vh; }
    .iw-chat { max-height: 50vh; }
    .iw-bubble { max-width: 95%; }
    .position-grid { grid-template-columns: repeat(2, 1fr); }
    .qty-row { flex-direction: column; }
}

/* ============================================
   DARK MODE — Transisi & Detail Tambahan
   ============================================ */

/* Transisi halus saat toggle tema */
.theme-transitioning * {
    transition: background-color 0.35s ease,
                border-color 0.35s ease,
                color 0.25s ease,
                box-shadow 0.35s ease !important;
}

/* Dark: section headings neon glow */
[data-theme="dark"] .page-title,
[data-theme="dark"] .section-heading,
[data-theme="dark"] .hero-title {
    color: var(--text);
}
[data-theme="dark"] .text-gradient {
    background: linear-gradient(135deg, #818cf8, #a78bfa, #34d399);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Dark: category cards dengan neon border */
[data-theme="dark"] .category-card::before {
    background: var(--cat-color, var(--primary));
    filter: blur(1px);
}

/* Dark: step cards */
[data-theme="dark"] .step-card {
    background: var(--glass) !important;
}
[data-theme="dark"] .step-num { opacity: 0.7; color: var(--primary); }

/* Dark: history filter buttons */
[data-theme="dark"] .filter-btn {
    background: rgba(15,20,40,0.6) !important;
    border-color: rgba(99,102,241,0.2) !important;
    color: var(--text-muted) !important;
}
[data-theme="dark"] .filter-btn:hover,
[data-theme="dark"] .filter-btn.active {
    background: rgba(99,102,241,0.3) !important;
    border-color: var(--primary) !important;
    color: var(--primary) !important;
}

/* Dark: pagination buttons */
[data-theme="dark"] .page-btn {
    background: rgba(15,20,40,0.6) !important;
    border-color: rgba(99,102,241,0.2) !important;
    color: var(--text) !important;
}
[data-theme="dark"] .page-btn:hover {
    border-color: var(--primary) !important;
    color: var(--primary) !important;
}

/* Dark: btn-sm */
[data-theme="dark"] .btn-sm {
    background: rgba(99,102,241,0.15) !important;
    color: var(--primary) !important;
}
[data-theme="dark"] .btn-sm:hover {
    background: var(--primary) !important;
    color: white !important;
}

/* Dark: btn-secondary & btn-outline */
[data-theme="dark"] .btn-secondary {
    background: rgba(15,20,40,0.7) !important;
    border-color: rgba(99,102,241,0.3) !important;
    color: var(--text) !important;
}
[data-theme="dark"] .btn-secondary:hover {
    border-color: var(--primary) !important;
    color: var(--primary) !important;
    background: rgba(99,102,241,0.1) !important;
}
[data-theme="dark"] .btn-outline {
    background: transparent !important;
    border-color: var(--primary) !important;
    color: var(--primary) !important;
}
[data-theme="dark"] .btn-outline:hover {
    background: rgba(99,102,241,0.15) !important;
}

/* Dark: record buttons */
[data-theme="dark"] .btn-record {
    background: rgba(239,68,68,0.15) !important;
    border-color: rgba(248,113,113,0.3) !important;
    color: #f87171 !important;
}
[data-theme="dark"] .btn-record:not(:disabled):hover {
    background: #ef4444 !important;
    color: white !important;
}
[data-theme="dark"] .btn-pause {
    background: rgba(245,158,11,0.15) !important;
    border-color: rgba(251,191,36,0.3) !important;
    color: #fbbf24 !important;
}
[data-theme="dark"] .btn-resume {
    background: rgba(16,185,129,0.15) !important;
    border-color: rgba(52,211,153,0.3) !important;
    color: #34d399 !important;
}
[data-theme="dark"] .btn-stop {
    background: rgba(148,163,184,0.1) !important;
    border-color: rgba(148,163,184,0.2) !important;
    color: var(--text-muted) !important;
}
[data-theme="dark"] .btn-stop:not(:disabled):hover {
    background: rgba(148,163,184,0.3) !important;
    color: var(--text) !important;
}

/* Dark: visualizer container */
[data-theme="dark"] .visualizer-container {
    background: rgba(8,11,20,0.6) !important;
    border: 1px solid rgba(99,102,241,0.15);
}

/* Dark: timer circle */
[data-theme="dark"] .timer-circle {
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 20px rgba(129,140,248,0.2);
}
[data-theme="dark"] .timer-circle.recording {
    border-color: #f87171;
    color: #f87171;
    box-shadow: 0 0 20px rgba(248,113,113,0.25);
}
[data-theme="dark"] .timer-circle.paused {
    border-color: #fbbf24;
    color: #fbbf24;
}

/* Dark: segment info */
[data-theme="dark"] .segment-info {
    background: rgba(15,20,40,0.6) !important;
    border-color: rgba(99,102,241,0.2) !important;
}

/* Dark: empty state */
[data-theme="dark"] .empty-state {
    background: var(--glass) !important;
    border-color: rgba(99,102,241,0.2) !important;
    backdrop-filter: blur(10px);
}

/* Dark: hero result */
[data-theme="dark"] .hero-result {
    background: var(--glass) !important;
    border: 1px solid var(--glass-border) !important;
    backdrop-filter: blur(20px);
}

/* Dark: detail items */
[data-theme="dark"] .detail-item {
    background: rgba(15,20,40,0.6) !important;
    border-color: rgba(99,102,241,0.15) !important;
}
[data-theme="dark"] .detail-clarity    { border-left-color: #818cf8 !important; }
[data-theme="dark"] .detail-structure  { border-left-color: #a78bfa !important; }
[data-theme="dark"] .detail-confidence { border-left-color: #34d399 !important; }
[data-theme="dark"] .detail-relevance  { border-left-color: #fbbf24 !important; }
[data-theme="dark"] .detail-vocabulary { border-left-color: #60a5fa !important; }
[data-theme="dark"] .detail-fluency    { border-left-color: #22d3ee !important; }

/* Dark: feedback detail item */
[data-theme="dark"] .feedback-detail-item {
    background: rgba(15,20,40,0.6) !important;
    border-left-color: var(--primary) !important;
}

/* Dark: tab buttons */
[data-theme="dark"] .tab, [data-theme="dark"] .tab-btn {
    background: rgba(15,20,40,0.6) !important;
    border-color: rgba(99,102,241,0.2) !important;
    color: var(--text-muted) !important;
}
[data-theme="dark"] .tab.active, [data-theme="dark"] .tab-btn.active,
[data-theme="dark"] .tab:hover,  [data-theme="dark"] .tab-btn:hover {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: white !important;
    box-shadow: 0 0 12px rgba(129,140,248,0.3) !important;
}

/* Dark: hiring badge */
[data-theme="dark"] .hire-great { background: rgba(52,211,153,0.12) !important; border-color: rgba(52,211,153,0.3) !important; color: #34d399 !important; }
[data-theme="dark"] .hire-good  { background: rgba(129,140,248,0.12) !important; border-color: rgba(129,140,248,0.3) !important; color: #818cf8 !important; }
[data-theme="dark"] .hire-ok    { background: rgba(251,191,36,0.12) !important; border-color: rgba(251,191,36,0.3) !important; color: #fbbf24 !important; }
[data-theme="dark"] .hire-no    { background: rgba(248,113,113,0.12) !important; border-color: rgba(248,113,113,0.3) !important; color: #f87171 !important; }

/* Dark: iw session answer cards */
[data-theme="dark"] .btn-rec-start {
    background: rgba(239,68,68,0.15) !important;
    border-color: rgba(248,113,113,0.3) !important;
    color: #f87171 !important;
}
[data-theme="dark"] .btn-rec-stop {
    background: rgba(52,211,153,0.12) !important;
    border-color: rgba(52,211,153,0.3) !important;
    color: #34d399 !important;
}
[data-theme="dark"] .btn-rec-pause {
    background: rgba(251,191,36,0.12) !important;
    border-color: rgba(251,191,36,0.3) !important;
    color: #fbbf24 !important;
}
[data-theme="dark"] .btn-rec-resume {
    background: rgba(52,211,153,0.12) !important;
    border-color: rgba(52,211,153,0.3) !important;
    color: #34d399 !important;
}

/* Dark: pause overlay */
[data-theme="dark"] .pause-overlay {
    background: rgba(251,191,36,0.08) !important;
    border-color: rgba(251,191,36,0.25) !important;
}
[data-theme="dark"] .pause-text { color: #fbbf24 !important; }

/* Dark: proc steps */
[data-theme="dark"] .proc-step {
    background: rgba(15,20,40,0.6) !important;
    border-color: rgba(99,102,241,0.2) !important;
}
[data-theme="dark"] .step-done    { background: rgba(52,211,153,0.12) !important; border-color: rgba(52,211,153,0.3) !important; }
[data-theme="dark"] .step-loading { background: rgba(99,102,241,0.12) !important; border-color: rgba(129,140,248,0.3) !important; }

/* Dark: cta section */
[data-theme="dark"] .cta-box {
    background: linear-gradient(135deg,
        rgba(99,102,241,0.3),
        rgba(139,92,246,0.2)) !important;
    border: 1px solid rgba(129,140,248,0.25) !important;
    backdrop-filter: blur(20px) !important;
}

/* Dark: hero badge */
[data-theme="dark"] .hero-badge {
    background: rgba(99,102,241,0.15) !important;
    color: var(--primary) !important;
    border: 1px solid rgba(129,140,248,0.3);
}

/* Dark: interview modal overlay */
[data-theme="dark"] .iw-modal-overlay { background: rgba(0,0,0,0.75) !important; }

/* Dark: position cards */
[data-theme="dark"] .position-card,
[data-theme="dark"] .qty-card,
[data-theme="dark"] .lang-card {
    background: rgba(15,20,40,0.6) !important;
    border-color: rgba(99,102,241,0.2) !important;
    color: var(--text) !important;
}
[data-theme="dark"] .position-card.selected,
[data-theme="dark"] .qty-card.selected,
[data-theme="dark"] .lang-card.selected {
    background: rgba(99,102,241,0.2) !important;
    border-color: var(--primary) !important;
}
[data-theme="dark"] .position-card:hover,
[data-theme="dark"] .qty-card:hover,
[data-theme="dark"] .lang-card:hover {
    background: rgba(99,102,241,0.15) !important;
    border-color: var(--primary) !important;
}
[data-theme="dark"] .qty-num { color: var(--primary) !important; }

/* Dark: auth page background */
[data-theme="dark"] .auth-page {
    background: transparent;
}

/* Dark: nav brand */
[data-theme="dark"] .nav-brand { color: var(--text) !important; }

/* Dark: btn-logout */
[data-theme="dark"] .btn-logout {
    border-color: rgba(99,102,241,0.25) !important;
    color: var(--text-muted) !important;
}
[data-theme="dark"] .btn-logout:hover {
    border-color: #f87171 !important;
    color: #f87171 !important;
}

/* Dark: btn-end-session wawancara */
[data-theme="dark"] .btn-end-session {
    background: rgba(239,68,68,0.12) !important;
    border-color: rgba(248,113,113,0.25) !important;
    color: #f87171 !important;
}
[data-theme="dark"] .btn-end-session:not(:disabled):hover {
    background: #ef4444 !important;
    color: white !important;
}

/* Dark: score circles */
[data-theme="dark"] .score-high { background: rgba(52,211,153,0.12) !important; color: #34d399 !important; }
[data-theme="dark"] .score-mid  { background: rgba(251,191,36,0.12) !important; color: #fbbf24 !important; }
[data-theme="dark"] .score-low  { background: rgba(248,113,113,0.12) !important; color: #f87171 !important; }
[data-theme="dark"] .ans-high   { background: rgba(52,211,153,0.12) !important; color: #34d399 !important; }
[data-theme="dark"] .ans-mid    { background: rgba(251,191,36,0.12) !important; color: #fbbf24 !important; }
[data-theme="dark"] .ans-low    { background: rgba(248,113,113,0.12) !important; color: #f87171 !important; }

/* ============ FOOTER ============ */
.footer {
    text-align: center;
    padding: 24px;
    border-top: 1px solid var(--border);
    font-size: 0.8rem; color: var(--text-muted);
    background: var(--surface);
}
.footer-sub { margin-top: 4px; opacity: 0.7; }

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
    .hero-result { flex-direction: column; text-align: center; }
    .hero-meta   { justify-content: center; }
    .two-col-grid { grid-template-columns: 1fr; }
    .audio-counters { grid-template-columns: 1fr; }
    .audio-chars    { grid-template-columns: 1fr; }
    .detail-grid    { grid-template-columns: 1fr; }
    .hero-stats  { gap: 16px; }
    .stat-divider{ display: none; }
    .nav-user .user-greeting { display: none; }
    .record-controls { flex-direction: column; }
    .action-row  { flex-direction: column; align-items: center; }
    .big-score-ring { width: 120px; height: 120px; }
    .ring-num    { font-size: 2rem; }
}
/* ============================================================
   SPEAKUP — MOBILE-FIRST RESPONSIVE OVERHAUL
   Hamburger Nav + Full Mobile/Tablet Responsiveness
   ============================================================ */

/* ── HAMBURGER BUTTON ── */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px; height: 40px;
    background: none;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    padding: 8px;
    z-index: 201;
    transition: border-color 0.3s, background 0.3s;
    flex-shrink: 0;
}
.hamburger:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}
[data-theme="dark"] .hamburger {
    border-color: rgba(99,102,241,0.3);
}
[data-theme="dark"] .hamburger:hover {
    border-color: var(--primary);
    background: rgba(99,102,241,0.12);
}

/* Three animated bars */
.hamburger-bar {
    display: block;
    width: 18px; height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.35s cubic-bezier(.4,0,.2,1),
                opacity 0.25s ease,
                width 0.3s ease;
    transform-origin: center;
}

/* Animate to X when open */
.hamburger.open .hamburger-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.hamburger.open .hamburger-bar:nth-child(2) {
    opacity: 0;
    width: 0;
}
.hamburger.open .hamburger-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ── MOBILE OVERLAY ── */
.nav-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 199;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.nav-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* ── MOBILE NAV DRAWER ── */
.mobile-nav {
    position: fixed;
    top: 0; right: 0;
    width: min(320px, 85vw);
    height: 100dvh;
    background: var(--surface);
    border-left: 1px solid var(--border);
    z-index: 200;
    padding: 0;
    transform: translateX(110%);
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.4s cubic-bezier(.4,0,.2,1),
                visibility 0s linear 0.4s;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: -8px 0 40px rgba(0,0,0,0.15);
}
[data-theme="dark"] .mobile-nav {
    background: rgba(8,11,20,0.97);
    border-left-color: rgba(99,102,241,0.2);
    backdrop-filter: blur(20px);
}
.mobile-nav.open {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
    transition: transform 0.4s cubic-bezier(.4,0,.2,1),
                visibility 0s linear 0s;
}

/* Mobile nav header */
.mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--border);
}
[data-theme="dark"] .mobile-nav-header {
    border-bottom-color: rgba(99,102,241,0.15);
}
.mobile-nav-brand {
    display: flex; align-items: center; gap: 8px;
    font-weight: 800; font-size: 1.15rem;
    text-decoration: none; color: var(--text);
}
.mobile-nav-brand .brand-name { color: var(--primary); }
.mobile-nav-close {
    width: 32px; height: 32px;
    background: var(--primary-light);
    border: none; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 1rem; color: var(--primary);
    transition: background 0.2s, transform 0.2s;
}
.mobile-nav-close:hover { background: var(--primary); color: white; transform: rotate(90deg); }

/* Mobile nav user section */
.mobile-nav-user {
    padding: 16px 20px;
    background: var(--primary-light);
    margin: 16px 16px 8px;
    border-radius: var(--radius);
    display: flex; align-items: center; gap: 12px;
}
[data-theme="dark"] .mobile-nav-user {
    background: rgba(99,102,241,0.1);
    border: 1px solid rgba(99,102,241,0.15);
}
.mobile-nav-avatar {
    width: 40px; height: 40px;
    background: var(--primary);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; color: white; font-weight: 700;
    flex-shrink: 0;
}
.mobile-nav-username {
    font-weight: 700; font-size: 0.9rem; color: var(--text);
}
.mobile-nav-role {
    font-size: 0.75rem; color: var(--text-muted); margin-top: 1px;
}

/* Mobile nav links */
.mobile-nav-links {
    padding: 8px 12px;
}
.mobile-nav-links a,
.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 12px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
    font-size: 0.95rem;
    transition: background 0.2s, color 0.2s, transform 0.15s;
    margin-bottom: 2px;
    position: relative;
}
.mobile-nav-links a:hover,
.mobile-nav-link:hover {
    background: var(--primary-light);
    color: var(--primary);
    transform: translateX(4px);
}
[data-theme="dark"] .mobile-nav-links a:hover,
[data-theme="dark"] .mobile-nav-link:hover {
    background: rgba(99,102,241,0.12);
}
.mobile-nav-links a.active,
.mobile-nav-link.active {
    background: var(--primary-light);
    color: var(--primary);
}
[data-theme="dark"] .mobile-nav-links a.active {
    background: rgba(99,102,241,0.15);
}
.mobile-nav-icon {
    font-size: 1.1rem; width: 24px; text-align: center; flex-shrink: 0;
}
.mobile-nav-arrow {
    margin-left: auto;
    opacity: 0.3;
    transition: opacity 0.2s, transform 0.2s;
    font-size: 0.8rem;
}
.mobile-nav-links a:hover .mobile-nav-arrow { opacity: 1; transform: translateX(4px); }

/* Divider in mobile nav */
.mobile-nav-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 20px;
}
[data-theme="dark"] .mobile-nav-divider {
    background: rgba(99,102,241,0.12);
}

/* Mobile nav section label */
.mobile-nav-section {
    padding: 10px 20px 4px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* Mobile nav theme toggle row */
.mobile-nav-theme {
    display: flex; align-items: center;
    justify-content: space-between;
    padding: 13px 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 2px;
}
.mobile-nav-theme-label {
    display: flex; align-items: center; gap: 12px;
    font-weight: 600; font-size: 0.95rem; color: var(--text);
}

/* Mobile logout button */
.mobile-nav-logout {
    width: calc(100% - 24px);
    margin: 8px 12px;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px;
    background: none;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.9rem; font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}
.mobile-nav-logout:hover {
    border-color: var(--danger);
    color: var(--danger);
    background: rgba(239,68,68,0.05);
}
[data-theme="dark"] .mobile-nav-logout:hover {
    border-color: #f87171;
    color: #f87171;
    background: rgba(248,113,113,0.08);
}

/* Stagger animation for mobile nav links */
.mobile-nav.open .mobile-nav-links a,
.mobile-nav.open .mobile-nav-link,
.mobile-nav.open .mobile-nav-user,
.mobile-nav.open .mobile-nav-theme,
.mobile-nav.open .mobile-nav-logout {
    animation: navItemIn 0.3s ease both;
}
.mobile-nav.open .mobile-nav-user            { animation-delay: 0.05s; }
.mobile-nav.open .mobile-nav-links a:nth-child(1) { animation-delay: 0.1s; }
.mobile-nav.open .mobile-nav-links a:nth-child(2) { animation-delay: 0.13s; }
.mobile-nav.open .mobile-nav-links a:nth-child(3) { animation-delay: 0.16s; }
.mobile-nav.open .mobile-nav-theme           { animation-delay: 0.19s; }
.mobile-nav.open .mobile-nav-logout          { animation-delay: 0.22s; }

@keyframes navItemIn {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ── SHOW ON MOBILE ── */
@media (max-width: 768px) {
    .hamburger      { display: flex; }
    /* mobile-nav and nav-overlay always rendered, controlled via visibility/pointer-events */

    /* Hide desktop nav elements */
    .nav-links      { display: none !important; }
    .nav-user       { display: none !important; }

    /* Tighten nav container */
    .nav-container  { padding: 0 16px; height: 58px; }

    /* Flash messages on mobile */
    .flash-container { top: 64px; right: 12px; left: 12px; right: 12px; }
    .flash { font-size: 0.82rem; padding: 10px 14px; }
}

/* ======================================================
   GLOBAL MOBILE LAYOUT FIXES
   ====================================================== */
@media (max-width: 768px) {

    /* Page container */
    .page-container { padding: 20px 16px; }
    .page-container.narrow { padding: 20px 16px; }
    .container { padding: 0 16px; }

    /* Page header: stack on mobile */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
        margin-bottom: 24px;
    }
    .page-header .btn-primary { width: 100%; justify-content: center; }
    .page-title   { font-size: 1.4rem; }
    .page-subtitle { font-size: 0.875rem; }

    /* ── STATS GRID: 2 columns on phone ── */
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        margin-bottom: 24px;
    }
    .stat-card { padding: 14px 12px; gap: 10px; }
    .stat-card-icon { font-size: 1.5rem; }
    .stat-card-num  { font-size: 1.35rem; }
    .stat-card-label { font-size: 0.72rem; }

    /* ── CATEGORY GRID: 2 columns ── */
    .category-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    .category-card { padding: 14px 12px; }
    .cat-icon { font-size: 1.3rem; }
    .cat-name { font-size: 0.82rem; }
    .cat-desc { font-size: 0.7rem; }

    /* ── CATEGORY LARGE GRID ── */
    .category-grid-large { grid-template-columns: 1fr; gap: 14px; }

    /* ── SESSIONS LIST ── */
    .session-item {
        flex-wrap: wrap;
        padding: 14px 14px;
        gap: 10px;
    }
    .session-info { flex: 1; min-width: 0; }
    .session-title { font-size: 0.875rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .session-meta { flex-wrap: wrap; gap: 6px; }

    /* ── SECTION ── */
    .section { margin-bottom: 28px; }
    .section-heading { font-size: 1.1rem; }

    /* ── EMPTY STATE ── */
    .empty-state { padding: 40px 16px; }
    .empty-icon  { font-size: 3rem; }
    .empty-state h3 { font-size: 1.1rem; }

    /* ── HERO (landing) ── */
    .hero { padding: 52px 20px 40px; }
    .hero-title { font-size: clamp(1.65rem, 8vw, 2.5rem); }
    .hero-desc  { font-size: 0.95rem; }
    .hero-actions { flex-direction: column; gap: 10px; align-items: stretch; }
    .btn-hero-primary,
    .btn-hero-secondary { text-align: center; padding: 13px 24px; }
    .hero-stats { gap: 16px; margin-top: 0; }
    .stat-divider { display: none; }

    /* ── FEATURES / STEPS ── */
    .features { padding: 48px 0; }
    .section-title { font-size: 1.3rem; margin-bottom: 28px; }
    .steps-grid { grid-template-columns: 1fr; gap: 12px; }
    .step-card { padding: 20px; }

    /* ── CTA ── */
    .cta-section { padding: 32px 0; }
    .cta-box { padding: 36px 20px; border-radius: var(--radius-sm); }
    .cta-box h2 { font-size: 1.3rem; }

    /* ── AUTH PAGES ── */
    .auth-page { padding: 24px 16px; align-items: flex-start; padding-top: 40px; }
    .auth-card { padding: 28px 20px; border-radius: var(--radius); }

    /* ── RESULT PAGE ── */
    .hero-result {
        flex-direction: column;
        text-align: center;
        padding: 20px 16px;
        gap: 20px;
    }
    .hero-left { order: 1; }
    .hero-score-block { order: 0; }
    .hero-meta { justify-content: center; flex-wrap: wrap; gap: 6px; }
    .hero-topic { font-size: 1.1rem; }
    .hero-ai-tag { font-size: 0.78rem; }

    .two-col-grid { grid-template-columns: 1fr; gap: 16px; }
    .audio-counters { grid-template-columns: 1fr; gap: 10px; }
    .audio-chars    { grid-template-columns: 1fr 1fr; gap: 10px; }
    .detail-grid    { grid-template-columns: 1fr; gap: 12px; }

    .score-bars { gap: 14px; }
    .bar-label-row { gap: 4px; }
    .bar-name { font-size: 0.82rem; }
    .bar-hint { display: none; }

    .action-row {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .action-row .btn-primary,
    .action-row .btn-secondary,
    .action-row .btn-outline {
        width: 100%; justify-content: center;
    }

    /* Radar chart */
    .radar-wrap { max-width: 260px; margin: 0 auto; }
    .big-score-ring { width: 110px; height: 110px; }
    .ring-num { font-size: 1.8rem; }

    /* Tab row */
    .tab-row { flex-wrap: wrap; gap: 6px; }
    .tab { font-size: 0.8rem; padding: 6px 12px; }

    /* Transcript */
    .transcript { font-size: 0.85rem; line-height: 1.7; }

    /* Breadcrumb */
    .breadcrumb { font-size: 0.78rem; flex-wrap: wrap; gap: 4px; }

    /* ── HISTORY PAGE ── */
    .filter-bar {
        flex-wrap: wrap;
        gap: 6px;
        margin-bottom: 20px;
    }
    .filter-btn { font-size: 0.78rem; padding: 5px 12px; }

    .session-row {
        flex-wrap: wrap;
        padding: 14px;
        gap: 10px;
    }
    .sr-info { flex: 1; min-width: 0; }
    .sr-title { font-size: 0.875rem; }
    .sr-meta  { flex-wrap: wrap; gap: 5px; font-size: 0.75rem; }
    .sr-scores-mini { gap: 8px; font-size: 0.8rem; }
    .sr-actions { width: 100%; display: flex; gap: 8px; }
    .sr-actions .btn-sm { flex: 1; justify-content: center; }

    /* Chart big card */
    .chart-big-card { padding: 18px 14px; }
    .chart-stats { gap: 12px; }
    .cs-num { font-size: 1.3rem; }

    /* Pagination */
    .pagination { gap: 12px; font-size: 0.85rem; flex-wrap: wrap; justify-content: center; }
    .page-btn { font-size: 0.82rem; padding: 7px 14px; }

    /* ── SETUP PAGE (interview) ── */
    .iw-setup-header { padding: 0 0 16px; }
    .iw-setup-header h1 { font-size: 1.4rem; }
    .iw-steps { gap: 10px; }
    .iw-step { font-size: 0.875rem; }
    .position-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .position-card { padding: 12px 8px; }
    .pos-icon  { font-size: 1.4rem; }
    .pos-label { font-size: 0.78rem; }
    .qty-row { gap: 8px; }
    .qty-card { padding: 12px 8px; }
    .qty-num { font-size: 1.2rem; }
    .lang-row { gap: 8px; }
    .lang-card { font-size: 0.875rem; }
    .btn-start-iw { font-size: 0.95rem; }

    /* ── RECORD PAGE ── */
    .record-controls { flex-direction: column; gap: 10px; align-items: stretch; }
    .record-controls button { width: 100%; justify-content: center; }

    /* ── AI AGENT FAB ── */
    .agent-fab {
        bottom: 16px; right: 16px;
        padding: 10px 14px;
        font-size: 0.82rem;
    }
    .fab-label { display: none; } /* icon only on tiny screens */

    /* Agent chat popup */
    .agent-chat {
        right: 0; bottom: 0;
        width: 100vw;
        max-width: 100vw;
        border-radius: var(--radius) var(--radius) 0 0;
        max-height: 88dvh;
    }
    .ac-messages { max-height: 38dvh; }
    .ac-textarea { font-size: 0.9rem; }

    /* ── Interview per-answer ── */
    .iw-per-ans-list { gap: 10px; }
    .iw-ans-header { padding: 12px 14px; }
    .iw-ans-q { font-size: 0.85rem; }
    .iw-ans-body { padding: 14px; }

    /* ── Hire rec badge ── */
    .hire-rec-badge { font-size: 0.8rem; padding: 7px 14px; }
    .hire-reason    { font-size: 0.82rem; }

    /* ── Suggest/prose items ── */
    .suggest-item { font-size: 0.875rem; }
    .prose-item   { font-size: 0.875rem; }

    /* ── Cards ── */
    .card { padding: 18px 14px; }
    .card-header h2 { font-size: 1rem; }
    .card-icon { font-size: 1.1rem; }

    /* ── Audio counter cards ── */
    .counter-card { padding: 14px; }
    .cc-num { font-size: 1.6rem; }

    /* Score circle small */
    .score-circle-sm { width: 38px; height: 38px; font-size: 0.85rem; }

    /* Form adjustments */
    .form-group input,
    .form-group textarea { font-size: 16px; } /* prevent iOS zoom */
}

/* ======================================================
   TABLET (769–1024px)
   ====================================================== */
@media (min-width: 769px) and (max-width: 1024px) {

    .nav-container { padding: 0 20px; }

    .page-container { padding: 24px 20px; }
    .container { padding: 0 20px; }

    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .category-grid { grid-template-columns: repeat(3, 1fr); }
    .category-grid-large { grid-template-columns: repeat(2, 1fr); }
    .steps-grid { grid-template-columns: repeat(2, 1fr); }
    .two-col-grid { grid-template-columns: 1fr; }

    .auth-card { padding: 36px 28px; }
    .position-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ======================================================
   EXTRA SMALL (max 375px — iPhone SE, small Androids)
   ====================================================== */
@media (max-width: 375px) {
    .category-grid { grid-template-columns: 1fr; }
    .stats-grid    { grid-template-columns: 1fr 1fr; }
    .audio-chars   { grid-template-columns: 1fr; }
    .position-grid { grid-template-columns: 1fr 1fr; }
    .auth-card     { padding: 24px 14px; }
    .hero-title    { font-size: 1.5rem; }
    .page-title    { font-size: 1.25rem; }

    .agent-fab { bottom: 12px; right: 12px; }
}

/* ======================================================
   LARGE SCREENS — ensure max-width is respected
   ====================================================== */
@media (min-width: 1025px) {
    .hamburger   { display: none !important; }
    .mobile-nav  { visibility: hidden !important; pointer-events: none !important; transform: translateX(110%) !important; }
    .nav-overlay { opacity: 0 !important; pointer-events: none !important; }
}

/* ======================================================
   SAFE AREA (iPhone notch / home indicator)
   ====================================================== */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .agent-chat {
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }
    .mobile-nav {
        padding-bottom: env(safe-area-inset-bottom);
    }
    .footer {
        padding-bottom: max(24px, env(safe-area-inset-bottom));
    }
}

/* ======================================================
   TOUCH IMPROVEMENTS — bigger tap targets
   ====================================================== */
@media (hover: none) and (pointer: coarse) {
    .btn-sm, .filter-btn, .page-btn { min-height: 40px; }
    .nav-link { min-height: 44px; display: flex; align-items: center; }
    .chip { min-height: 38px; }
    .tab  { min-height: 38px; }
    .category-card:hover { transform: none; } /* no hover lift on touch */
    .step-card:hover     { transform: none; }
    .category-card:active { transform: scale(0.98); }
    .step-card:active     { transform: scale(0.98); }
}

/* ======================================================
   DARK MODE: Mobile nav extras
   ====================================================== */
[data-theme="dark"] .hamburger-bar { background: var(--text); }
[data-theme="dark"] .mobile-nav-close {
    background: rgba(99,102,241,0.15);
    color: var(--primary);
}
[data-theme="dark"] .mobile-nav-close:hover {
    background: var(--primary);
    color: white;
}


/* ── btn-primary-sm (missing @extend fix) ── */
.btn-primary-sm {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--primary); color: white;
    padding: 6px 14px; border-radius: var(--radius-sm);
    font-weight: 600; font-size: 0.82rem;
    text-decoration: none; border: none; cursor: pointer;
    transition: all 0.2s;
}
.btn-primary-sm:hover { background: var(--primary-dark); }

/* ── Mobile nav: keep theme toggle minimal inside drawer ── */
.mobile-nav .theme-toggle .toggle-label { display: none; }
.mobile-nav .theme-toggle { margin-left: auto; }

/* ── Smooth body scroll lock ── */
body.nav-open { overflow: hidden; }