/* app/static/css/custom.css */

/* ============================================
   Локальные шрифты (Inter woff2)
============================================ */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/static/fonts/inter-400.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('/static/fonts/inter-500.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('/static/fonts/inter-600.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/static/fonts/inter-700.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 800;
    font-display: swap;
    src: url('/static/fonts/inter-800.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ============================================
   101slovo — Modern UI Design System (COMPACT)
============================================ */
:root {
    /* Brand */
    --brand-primary: #6366f1;
    --brand-primary-dark: #4f46e5;
    --brand-primary-light: #818cf8;
    --brand-secondary: #ec4899;
    --brand-accent: #06b6d4;

    /* Semantic colors */
    --color-success: #10b981;
    --color-success-hover: #059669;
    --color-info: #3b82f6;
    --color-warning: #f59e0b;
    --color-accent: #06b6d4;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-success: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --gradient-warning: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-info: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gradient-fire: linear-gradient(135deg, #f12711 0%, #f5af19 100%);

    /* Surfaces */
    --surface-0: #ffffff;
    --surface-50: #f8fafc;
    --surface-100: #f1f5f9;
    --surface-200: #e2e8f0;
    --surface-300: #cbd5e1;

    /* Text */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-inverse: #ffffff;
    --text-success: #065f46;
    --text-success-strong: #059669;
    --text-error: #991b1b;
    --text-error-strong: #dc2626;
    --text-info: #1e40af;
    --text-info-strong: #2563eb;
    --text-warning: #92400e;
    --text-warning-strong: #d97706;
    --text-brand: #4f46e5;
    --text-brand-secondary: #db2777;
    --text-accent: #0891b2;

    --bg-success: rgba(16, 185, 129, 0.08);
    --bg-success-border: rgba(16, 185, 129, 0.2);
    --bg-error: rgba(239, 68, 68, 0.08);
    --bg-error-border: rgba(239, 68, 68, 0.2);
    --bg-info: rgba(59, 130, 246, 0.08);
    --bg-info-border: rgba(59, 130, 246, 0.2);
    --bg-warning: rgba(245, 158, 11, 0.08);
    --bg-warning-border: rgba(245, 158, 11, 0.2);

    /* Borders & Shadows */
    --border-light: #e2e8f0;
    --border-medium: #cbd5e1;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.05);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.05);
    --shadow-glow: 0 0 20px rgb(99 102 241 / 0.3);

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   Тёмная тема
============================================ */
[data-theme="dark"] {
    --surface-0: #0f172a;
    --surface-50: #1e293b;
    --surface-100: #334155;
    --surface-200: #475569;
    --surface-300: #64748b;

    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --text-success: #6ee7b7;
    --text-success-strong: #34d399;
    --text-error: #fca5a5;
    --text-error-strong: #f87171;
    --text-info: #93c5fd;
    --text-info-strong: #60a5fa;
    --text-warning: #fcd34d;
    --text-warning-strong: #fbbf24;
    --text-brand: #a5b4fc;
    --text-brand-secondary: #f9a8d4;
    --text-accent: #67e8f9;

    --bg-success: rgba(16, 185, 129, 0.12);
    --bg-success-border: rgba(16, 185, 129, 0.3);
    --bg-error: rgba(239, 68, 68, 0.12);
    --bg-error-border: rgba(239, 68, 68, 0.3);
    --bg-info: rgba(59, 130, 246, 0.12);
    --bg-info-border: rgba(59, 130, 246, 0.3);
    --bg-warning: rgba(245, 158, 11, 0.12);
    --bg-warning-border: rgba(245, 158, 11, 0.3);

    --border-light: #334155;
    --border-medium: #475569;
    --border: #334155;

    --color-success: #34d399;
    --color-success-hover: #6ee7b7;
    --color-info: #60a5fa;
    --color-warning: #fbbf24;
    --color-accent: #67e8f9;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    font-feature-settings: 'cv11', 'ss01';
    color: var(--text-primary);
    background: var(--surface-50);
    font-size: 0.9375rem;
    line-height: 1.5;
    letter-spacing: -0.011em;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.2;
}
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.0625rem; }

/* === A11Y: визуально скрытый, но доступный скринридеру === */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ============================================
   УТИЛИТЫ: градиентный текст
============================================ */
.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   SECTION HEADER
============================================ */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}
.section-header--start {
    align-items: flex-start;
}

/* ============================================
   PAGE HEADER
============================================ */
.page-header {
    text-align: center;
    margin-bottom: 1.5rem;
}
.page-header__emoji {
    font-size: 2.25rem;
    margin-bottom: 0.375rem;
}
.page-header__title { margin: 0; }
.page-header__subtitle {
    color: var(--text-muted);
    margin-top: 0.375rem;
    font-size: 0.9375rem;
}

/* ============================================
   NAVBAR
============================================ */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border-light);
    padding: 0.5rem 0;
}
[data-theme="dark"] .navbar {
    background: rgba(15, 23, 42, 0.8);
}
.navbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}
.navbar-brand {
    font-weight: 800;
    font-size: 1.125rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    letter-spacing: -0.03em;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}
.navbar-menu--desktop {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.navbar-burger {
    display: none;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    box-shadow: none;
}
.navbar-burger:hover {
    background: rgba(99, 102, 241, 0.08);
    color: var(--brand-primary);
}
.navbar-mobile-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface-0);
    border-bottom: 1px solid var(--border-light);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem 0.75rem;
    flex-direction: column;
    gap: 0.125rem;
    z-index: 99;
}
.navbar-mobile-menu.is-open { display: flex; }
[data-theme="dark"] .navbar-mobile-menu {
    background: var(--surface-0);
    border-bottom-color: var(--border-light);
}
.navbar-mobile-menu .nav-link {
    width: 100%;
    justify-content: flex-start;
    padding: 0.625rem 1rem;
    font-size: 0.9375rem;
}
.navbar-mobile-menu .navbar-logout {
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.625rem 1rem;
    text-align: center;
}
.nav-link {
    padding: 0.375rem 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}
.nav-link:hover {
    color: var(--brand-primary);
    background: rgba(99, 102, 241, 0.08);
}
.nav-link.active {
    color: var(--brand-primary);
    background: rgba(99, 102, 241, 0.1);
}
.nav-link--admin { color: var(--brand-secondary); }
.nav-link--admin:hover { background: rgba(236, 72, 153, 0.08); }
.navbar-logout {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
    font-weight: 500;
}
.navbar-logout:hover {
    color: var(--text-error-strong);
    border-color: #fca5a5;
    background: rgba(239, 68, 68, 0.05);
}

/* ============================================
   BUTTONS
   ✅ ИСПРАВЛЕНИЕ: добавлен :not(.word-card) ко всем
   селекторам с [role="button"], чтобы карточки новых
   слов в превью урока не получали стили кнопки.
============================================ */
button:not(.word-card),
.button:not(.word-card),
[role="button"]:not(.word-card),
input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1.125rem;
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
    font-family: inherit;
}

button:not(.secondary):not(.outline):not(.navbar-burger):not(.word-card),
.button:not(.secondary):not(.outline):not(.word-card),
[role="button"]:not(.secondary):not(.outline):not(.word-card),
input[type="submit"] {
    background: var(--brand-primary);
    color: var(--text-inverse);
    box-shadow: var(--shadow-sm), 0 1px 2px rgba(99, 102, 241, 0.2);
}

button:not(.secondary):not(.outline):not(.navbar-burger):not(.word-card):hover,
.button:not(.secondary):not(.outline):not(.word-card):hover,
[role="button"]:not(.secondary):not(.outline):not(.word-card):hover,
input[type="submit"]:hover {
    background: var(--brand-primary-dark);
    box-shadow: var(--shadow-md), 0 4px 12px rgba(99, 102, 241, 0.25);
    transform: translateY(-1px);
}

button:not(.word-card):active,
.button:not(.word-card):active,
[role="button"]:not(.word-card):active {
    transform: translateY(0);
}

.secondary, [role="button"].secondary {
    background: var(--surface-100);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
}
.secondary:hover, [role="button"].secondary:hover {
    background: var(--surface-200);
    color: var(--text-primary);
}

/* Модификаторы размеров кнопок */
.btn--sm {
    padding: 0.375rem 0.875rem;
    font-size: 0.8125rem;
}
.btn--xs {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}
.btn-lg, [role="button"][style*="font-size: 1.2rem"],
[role="button"][style*="padding: 1rem 2rem"] {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border-radius: var(--radius-lg);
}

/* Модификаторы цвета кнопок */
.btn--success {
    background: var(--color-success) !important;
    color: var(--text-inverse) !important;
}
.btn--success:hover {
    background: var(--color-success-hover) !important;
}
.btn--ghost {
    background: var(--surface-0) !important;
    color: var(--brand-primary) !important;
    border: none;
    box-shadow: 0 4px 14px rgba(0,0,0,0.15);
}

/* ============================================
   FORMS
============================================ */
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="search"], textarea, select {
    padding: 0.5rem 0.75rem;
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-md);
    background: var(--surface-0);
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-family: inherit;
    transition: all var(--transition-fast);
    width: 100%;
    box-sizing: border-box;
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }
textarea { resize: vertical; min-height: 90px; line-height: 1.5; }
label {
    display: block;
    margin-bottom: 0.375rem;
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}
.form-group { margin-bottom: 0.875rem; }
.form-group--last { margin-bottom: 1.25rem; }
fieldset {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1rem;
    margin-bottom: 1rem;
    background: var(--surface-50);
}
legend { font-weight: 600; padding: 0 0.5rem; font-size: 0.9rem; }

/* === RANGE INPUT === */
input[type="range"] {
    height: 6px;
    background: var(--surface-200);
    border-radius: var(--radius-full);
    border: none;
    padding: 0;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}
input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--brand-primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.4);
    transition: all var(--transition-fast);
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.15); }
input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--brand-primary);
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.4);
}
input[type="range"]::-moz-range-thumb:hover { transform: scale(1.15); }
input[type="range"]::-moz-range-track {
    height: 6px;
    background: var(--surface-200);
    border-radius: var(--radius-full);
    border: none;
}

/* ============================================
   BADGES
============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
.badge--md {
    font-size: 0.8125rem;
    padding: 0.375rem 0.75rem;
}
.badge-active { background: rgba(99, 102, 241, 0.12); color: var(--text-brand); }
.badge-mastered { background: var(--bg-success); color: var(--text-success-strong); }
.badge-ignored { background: var(--bg-error); color: var(--text-error-strong); }
.badge-new { background: rgba(236, 72, 153, 0.12); color: var(--text-brand-secondary); }
.badge-review { background: rgba(6, 182, 212, 0.12); color: var(--text-accent); }
.badge--stage { background: rgba(99, 102, 241, 0.1); color: var(--brand-primary); }

/* ============================================
   FLASH
============================================ */
.flash-success, .flash-error, .flash-info, .flash-warning {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 0.875rem;
    font-weight: 500;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    border: 1px solid transparent;
    animation: slideInDown 0.3s ease-out;
}
.flash-success { background: var(--bg-success); border-color: var(--bg-success-border); color: var(--text-success); }
.flash-error { background: var(--bg-error); border-color: var(--bg-error-border); color: var(--text-error); }
.flash-info { background: var(--bg-info); border-color: var(--bg-info-border); color: var(--text-info); }
.flash-warning { background: var(--bg-warning); border-color: var(--bg-warning-border); color: var(--text-warning); }

/* ============================================
   TABLES
============================================ */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--surface-0);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}
thead { background: var(--surface-50); }
th {
    padding: 0.625rem 0.75rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-light);
}
td {
    padding: 0.625rem 0.75rem;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.875rem;
}
tbody tr { transition: background var(--transition-fast); }
tbody tr:hover { background: var(--surface-50); }
tbody tr:last-child td { border-bottom: none; }
.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ============================================
   STAT CARDS
============================================ */
.stat-card {
    position: relative;
    overflow: hidden;
    padding: 1.25rem;
    background: var(--surface-0);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition-base);
}
.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}
.stat-card:hover::before { opacity: 1; }
.stat-card__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    border-radius: var(--radius-md);
    background: rgba(99, 102, 241, 0.1);
    color: var(--brand-primary);
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
}
.stat-card__icon--fire { background: var(--bg-warning); color: var(--text-warning-strong); }
.stat-card__icon--book { background: var(--bg-success); color: var(--text-success-strong); }
.stat-card__icon--calendar { background: var(--bg-info); color: var(--text-info-strong); }
.stat-card__value {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
    margin-bottom: 0.25rem;
}
.stat-card__label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.stat-card__sublabel {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}
.stat-card__body { min-width: 0; }
@media (max-width: 768px) {
    .stat-card--compact {
        display: flex;
        align-items: center;
        gap: 0.625rem;
        padding: 0.625rem 0.875rem;
    }
    .stat-card--compact .stat-card__icon {
        width: 36px; height: 36px;
        font-size: 1.125rem;
        margin-bottom: 0;
        flex-shrink: 0;
    }
    .stat-card--compact .stat-card__value { font-size: 1.375rem; margin-bottom: 0; }
    .stat-card--compact .stat-card__label { font-size: 0.6875rem; }
    .stat-card--compact .stat-card__sublabel { font-size: 0.6875rem; margin-top: 0; }
}

/* ============================================
   CARD
============================================ */
.card {
    background: var(--surface-0);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
}
.card--compact { padding: 0.875rem 1rem; }
.card--spacious { padding: 1.75rem; }
.card--legal { padding: 2rem; line-height: 1.8; }
.card--auth { max-width: 440px; margin: 0 auto; padding: 1.5rem; }
.card--settings { padding: 1.125rem; }

/* ============================================
   EXERCISE
============================================ */
.exercise-card {
    background: var(--surface-0);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 1rem;
}
.exercise-sentence {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 0.75rem;
    letter-spacing: -0.01em;
}
.exercise-words {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-bottom: 1rem;
}
.exercise-result-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

/* ============================================
   SUGGESTION
============================================ */
.suggestion-card {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
    background: var(--surface-50);
    transition: all var(--transition-fast);
}
.suggestion-card:hover {
    border-color: var(--brand-primary-light);
    background: var(--surface-0);
    box-shadow: var(--shadow-sm);
}
.suggestion-card--added {
    background: var(--bg-success);
    border-color: var(--bg-success-border);
}
.suggestion-card--ignored {
    background: rgba(148, 163, 184, 0.05);
    border-color: rgba(148, 163, 184, 0.2);
    opacity: 0.7;
}
.text-success { color: var(--text-success-strong); }
.text-error { color: var(--text-error-strong); }
.text-warning { color: var(--text-warning-strong); }
.text-info { color: var(--text-info-strong); }

/* ============================================
   SPINNER
============================================ */
.htmx-indicator {
    display: none;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-style: normal;
}
.htmx-request .htmx-indicator, .htmx-indicator.htmx-request {
    display: inline-flex;
}
.spinner {
    display: inline-block;
    width: 16px; height: 16px;
    border: 2px solid var(--surface-200);
    border-top-color: var(--brand-primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
.spinner--sm {
    width: 12px;
    height: 12px;
    border-width: 2px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================
   PAGINATION
============================================ */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.375rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}
.pagination a {
    min-width: 34px; height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: var(--surface-0);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: all var(--transition-fast);
}
.pagination a:hover {
    background: var(--brand-primary);
    color: var(--text-inverse);
    border-color: var(--brand-primary);
}

/* ============================================
   WORD ITEM (vocabulary)
============================================ */
.word-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--surface-0);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    margin-bottom: 0.375rem;
    transition: all var(--transition-fast);
    text-decoration: none;
    color: inherit;
}
.word-item:hover {
    border-color: var(--brand-primary-light);
    box-shadow: var(--shadow-sm);
    transform: translateX(4px);
}
.word-item__main {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}
.word-item__lemma {
    font-weight: 700;
    font-size: 0.9375rem;
}
.word-item__pos {
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 0.125rem 0.5rem;
    background: var(--surface-100);
    border-radius: var(--radius-sm);
}
.word-item__translation {
    color: var(--text-secondary);
    font-size: 0.875rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.word-item__meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}
.word-item__due {
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 0.2rem 0.5rem;
    background: var(--surface-100);
    border-radius: var(--radius-full);
    white-space: nowrap;
}
.vocab-filters {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 0.75rem;
    align-items: end;
}

/* ============================================
   CTA SECTION
============================================ */
.cta-section {
    text-align: center;
    padding: 2rem 1.5rem;
    background: var(--gradient-primary);
    border-radius: var(--radius-lg);
    color: var(--text-inverse);
    margin: 1.5rem 0;
    box-shadow: var(--shadow-lg), 0 8px 32px rgba(99, 102, 241, 0.25);
}
.cta-section h3 { color: var(--text-inverse); font-size: 1.375rem; margin-bottom: 0.375rem; }
.cta-section p { opacity: 0.9; margin-bottom: 1rem; font-size: 0.9375rem; }
.cta-section .button, .cta-section [role="button"] {
    background: var(--surface-0);
    color: var(--brand-primary);
    border: none;
    padding: 0.75rem 1.75rem;
    font-size: 1rem;
    font-weight: 700;
    box-shadow: var(--shadow-lg);
}
.cta-section .button:hover, .cta-section [role="button"]:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

/* ============================================
   HERO
============================================ */
.hero {
    padding: 1rem 0;
    margin-bottom: 1.25rem;
}
.hero__greeting {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 0.125rem;
}
.hero__title {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin: 0;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   UTILS
============================================ */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.container--xs { max-width: 480px; }
.container--narrow { max-width: 720px; }
.container--medium { max-width: 960px; }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.grid { display: grid; gap: 1rem; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ============================================
   ICON SIZES
============================================ */
.icon-xs { width: 12px !important; height: 12px !important; }
.icon-sm { width: 14px !important; height: 14px !important; }
.icon-md { width: 16px !important; height: 16px !important; }
.icon-lg { width: 18px !important; height: 18px !important; }
.icon-xl { width: 22px !important; height: 22px !important; }
.icon-2xl { width: 24px !important; height: 24px !important; }

/* ============================================
   INFO BOX
============================================ */
.info-box {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-info);
    border: 1px solid var(--bg-info-border);
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* ============================================
   OPTION CARD
============================================ */
.option-card {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    background: var(--surface-50);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: center;
    color: var(--text-secondary);
}
.option-card:hover {
    border-color: var(--brand-primary-light);
    background: var(--surface-0);
    transform: translateY(-1px);
}
.option-card--active {
    border-color: var(--brand-primary) !important;
    background: rgba(99, 102, 241, 0.08) !important;
    color: var(--brand-primary) !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* ============================================
   PRICING CARD
============================================ */
.pricing-card {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
}
.pricing-card--popular {
    border-color: var(--brand-primary);
    box-shadow: var(--shadow-glow);
}
.pricing-card--best {
    border-color: var(--color-success);
}
.pricing-card__price {
    font-size: 1.875rem;
    font-weight: 800;
    margin-bottom: 0.375rem;
}
.pricing-card__period {
    font-size: 0.9375rem;
    font-weight: 400;
    color: var(--text-muted);
}
.pricing-card__note {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 0.375rem;
}
.pricing-card__features {
    list-style: none;
    padding: 0;
    margin: 0 0 1.25rem 0;
    flex: 1;
}
.pricing-card__features li {
    padding: 0.375rem 0;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.pricing-card__features li:last-child {
    border-bottom: none;
}

/* ============================================
   WORD CARD (lesson preview)
============================================ */
.word-card {
    padding: 0.875rem 1rem;
    border-left: none !important;
    box-shadow: var(--shadow-sm), inset 4px 0 0 0 var(--brand-accent);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: default;
}

.word-card.word-card-clickable {
    cursor: pointer;
    box-shadow: var(--shadow-sm), inset 4px 0 0 0 var(--brand-secondary);
}

.word-card.word-card-clickable:hover {
    box-shadow: var(--shadow-md), inset 4px 0 0 0 var(--brand-primary);
    transform: translateY(-2px);
    border-color: var(--brand-primary-light);
}

.word-card.word-card-clickable:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm), inset 4px 0 0 0 var(--brand-primary-dark);
}

.word-card.word-card-clickable:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
}

.word-card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.word-card__actions {
    display: flex;
    gap: 0.375rem;
    align-items: center;
    flex-shrink: 0;
}

.word-card__lemma {
    font-weight: 700;
    font-size: 1.0625rem;
    color: var(--text-primary);
}

.word-card__lemma--flex {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.word-card__external-icon {
    color: var(--text-muted);
    opacity: 0.6;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.word-card.word-card-clickable:hover .word-card__external-icon {
    opacity: 1;
    color: var(--brand-primary);
}

.word-card__pos {
    color: var(--text-muted);
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.word-card__translations {
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-light);
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.4;
}

/* ============================================
   EVAL ICON
============================================ */
.eval-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}
.eval-icon--success { background: var(--bg-success); }
.eval-icon--warning { background: var(--bg-warning); }
.eval-icon--error { background: var(--bg-error); }

/* ============================================
   STAT ROW
============================================ */
.stat-row {
    color: var(--text-muted);
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.stat-row__value {
    font-weight: 700;
    font-size: 1.0625rem;
}

/* ============================================
   FEEDBACK BLOCK
============================================ */
.feedback-block {
    padding: 0.875rem;
    background: var(--surface-50);
    border-radius: var(--radius-md);
    margin-bottom: 0.875rem;
    border-left: 3px solid var(--brand-primary);
}

/* ============================================
   LEGAL BLOCK
============================================ */
.legal-requisites {
    background: var(--surface-50);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    margin-top: 1rem;
}
.legal-requisites p {
    margin: 0.25rem 0;
}

/* ============================================
   PROMO CODE BOX
============================================ */
.promo-box {
    background: var(--surface-100);
    border: 2px dashed var(--brand-primary);
    border-radius: var(--radius-md);
    padding: 0.5rem 1.25rem;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: var(--brand-primary);
}

/* ============================================
   ERROR PAGE
============================================ */
.error-page {
    text-align: center;
    padding-top: 4rem;
}

/* === Skeleton Loading === */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--surface-100) 25%,
        var(--surface-200) 50%,
        var(--surface-100) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}
@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.skeleton-text { height: 1rem; margin-bottom: 0.5rem; width: 100%; }
.skeleton-text.short { width: 60%; }
.skeleton-text.title { height: 1.5rem; width: 40%; margin-bottom: 1rem; }
.skeleton-card { height: 120px; width: 100%; }
.htmx-skeleton-wrapper.htmx-request .skeleton-target { opacity: 0.5; pointer-events: none; }
.htmx-skeleton-wrapper.htmx-request .skeleton-loader { display: block !important; }
.skeleton-loader { display: none; }

/* === ADD WORD MODAL === */
[x-cloak] { display: none !important; }
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 8vh 1rem 1.5rem 1rem;
}
.modal-panel {
    width: 100%;
    max-width: 600px;
    max-height: 82vh;
    overflow-y: auto;
    background: var(--surface-0);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-xl);
    animation: fadeInUp 0.25s ease-out;
}
.word-option-card {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    padding: 0.75rem 1rem;
    background: var(--surface-50);
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}
.word-option-card:hover {
    border-color: var(--brand-primary-light);
    background: var(--surface-0);
    box-shadow: var(--shadow-sm);
}
.word-option-card input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--brand-primary);
    cursor: pointer;
    flex-shrink: 0;
}

/* === ANIMATIONS === */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes slideInDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.4s ease-out; }
.fade-in-up { animation: fadeInUp 0.5s ease-out; }

::selection { background: rgba(99, 102, 241, 0.2); }
:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 2px; }

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--surface-100); }
::-webkit-scrollbar-thumb { background: var(--surface-300); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--surface-200); }
* {
    scrollbar-width: thin;
    scrollbar-color: var(--surface-300) var(--surface-100);
}

/* ============================================
   BREAKPOINTS
============================================ */
@media (min-width: 1280px) {
    .container { max-width: 1200px; }
}
@media (max-width: 1024px) {
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    h1 { font-size: 1.875rem; }
    .hero__title { font-size: 1.875rem; }
}
@media (max-width: 768px) {
    body { font-size: 0.875rem; }
    .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .grid-3--stats, .grid-3--compact { grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
    .grid-4 { grid-template-columns: repeat(2, 1fr); gap: 0.625rem; }
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
    h3 { font-size: 1.125rem; }
    h4 { font-size: 1rem; }
    .stat-card__value { font-size: 1.625rem; }
    .hero__title { font-size: 1.625rem; }
    .navbar-menu--desktop { display: none; }
    .navbar-burger { display: flex; }
    .navbar-inner { gap: 0.75rem; }
    .exercise-result-grid { grid-template-columns: 1fr; }
    .vocab-filters { grid-template-columns: 1fr; }
    .vocab-filters select { min-width: unset; }
    .container { padding: 0 0.875rem; }
    .grid { gap: 0.75rem; }
    .card { padding: 1rem; }
    .card--legal { padding: 1.25rem; }
    .exercise-card { padding: 1rem; }
    .stat-card { padding: 0.875rem 1rem; }
    .cta-section { padding: 1.5rem 1rem; }
    .cta-section h3 { font-size: 1.25rem; }
    fieldset { padding: 1rem; margin-bottom: 1rem; }
    .exercise-sentence { font-size: 1.125rem; }
    .modal-overlay { padding: 5vh 0.75rem 1.5rem 0.75rem; }
    .modal-panel { padding: 1.25rem; }
    .word-item { flex-wrap: wrap; gap: 0.5rem; }
    .word-item__meta { width: 100%; justify-content: flex-start; }
    .summary-streak-flex { gap: 1.25rem !important; }
}
@media (max-width: 480px) {
    .container { padding: 0 0.75rem; }
    .card { padding: 0.875rem; }
    .card--legal { padding: 1rem; }
    .exercise-card { padding: 0.875rem; }
    .stat-card { padding: 0.75rem; }
    .cta-section { padding: 1.25rem 0.875rem; }
    .modal-overlay { padding: 3vh 0.5rem 1rem 0.5rem; }
    .modal-panel { padding: 1rem; }
    h1 { font-size: 1.375rem; }
    h2 { font-size: 1.1875rem; }
    .hero__title { font-size: 1.5rem; }
    .stat-card__value { font-size: 1.5rem; }
    .exercise-sentence { font-size: 1.0625rem; }
    .flash-success, .flash-error, .flash-info, .flash-warning {
        padding: 0.625rem 0.875rem;
        font-size: 0.8125rem;
    }
    .pagination { gap: 0.25rem; }
    .pagination a { min-width: 32px; height: 32px; font-size: 0.875rem; }
    .grid-3--compact { gap: 0.375rem; }
}

/* ============================================
   SUPPORT TICKETS
============================================ */
.support-ticket-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.125rem;
    background: var(--surface-0);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: inherit;
    transition: all var(--transition-fast);
}
.support-ticket-card:hover {
    border-color: var(--brand-primary-light);
    box-shadow: var(--shadow-sm);
    transform: translateX(2px);
}
.support-ticket-card--unread {
    border-left: 3px solid var(--brand-primary);
    background: rgba(99, 102, 241, 0.03);
}
.support-message {
    padding: 0.875rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    background: var(--surface-0);
    position: relative;
    margin-bottom: 0.75rem;
}
.support-message--own {
    background: rgba(99, 102, 241, 0.04);
    border-color: rgba(99, 102, 241, 0.2);
    margin-left: 1.5rem;
}
.support-message--user {
    background: var(--surface-50);
    margin-right: 1.5rem;
}
.support-message--admin {
    background: rgba(236, 72, 153, 0.04);
    border-color: rgba(236, 72, 153, 0.2);
    margin-right: 1.5rem;
}
.support-message--deleted {
    background: var(--surface-50);
    border: 1px dashed var(--border-medium);
    padding: 0.625rem 1rem;
    opacity: 0.7;
}
.support-message__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.375rem;
    font-size: 0.8125rem;
}
.support-message__body {
    color: var(--text-primary);
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.9375rem;
}
.support-message__admin-actions {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    opacity: 0;
    transition: opacity var(--transition-fast);
}
.support-message:hover .support-message__admin-actions {
    opacity: 1;
}
.support-message__delete-btn {
    background: transparent;
    border: none;
    color: var(--text-error-strong);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
}
.support-message__delete-btn:hover {
    background: var(--bg-error);
    transform: none;
}
.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1;
    color: white;
    background: var(--brand-primary);
    border-radius: var(--radius-full);
    margin-left: 0.25rem;
}
.nav-badge--admin {
    background: var(--brand-secondary);
}