:root {
    --bg-primary: #090d16;
    --bg-secondary: #0f1523;
    --bg-card: rgba(18, 26, 43, 0.65);
    --bg-card-hover: rgba(26, 37, 60, 0.85);
    --bg-input: #0b101c;
    --bg-glass: rgba(255, 255, 255, 0.03);

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-link: #38bdf8;

    --accent-blue: #38bdf8;
    --accent-blue-deep: #2563eb;
    --accent-purple: #c084fc;
    --accent-purple-deep: #7c3aed;
    --accent-green: #34d399;
    --accent-yellow: #fbbf24;
    --accent-red: #f87171;

    --border-default: rgba(255, 255, 255, 0.08);
    --border-muted: rgba(255, 255, 255, 0.05);
    --border-highlight: rgba(255, 255, 255, 0.16);
    --border-focus: rgba(56, 189, 248, 0.45);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;

    --sidebar-width: 250px;

    --font-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 8px 24px -4px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 16px 40px -8px rgba(0, 0, 0, 0.6);
    --shadow-glow-blue: 0 0 24px rgba(56, 189, 248, 0.18);
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-ui);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
    background-image:
        radial-gradient(at 0% 0%, rgba(37, 99, 235, 0.08) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(124, 58, 237, 0.06) 0px, transparent 50%);
    background-attachment: fixed;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.15s ease, opacity 0.15s ease;
}

.font-mono {
    font-family: var(--font-mono);
}

.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-default);
    display: flex;
    flex-direction: column;
    padding: 24px 0 16px;
    z-index: 100;
    overflow-y: auto;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.2);
}

a.sidebar__logo,
a.sidebar__logo:link,
a.sidebar__logo:visited,
a.sidebar__logo:hover,
a.sidebar__logo:active {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px 22px;
    border-bottom: 1px solid var(--border-muted);
    margin-bottom: 16px;
    text-decoration: none !important;
    color: inherit !important;
    outline: none;
    transition: opacity 0.2s ease;
}

a.sidebar__logo:hover {
    opacity: 0.92;
}

.sidebar__logo-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

a.sidebar__logo:hover .sidebar__logo-mark {
    transform: scale(1.06);
}

.sidebar__logo-brand {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar__logo-title {
    font-size: 19px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-primary);
    line-height: 1.1;
    text-decoration: none !important;
}

.sidebar__logo-title-accent {
    color: var(--accent-blue);
    font-weight: 700;
}

.sidebar__logo-tagline {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.4px;
    line-height: 1;
    text-decoration: none !important;
}

.sidebar__menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 12px;
}

.sidebar__item {
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

.sidebar__item--active {
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.12) 0%, rgba(124, 58, 237, 0.06) 100%);
    border: 1px solid rgba(56, 189, 248, 0.25);
    box-shadow: 0 2px 10px rgba(56, 189, 248, 0.08);
}

.sidebar__item--active .sidebar__link {
    color: var(--accent-blue);
    font-weight: 600;
}

.sidebar__link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.sidebar__link:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    transform: translateX(2px);
}

.sidebar__link--disabled {
    opacity: 0.35;
    pointer-events: none;
    cursor: default;
}

.sidebar__icon {
    font-size: 18px;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}

.sidebar__text {
    white-space: nowrap;
}

.main {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.topbar {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 36px;
    border-bottom: 1px solid var(--border-default);
    background: rgba(9, 13, 22, 0.82);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 50;
}

.topbar__left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar__burger {
    display: none;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-default);
    color: var(--text-primary);
    font-size: 18px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.topbar__burger:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-highlight);
}

.topbar__title {
    font-size: 21px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.topbar__actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.topbar__user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar__user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 12px 5px 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-default);
    border-radius: 999px;
}

.topbar__user-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-blue-deep) 0%, var(--accent-purple-deep) 100%);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.topbar__user-email {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

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

.content {
    padding: 32px 36px;
    flex: 1;
    max-width: 1320px;
    width: 100%;
    margin: 0 auto;
}

.card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 26px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    border-color: var(--border-highlight);
    box-shadow: var(--shadow-md);
}

.card__title {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 18px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    border: 1px solid var(--border-default);
    letter-spacing: 0.02em;
}

.badge--cefr {
    background: rgba(56, 189, 248, 0.12);
    color: var(--accent-blue);
    border-color: rgba(56, 189, 248, 0.28);
}

.badge--learning {
    background: rgba(251, 191, 36, 0.12);
    color: var(--accent-yellow);
    border-color: rgba(251, 191, 36, 0.28);
}

.badge--learned {
    background: rgba(52, 211, 153, 0.12);
    color: var(--accent-green);
    border-color: rgba(52, 211, 153, 0.28);
}

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

.tag {
    display: inline-block;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-default);
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.tag:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border-color: var(--border-highlight);
}

.dictionary__search {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
    max-width: 680px;
}

.dictionary__input {
    flex: 1;
    padding: 14px 18px;
    font-size: 16px;
    font-family: var(--font-ui);
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    outline: none;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.dictionary__input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2), inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.dictionary__input::placeholder {
    color: var(--text-muted);
}

.dictionary__btn {
    padding: 14px 26px;
    font-size: 15px;
    font-weight: 600;
    font-family: var(--font-ui);
    color: #fff;
    background: linear-gradient(135deg, var(--accent-blue-deep) 0%, var(--accent-purple-deep) 100%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
    transition: opacity 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.dictionary__btn:hover {
    opacity: 0.92;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
}

.dictionary__btn:active {
    transform: scale(0.98);
}

.dictionary__btn:disabled,
.dictionary__btn--loading {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
    box-shadow: none;
    transform: none;
}

.dictionary__header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 12px;
}

.dictionary__header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
    margin-bottom: 6px;
}

.dictionary__header-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 12px;
}

.dictionary__header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dictionary__word {
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.dictionary__transcription {
    font-size: 18px;
    color: var(--accent-blue);
    font-weight: 500;
}

.dictionary__definition {
    width: 100%;
    margin-top: 8px;
    font-size: 15px;
    color: var(--text-secondary);
    font-style: italic;
    line-height: 1.6;
}

.meaning {
    padding: 16px 0;
    border-bottom: 1px solid var(--border-muted);
}

.meaning:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.meaning__ru {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.meaning__context {
    display: inline-block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-muted);
    padding: 2px 10px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.meaning__examples {
    list-style: none;
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.meaning__examples li {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding-left: 14px;
    border-left: 2px solid var(--accent-blue);
    background: rgba(56, 189, 248, 0.03);
    padding-top: 4px;
    padding-bottom: 4px;
    border-radius: 0 4px 4px 0;
}

.example__en {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

.example__ru {
    font-size: 13px;
    color: var(--text-muted);
}

.construction__pattern {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-yellow);
    margin-bottom: 16px;
    padding: 8px 14px;
    background: rgba(251, 191, 36, 0.08);
    border: 1px solid rgba(251, 191, 36, 0.2);
    border-radius: var(--radius-sm);
    display: inline-block;
}

.slot {
    padding: 14px 0;
    border-bottom: 1px solid var(--border-muted);
}

.slot:last-child {
    border-bottom: none;
}

.slot__name {
    font-size: 15px;
    font-weight: 600;
    color: var(--accent-green);
}

.slot__desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 4px 0 8px;
}

.synonym-group {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}

.synonym-group:last-child {
    margin-bottom: 0;
}

.synonym-group .badge--cefr {
    margin-left: 0;
    flex-shrink: 0;
    margin-top: 2px;
}

.variation {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-muted);
}

.variation:last-child {
    border-bottom: none;
}

.variation__pattern {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-yellow);
    background: rgba(251, 191, 36, 0.08);
    border: 1px solid rgba(251, 191, 36, 0.2);
    padding: 3px 10px;
    border-radius: 6px;
}

.variation__note {
    font-size: 13px;
    color: var(--text-secondary);
}

.dictionary__empty {
    text-align: center;
    color: var(--text-muted);
    padding: 56px 24px;
    font-size: 15px;
}

.dictionary__error {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 24px;
    border: 1px solid rgba(248, 113, 113, 0.35);
    background: rgba(248, 113, 113, 0.08);
    border-radius: var(--radius-md);
}

.dictionary__error-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.dictionary__error-text {
    font-size: 15px;
    color: var(--accent-red);
    font-weight: 600;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-ui);
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    text-decoration: none;
    outline: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn:active {
    transform: scale(0.97);
}

.btn--primary-sm {
    padding: 7px 16px;
    font-size: 13px;
    background: linear-gradient(135deg, var(--accent-blue-deep) 0%, var(--accent-purple-deep) 100%);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.btn--primary-sm:hover {
    opacity: 0.92;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.45);
}

.btn--outline-sm {
    padding: 6px 14px;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
}

.btn--outline-sm:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-highlight);
    color: #fff;
}

.btn--primary {
    padding: 13px 24px;
    font-size: 15px;
    font-weight: 600;
    background: linear-gradient(135deg, var(--accent-blue-deep) 0%, var(--accent-purple-deep) 100%);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
    width: 100%;
}

.btn--primary:hover {
    opacity: 0.92;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
}

.btn--success-sm {
    padding: 6px 14px;
    font-size: 13px;
    background: rgba(52, 211, 153, 0.12);
    color: var(--accent-green);
    border: 1px solid rgba(52, 211, 153, 0.3);
    border-radius: var(--radius-sm);
}

.btn--success-sm:hover {
    background: rgba(52, 211, 153, 0.22);
    border-color: rgba(52, 211, 153, 0.45);
}

.btn--danger-sm {
    padding: 6px 14px;
    font-size: 13px;
    background: rgba(248, 113, 113, 0.1);
    color: var(--accent-red);
    border: 1px solid rgba(248, 113, 113, 0.25);
    border-radius: var(--radius-sm);
}

.btn--danger-sm:hover {
    background: rgba(248, 113, 113, 0.2);
    border-color: rgba(248, 113, 113, 0.45);
}

.btn--ghost-sm {
    padding: 6px 12px;
    font-size: 13px;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
}

.btn--ghost-sm:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--border-default);
    color: var(--text-primary);
}

.btn--ghost-danger:hover {
    color: var(--accent-red);
    border-color: rgba(248, 113, 113, 0.35);
    background: rgba(248, 113, 113, 0.12);
}

.auth-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 48px;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    padding: 36px;
    background: rgba(18, 26, 43, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.auth-card__title {
    font-size: 23px;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 24px;
    text-align: center;
    color: var(--text-primary);
}

.auth-card__errors {
    margin-bottom: 20px;
    padding: 12px 16px;
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.35);
    border-radius: var(--radius-sm);
}

.auth-card__error {
    font-size: 13px;
    color: var(--accent-red);
    line-height: 1.4;
    font-weight: 500;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.auth-form__group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auth-form__label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.auth-card input[type="text"],
.auth-card input[type="email"],
.auth-card input[type="password"],
.auth-card textarea {
    width: 100%;
    padding: 11px 16px;
    font-size: 14px;
    font-family: var(--font-ui);
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    outline: none;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-card input[type="text"]:focus,
.auth-card input[type="email"]:focus,
.auth-card input[type="password"]:focus,
.auth-card textarea:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2), inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.auth-form__field-errors {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 4px;
}

.auth-form__error {
    font-size: 12px;
    color: var(--accent-red);
    font-weight: 500;
}

.auth-form__help {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
    margin-top: 4px;
}

.auth-form__help ul {
    list-style: disc;
    padding-left: 18px;
    margin-top: 4px;
}

.auth-form__submit {
    margin-top: 8px;
}

.auth-card__footer {
    margin-top: 24px;
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    justify-content: center;
    gap: 6px;
}

.auth-card__link {
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 600;
}

.auth-card__link:hover {
    text-decoration: underline;
}

.auth-card__info-box {
    margin-bottom: 22px;
    text-align: center;
}

.auth-card__hint {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 12px;
}

.auth-card__email-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(56, 189, 248, 0.12);
    color: var(--accent-blue);
    border: 1px solid rgba(56, 189, 248, 0.3);
    padding: 7px 16px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 12px;
    word-break: break-all;
}

.auth-card__subhint {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

.auth-form__group--center {
    text-align: center;
}

.auth-card input[name$="otp_token"] {
    text-align: center;
    font-family: var(--font-mono);
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 8px;
    padding: 14px 18px;
    border-radius: var(--radius-md);
}

.auth-form__actions {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 8px;
}

.auth-form__actions .auth-form__submit {
    flex: 1;
    margin-top: 0;
}

.profile__stats {
    display: flex;
    gap: 16px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.stat-card {
    flex: 1;
    min-width: 130px;
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-highlight);
}

.stat-card--learning {
    border-color: rgba(251, 191, 36, 0.3);
    background: linear-gradient(180deg, rgba(251, 191, 36, 0.08) 0%, rgba(18, 26, 43, 0.7) 100%);
}

.stat-card--learned {
    border-color: rgba(52, 211, 153, 0.3);
    background: linear-gradient(180deg, rgba(52, 211, 153, 0.08) 0%, rgba(18, 26, 43, 0.7) 100%);
}

.stat-card__value {
    font-size: 38px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    letter-spacing: -0.02em;
}

.stat-card__label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
}

.profile__filters {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

.profile__filter-btn {
    padding: 7px 18px;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-ui);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    border: 1px solid var(--border-default);
    border-radius: 999px;
    text-decoration: none;
    transition: all 0.15s ease;
}

.profile__filter-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border-color: var(--border-highlight);
}

.profile__filter-btn--active {
    background: linear-gradient(135deg, var(--accent-blue-deep) 0%, var(--accent-purple-deep) 100%);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.3);
}

.word-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
}

.word-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.word-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-highlight);
    box-shadow: var(--shadow-md);
}

.word-card--learned {
    border-color: rgba(52, 211, 153, 0.25);
}

.word-card__header {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.word-card__word {
    font-size: 21px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

.word-card__transcription {
    font-size: 14px;
    color: var(--accent-blue);
    font-weight: 500;
}

.word-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.word-card__translation {
    font-size: 14px;
    color: var(--text-secondary);
    flex: 1;
    line-height: 1.5;
}

.word-card__actions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid var(--border-muted);
}

.profile__empty {
    text-align: center;
    color: var(--text-muted);
    padding: 56px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.flashcard-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
    padding-top: 16px;
}

.flashcard-progress {
    width: 100%;
    max-width: 580px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.flashcard-progress__bar {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.flashcard-progress__fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
    border-radius: 999px;
    transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.flashcard-progress__label {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    font-weight: 600;
}

.flashcard {
    width: 100%;
    max-width: 580px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 44px 40px;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    min-height: 240px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.flashcard:hover {
    border-color: var(--border-highlight);
    box-shadow: var(--shadow-lg), var(--shadow-glow-blue);
    transform: translateY(-2px);
}

.flashcard--revealed {
    cursor: default;
    border-color: var(--accent-blue);
    box-shadow: var(--shadow-md);
}

.flashcard--done {
    cursor: default;
    text-align: center;
    align-items: center;
    justify-content: center;
    gap: 18px;
    min-height: 320px;
}

.flashcard__hint {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}

.flashcard__word {
    font-size: 44px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.flashcard__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.flashcard__transcription {
    font-size: 17px;
    color: var(--accent-blue);
    font-weight: 500;
}

.flashcard__back {
    border-top: 1px solid var(--border-muted);
    padding-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    animation: fadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.flashcard__meanings {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.flashcard__meaning {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.flashcard__meaning-ru {
    font-size: 19px;
    font-weight: 600;
    color: var(--text-primary);
}

.flashcard__example {
    font-size: 14px;
    color: var(--text-primary);
    font-style: italic;
    padding-left: 12px;
    border-left: 2px solid var(--accent-blue);
}

.flashcard__example-ru {
    font-size: 13px;
    color: var(--text-muted);
    padding-left: 12px;
}

.flashcard__actions {
    display: flex;
    gap: 14px;
    width: 100%;
    max-width: 580px;
}

.flashcard__actions form {
    flex: 1;
}

.flashcard__btn {
    width: 100%;
    padding: 14px 22px;
    font-size: 16px;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
}

.flashcard__btn--skip {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    border: 1px solid var(--border-default);
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.flashcard__btn--skip:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-highlight);
    color: var(--text-primary);
}

.flashcard__btn--learned {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.flashcard__btn--learned:hover {
    opacity: 0.92;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.45);
}

.flashcard__done-icon {
    font-size: 60px;
}

.flashcard__done-title {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.flashcard__done-sub {
    font-size: 15px;
    color: var(--text-secondary);
}

.flashcard__done-actions {
    display: flex;
    gap: 12px;
    margin-top: 10px;
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar--open {
        transform: translateX(0);
        box-shadow: 4px 0 28px rgba(0, 0, 0, 0.65);
    }

    .main {
        margin-left: 0;
    }

    .topbar__burger {
        display: block;
    }

    .topbar {
        padding: 14px 20px;
    }

    .content {
        padding: 20px 16px;
    }

    .dictionary__search {
        flex-direction: column;
    }

    .dictionary__word {
        font-size: 26px;
    }

    .profile__stats {
        gap: 10px;
    }

    .word-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .flashcard__word {
        font-size: 34px;
    }

    .flashcard__actions {
        flex-direction: column;
    }
}

.topbar__subscription {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    margin-right: 12px;
    white-space: nowrap;
}

.plan-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.plan-badge--free {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.25);
}

.plan-badge--middle {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(124, 58, 237, 0.2));
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.35);
    text-shadow: 0 0 12px rgba(56, 189, 248, 0.5);
}

.plan-badge--maximum {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.25), rgba(245, 158, 11, 0.25));
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.45);
    text-shadow: 0 0 12px rgba(251, 191, 36, 0.5);
}

.plan-badge--lg {
    padding: 6px 14px;
    font-size: 13px;
    border-radius: 8px;
}

.quota-indicators {
    display: flex;
    align-items: center;
    gap: 6px;
}

.quota-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: 6px;
    font-size: 12px;
    font-family: var(--font-mono);
    color: var(--text-secondary);
    cursor: default;
}

.btn--upgrade-sm {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: #fff !important;
    font-size: 11px;
    font-weight: 600;
    border-radius: 6px;
    text-decoration: none !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.btn--upgrade-sm:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.5);
}

.profile__subscription-card {
    margin-bottom: 24px;
    padding: 22px;
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
}

.profile__subscription-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-muted);
}

.profile__subscription-sub {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.profile__subscription-tier {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.profile__subscription-desc {
    font-size: 13px;
    color: var(--text-secondary);
}

.profile__quotas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.quota-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border-muted);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quota-box__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.quota-box__val {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--accent-blue);
}

.quota-box__max {
    color: var(--text-muted);
    font-weight: 400;
}

.quota-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    overflow: hidden;
}

.quota-bar__fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
    border-radius: 999px;
    transition: width 0.3s ease;
}

.quota-box__note {
    font-size: 11px;
    color: var(--text-muted);
}
