/* ==============================================
   INTEGRISCAN — Modern Design System
   ============================================== */

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

/* ===== THEME VARIABLES ===== */
:root {
    /* Brand */
    --brand: #6366f1;
    --brand-hover: #4f46e5;
    --brand-light: #e0e7ff;
    --brand-lighter: #eef2ff;
    --brand-dark: #4338ca;
    --accent: #ec4899;
    --accent-light: #fce7f3;

    /* Light mode base */
    --bg: #fafafa;
    --bg-elevated: #ffffff;
    --bg-subtle: #f4f4f5;
    --bg-hover: #f1f5f9;
    --surface: #ffffff;
    --surface-2: #f8fafc;

    /* Text */
    --text: #09090b;
    --text-2: #27272a;
    --text-3: #52525b;
    --text-4: #a1a1aa;
    --text-inverse: #ffffff;

    /* Borders */
    --border: #e4e4e7;
    --border-strong: #d4d4d8;
    --border-subtle: #f1f5f9;

    /* Semantic */
    --success: #10b981;
    --success-light: #d1fae5;
    --success-bg: #ecfdf5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --warning-bg: #fffbeb;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --danger-bg: #fef2f2;
    --info: #0ea5e9;
    --info-light: #e0f2fe;
    --purple: #8b5cf6;
    --purple-light: #ede9fe;

    /* Grade colors */
    --grade-a: #10b981;
    --grade-a-bg: #d1fae5;
    --grade-b: #6366f1;
    --grade-b-bg: #e0e7ff;
    --grade-c: #f59e0b;
    --grade-c-bg: #fef3c7;
    --grade-d: #ef4444;
    --grade-d-bg: #fee2e2;

    /* Radii */
    --r-xs: 6px;
    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 16px;
    --r-xl: 24px;
    --r-full: 9999px;

    /* Shadows */
    --sh-xs: 0 1px 2px rgba(0,0,0,0.04);
    --sh-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --sh-md: 0 4px 6px -1px rgba(0,0,0,0.06), 0 2px 4px -2px rgba(0,0,0,0.04);
    --sh-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
    --sh-xl: 0 20px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04);
    --sh-2xl: 0 25px 50px -12px rgba(0,0,0,0.15);
    --sh-glow: 0 0 0 3px rgba(99,102,241,0.15);

    /* Transitions */
    --t-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --t: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --t-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);

    /* Gradients */
    --grad-brand: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
    --grad-hero: linear-gradient(135deg, #1e1b4b 0%, #312e81 30%, #4338ca 60%, #6366f1 100%);
    --grad-surface: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

/* Dark mode */
[data-theme="dark"] {
    --bg: #09090b;
    --bg-elevated: #18181b;
    --bg-subtle: #1a1a1d;
    --bg-hover: #27272a;
    --surface: #18181b;
    --surface-2: #1a1a1d;

    --text: #fafafa;
    --text-2: #e4e4e7;
    --text-3: #a1a1aa;
    --text-4: #71717a;
    --text-inverse: #09090b;

    --border: #27272a;
    --border-strong: #3f3f46;
    --border-subtle: #1a1a1d;

    --brand-light: rgba(99,102,241,0.15);
    --brand-lighter: rgba(99,102,241,0.08);

    --success-light: rgba(16,185,129,0.15);
    --success-bg: rgba(16,185,129,0.05);
    --warning-light: rgba(245,158,11,0.15);
    --warning-bg: rgba(245,158,11,0.05);
    --danger-light: rgba(239,68,68,0.15);
    --danger-bg: rgba(239,68,68,0.05);
    --purple-light: rgba(139,92,246,0.15);
    --info-light: rgba(14,165,233,0.15);

    --grade-a-bg: rgba(16,185,129,0.15);
    --grade-b-bg: rgba(99,102,241,0.15);
    --grade-c-bg: rgba(245,158,11,0.15);
    --grade-d-bg: rgba(239,68,68,0.15);

    --sh-xs: 0 1px 2px rgba(0,0,0,0.3);
    --sh-sm: 0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
    --sh-md: 0 4px 6px -1px rgba(0,0,0,0.5), 0 2px 4px -2px rgba(0,0,0,0.4);
    --sh-lg: 0 10px 15px -3px rgba(0,0,0,0.5), 0 4px 6px -4px rgba(0,0,0,0.4);
    --sh-xl: 0 20px 25px -5px rgba(0,0,0,0.6), 0 8px 10px -6px rgba(0,0,0,0.4);

    --grad-surface: linear-gradient(180deg, #1a1a1d 0%, #18181b 100%);
    --grad-hero: linear-gradient(135deg, #0f0e1f 0%, #1e1b4b 30%, #312e81 60%, #4338ca 100%);
}

/* ===== BASE ===== */
html { scroll-behavior: smooth; }

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

::selection { background: var(--brand); color: white; }

.hidden { display: none !important; }
.view.hidden { display: none !important; }

button { font-family: inherit; cursor: pointer; }

input, textarea, select, button { font-family: inherit; }

/* Custom scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-4); }

/* ===== NAVBAR ===== */
.navbar {
    background: rgba(255,255,255,0.8);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background-color var(--t);
}

[data-theme="dark"] .navbar {
    background: rgba(9,9,11,0.8);
}

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

.nav-left { display: flex; align-items: center; gap: 36px; flex: 1; }

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
    transition: transform var(--t-fast);
}
.logo:hover { transform: scale(1.02); }

.logo-icon-wrap {
    width: 32px; height: 32px;
    border-radius: 8px;
    background: var(--grad-brand);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}

.logo-text {
    font-size: 19px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: var(--grad-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links { display: flex; gap: 4px; }

.nav-link {
    text-decoration: none;
    color: var(--text-3);
    font-size: 13px;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: var(--r-sm);
    transition: all var(--t-fast);
    position: relative;
}

.nav-link:hover { color: var(--text); background: var(--bg-hover); }
.nav-link.active { color: var(--brand); background: var(--brand-light); }

/* Earn Money nav link — stands out with gold gradient + subtle pulse */
.nav-link.nav-link-earn {
    background: linear-gradient(135deg, rgba(251,191,36,0.12), rgba(245,158,11,0.08));
    color: #b45309;
    font-weight: 800;
    border: 1px solid rgba(251,191,36,0.35);
    padding: 7px 14px;
    position: relative;
    overflow: hidden;
}
.nav-link.nav-link-earn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 30%, rgba(251,191,36,0.25) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.8s;
    pointer-events: none;
}
.nav-link.nav-link-earn:hover {
    background: linear-gradient(135deg, rgba(251,191,36,0.2), rgba(245,158,11,0.14));
    color: #92400e;
    border-color: rgba(251,191,36,0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(251,191,36,0.25);
}
.nav-link.nav-link-earn:hover::before { transform: translateX(100%); }

[data-theme="dark"] .nav-link.nav-link-earn {
    color: #fbbf24;
    background: linear-gradient(135deg, rgba(251,191,36,0.12), rgba(245,158,11,0.06));
}
[data-theme="dark"] .nav-link.nav-link-earn:hover {
    color: #fde047;
    background: linear-gradient(135deg, rgba(251,191,36,0.2), rgba(245,158,11,0.1));
}

/* Emphasize the "Sign Up Free" CTA — it's the primary action for new visitors */
.btn-primary-sm {
    position: relative;
    overflow: hidden;
}
.btn-primary-sm::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.3) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.7s;
    pointer-events: none;
}
.btn-primary-sm:hover::after { transform: translateX(100%); }

/* Emphasize hero badge — subtle glow so it reads as "notice me" */
.hero-scanner .hero-badge {
    box-shadow: 0 0 24px rgba(255,255,255,0.15), inset 0 1px 0 rgba(255,255,255,0.2);
    font-weight: 700;
}

/* "enchantly" brand word — solid gradient (no italic; italic y descender was clipping) */
.hero-scanner h1 .gradient-text {
    background: linear-gradient(135deg, #a5b4fc 0%, #c4b5fd 40%, #f0abfc 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 900;
    display: inline-block;
    padding-bottom: 4px;
}

.nav-right { display: flex; align-items: center; gap: 10px; }

.nav-xp-badge {
    font-size: 11px;
    font-weight: 800;
    color: white;
    background: var(--grad-brand);
    padding: 4px 10px;
    border-radius: var(--r-full);
    box-shadow: 0 2px 6px rgba(99,102,241,0.3);
}

.nav-xp-bar-wrap {
    width: 80px;
    height: 6px;
    background: var(--border);
    border-radius: var(--r-full);
    overflow: hidden;
}

.nav-xp-bar {
    height: 100%;
    background: var(--grad-brand);
    border-radius: var(--r-full);
    transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-username {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Theme toggle */
.theme-toggle {
    width: 36px;
    height: 36px;
    border-radius: var(--r-sm);
    background: var(--bg-hover);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-3);
    transition: all var(--t-fast);
}

.theme-toggle:hover {
    color: var(--brand);
    border-color: var(--brand);
    transform: rotate(15deg);
}

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

/* ===== BUTTONS ===== */
.btn-primary, .btn-outline, .btn-ghost, .btn-primary-sm, .btn-primary-full, .btn-outline-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--r-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--t-fast);
    border: none;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--grad-brand);
    color: white;
    box-shadow: 0 2px 8px rgba(99,102,241,0.25);
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(99,102,241,0.4);
}
.btn-primary:active { transform: translateY(0); }

.btn-primary-sm {
    padding: 7px 14px;
    font-size: 13px;
    background: var(--brand);
    color: white;
}
.btn-primary-sm:hover { background: var(--brand-hover); }

.btn-primary-full {
    width: 100%;
    padding: 12px;
    background: var(--grad-brand);
    color: white;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(99,102,241,0.25);
}
.btn-primary-full:hover { box-shadow: 0 4px 14px rgba(99,102,241,0.4); }
.btn-primary-full:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-outline, .btn-outline-sm {
    background: var(--surface);
    color: var(--text-2);
    border: 1px solid var(--border-strong);
}
.btn-outline:hover, .btn-outline-sm:hover {
    background: var(--bg-hover);
    border-color: var(--text-4);
    color: var(--text);
}

.btn-outline-sm { padding: 7px 14px; font-size: 13px; }

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

.btn-text {
    background: none;
    border: none;
    color: var(--text-3);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    transition: color var(--t-fast);
}
.btn-text:hover { color: var(--danger); }

/* ===== HERO ===== */
.hero {
    background: var(--grad-hero);
    padding: 72px 24px 64px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(99,102,241,0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(236,72,153,0.2) 0%, transparent 50%);
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Ccircle cx='20' cy='20' r='1'/%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.hero-container { max-width: 720px; margin: 0 auto; position: relative; z-index: 1; }

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    color: white;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: var(--r-full);
    margin-bottom: 20px;
    border: 1px solid rgba(255,255,255,0.15);
    animation: fadeInUp 0.6s ease both;
}

/* Hero badge prefix removed — flag emoji doesn't render on Windows */

.hero h1 {
    font-size: 48px;
    font-weight: 900;
    color: white;
    line-height: 1.1;
    margin-bottom: 18px;
    letter-spacing: -1.5px;
    animation: fadeInUp 0.6s 0.1s ease both;
}

.gradient-text {
    background: linear-gradient(135deg, #a5b4fc 0%, #c4b5fd 50%, #f0abfc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

.hero-subtitle {
    font-size: 17px;
    color: rgba(255,255,255,0.85);
    max-width: 560px;
    margin: 0 auto 28px;
    line-height: 1.7;
    animation: fadeInUp 0.6s 0.2s ease both;
}

.hero-features {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 28px;
    flex-wrap: wrap;
    animation: fadeInUp 0.6s 0.3s ease both;
}

.hero-feat {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255,255,255,0.95);
    font-size: 12px;
    font-weight: 600;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    padding: 8px 14px;
    border-radius: var(--r-full);
    border: 1px solid rgba(255,255,255,0.15);
    transition: all var(--t);
}

.hero-feat:hover {
    transform: translateY(-2px);
    background: rgba(255,255,255,0.15);
}

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

/* ===== MAIN CONTENT ===== */
.main-content {
    padding: 0 24px 80px;
    margin-top: -32px;
    position: relative;
    z-index: 2;
}

.container { max-width: 900px; margin: 0 auto; }
.container-lg { max-width: 1000px; margin: 0 auto; padding: 0 24px; }

/* Subject Selector */
.subject-selector {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md) var(--r-md) 0 0;
    padding: 20px 24px;
    box-shadow: var(--sh-lg);
}

.subject-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-2);
    margin-bottom: 12px;
    display: block;
}

.subject-chips { display: flex; gap: 8px; flex-wrap: wrap; }

.subject-chip {
    padding: 8px 16px;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    border-radius: var(--r-full);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-3);
    transition: all var(--t-fast);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.subject-chip:hover {
    border-color: var(--brand);
    color: var(--brand);
    transform: translateY(-1px);
}

.subject-chip.active {
    background: var(--grad-brand);
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}

/* ===== FEATURE GRID (home page) ===== */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-top: -40px;
    position: relative;
    z-index: 5;
    margin-bottom: 60px;
}

.feature-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 28px 24px;
    text-align: left;
    cursor: pointer;
    transition: all var(--t);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    font-family: inherit;
    color: var(--text);
    box-shadow: var(--sh-lg);
    min-height: 200px;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--grad-brand);
    opacity: 0;
    transition: opacity var(--t);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--sh-xl);
    border-color: var(--brand);
}

.feature-card:hover::before { opacity: 1; }

.feature-card-hero {
    grid-column: span 1;
    background: linear-gradient(135deg, var(--brand-lighter), var(--surface));
    border: 2px solid var(--brand);
}

.feature-card-hero::before {
    opacity: 1;
    background: var(--grad-brand);
    height: 4px;
}

.feature-card-gold {
    background: linear-gradient(135deg, rgba(251,191,36,0.08), var(--surface));
    border: 2px solid #f59e0b;
}

.feature-card-gold::before {
    opacity: 1;
    background: linear-gradient(90deg, #fbbf24, #f59e0b, #eab308);
    height: 4px;
}

.feature-card-gold h3 { color: var(--text); }

.feature-icon {
    font-size: 42px;
    margin-bottom: 14px;
    line-height: 1;
}

.feature-card h3 {
    font-size: 18px;
    font-weight: 900;
    margin-bottom: 8px;
    color: var(--text);
    letter-spacing: -0.3px;
}

.feature-card p {
    font-size: 13px;
    color: var(--text-3);
    line-height: 1.6;
    margin-bottom: 16px;
    flex: 1;
}

.feature-cta {
    font-size: 13px;
    font-weight: 800;
    color: var(--brand);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.feature-card-gold .feature-cta { color: #d97706; }

.feature-badge-new, .feature-badge-earn {
    position: absolute;
    top: 14px;
    right: 14px;
    background: var(--grad-brand);
    color: white;
    font-size: 10px;
    font-weight: 900;
    padding: 4px 10px;
    border-radius: 100px;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}

.feature-badge-earn {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #0a0a0f;
    box-shadow: 0 2px 8px rgba(251,191,36,0.4);
    animation: earn-pulse 2s ease-in-out infinite;
}

@keyframes earn-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); }
}

@media (max-width: 900px) {
    .feature-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .feature-grid { grid-template-columns: 1fr; }
    .feature-card { min-height: auto; padding: 24px; }
    .feature-icon { font-size: 36px; }
}

/* Snap Assignment CTA Banner */
.snap-cta-banner {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
    border-radius: var(--r-md);
    padding: 18px 22px;
    margin: 16px 0;
    display: flex;
    align-items: center;
    gap: 16px;
    color: white;
    box-shadow: 0 8px 24px rgba(99,102,241,0.25);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.5s ease;
}
.snap-cta-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Ccircle cx='20' cy='20' r='1.5'/%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}
.snap-cta-icon {
    font-size: 38px;
    flex-shrink: 0;
    position: relative;
    animation: snap-pulse 2.5s ease-in-out infinite;
}
@keyframes snap-pulse {
    0%, 100% { transform: scale(1) rotate(0); }
    50% { transform: scale(1.08) rotate(-3deg); }
}
.snap-cta-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    position: relative;
    min-width: 0;
}
.snap-cta-text strong {
    font-size: 15px;
    font-weight: 800;
    line-height: 1.3;
}
.snap-cta-text span {
    font-size: 12px;
    opacity: 0.9;
    line-height: 1.5;
}
.snap-cta-btn {
    background: white;
    color: var(--brand);
    border: none;
    padding: 10px 18px;
    border-radius: var(--r-sm);
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    font-family: inherit;
    flex-shrink: 0;
    transition: all var(--t-fast);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    position: relative;
    white-space: nowrap;
}
.snap-cta-btn:hover {
    transform: translateY(-1px) scale(1.03);
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
@media (max-width: 600px) {
    .snap-cta-banner { flex-direction: column; text-align: center; padding: 20px; }
    .snap-cta-btn { width: 100%; }
}

/* Tabs */
.tab-container {
    display: flex;
    background: var(--surface);
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    box-shadow: var(--sh-lg);
}

.tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    border: none;
    background: transparent;
    color: var(--text-3);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--t-fast);
    border-bottom: 2px solid transparent;
}

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

.tab.active {
    color: var(--brand);
    border-bottom-color: var(--brand);
    background: var(--brand-lighter);
}

/* Panels */
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: none;
    padding: 28px;
    box-shadow: var(--sh-lg);
}

.text-input {
    width: 100%;
    min-height: 240px;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: 18px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.8;
    resize: vertical;
    color: var(--text);
    background: var(--surface);
    transition: all var(--t-fast);
}

.text-input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: var(--sh-glow);
}

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

.textarea-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-4);
}

.min-notice.ready { color: var(--success); font-weight: 600; }

/* Upload Zone */
.upload-zone {
    border: 2px dashed var(--border-strong);
    border-radius: var(--r-md);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all var(--t);
    background: var(--surface-2);
}

.upload-zone:hover, .upload-zone.drag-over {
    border-color: var(--brand);
    background: var(--brand-lighter);
    transform: scale(1.01);
}

.upload-zone h3 {
    font-size: 16px;
    font-weight: 700;
    margin-top: 14px;
    margin-bottom: 6px;
    color: var(--text);
}

.upload-zone p { font-size: 13px; color: var(--text-3); }

.upload-link { color: var(--brand); font-weight: 700; cursor: pointer; }
.upload-link:hover { text-decoration: underline; }

.upload-formats {
    margin-top: 12px;
    font-size: 11px !important;
    color: var(--text-4) !important;
}

.file-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: 14px 18px;
}

.file-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--r-sm);
    background: var(--brand-light);
    color: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.file-details { flex: 1; display: flex; flex-direction: column; }
.file-name { font-size: 14px; font-weight: 700; color: var(--text); }
.file-size { font-size: 12px; color: var(--text-4); }

.file-remove {
    background: none;
    border: none;
    color: var(--text-4);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--r-xs);
    transition: all var(--t-fast);
}

.file-remove:hover {
    color: var(--danger);
    background: var(--danger-light);
}

/* Context Bar */
.context-bar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: none;
    padding: 14px 28px;
    border-radius: 0 0 var(--r-md) var(--r-md);
    box-shadow: var(--sh-lg);
}

.context-input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--r-xs);
    padding: 11px 14px;
    font-size: 13px;
    color: var(--text);
    background: var(--surface);
    transition: all var(--t-fast);
}
.context-input:focus { outline: none; border-color: var(--brand); box-shadow: var(--sh-glow); }
.context-input::placeholder { color: var(--text-4); }

/* Scan Button */
.scan-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 18px;
    background: var(--grad-brand);
    color: white;
    border: none;
    border-radius: var(--r-md);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--t);
    margin-top: 20px;
    box-shadow: 0 4px 20px rgba(99,102,241,0.35);
    position: relative;
    overflow: hidden;
}

.scan-button::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.2) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.scan-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(99,102,241,0.5);
}
.scan-button:hover::before { transform: translateX(100%); }
.scan-button:active { transform: translateY(0); }

/* ===== LOADING ===== */
.loading-fullpage {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    padding: 24px;
}

.loading-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 48px;
    text-align: center;
    box-shadow: var(--sh-xl);
    max-width: 520px;
    width: 100%;
}

.loading-spinner {
    width: 56px;
    height: 56px;
    border: 4px solid var(--border);
    border-top-color: var(--brand);
    border-radius: 50%;
    margin: 0 auto 24px;
    animation: spin 0.8s linear infinite;
}

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

.loading-card h3 {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--text);
}

.loading-card > p { color: var(--text-3); font-size: 14px; }

.progress-bar {
    width: 100%;
    max-width: 360px;
    height: 8px;
    background: var(--bg-hover);
    border-radius: var(--r-full);
    margin: 24px auto 8px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--grad-brand);
    border-radius: var(--r-full);
    width: 0%;
    transition: width 0.4s ease;
    box-shadow: 0 0 10px rgba(99,102,241,0.5);
}

.progress-percent {
    font-size: 13px;
    font-weight: 800;
    color: var(--brand);
    margin-bottom: 24px;
}

.loading-steps {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 320px;
    margin: 0 auto;
}

.loading-step {
    font-size: 13px;
    color: var(--text-4);
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all var(--t);
    padding: 4px 0;
}

.loading-step.active { color: var(--brand); font-weight: 700; transform: translateX(4px); }
.loading-step.done { color: var(--success); }

.step-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border-strong);
    flex-shrink: 0;
    transition: all var(--t);
}

.loading-step.active .step-dot {
    background: var(--brand);
    box-shadow: 0 0 0 4px rgba(99,102,241,0.2);
    animation: pulse 1.2s infinite;
}

.loading-step.done .step-dot { background: var(--success); }

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(99,102,241,0.2); }
    50% { box-shadow: 0 0 0 8px rgba(99,102,241,0.1); }
}

/* ===== RESULTS ===== */
.results-wrapper { padding: 40px 0 80px; }

.results-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.results-top h2 {
    font-size: 26px;
    font-weight: 900;
    letter-spacing: -0.5px;
    color: var(--text);
}

.results-meta { font-size: 13px; color: var(--text-3); margin-top: 2px; }

.results-top-right { display: flex; gap: 10px; flex-wrap: wrap; }

/* XP Banner */
.xp-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, var(--brand-light), var(--purple-light));
    border: 1px solid var(--brand);
    border-radius: var(--r-md);
    padding: 14px 22px;
    margin-bottom: 24px;
    animation: slideDown 0.5s ease;
}

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

.xp-banner-left {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text);
}

.xp-icon { font-size: 20px; animation: wiggle 0.8s ease; }
@keyframes wiggle {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

.xp-banner-right { font-size: 13px; color: var(--text-2); font-weight: 700; }

/* Grade Hero */
.grade-hero {
    display: flex;
    align-items: center;
    gap: 40px;
    background: var(--grad-surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 36px;
    margin-bottom: 28px;
    box-shadow: var(--sh-lg);
    animation: fadeInUp 0.5s ease;
}

.grade-circle-wrap { flex-shrink: 0; position: relative; }

.grade-circle {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-subtle);
    border: 5px solid var(--border);
    position: relative;
    transition: all var(--t);
}

.grade-circle::before {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    background: var(--grad-brand);
    opacity: 0.15;
    filter: blur(20px);
    z-index: -1;
}

.grade-circle.grade-A { border-color: var(--grade-a); background: var(--grade-a-bg); }
.grade-circle.grade-B { border-color: var(--grade-b); background: var(--grade-b-bg); }
.grade-circle.grade-C { border-color: var(--grade-c); background: var(--grade-c-bg); }
.grade-circle.grade-D { border-color: var(--grade-d); background: var(--grade-d-bg); }

.grade-letter { font-size: 52px; font-weight: 900; line-height: 1; letter-spacing: -2px; }
.grade-circle.grade-A .grade-letter { color: var(--grade-a); }
.grade-circle.grade-B .grade-letter { color: var(--grade-b); }
.grade-circle.grade-C .grade-letter { color: var(--grade-c); }
.grade-circle.grade-D .grade-letter { color: var(--grade-d); }

.grade-percent {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-3);
    margin-top: 2px;
}

.grade-info { flex: 1; }
.grade-info h3 { font-size: 20px; font-weight: 800; margin-bottom: 10px; color: var(--text); }

.grade-summary {
    font-size: 14px;
    color: var(--text-2);
    line-height: 1.7;
    margin-bottom: 14px;
}

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

.grade-tag {
    font-size: 12px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: var(--r-full);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.grade-tag.strength { background: var(--success-light); color: var(--success); }
.grade-tag.weakness { background: var(--warning-light); color: var(--warning); }

/* AI Summary */
.ai-summary-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 28px;
    margin-bottom: 28px;
    box-shadow: var(--sh-sm);
}

.ai-summary-left {
    display: flex;
    align-items: center;
    gap: 24px;
}

.ai-ring-mini-wrap {
    width: 84px;
    height: 84px;
    position: relative;
    flex-shrink: 0;
}

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

.ring-bg-mini { fill: none; stroke: var(--bg-hover); stroke-width: 7; }

.ring-fill-mini {
    fill: none;
    stroke: var(--purple);
    stroke-width: 7;
    stroke-linecap: round;
    stroke-dasharray: 213.63;
    stroke-dashoffset: 213.63;
    transition: stroke-dashoffset 1.5s ease;
    filter: drop-shadow(0 0 4px rgba(139,92,246,0.4));
}

.ai-ring-val {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    font-size: 18px;
    font-weight: 900;
    color: var(--purple);
}

.ai-summary-left h4 { font-size: 16px; font-weight: 800; margin-bottom: 6px; color: var(--text); }
.ai-summary-left p { font-size: 13px; color: var(--text-3); line-height: 1.7; }

/* Section Titles */
.section-title {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 8px;
    margin-top: 16px;
    color: var(--text);
    letter-spacing: -0.3px;
}

.section-title-inline {
    font-size: 17px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    color: var(--text);
}

.section-desc {
    font-size: 13px;
    color: var(--text-3);
    margin-bottom: 20px;
    line-height: 1.6;
}

/* ===== SKILLS GRID ===== */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 36px;
}

.skill-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 22px;
    box-shadow: var(--sh-sm);
    position: relative;
    overflow: hidden;
    transition: all var(--t);
}

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

.skill-card.strongest {
    border-color: var(--success);
    background: linear-gradient(135deg, var(--success-bg), var(--surface));
}

.skill-card.strongest::before {
    content: '⭐ STRONGEST';
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--success);
    color: white;
    font-size: 9px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: var(--r-xs);
    letter-spacing: 0.5px;
    box-shadow: var(--sh-sm);
}

.skill-card.weakest {
    border-color: var(--warning);
    background: linear-gradient(135deg, var(--warning-bg), var(--surface));
}

.skill-card.weakest::before {
    content: '🎯 FOCUS';
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--warning);
    color: white;
    font-size: 9px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: var(--r-xs);
    letter-spacing: 0.5px;
    box-shadow: var(--sh-sm);
}

.skill-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 10px;
}

.skill-grade {
    font-size: 32px;
    font-weight: 900;
    margin-bottom: 2px;
    line-height: 1;
    letter-spacing: -1.5px;
}

.skill-grade.grade-A { color: var(--grade-a); }
.skill-grade.grade-B { color: var(--grade-b); }
.skill-grade.grade-C { color: var(--grade-c); }
.skill-grade.grade-D { color: var(--grade-d); }

.skill-grade-label { font-size: 12px; color: var(--text-3); margin-bottom: 12px; font-weight: 500; }

.skill-bar-wrap {
    height: 8px;
    background: var(--bg-hover);
    border-radius: var(--r-full);
    overflow: hidden;
}

.skill-bar {
    height: 100%;
    border-radius: var(--r-full);
    transition: width 1.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.skill-bar.grade-A { background: linear-gradient(90deg, #34d399, var(--grade-a)); }
.skill-bar.grade-B { background: linear-gradient(90deg, #818cf8, var(--grade-b)); }
.skill-bar.grade-C { background: linear-gradient(90deg, #fbbf24, var(--grade-c)); }
.skill-bar.grade-D { background: linear-gradient(90deg, #f87171, var(--grade-d)); }

.skill-feedback {
    font-size: 12px;
    color: var(--text-2);
    margin-top: 12px;
    line-height: 1.6;
}

/* ===== PATHWAYS ===== */
.pathways-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 36px;
}

.pathway-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    overflow: hidden;
    box-shadow: var(--sh-sm);
    transition: all var(--t-fast);
}

.pathway-card:hover { box-shadow: var(--sh-md); }

.pathway-header {
    padding: 16px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: background var(--t-fast);
}

.pathway-header:hover { background: var(--bg-hover); }

.pathway-arrow {
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-3);
}

.pathway-from, .pathway-to {
    font-size: 16px;
    font-weight: 900;
    padding: 4px 12px;
    border-radius: var(--r-xs);
    letter-spacing: -0.5px;
}

.pathway-from.grade-D { background: var(--grade-d-bg); color: var(--grade-d); }
.pathway-from.grade-C { background: var(--grade-c-bg); color: var(--grade-c); }
.pathway-from.grade-B { background: var(--grade-b-bg); color: var(--grade-b); }
.pathway-to.grade-C { background: var(--grade-c-bg); color: var(--grade-c); }
.pathway-to.grade-B { background: var(--grade-b-bg); color: var(--grade-b); }
.pathway-to.grade-A { background: var(--grade-a-bg); color: var(--grade-a); }

.pathway-title { font-size: 13px; font-weight: 600; color: var(--text-3); }

.pathway-body { padding: 0 22px 22px; }

.pathway-tip {
    display: flex;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-subtle);
}
.pathway-tip:last-child { border-bottom: none; }

.pathway-tip-num {
    width: 28px;
    height: 28px;
    background: var(--brand-light);
    color: var(--brand);
    border-radius: var(--r-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    flex-shrink: 0;
}

.pathway-tip-text { font-size: 13px; color: var(--text-2); line-height: 1.7; }
.pathway-tip-text strong { color: var(--text); }

/* ===== PARAGRAPH COACHING ===== */
.paragraphs-coaching {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 36px;
}

.para-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 22px;
    box-shadow: var(--sh-sm);
    transition: all var(--t);
}

.para-card:hover { box-shadow: var(--sh-md); }

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

.para-num {
    font-size: 12px;
    font-weight: 800;
    color: var(--text-4);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.para-grade-badge {
    font-size: 11px;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: var(--r-full);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.para-grade-badge.good { background: var(--success-light); color: var(--success); }
.para-grade-badge.ok { background: var(--warning-light); color: var(--warning); }
.para-grade-badge.weak { background: var(--danger-light); color: var(--danger); }

.para-text {
    font-size: 13px;
    color: var(--text-2);
    line-height: 1.8;
    margin-bottom: 14px;
    padding: 14px;
    background: var(--bg-subtle);
    border-radius: var(--r-sm);
    border-left: 3px solid var(--border-strong);
}

.para-good, .para-improve, .para-hint {
    font-size: 13px;
    line-height: 1.7;
    padding: 10px 14px;
    border-radius: var(--r-sm);
    margin-bottom: 8px;
}

.para-good {
    background: var(--success-bg);
    color: var(--success);
    border-left: 3px solid var(--success);
}

.para-improve {
    background: var(--warning-bg);
    color: var(--warning);
    border-left: 3px solid var(--warning);
}

.para-hint {
    background: var(--brand-lighter);
    color: var(--brand);
    border-left: 3px solid var(--brand);
}

.para-label {
    font-weight: 800;
    display: block;
    margin-bottom: 4px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
}

/* ===== AI DETAILED BREAKDOWN ===== */
.ai-detail-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 28px;
    margin-bottom: 28px;
    box-shadow: var(--sh-sm);
}

.ai-reason-item {
    padding: 16px 18px;
    background: var(--bg-subtle);
    border-radius: var(--r-md);
    margin-bottom: 10px;
    border: 1px solid var(--border);
    border-left: 4px solid var(--border);
    transition: all var(--t-fast);
}

.ai-reason-item:hover { transform: translateX(2px); }
.ai-reason-item.high { border-left-color: var(--danger); }
.ai-reason-item.medium { border-left-color: var(--warning); }
.ai-reason-item.low { border-left-color: var(--brand); }
.ai-reason-item.positive { border-left-color: var(--success); background: var(--success-bg); }

.ai-reason-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 14px;
    flex-wrap: wrap;
    color: var(--text);
}

.ai-reason-badge {
    font-size: 10px;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: var(--r-full);
    white-space: nowrap;
    letter-spacing: 0.3px;
}

.ai-reason-badge.high { background: var(--danger-light); color: var(--danger); }
.ai-reason-badge.medium { background: var(--warning-light); color: var(--warning); }
.ai-reason-badge.low { background: var(--brand-light); color: var(--brand); }
.ai-reason-badge.positive { background: var(--success-light); color: var(--success); }

.ai-reason-detail {
    font-size: 13px;
    color: var(--text-2);
    margin-bottom: 10px;
    line-height: 1.7;
}

.ai-reason-why, .ai-reason-fix {
    font-size: 12px;
    padding: 10px 14px;
    border-radius: var(--r-xs);
    margin-bottom: 6px;
    line-height: 1.7;
}

.ai-reason-why {
    color: var(--brand);
    background: var(--brand-lighter);
}

.ai-reason-fix {
    color: var(--success);
    background: var(--success-bg);
}

/* ===== SIMILARITY INDEX ===== */
.similarity-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 28px;
    margin-bottom: 36px;
    box-shadow: var(--sh-sm);
}

.sim-score-row {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 24px;
}

.sim-score-big {
    font-size: 56px;
    font-weight: 900;
    letter-spacing: -2.5px;
    flex-shrink: 0;
    line-height: 1;
}

.sim-score-info strong { font-size: 16px; display: block; margin-bottom: 4px; }
.sim-score-info p { font-size: 13px; color: var(--text-3); line-height: 1.6; }

.sim-bars { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }

.sim-bar-row { display: flex; align-items: center; gap: 14px; }

.sim-bar-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-3);
    min-width: 130px;
}

.sim-bar-track {
    flex: 1;
    height: 10px;
    background: var(--bg-hover);
    border-radius: var(--r-full);
    overflow: hidden;
}

.sim-bar-fill {
    height: 100%;
    border-radius: var(--r-full);
    transition: width 1.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sim-bar-val {
    font-size: 13px;
    font-weight: 800;
    min-width: 42px;
    text-align: right;
    color: var(--text);
}

.sim-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.sim-stat {
    text-align: center;
    padding: 14px 8px;
    background: var(--bg-subtle);
    border-radius: var(--r-sm);
}

.sim-stat-num {
    display: block;
    font-size: 24px;
    font-weight: 900;
    color: var(--brand);
    letter-spacing: -0.5px;
}

.sim-stat-label {
    font-size: 10px;
    color: var(--text-4);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 700;
}

/* ===== CITATION HELPER ===== */
.citation-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 28px;
    margin-bottom: 36px;
    box-shadow: var(--sh-sm);
}

.citation-item {
    padding: 14px 18px;
    background: var(--bg-subtle);
    border-radius: var(--r-md);
    margin-bottom: 10px;
    border: 1px solid var(--border);
}

.citation-claim {
    font-size: 13px;
    color: var(--text);
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.6;
}

.citation-claim em { font-style: italic; color: var(--text-3); font-weight: 400; }

.citation-example {
    font-size: 12px;
    color: var(--brand);
    background: var(--brand-lighter);
    padding: 10px 14px;
    border-radius: var(--r-xs);
    font-family: 'Courier New', monospace;
    line-height: 1.6;
}

/* ===== HIGHLIGHTED TEXT ===== */
.legend { display: flex; gap: 18px; margin-bottom: 14px; flex-wrap: wrap; }

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-3);
    font-weight: 600;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.ai-hl { background: rgba(139,92,246,0.25); border: 1px solid rgba(139,92,246,0.5); }
.weak-hl { background: rgba(245,158,11,0.25); border: 1px solid rgba(245,158,11,0.5); }
.good-hl { background: rgba(16,185,129,0.15); border: 1px solid rgba(16,185,129,0.4); }

.highlighted-text {
    font-size: 14px;
    line-height: 2;
    color: var(--text);
    max-height: 440px;
    overflow-y: auto;
    padding: 20px;
    background: var(--bg-subtle);
    border-radius: var(--r-md);
    border: 1px solid var(--border);
    margin-bottom: 36px;
}

.highlighted-text .hl-ai {
    background: rgba(139,92,246,0.15);
    border-bottom: 2px solid var(--purple);
    padding: 1px 3px;
    border-radius: 3px;
}

.highlighted-text .hl-weak {
    background: rgba(245,158,11,0.15);
    border-bottom: 2px solid var(--warning);
    padding: 1px 3px;
    border-radius: 3px;
}

.highlighted-text .hl-good {
    background: rgba(16,185,129,0.08);
    padding: 1px 3px;
    border-radius: 3px;
}

/* ===== AUTH ===== */
.auth-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 64px);
    padding: 40px 24px;
    background:
        radial-gradient(circle at 20% 20%, rgba(99,102,241,0.08), transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(236,72,153,0.08), transparent 40%);
}

.auth-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 44px;
    max-width: 420px;
    width: 100%;
    box-shadow: var(--sh-xl);
    text-align: center;
}

.auth-card h2 {
    font-size: 24px;
    font-weight: 900;
    margin-bottom: 8px;
    color: var(--text);
    letter-spacing: -0.5px;
}

.auth-card > p { font-size: 14px; color: var(--text-3); margin-bottom: 28px; }

.auth-input {
    width: 100%;
    padding: 13px 16px;
    border: 1px solid var(--border-strong);
    border-radius: var(--r-sm);
    font-size: 14px;
    color: var(--text);
    background: var(--surface);
    margin-bottom: 12px;
    transition: all var(--t-fast);
}

.auth-input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: var(--sh-glow);
}

.auth-input::placeholder { color: var(--text-4); }

.auth-error {
    background: var(--danger-light);
    color: var(--danger);
    border: 1px solid var(--danger);
    border-radius: var(--r-sm);
    padding: 12px 16px;
    font-size: 13px;
    margin-bottom: 16px;
    text-align: left;
    line-height: 1.6;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 20px 0;
    color: var(--text-4);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.auth-divider::before, .auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.btn-google {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    border-radius: var(--r-sm);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    color: var(--text-2);
    transition: all var(--t-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.btn-google:hover {
    background: var(--bg-hover);
    border-color: var(--text-4);
    box-shadow: var(--sh-md);
    transform: translateY(-1px);
}

.auth-switch { font-size: 13px; color: var(--text-3); margin-top: 16px; }
.auth-switch a { color: var(--brand); font-weight: 700; text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }

/* ===== DASHBOARD ===== */
.dashboard-wrapper { padding: 40px 24px 80px; }

.dash-header { margin-bottom: 28px; }
.dash-header h2 {
    font-size: 28px;
    font-weight: 900;
    letter-spacing: -0.8px;
    color: var(--text);
}

.dash-subtitle { font-size: 14px; color: var(--text-3); margin-top: 4px; }

.level-card {
    background: var(--grad-hero);
    border-radius: var(--r-lg);
    padding: 32px;
    margin-bottom: 36px;
    color: white;
    position: relative;
    overflow: hidden;
    box-shadow: var(--sh-xl);
}

.level-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(236,72,153,0.3), transparent 70%);
    pointer-events: none;
}

.level-visual {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 24px;
    position: relative;
}

.level-badge-big {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    border: 3px solid rgba(255,255,255,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 900;
    flex-shrink: 0;
    box-shadow: 0 0 30px rgba(255,255,255,0.2);
}

.level-info { flex: 1; }
.level-info h3 { font-size: 20px; font-weight: 800; margin-bottom: 10px; }

.level-xp-bar-big {
    height: 10px;
    background: rgba(255,255,255,0.2);
    border-radius: var(--r-full);
    overflow: hidden;
    margin-bottom: 8px;
}

.level-xp-fill-big {
    height: 100%;
    background: linear-gradient(90deg, #fff, #c4b5fd);
    border-radius: var(--r-full);
    transition: width 1s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 0 10px rgba(255,255,255,0.5);
}

.level-xp-text { font-size: 13px; opacity: 0.8; }

.level-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    position: relative;
}

.level-stat {
    text-align: center;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border-radius: var(--r-sm);
    padding: 16px 8px;
    border: 1px solid rgba(255,255,255,0.1);
}

.level-stat-num {
    display: block;
    font-size: 26px;
    font-weight: 900;
    letter-spacing: -0.5px;
}

.level-stat-label {
    font-size: 11px;
    opacity: 0.75;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 700;
}

.skill-progress-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 36px;
}

.skill-prog-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 20px;
    box-shadow: var(--sh-sm);
}

.skill-prog-name {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 8px;
}

.skill-prog-grade {
    font-size: 22px;
    font-weight: 900;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.skill-prog-bar-wrap {
    height: 6px;
    background: var(--bg-hover);
    border-radius: var(--r-full);
    overflow: hidden;
}

.skill-prog-bar {
    height: 100%;
    border-radius: var(--r-full);
    transition: width 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ===== ACHIEVEMENTS GRID ===== */
.achievements-section { margin-bottom: 36px; }

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.achievement-badge {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 18px 12px;
    text-align: center;
    transition: all var(--t);
    cursor: default;
    position: relative;
    overflow: hidden;
}

.achievement-badge.unlocked {
    border-color: var(--brand);
    background: linear-gradient(135deg, var(--brand-lighter), var(--surface));
}

.achievement-badge.locked {
    opacity: 0.5;
    filter: grayscale(0.8);
}

.achievement-badge:hover {
    transform: translateY(-2px);
    box-shadow: var(--sh-md);
}

.achievement-badge.rare { border-color: #3b82f6; }
.achievement-badge.epic { border-color: #8b5cf6; }
.achievement-badge.legendary {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #fef3c7, var(--surface));
    animation: legendary-glow 2s infinite;
}

@keyframes legendary-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245,158,11,0.4); }
    50% { box-shadow: 0 0 0 4px rgba(245,158,11,0.1); }
}

.achievement-icon { font-size: 32px; margin-bottom: 8px; display: block; }
.achievement-title {
    font-size: 12px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 4px;
    line-height: 1.3;
}
.achievement-desc { font-size: 10px; color: var(--text-4); line-height: 1.4; }

/* History */
.history-list, .history-list-full {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 16px 20px;
    cursor: pointer;
    transition: all var(--t-fast);
}

.history-item:hover {
    border-color: var(--brand);
    box-shadow: var(--sh-md);
    transform: translateX(2px);
}

.history-grade {
    width: 48px;
    height: 48px;
    border-radius: var(--r-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 900;
    flex-shrink: 0;
}

.history-grade.grade-A { background: var(--grade-a-bg); color: var(--grade-a); }
.history-grade.grade-B { background: var(--grade-b-bg); color: var(--grade-b); }
.history-grade.grade-C { background: var(--grade-c-bg); color: var(--grade-c); }
.history-grade.grade-D { background: var(--grade-d-bg); color: var(--grade-d); }

.history-info { flex: 1; min-width: 0; }
.history-title { font-size: 14px; font-weight: 700; color: var(--text); }
.history-meta-text { font-size: 12px; color: var(--text-4); }
.history-ai { font-size: 12px; font-weight: 800; color: var(--purple); flex-shrink: 0; }

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-4);
    font-size: 14px;
    background: var(--surface);
    border: 1px dashed var(--border-strong);
    border-radius: var(--r-md);
}

.empty-state-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.5; }

/* ===== FOOTER ===== */
.footer {
    background: var(--bg-elevated);
    color: var(--text-3);
    padding: 56px 24px 28px;
    border-top: 1px solid var(--border);
}

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

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 36px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 12px;
}

.footer-col p {
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-3);
    max-width: 320px;
}

.footer-col h4 {
    color: var(--text);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-bottom: 14px;
}

.footer-col a {
    display: block;
    color: var(--text-3);
    text-decoration: none;
    font-size: 13px;
    padding: 4px 0;
    transition: color var(--t-fast);
}

.footer-col a:hover { color: var(--brand); }

.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 20px;
    text-align: center;
    font-size: 13px;
    color: var(--text-4);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .nav-links { display: none; }
    .nav-xp-bar-wrap { display: none; }
    .nav-username { display: none; }
    .hero h1 { font-size: 34px; }
    .hero-subtitle { font-size: 15px; }
    .hero-features { gap: 8px; }
    .hero-feat { font-size: 11px; padding: 6px 12px; }
    .skills-grid { grid-template-columns: repeat(2, 1fr); }
    .skill-progress-grid { grid-template-columns: repeat(2, 1fr); }
    .grade-hero { flex-direction: column; text-align: center; gap: 24px; padding: 28px; }
    .level-stats { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
    .results-top { flex-direction: column; align-items: flex-start; }
    .ai-summary-left { flex-direction: column; text-align: center; }
    .sim-stats { grid-template-columns: repeat(2, 1fr); }
    .container-lg { padding: 0 16px; }
}

@media (max-width: 600px) {
    .hero { padding: 48px 20px 44px; }
    .hero h1 { font-size: 28px; }
    .main-content { padding: 0 16px 60px; }
    .skills-grid { grid-template-columns: 1fr; }
    .skill-progress-grid { grid-template-columns: 1fr; }
    .auth-card { padding: 32px 24px; }
    .grade-circle { width: 110px; height: 110px; }
    .grade-letter { font-size: 42px; }
    .skill-grade { font-size: 26px; }
    .sim-score-big { font-size: 42px; }
    .sim-stats { grid-template-columns: 1fr 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .section-title { font-size: 18px; }
    .loading-card { padding: 32px 20px; }
    .results-top h2 { font-size: 22px; }
    .dash-header h2 { font-size: 22px; }
    .panel { padding: 20px; }
    .sim-bar-label { min-width: 100px; font-size: 12px; }
    .results-top-right { width: 100%; }
    .results-top-right .btn-outline, .results-top-right .btn-primary-sm { flex: 1; }
}

/* ===== PRICING PAGE ===== */
.page-title {
    font-size: 42px;
    font-weight: 900;
    letter-spacing: -1.2px;
    color: var(--text);
    margin: 14px 0 14px;
    line-height: 1.15;
}
.page-subtitle {
    font-size: 17px;
    color: var(--text-3);
    max-width: 620px;
    margin: 0 auto;
    line-height: 1.6;
}
.price-badge {
    display: inline-block;
    background: var(--brand-light);
    color: var(--brand);
    padding: 6px 14px;
    border-radius: var(--r-full);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 56px;
}
.price-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 32px 28px;
    box-shadow: var(--sh-sm);
    position: relative;
    transition: all var(--t);
    display: flex;
    flex-direction: column;
}
.price-card:hover { transform: translateY(-4px); box-shadow: var(--sh-lg); }
.price-card-popular {
    border: 2px solid var(--brand);
    background: linear-gradient(135deg, var(--brand-lighter), var(--surface));
    transform: scale(1.04);
    box-shadow: var(--sh-lg);
}
.price-card-popular:hover { transform: scale(1.04) translateY(-4px); }
.popular-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--grad-brand);
    color: white;
    font-size: 11px;
    font-weight: 800;
    padding: 5px 14px;
    border-radius: var(--r-full);
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(99,102,241,0.3);
    white-space: nowrap;
}
.price-tier-name {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 14px;
}
.price-amount {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 10px;
}
.price-num {
    font-size: 48px;
    font-weight: 900;
    color: var(--text);
    letter-spacing: -2px;
    line-height: 1;
}
.price-period { font-size: 14px; color: var(--text-3); font-weight: 600; }
.price-pitch {
    font-size: 13px;
    color: var(--text-3);
    margin-bottom: 22px;
    line-height: 1.5;
    min-height: 36px;
}
.price-features {
    list-style: none;
    padding: 0;
    margin: 0 0 28px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}
.price-features li {
    font-size: 13px;
    color: var(--text-2);
    line-height: 1.5;
}
.price-features li strong { color: var(--text); font-weight: 700; }
.price-cta {
    width: 100%;
    padding: 13px;
    border-radius: var(--r-sm);
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    font-family: inherit;
    transition: all var(--t-fast);
    border: none;
}
.price-cta-primary {
    background: var(--grad-brand);
    color: white;
    box-shadow: 0 2px 8px rgba(99,102,241,0.25);
}
.price-cta-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(99,102,241,0.4); }
.price-cta-outline {
    background: var(--surface);
    color: var(--text-2);
    border: 1px solid var(--border-strong);
}
.price-cta-outline:hover { background: var(--bg-hover); border-color: var(--brand); color: var(--brand); }
.entrepreneur-cta {
    background: linear-gradient(135deg, var(--brand-lighter), var(--purple-light));
    border: 2px solid var(--brand);
    border-radius: var(--r-lg);
    padding: 36px;
    text-align: center;
    box-shadow: var(--sh-md);
}
.entrepreneur-cta h3 {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 12px;
    color: var(--text);
}
.entrepreneur-cta h3 em { font-style: italic; color: var(--brand); }
.entrepreneur-cta p {
    font-size: 14px;
    color: var(--text-2);
    max-width: 600px;
    margin: 0 auto 20px;
    line-height: 1.6;
}

/* ===== ABOUT PAGE ===== */
.about-section { margin-bottom: 56px; }
.about-h3 {
    font-size: 24px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 18px;
    letter-spacing: -0.5px;
}
.about-section > p {
    font-size: 15px;
    color: var(--text-2);
    line-height: 1.8;
    margin-bottom: 14px;
}
.about-section > p strong { color: var(--text); font-weight: 700; }
.belief-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}
.belief-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 24px;
    box-shadow: var(--sh-sm);
    transition: all var(--t);
}
.belief-card:hover { transform: translateY(-2px); box-shadow: var(--sh-md); }
.belief-icon { font-size: 32px; margin-bottom: 10px; }
.belief-card h4 {
    font-size: 16px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 8px;
}
.belief-card p {
    font-size: 13px;
    color: var(--text-3);
    line-height: 1.6;
    margin: 0;
}
.how-step {
    display: flex;
    gap: 20px;
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
}
.how-step:last-child { border-bottom: none; }
.how-step-num {
    width: 40px;
    height: 40px;
    background: var(--grad-brand);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 900;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}
.how-step h4 {
    font-size: 16px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 6px;
}
.how-step p {
    font-size: 14px;
    color: var(--text-2);
    line-height: 1.7;
    margin: 0;
}

@media (max-width: 768px) {
    .pricing-grid { grid-template-columns: 1fr; gap: 16px; }
    .price-card-popular { transform: none; }
    .price-card-popular:hover { transform: translateY(-4px); }
    .belief-grid { grid-template-columns: 1fr; }
    .page-title { font-size: 28px; }
    .page-subtitle { font-size: 14px; }
    .entrepreneur-cta { padding: 24px; }
    .entrepreneur-cta h3 { font-size: 18px; }
}

/* ===== MOBILE CLEANUP ===== */
@media (max-width: 768px) {
    .hero { padding: 32px 20px 28px; }
    .hero h1 { font-size: 30px; margin-bottom: 10px; }
    .hero-badge { margin-bottom: 12px; padding: 4px 12px; font-size: 11px; }
    .hero-subtitle { font-size: 14px; margin-bottom: 0; line-height: 1.55; }

    .main-content { padding: 0 14px 40px; margin-top: -16px; }

    .feature-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-top: 20px;
        margin-bottom: 32px;
    }
    .feature-card {
        min-height: auto;
        padding: 18px;
        display: grid;
        grid-template-columns: 48px 1fr;
        column-gap: 14px;
        align-items: start;
    }
    .feature-icon {
        font-size: 32px;
        margin-bottom: 0;
        grid-row: 1 / 4;
        align-self: center;
    }
    .feature-card h3 {
        grid-column: 2;
        font-size: 15px;
        margin-bottom: 4px;
        margin-top: 0;
    }
    .feature-card p {
        grid-column: 2;
        font-size: 12px;
        line-height: 1.45;
        margin-bottom: 6px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .feature-card .feature-cta {
        grid-column: 2;
        font-size: 11px;
    }
    .feature-badge-new, .feature-badge-earn {
        top: 10px;
        right: 10px;
        font-size: 9px;
        padding: 3px 8px;
    }

    .subject-selector { padding: 14px 16px; }
    .subject-label { font-size: 11px; margin-bottom: 8px; }
    .subject-chip { padding: 6px 11px; font-size: 11px; }
    .subject-chips { gap: 6px; }

    .tab { padding: 12px 8px; font-size: 12px; }
    .panel { padding: 16px; }
    .text-input { min-height: 180px; padding: 14px; font-size: 13px; }
    .context-bar { padding: 10px 16px; }
    .scan-button { padding: 15px; font-size: 14px; margin-top: 14px; }

    .snap-cta-banner { padding: 16px; margin: 12px 0; }
    .snap-cta-icon { font-size: 30px; }
    .snap-cta-text strong { font-size: 14px; }
    .snap-cta-text span { font-size: 11px; }

    .results-wrapper { padding: 20px 0 60px; }
    .results-top h2 { font-size: 20px; }
    .results-top-right {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .results-top-right > button {
        padding: 10px 12px;
        font-size: 12px;
        justify-content: center;
    }
    .results-top-right > button:last-child { grid-column: span 2; }

    .grade-hero { padding: 22px; gap: 18px; margin-bottom: 20px; }
    .grade-circle { width: 96px; height: 96px; border-width: 4px; }
    .grade-letter { font-size: 36px; }
    .grade-info h3 { font-size: 16px; }
    .grade-summary { font-size: 13px; line-height: 1.6; }

    .todays-focus { padding: 22px 18px; margin-bottom: 22px; }
    .tf-title { font-size: 19px; }
    .tf-why, .tf-action-text { font-size: 13px; }

    .section-title { font-size: 17px; }
    .section-desc { font-size: 12px; margin-bottom: 14px; }

    .skills-grid,
    .pathways-container,
    .paragraphs-coaching,
    .ai-detail-card,
    .similarity-card,
    .citation-card,
    .highlighted-text { margin-bottom: 24px; }

    .para-card { padding: 16px; }
    .para-text { font-size: 12px; padding: 10px; }
    .para-good, .para-improve, .para-hint { font-size: 12px; padding: 8px 12px; }

    .ai-detail-card { padding: 18px; }
    .ai-reason-item { padding: 12px 14px; }
    .ai-reason-header { font-size: 13px; }

    .similarity-card { padding: 18px; }
    .sim-score-row { flex-direction: column; text-align: center; gap: 12px; }
    .sim-score-big { font-size: 44px; }
    .sim-bar-label { min-width: 96px; font-size: 11px; }

    .level-card { padding: 22px 20px; margin-bottom: 24px; }
    .level-badge-big { width: 56px; height: 56px; font-size: 24px; }
    .level-info h3 { font-size: 16px; }
    .level-stat-num { font-size: 20px; }

    .pricing-grid { gap: 14px; }
    .price-card { padding: 26px 22px; }
    .price-num { font-size: 40px; }
    .page-title { font-size: 26px; }
    .page-subtitle { font-size: 14px; }

    .auth-card { padding: 28px 22px; }
    .auth-card h2 { font-size: 20px; }

    .footer { padding: 32px 20px 16px; }
    .footer-grid { gap: 24px; margin-bottom: 24px; }

    /* Prevent horizontal overflow */
    .container, .container-lg { overflow-x: hidden; }
}

@media (max-width: 400px) {
    .hero h1 { font-size: 26px; }
    .grade-circle { width: 84px; height: 84px; }
    .grade-letter { font-size: 32px; }
    .feature-card { grid-template-columns: 40px 1fr; column-gap: 12px; padding: 16px; }
    .feature-icon { font-size: 28px; }
}

/* Move onboarding tour help button above mobile tab bar */
@media (max-width: 768px) {
    .ig-tour-help,
    [class*="tour-help"],
    button[aria-label*="tour" i],
    button[title*="tour" i] {
        bottom: 84px !important;
    }
}

/* Progressive disclosure: hide features 4-9 behind a "show more" button on mobile first visit */
.feature-grid.collapsed .feature-card:nth-child(n+4) {
    display: none;
}
.show-more-features {
    display: none;
    width: 100%;
    padding: 14px;
    background: var(--surface);
    border: 1px dashed var(--border-strong);
    border-radius: var(--r-md);
    color: var(--text-3);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    margin-top: -6px;
    margin-bottom: 24px;
    transition: all var(--t-fast);
}
.show-more-features:hover {
    border-color: var(--brand);
    color: var(--brand);
    background: var(--brand-lighter);
}
@media (max-width: 768px) {
    .show-more-features { display: block; }
}

/* Marketplace mobile fixes */
@media (max-width: 768px) {
    .mp-wrap { padding: 20px 14px 60px; }
    .mp-hero { padding: 28px 20px; border-radius: 16px; margin-bottom: 20px; }
    .mp-hero h2 { font-size: 24px !important; line-height: 1.15; margin-bottom: 8px; }
    .mp-hero p { font-size: 13px !important; margin-bottom: 16px; }
    .mp-hero-badge { font-size: 10px; padding: 4px 12px; margin-bottom: 12px; }
    .mp-upload-cta { padding: 11px 20px; font-size: 12px; }
    .mp-controls { flex-direction: column; gap: 12px; }
    .mp-categories { order: 2; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
    .mp-categories::-webkit-scrollbar { display: none; }
    .mp-cat-chip { flex-shrink: 0; white-space: nowrap; }
    .mp-sort { order: 1; width: 100%; }
    .mp-grid { grid-template-columns: 1fr !important; gap: 14px; }
    .mp-card-top { height: 100px; }
    .mp-card-icon { font-size: 40px; }
    .mp-card-body { padding: 14px; }
    .mp-card-body h4 { font-size: 14px; }
    .mp-card-preview { font-size: 11px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== SCANNER-FIRST HOME ===== */
/* Tighter hero variant that sits directly above the scanner */
.hero-scanner {
    padding: 56px 20px 72px !important;
}
.hero-scanner .hero-container {
    max-width: 780px;
    margin: 0 auto;
    text-align: center;
}
.hero-scanner .hero-badge {
    display: inline-block;
    margin-bottom: 14px;
}
.hero-scanner h1 {
    font-size: 44px;
    line-height: 1.18;
    font-weight: 900;
    letter-spacing: -0.02em;
    margin: 0 0 18px;
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(15, 10, 40, 0.2);
    padding-bottom: 6px;
}
.hero-scanner .hero-subtitle {
    font-size: 16px;
    line-height: 1.7;
    color: rgba(255,255,255,0.88);
    max-width: 620px;
    margin: 0 auto;
    text-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

/* Scanner wrapper lifts out of the hero */
.scanner-primary {
    max-width: 720px;
    margin: -44px auto 0;
    padding: 28px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-xl);
    position: relative;
    z-index: 2;
}

/* Extra-large scan button variant for the primary CTA */
.scan-button.scan-button-xl {
    padding: 22px;
    font-size: 17px;
    font-weight: 800;
    margin-top: 22px;
    border-radius: var(--r-md);
    box-shadow: 0 10px 28px -10px rgba(37, 99, 235, 0.55), var(--sh-md);
    letter-spacing: 0.01em;
}
.scan-button.scan-button-xl:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 34px -10px rgba(37, 99, 235, 0.65), var(--sh-md);
}

/* Secondary feature section below the fold */
.secondary-features {
    max-width: 1040px;
    margin: 60px auto 40px;
    padding: 0 20px;
}
.secondary-features-header {
    text-align: center;
    margin-bottom: 24px;
}
.secondary-features-header h2 {
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
    margin: 0 0 6px;
    letter-spacing: -0.01em;
}
.secondary-features-header p {
    font-size: 14px;
    color: var(--text-3);
    margin: 0;
}

/* Grid of compact tiles */
.secondary-tiles {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

/* Individual tile */
.secondary-tile {
    display: flex;
    align-items: center;
    gap: 14px;
    text-align: left;
    padding: 16px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    cursor: pointer;
    transition: transform var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
    font-family: inherit;
    color: inherit;
    width: 100%;
    position: relative;
}
.secondary-tile-icon {
    font-size: 28px;
    line-height: 1;
    flex-shrink: 0;
}
.secondary-tile-body {
    flex: 1;
    min-width: 0;
}
.secondary-tile-body h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 3px;
    line-height: 1.25;
}
.secondary-tile-body p {
    font-size: 12px;
    color: var(--text-3);
    margin: 0;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.secondary-tile-arrow {
    font-size: 16px;
    color: var(--text-4);
    flex-shrink: 0;
    transition: transform var(--t-fast), color var(--t-fast);
}
.secondary-tile:hover {
    transform: translateY(-2px);
    border-color: var(--brand);
    box-shadow: var(--sh-md);
    background: var(--brand-lighter);
}
.secondary-tile:hover .secondary-tile-arrow {
    color: var(--brand);
    transform: translateX(3px);
}

/* Earn tile — always show gold accent so it stands out in the grid */
.secondary-tile-earn {
    background: linear-gradient(135deg, rgba(251,191,36,0.06), var(--surface));
    border-color: rgba(251,191,36,0.3);
}
.secondary-tile-earn .secondary-tile-body h3 {
    color: #b45309;
}
[data-theme="dark"] .secondary-tile-earn .secondary-tile-body h3 {
    color: #fbbf24;
}
.secondary-tile-earn:hover {
    border-color: #d97706;
    background: #fff7ed;
}
.secondary-tile-earn:hover .secondary-tile-arrow {
    color: #d97706;
}

/* Mobile breakpoints */
@media (max-width: 768px) {
    .hero-scanner {
        padding: 36px 18px 24px !important;
    }
    .hero-scanner h1 {
        font-size: 30px;
    }
    .hero-scanner .hero-subtitle {
        font-size: 14px;
    }
    .scanner-primary {
        margin: -16px 14px 0;
        padding: 20px 18px;
        border-radius: var(--r-md);
    }
    .scan-button.scan-button-xl {
        padding: 18px;
        font-size: 15px;
    }
    .secondary-features {
        margin: 48px auto 32px;
    }
    .secondary-tiles {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .secondary-features-header h2 {
        font-size: 19px;
    }
    .secondary-tile {
        padding: 14px;
    }
    .secondary-tile-icon {
        font-size: 24px;
    }
}
@media (max-width: 400px) {
    .hero-scanner {
        padding: 30px 14px 20px !important;
    }
    .hero-scanner h1 {
        font-size: 26px;
    }
    .scanner-primary {
        margin: -12px 10px 0;
        padding: 18px 14px;
    }
    .secondary-tiles {
        grid-template-columns: 1fr;
    }
    .secondary-tile-body h3 {
        font-size: 13px;
    }
    .secondary-tile-body p {
        font-size: 11px;
    }
}
