@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700&display=swap');

/* ═══════════════════════════════════
   ROOT VARIABLES — Light Mode (Persian Green)
═══════════════════════════════════ */
:root {
    /* Nevissaar: calm, premium coaching palette */
    --primary: #0B1F3A;
    --primary-dark: #07162A;
    --primary-light: #E8EEF5;
    --primary-mid: #173A63;

    --secondary: #16A34A;
    --accent: #3B82F6;

    --success: #16A34A;
    --warning: #FF9500;
    --danger: #FF3B30;

    /* Warm, low-distraction surfaces */
    --bg: #FAF8F3;
    --surface: #FFFFFF;
    --surface2: #F5F2EA;
    --surface3: #E8E5DD;

    /* Text — Apple uses near-black, not pure black */
    --text: #0B1F3A;
    --text-muted: #5E6B7B;

    /* Border — very subtle */
    --border: #D9DDE4;
    --shadow: 0 2px 12px rgba(11, 31, 58, 0.08);
    --shadow-lg: 0 8px 32px rgba(11, 31, 58, 0.12);

    --radius: 12px;
    --radius-sm: 8px;
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --font-fa: 'Vazirmatn', system-ui, sans-serif;
    --font-en: 'Inter', system-ui, sans-serif;
}

/* ─── Dark Mode — Apple Dark ─── */
[data-theme="dark"] {
    --primary: #60A5FA;
    --primary-dark: #2563EB;
    --primary-light: #112B4C;
    --primary-mid: #3B82F6;
    --secondary: #4ADE80;
    --accent: #38BDF8;
    --success: #4ADE80;
    --warning: #FBBF24;
    --danger: #FB7185;
    --bg: #07111F;
    --surface: #0D1B2D;
    --surface2: #12243A;
    --surface3: #1A314D;
    --text: #F3F7FF;
    --text-muted: #9FB0C7;
    --border: #203954;
    --shadow: 0 8px 22px rgba(0, 0, 0, 0.26);
    --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.38);
}

[data-theme="dark"] body {
    background: radial-gradient(circle at 10% -10%, rgba(37, 99, 235, 0.20), transparent 29rem), radial-gradient(circle at 95% 8%, rgba(22, 163, 74, 0.11), transparent 24rem), var(--bg);
}

[data-theme="dark"] .sidebar {
    background: linear-gradient(180deg, #09182A 0%, #07111F 100%);
    border-left: 1px solid rgba(96, 165, 250, 0.12);
    box-shadow: -12px 0 40px rgba(0, 0, 0, 0.20);
}

[data-theme="dark"] .nav-item.active {
    background: linear-gradient(135deg, #2563EB, #0EA5E9);
    box-shadow: 0 8px 22px rgba(37, 99, 235, 0.28);
}

[data-theme="dark"] .nav-item:hover { background: rgba(96, 165, 250, 0.11); }
[data-theme="dark"] .card { box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18); }

[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
    background-color: #0A1727;
    color: var(--text);
    border-color: #274563;
}

/* ─── Color themes (accent color, independent of light/dark mode) ─── */
[data-color-theme="ocean"] {
    --primary: #0891B2;
    --primary-dark: #0E7490;
    --primary-light: #E0F7FA;
    --primary-mid: #06B6D4;
    --secondary: #22D3EE;
    --accent: #0EA5E9;
}

[data-theme="dark"][data-color-theme="ocean"] {
    --primary: #22D3EE;
    --primary-dark: #06B6D4;
    --primary-light: #063542;
    --primary-mid: #06B6D4;
    --secondary: #22D3EE;
    --accent: #0EA5E9;
}

[data-color-theme="purple"] {
    --primary: #7C3AED;
    --primary-dark: #6D28D9;
    --primary-light: #EDE9FE;
    --primary-mid: #8B5CF6;
    --secondary: #A78BFA;
    --accent: #C084FC;
}

[data-theme="dark"][data-color-theme="purple"] {
    --primary: #A78BFA;
    --primary-dark: #8B5CF6;
    --primary-light: #2E1065;
    --primary-mid: #8B5CF6;
    --secondary: #A78BFA;
    --accent: #C084FC;
}

[data-color-theme="sunset"] {
    --primary: #F97316;
    --primary-dark: #EA580C;
    --primary-light: #FFEDD5;
    --primary-mid: #FB923C;
    --secondary: #F43F5E;
    --accent: #FBBF24;
}

[data-theme="dark"][data-color-theme="sunset"] {
    --primary: #FB923C;
    --primary-dark: #F97316;
    --primary-light: #431407;
    --primary-mid: #FB923C;
    --secondary: #F43F5E;
    --accent: #FBBF24;
}

[data-color-theme="forest"] {
    --primary: #16A34A;
    --primary-dark: #15803D;
    --primary-light: #DCFCE7;
    --primary-mid: #22C55E;
    --secondary: #4ADE80;
    --accent: #84CC16;
}

[data-theme="dark"][data-color-theme="forest"] {
    --primary: #4ADE80;
    --primary-dark: #22C55E;
    --primary-light: #052E16;
    --primary-mid: #22C55E;
    --secondary: #4ADE80;
    --accent: #84CC16;
}

[data-color-theme="ruby"] {
    --primary: #E11D48;
    --primary-dark: #BE123C;
    --primary-light: #FFE4E6;
    --primary-mid: #F43F5E;
    --secondary: #FB7185;
    --accent: #FDA4AF;
}

[data-theme="dark"][data-color-theme="ruby"] {
    --primary: #FB7185;
    --primary-dark: #F43F5E;
    --primary-light: #4C0519;
    --primary-mid: #F43F5E;
    --secondary: #FB7185;
    --accent: #FDA4AF;
}

/* ─── Language: English mode ─── */
[data-lang="en"] {
    direction: ltr;
    font-family: var(--font-en);
}

[data-lang="en"] body,
[data-lang="en"] input,
[data-lang="en"] textarea,
[data-lang="en"] select,
[data-lang="en"] button {
    font-family: var(--font-en) !important;
}

[data-lang="en"] .sidebar {
    right: auto;
    left: 0;
    border-left: none;
    border-right: 1px solid var(--border);
}

[data-lang="en"] .main-content {
    margin-right: 0;
    margin-left: 260px;
}

[data-lang="en"] input,
[data-lang="en"] select,
[data-lang="en"] textarea {
    direction: ltr;
    text-align: left;
}

[data-lang="en"] .nav-item {
    text-align: left;
}

[data-lang="en"] .page-title,
[data-lang="en"] .page-subtitle {
    text-align: left;
}

[data-lang="en"] .feedback-title {
    text-align: left;
}

[data-lang="en"] label {
    text-align: left;
}

/* ════════════════════════════════
   BASE RESET
════════════════════════════════ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    direction: rtl;
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-fa);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.7;
    transition: background var(--transition), color var(--transition);
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--surface2);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

/* ════════════════════════════════
   ANIMATIONS
════════════════════════════════ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.92);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }

    50% {
        transform: scale(1.05);
    }

    70% {
        transform: scale(0.9);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.fade-in {
    animation: fadeInUp 0.45s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.fade-in-down {
    animation: fadeInDown 0.35s ease both;
}

.scale-in {
    animation: scaleIn 0.35s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.slide-in {
    animation: slideInRight 0.4s ease both;
}

/* Staggered children */
.stagger>*:nth-child(1) {
    animation-delay: 0.05s;
}

.stagger>*:nth-child(2) {
    animation-delay: 0.10s;
}

.stagger>*:nth-child(3) {
    animation-delay: 0.15s;
}

.stagger>*:nth-child(4) {
    animation-delay: 0.20s;
}

.stagger>*:nth-child(5) {
    animation-delay: 0.25s;
}

/* Skeleton loader */
.skeleton {
    background: linear-gradient(90deg, var(--surface2) 25%, var(--surface3) 50%, var(--surface2) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
    border-radius: var(--radius-sm);
    color: transparent !important;
}

/* ════════════════════════════════
   LAYOUT
════════════════════════════════ */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ─── Sidebar ─── */
.sidebar {
    width: 260px;
    background: #1D1D1F;
    border-left: none;
    display: flex;
    flex-direction: column;
    position: fixed;
    right: 0;
    top: 0;
    height: 100vh;
    z-index: 100;
    box-shadow: var(--shadow);
    transition: background var(--transition), border-color var(--transition), transform 0.3s ease;
    overflow: hidden;
}

.sidebar-logo {
    padding: 28px 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo .logo-text {
    font-size: 1.3rem;
    font-weight: 800;
    color: #FFFFFF;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: fadeInDown 0.4s ease both;
}

.sidebar-logo .logo-text span {
    font-size: 1.5rem;
}

.sidebar-user {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: fadeInDown 0.4s 0.05s ease both;
}

.user-avatar {
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #FFFFFF;
    font-size: 1.1rem;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: transform var(--transition), box-shadow var(--transition);
}

.user-avatar:hover {
    transform: scale(1.08);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #FFFFFF;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.55);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
}

.sidebar-nav::-webkit-scrollbar {
    width: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.nav-section-title {
    font-size: 0.68rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.38);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 14px 16px 6px;
    margin-top: 2px;
    user-select: none;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition), color var(--transition), transform var(--transition), box-shadow var(--transition);
    font-weight: 500;
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
    border: none;
    background: none;
    width: 100%;
    text-align: right;
    position: relative;
    overflow: hidden;
}

.nav-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--primary);
    opacity: 0;
    transition: opacity var(--transition);
    border-radius: var(--radius-sm);
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
    transform: translateX(-3px);
}

[data-lang="en"] .nav-item:hover {
    transform: translateX(3px);
}

.nav-item.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 14px rgba(0, 113, 227, 0.35);
}

.nav-item .nav-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
    transition: transform var(--transition);
}

.nav-item:hover .nav-icon {
    transform: scale(1.15);
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ─── Main content ─── */
.main-content {
    flex: 1;
    margin-right: 260px;
    padding: 32px;
    min-height: 100vh;
    transition: margin var(--transition);
}

/* ─── Writing / Mock mode switch ─── */
.mode-switch {
    display: flex;
    gap: 6px;
    background: var(--surface2);
    border-radius: var(--radius-sm);
    padding: 5px;
    margin-bottom: 20px;
    max-width: 420px;
}

.mode-switch-tab {
    flex: 1;
    text-align: center;
    padding: 10px 14px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    border: none;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    text-decoration: none;
    transition: all .15s;
}

.mode-switch-tab:hover {
    color: var(--text);
}

.mode-switch-tab.active {
    background: var(--surface);
    color: var(--primary);
    box-shadow: var(--shadow);
    cursor: default;
}

/* ─── Theme picker ─── */
.theme-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 12px;
}

.theme-swatch-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px 10px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition);
}

.theme-swatch-btn:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.theme-swatch-btn.selected {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: var(--shadow);
}

.theme-swatch {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.35);
}

.theme-swatch-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
}

/* ─── Mobile hamburger toggle ─── */
.hamburger-btn {
    display: none;
    position: fixed;
    top: 14px;
    right: 16px;
    z-index: 200;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: #1D1D1F;
    border: none;
    color: #fff;
    font-size: 1.3rem;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow);
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 99;
}

/* ════════════════════════════════
   PAGE ELEMENTS
════════════════════════════════ */
.page-header {
    margin-bottom: 32px;
    animation: fadeInUp 0.4s ease both;
}

.page-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 6px;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* ─── Cards ─── */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: background var(--transition), border-color var(--transition), box-shadow var(--transition), transform var(--transition);
    animation: fadeInUp 0.4s ease both;
}

.card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.10);
}

.card-sm {
    padding: 20px;
}

/* ─── Stats grid ─── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 18px;
    transition: transform var(--transition), box-shadow var(--transition);
    animation: fadeInUp 0.4s ease both;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    transition: transform var(--transition);
}

.stat-card:hover .stat-icon {
    transform: scale(1.1) rotate(-5deg);
}

.stat-icon.purple {
    background: var(--primary-light);
}

.stat-icon.green {
    background: #D1FAE5;
}

.stat-icon.orange {
    background: #FEF3C7;
}

.stat-icon.pink {
    background: #FCE7F3;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
}

.stat-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ════════════════════════════════
   FORM ELEMENTS
════════════════════════════════ */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text);
    margin-bottom: 8px;
}

input[type="text"],
input[type="email"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text);
    background: var(--surface);
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
    outline: none;
    direction: rtl;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.12);
}

textarea {
    resize: vertical;
    min-height: 220px;
    line-height: 1.7;
}

/* ════════════════════════════════
   BUTTONS
════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: white;
    opacity: 0;
    transition: opacity 0.15s;
}

.btn:active::after {
    opacity: 0.15;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 113, 227, 0.25);
    letter-spacing: -0.01em;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 113, 227, 0.35);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1.05rem;
}

.btn-full {
    width: 100%;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* ─── Spinner ─── */
.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
    flex-shrink: 0;
}

/* ════════════════════════════════
   ALERTS
════════════════════════════════ */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: fadeInDown 0.3s ease both;
}

.alert-error {
    background: #FEF2F2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

.alert-success {
    background: #F0FDF4;
    color: #166534;
    border: 1px solid #BBF7D0;
}

.alert-info {
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid var(--border);
}

[data-theme="dark"] .alert-error {
    background: #3B0A0A;
    color: #FCA5A5;
    border-color: #7F1D1D;
}

[data-theme="dark"] .alert-success {
    background: #052E16;
    color: #86EFAC;
    border-color: #14532D;
}

/* ════════════════════════════════
   SCORE DISPLAY
════════════════════════════════ */
.score-big {
    text-align: center;
    padding: 32px;
}

.score-circle {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    border: 6px solid;
    position: relative;
    animation: bounceIn 0.6s ease both;
    transition: transform var(--transition);
}

.score-circle:hover {
    transform: scale(1.05);
}

.score-circle.excellent {
    border-color: var(--success);
    background: #F0FDF4;
}

.score-circle.good {
    border-color: #3B82F6;
    background: #EFF6FF;
}

.score-circle.average {
    border-color: var(--warning);
    background: #FFFBEB;
}

.score-circle.poor {
    border-color: var(--danger);
    background: #FEF2F2;
}

[data-theme="dark"] .score-circle.excellent {
    background: #052E16;
}

[data-theme="dark"] .score-circle.good {
    background: #1E3A5F;
}

[data-theme="dark"] .score-circle.average {
    background: #431407;
}

[data-theme="dark"] .score-circle.poor {
    background: #3B0A0A;
}

.score-num {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
}

.score-max {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.score-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
}

.score-breakdown {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 20px;
}

.score-item {
    background: var(--surface2);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    transition: transform var(--transition);
    animation: fadeInUp 0.4s ease both;
}

.score-item:hover {
    transform: translateY(-2px);
}

.score-item-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.score-item-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text);
}

/* Progress bar */
.progress-bar-wrap {
    background: var(--border);
    border-radius: 99px;
    height: 8px;
    margin-top: 6px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: 99px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.pb-excellent {
    background: var(--success);
}

.pb-good {
    background: #3B82F6;
}

.pb-average {
    background: var(--warning);
}

.pb-poor {
    background: var(--danger);
}

/* ════════════════════════════════
   FEEDBACK SECTIONS
════════════════════════════════ */
.feedback-section {
    margin-top: 20px;
}

.feedback-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.feedback-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.feedback-list li {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    animation: fadeInLeft 0.35s ease both;
}

.feedback-list.strengths li {
    background: #F0FDF4;
    color: #166534;
}

.feedback-list.improvements li {
    background: #FFFBEB;
    color: #92400E;
}

[data-theme="dark"] .feedback-list.strengths li {
    background: #052E16;
    color: #86EFAC;
}

[data-theme="dark"] .feedback-list.improvements li {
    background: #431407;
    color: #FDE68A;
}

.vocab-card {
    background: var(--surface2);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    margin-bottom: 10px;
    border-right: 4px solid var(--primary);
    transition: transform var(--transition), box-shadow var(--transition);
    animation: fadeInUp 0.4s ease both;
}

.vocab-card:hover {
    transform: translateX(-4px);
    box-shadow: var(--shadow);
}

[data-lang="en"] .vocab-card:hover {
    transform: translateX(4px);
}

.vocab-original {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.vocab-better {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}

.vocab-explain {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.grammar-card {
    background: var(--surface2);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    margin-bottom: 10px;
    border-right: 4px solid var(--warning);
    animation: fadeInUp 0.4s ease both;
}

[data-theme="dark"] .grammar-card {
    background: #431407;
}

.grammar-wrong {
    color: var(--danger);
    text-decoration: line-through;
    font-size: 0.9rem;
}

.grammar-correct {
    color: var(--success);
    font-weight: 600;
    font-size: 0.95rem;
    margin: 4px 0;
}

.grammar-explain {
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* ════════════════════════════════
   HISTORY LIST
════════════════════════════════ */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-item {
    background: var(--surface);
    border-radius: var(--radius-sm);
    padding: 18px 20px;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
    animation: fadeInUp 0.4s ease both;
}

.history-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
    transform: translateX(-3px);
}

[data-lang="en"] .history-item:hover {
    transform: translateX(3px);
}

.history-score {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 800;
    flex-shrink: 0;
    transition: transform var(--transition);
}

.history-item:hover .history-score {
    transform: scale(1.1);
}

.history-info {
    flex: 1;
    min-width: 0;
}

.history-type {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.history-preview {
    font-size: 0.9rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* ════════════════════════════════
   BADGES
════════════════════════════════ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 99px;
    font-size: 0.78rem;
    font-weight: 600;
}

.badge-ielts {
    background: var(--primary-light);
    color: var(--primary);
}

.badge-general {
    background: #FEF3C7;
    color: #92400E;
}

[data-theme="dark"] .badge-general {
    background: #431407;
    color: #FDE68A;
}

/* ─── Badge cards ─── */
.badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
}

.badge-card {
    background: var(--surface2);
    border-radius: var(--radius-sm);
    padding: 18px 14px;
    text-align: center;
    border: 2px solid var(--border);
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
    animation: scaleIn 0.35s ease both;
}

.badge-card.earned {
    background: var(--primary-light);
    border-color: var(--primary);
}

.badge-card.earned:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.badge-card:not(.earned) {
    opacity: 0.45;
    filter: grayscale(1);
}

.badge-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.badge-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text);
}

.badge-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ─── Badge toast ─── */
.badge-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(120px);
    background: var(--surface);
    border: 2px solid var(--primary);
    border-radius: 16px;
    padding: 16px 24px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 14px;
    z-index: 9999;
    transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
    min-width: 280px;
}

.badge-toast.show {
    transform: translateX(-50%) translateY(0);
}

.badge-toast-icon {
    font-size: 2rem;
}

.badge-toast-text strong {
    display: block;
    font-size: 0.95rem;
    color: var(--text);
}

.badge-toast-text span {
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* ════════════════════════════════
   GOAL CARD
════════════════════════════════ */
.goal-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: var(--radius);
    padding: 24px;
    position: relative;
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition);
}

.goal-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.goal-card::before {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
}

.goal-card::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: -20px;
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

.goal-title {
    font-size: 0.85rem;
    opacity: 0.85;
    margin-bottom: 8px;
}

.goal-score {
    font-size: 2.2rem;
    font-weight: 800;
}

.goal-progress-bar {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 99px;
    height: 10px;
    margin: 16px 0 8px;
    overflow: hidden;
}

.goal-progress-fill {
    height: 100%;
    background: white;
    border-radius: 99px;
    transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.goal-pct {
    font-size: 0.85rem;
    opacity: 0.85;
}

/* ════════════════════════════════
   CHART
════════════════════════════════ */
.chart-wrap {
    position: relative;
    height: 240px;
    margin-top: 8px;
}

/* ════════════════════════════════
   WORD ANNOTATIONS
════════════════════════════════ */
.ann-good {
    background: #DCFCE7;
    color: #166534;
    border-radius: 4px;
    padding: 1px 4px;
    cursor: help;
    border-bottom: 2px solid #22C55E;
    position: relative;
    transition: background var(--transition);
}

.ann-bad {
    background: #FEE2E2;
    color: #991B1B;
    border-radius: 4px;
    padding: 1px 4px;
    cursor: help;
    border-bottom: 2px solid #EF4444;
    position: relative;
}

.ann-spelling {
    background: #FEF9C3;
    color: #854D0E;
    border-radius: 4px;
    padding: 1px 4px;
    cursor: help;
    border-bottom: 2px dotted #EAB308;
    position: relative;
}

.ann-grammar {
    background: #DBEAFE;
    color: #1E40AF;
    border-radius: 4px;
    padding: 1px 4px;
    cursor: help;
    border-bottom: 2px solid #3B82F6;
    position: relative;
}

[data-theme="dark"] .ann-good {
    background: #14532D;
    color: #86EFAC;
}

[data-theme="dark"] .ann-bad {
    background: #7F1D1D;
    color: #FCA5A5;
}

[data-theme="dark"] .ann-spelling {
    background: #713F12;
    color: #FDE047;
}

[data-theme="dark"] .ann-grammar {
    background: #1E3A5F;
    color: #93C5FD;
}

[class^="ann-"]:hover::after {
    content: attr(data-reason);
    position: absolute;
    bottom: 110%;
    right: 0;
    background: var(--primary);
    color: white;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.78rem;
    white-space: normal;
    max-width: 240px;
    z-index: 999;
    pointer-events: none;
    animation: fadeInDown 0.2s ease both;
    box-shadow: var(--shadow);
}

[data-lang="en"] [class^="ann-"]:hover::after {
    right: auto;
    left: 0;
}

.ann-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 16px;
    background: var(--surface2);
    border-radius: var(--radius-sm);
    margin-top: 12px;
    font-size: 0.82rem;
}

.ann-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ════════════════════════════════
   TYPE TABS & SECTION TABS
════════════════════════════════ */
.type-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.type-tab {
    flex: 1;
    padding: 16px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    text-align: center;
    transition: border-color var(--transition), color var(--transition), background var(--transition), transform var(--transition);
    font-family: inherit;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.type-tab:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
    transform: translateY(-2px);
}

.type-tab.active {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.type-tab .tab-icon {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 6px;
}

.section-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.section-tab {
    padding: 10px 20px;
    border-radius: 99px;
    border: 2px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: border-color var(--transition), color var(--transition), background var(--transition), transform var(--transition);
}

.section-tab.active,
.section-tab:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
    transform: translateY(-2px);
}

.word-count {
    text-align: left;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 6px;
}

/* ════════════════════════════════
   AUTH PAGE
════════════════════════════════ */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--bg) 50%, #d4e8e0 100%);
    padding: 20px;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--surface);
    border-radius: 24px;
    padding: 44px;
    box-shadow: var(--shadow-lg);
    animation: scaleIn 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo .logo-icon {
    font-size: 3rem;
    margin-bottom: 8px;
    animation: bounceIn 0.6s ease both;
}

.auth-logo h1 {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
}

.auth-logo p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 4px;
}

.auth-tabs {
    display: flex;
    background: var(--surface2);
    border-radius: var(--radius-sm);
    padding: 4px;
    margin-bottom: 28px;
}

.auth-tab {
    flex: 1;
    padding: 10px;
    border: none;
    background: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition), color var(--transition), box-shadow var(--transition);
    color: var(--text-muted);
}

.auth-tab.active {
    background: var(--surface);
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ════════════════════════════════
   PROFILE
════════════════════════════════ */
.profile-avatar-wrap {
    position: relative;
    width: 96px;
    height: 96px;
    margin: 0 auto 16px;
}

.profile-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    border: 4px solid var(--primary);
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition);
}

.profile-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 0 0 6px var(--primary-light);
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.avatar-edit-btn {
    position: absolute;
    bottom: 0;
    left: 0;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition), background var(--transition);
}

.avatar-edit-btn:hover {
    transform: scale(1.15);
    background: var(--primary-dark);
}

/* ════════════════════════════════
   VOCABULARY
════════════════════════════════ */
.vocab-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
}

.vocab-item-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    position: relative;
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
    animation: fadeInUp 0.4s ease both;
}

.vocab-item-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
    transform: translateY(-3px);
}

.vocab-word {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
    direction: ltr;
}

.vocab-def {
    font-size: 0.85rem;
    color: var(--text);
    margin-top: 6px;
}

.vocab-ex {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
    font-style: italic;
    direction: ltr;
}

.vocab-cat {
    font-size: 0.72rem;
    background: var(--primary-light);
    color: var(--primary);
    padding: 2px 8px;
    border-radius: 99px;
    display: inline-block;
    margin-top: 8px;
}

.vocab-del {
    position: absolute;
    top: 10px;
    left: 10px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1rem;
    transition: color var(--transition), transform var(--transition);
}

.vocab-del:hover {
    color: var(--danger);
    transform: scale(1.2);
}

/* ════════════════════════════════
   LEARN PAGE
════════════════════════════════ */
.criteria-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.criteria-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 24px;
    border: 1px solid var(--border);
    border-top: 4px solid var(--primary);
    transition: transform var(--transition), box-shadow var(--transition);
    animation: fadeInUp 0.4s ease both;
}

.criteria-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.criteria-card:nth-child(2) {
    border-top-color: #22C55E;
}

.criteria-card:nth-child(3) {
    border-top-color: #F59E0B;
}

.criteria-card:nth-child(4) {
    border-top-color: #EF4444;
}

.criteria-icon {
    font-size: 2rem;
    margin-bottom: 12px;
}

.criteria-name {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.criteria-desc {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.7;
}

.criteria-tips {
    margin-top: 14px;
}

.criteria-tips li {
    font-size: 0.85rem;
    color: var(--text);
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
    list-style: none;
    display: flex;
    gap: 8px;
    transition: color var(--transition);
}

.criteria-tips li:hover {
    color: var(--primary);
}

.criteria-tips li::before {
    content: "→";
    color: var(--primary);
    flex-shrink: 0;
}

/* ─── Essay cards ─── */
.essay-card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    margin-bottom: 20px;
    transition: box-shadow var(--transition);
    animation: fadeInUp 0.4s ease both;
}

.essay-card:hover {
    box-shadow: var(--shadow-lg);
}

.essay-header {
    padding: 16px 20px;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: background var(--transition);
}

.essay-header:hover {
    background: var(--surface3);
}

.essay-band {
    background: var(--primary);
    color: white;
    padding: 4px 12px;
    border-radius: 99px;
    font-weight: 700;
    font-size: 0.9rem;
}

.essay-body {
    padding: 20px;
    display: none;
    direction: ltr;
    font-size: 0.9rem;
    line-height: 1.8;
    color: var(--text);
}

.essay-body.open {
    display: block;
    animation: fadeInUp 0.3s ease both;
}

/* ════════════════════════════════
   PLANS PAGE
════════════════════════════════ */
.plans-grid {
    align-items: stretch;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    margin-top: 32px;
}

.plan-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border-radius: 20px;
    padding: 32px 24px;
    border: 2px solid var(--border);
    text-align: center;
    position: relative;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
    animation: fadeInUp 0.4s ease both;
}

.plan-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.plan-card.popular {
    border-color: var(--primary);
}

.popular-badge {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: white;
    padding: 4px 18px;
    border-radius: 99px;
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
    animation: bounceIn 0.6s ease both;
}

.plan-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.plan-name {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 8px;
}

.plan-price {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    margin: 16px 0 4px;
}

.plan-period {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.plan-features {
    flex: 1;
    list-style: none;
    margin-bottom: 24px;
    text-align: right;
}

.plan-features li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.plan-features li:last-child {
    border: none;
}

.current-plan-badge {
    background: var(--success);
    color: white;
    padding: 8px 20px;
    border-radius: 99px;
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-block;
    animation: bounceIn 0.5s ease both;
}

/* ════════════════════════════════
   DARK MODE TOGGLE & LANG TOGGLE
════════════════════════════════ */
.sidebar .dark-toggle,
.sidebar .lang-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 99px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: border-color var(--transition), color var(--transition), background var(--transition), transform var(--transition);
    color: var(--text-muted);
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.dark-toggle:hover,
.lang-toggle:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
    transform: translateY(-1px);
}

/* ════════════════════════════════
   MISC
════════════════════════════════ */
.divider {
    height: 1px;
    background: var(--border);
    margin: 24px 0;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state .empty-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    animation: bounceIn 0.6s ease both;
}

.empty-state h3 {
    font-size: 1.1rem;
    color: var(--text);
    margin-bottom: 8px;
}

/* ════════════════════════════════
   RESPONSIVE
════════════════════════════════ */
@media (max-width: 900px) {
    #result-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 260px;
        height: 100vh;
        position: fixed;
        right: 0;
        top: 0;
        border-left: none;
        border-bottom: none;
        transform: translateX(100%);
        z-index: 150;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-right: 0;
        margin-left: 0;
        padding: 72px 16px 20px;
    }

    .app-layout {
        flex-direction: column;
    }

    .hamburger-btn {
        display: flex;
    }

    .sidebar-backdrop.open {
        display: block;
    }

    [data-lang="en"] .sidebar {
        left: 0;
        right: auto;
        border-right: none;
        transform: translateX(-100%);
    }

    [data-lang="en"] .sidebar.open {
        transform: translateX(0);
    }

    [data-lang="en"] .main-content {
        margin-left: 0;
    }

    [data-lang="en"] .hamburger-btn {
        right: auto;
        left: 16px;
    }

    .score-breakdown {
        grid-template-columns: 1fr;
    }

    .auth-card {
        padding: 28px 24px;
    }

    .plans-grid {
        align-items: stretch;
        grid-template-columns: 1fr;
    }
}

/* ─── Coming Soon nav items ─── */
.nav-coming-soon {
    opacity: 0.55;
    cursor: default !important;
    position: relative;
}

.nav-coming-soon:hover {
    background: var(--surface2) !important;
    color: var(--text-muted) !important;
    transform: none !important;
}

.coming-soon-badge {
    margin-right: auto;
    margin-left: 0;
    background: var(--warning);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 99px;
    letter-spacing: 0.02em;
}

[data-lang="en"] .coming-soon-badge {
    margin-left: auto;
    margin-right: 0;
}

/* ─── Coming Soon toast ─── */
.coming-soon-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: var(--surface);
    border: 2px solid var(--warning);
    border-radius: 14px;
    padding: 14px 24px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 9999;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-weight: 600;
    color: var(--text);
    font-size: 0.95rem;
}

.coming-soon-toast.show {
    transform: translateX(-50%) translateY(0);
}

.type-tab.type-tab-soon {
    opacity: 0.58;
    cursor: not-allowed;
    background: var(--surface2);
}

.type-tab.type-tab-soon:hover {
    border-color: var(--border);
    color: var(--text-muted);
    transform: none;
}

.type-tab.type-tab-soon small {
    display: block;
    margin-top: 5px;
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 700;
}

/* ─── Academic, minimal icon language ─── */
.nav-item { gap: 0; }
.nav-item .nav-icon { display: none; }
.nav-item { border-right: 2px solid transparent; border-radius: 7px; }
.nav-item.active { border-right-color: rgba(255,255,255,.78); }
.nav-item:hover .nav-icon { transform: none; }

.stat-icon, .empty-icon, .tab-icon, .info-card .icon, .feature-card .icon {
    font-size: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.stat-icon::after, .empty-icon::after, .tab-icon::after, .info-card .icon::after, .feature-card .icon::after {
    content: '';
    width: 8px;
    height: 8px;
    border: 1.5px solid currentColor;
    border-radius: 50%;
    opacity: .9;
}

.info-card .icon, .feature-card .icon { color: var(--primary); margin-bottom: 14px; }

[data-theme="dark"] .nav-item.active { border-right-color: #BAE6FD; }

/* ─── Product finishing layer: quieter surfaces, clearer actions ─── */
:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--primary) 55%, transparent);
    outline-offset: 3px;
}

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

.page-header { margin-bottom: 22px; }
.page-title { letter-spacing: -0.025em; }
.page-subtitle { max-width: 680px; line-height: 1.85; }

.card {
    border-color: color-mix(in srgb, var(--border) 88%, transparent);
}

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

.btn { min-height: 40px; font-weight: 750; }
.btn-primary { box-shadow: 0 6px 16px color-mix(in srgb, var(--primary) 20%, transparent); }
.btn-outline { border-color: var(--border); }

input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--text-muted) 74%, transparent); }

[data-theme="dark"] .btn-primary { box-shadow: 0 8px 20px rgba(37, 99, 235, .24); }
[data-theme="dark"] .card { border-color: #203954; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
