/* ==========================================================================
   Polyglot — дизайн-система
   Тёплая «бумажная» палитра с абрикосовым акцентом (ծիրան) и гранатовым вторым цветом.
   ========================================================================== */

:root {
    --bg: #fbf7f1;
    --bg-2: #f4ede3;
    --surface: #ffffff;
    --surface-2: #fdfaf6;
    --ink: #1f1d2b;
    --ink-2: #3d3a4f;
    --muted: #716d82;
    --line: #ece4d8;
    --line-2: #ddd2c2;

    --primary: #e8743b;
    --primary-600: #cf5f27;
    --primary-50: #fdf0e7;
    --berry: #b8324a;
    --berry-50: #fbebee;
    --teal: #1d8a7a;
    --teal-50: #e5f5f1;
    --gold: #c99212;
    --gold-50: #fdf4dd;
    --blue: #3b6fe6;
    --blue-50: #eaf0fd;

    --radius-xs: 8px;
    --radius-sm: 12px;
    --radius: 16px;
    --radius-lg: 24px;
    --shadow-sm: 0 1px 2px rgba(31, 29, 43, .05), 0 1px 1px rgba(31, 29, 43, .03);
    --shadow: 0 6px 24px -8px rgba(31, 29, 43, .14), 0 2px 6px rgba(31, 29, 43, .04);
    --shadow-lg: 0 24px 60px -20px rgba(31, 29, 43, .28);

    --font-sans: "Manrope", "Noto Sans Armenian", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-display: "Fraunces", "Noto Serif Armenian", Georgia, serif;
    --font-mono: ui-monospace, "Cascadia Code", "JetBrains Mono", Consolas, monospace;

    --header-h: 68px;
    --container: 1200px;
    color-scheme: light;
}

[data-theme="dark"] {
    --bg: #13121a;
    --bg-2: #1a1922;
    --surface: #1d1c26;
    --surface-2: #23222e;
    --ink: #f3efe8;
    --ink-2: #d5d0c7;
    --muted: #9c98aa;
    --line: #2d2b39;
    --line-2: #3a3848;
    --primary-50: #3a2419;
    --berry-50: #3b1b23;
    --teal-50: #12302a;
    --gold-50: #352b10;
    --blue-50: #18223c;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 8px 28px -10px rgba(0, 0, 0, .6);
    --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, .7);
    color-scheme: dark;
}

/* ───────────── База ───────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
img, video, svg { max-width: 100%; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--primary); }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-family: var(--font-display); font-weight: 650; font-size: clamp(1.8rem, 3.2vw, 2.4rem); }
h2 { font-size: 1.35rem; font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 700; }
p { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
code, kbd, .mono { font-family: var(--font-mono); font-size: .92em; }
code { background: var(--bg-2); padding: 1px 6px; border-radius: 6px; }
kbd { display: inline-block; padding: 0 6px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 6px; font-size: .75em; color: var(--muted); background: var(--surface); }
::selection { background: color-mix(in srgb, var(--primary) 30%, transparent); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px; }

.icon { flex: none; vertical-align: middle; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.tiny { font-size: .75rem; }
.center { text-align: center; justify-content: center; }
.nowrap { white-space: nowrap; }
.d-block { display: block; }
.grow { flex: 1 1 auto; }
.ml-auto { margin-left: auto; }
.w-80 { width: 80px; }
.text-danger { color: var(--berry); }
.text-warn { color: var(--gold); }
.clamp-1, .clamp-3 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-1 { -webkit-line-clamp: 1; }
.clamp-3 { -webkit-line-clamp: 3; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.row-gap { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.center-block { display: block; margin: 0 auto 12px; }
.align-end { align-self: flex-end; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.container.narrow { max-width: 780px; }
.page { padding-top: 32px; padding-bottom: 56px; }
.page-head { margin-bottom: 24px; }
.page-head h1 { margin-bottom: 6px; }
.center-page { padding-top: 64px; padding-bottom: 80px; }
.section { padding: 72px 0; }
.section-sm { padding: 40px 0 0; }
.section-tint { background: var(--bg-2); }
.section-head { margin-bottom: 32px; max-width: 720px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head h2 { font-family: var(--font-display); font-size: clamp(1.6rem, 2.6vw, 2.1rem); font-weight: 650; }
.section-title { font-size: 1.15rem; margin: 28px 0 14px; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 8px; }
.skip-link:focus { left: 8px; }

/* ───────────── Кнопки ───────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 18px; border-radius: 12px; border: 1px solid transparent;
    font: inherit; font-weight: 650; font-size: .95rem; line-height: 1.2;
    cursor: pointer; transition: background .15s, color .15s, border-color .15s, transform .08s, box-shadow .15s;
    white-space: nowrap; user-select: none; text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--primary) 80%, transparent); }
.btn-primary:hover:not([disabled]) { background: var(--primary-600); color: #fff; }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover:not([disabled]) { border-color: var(--ink-2); color: var(--ink); }
.btn-soft { background: var(--primary-50); color: var(--primary-600); }
.btn-soft:hover:not([disabled]) { background: color-mix(in srgb, var(--primary) 18%, var(--surface)); color: var(--primary-600); }
.btn-light { background: #fff; color: #1f1d2b; }
.btn-light:hover { background: #fff7f0; color: #1f1d2b; }
.btn-danger { background: var(--berry); color: #fff; }
.btn-danger:hover:not([disabled]) { background: #9d2a3f; color: #fff; }
.btn.danger, .icon-btn.danger { color: var(--berry); }
.btn-sm { padding: 7px 12px; font-size: .85rem; border-radius: 10px; }
.btn-lg { padding: 14px 24px; font-size: 1.02rem; border-radius: 14px; }
.btn-block { display: flex; width: 100%; }
.btn-icon { padding: 10px; }
.btn.is-armed, .icon-btn.is-armed { background: var(--berry-50); color: var(--berry); border-color: var(--berry); width: auto; padding: 6px 10px; gap: 6px; font-size: .82rem; font-weight: 650; }
.pulse { animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary) 55%, transparent); } 70% { box-shadow: 0 0 0 12px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

.icon-btn {
    display: inline-grid; place-items: center; position: relative;
    width: 38px; height: 38px; border-radius: 11px; border: 0; background: transparent;
    color: var(--ink-2); cursor: pointer; transition: background .15s, color .15s;
}
.icon-btn:hover:not([disabled]) { background: var(--bg-2); color: var(--ink); }
.icon-btn[disabled] { opacity: .35; cursor: default; }
.link-sm { font-size: .85rem; color: var(--primary-600); font-weight: 600; background: none; border: 0; cursor: pointer; padding: 0; font-family: inherit; }
.link-btn { background: none; border: 0; padding: 0; text-align: left; cursor: pointer; color: inherit; font: inherit; }
.copy-btn { margin-top: 2px; }

/* ───────────── Формы ───────────── */
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.form .field { margin-bottom: 0; }
.field > label, .field-row label { font-size: .875rem; font-weight: 650; color: var(--ink-2); }
.field-row { display: flex; justify-content: space-between; align-items: baseline; }
.input {
    width: 100%; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line-2);
    background: var(--surface); color: var(--ink); font: inherit; font-size: .95rem;
    transition: border-color .15s, box-shadow .15s;
}
.input:focus { outline: 0; border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 16%, transparent); }
.input::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
textarea.input { resize: vertical; min-height: 44px; line-height: 1.5; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23716d82' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='m1 1.5 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
.input-sm { padding: 7px 10px; font-size: .88rem; border-radius: 10px; }
.input.search { max-width: 280px; }
.input-group { display: flex; }
.input-group .input { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.input-addon { display: grid; place-items: center; padding: 0 12px; border: 1px solid var(--line-2); border-right: 0; border-radius: 12px 0 0 12px; background: var(--bg-2); color: var(--muted); font-size: .88rem; white-space: nowrap; }
.input-color { width: 56px; height: 40px; padding: 2px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); }
.hint { font-size: .78rem; color: var(--muted); }
.check { display: inline-flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: .92rem; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); margin-top: 3px; flex: none; }
.switch { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; margin: 6px 0 12px; }
.switch input { appearance: none; width: 42px; height: 24px; border-radius: 99px; background: var(--line-2); position: relative; cursor: pointer; transition: background .2s; flex: none; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .2s; }
.switch input:checked { background: var(--primary); }
.switch input:checked::after { transform: translateX(18px); }
.switch input:disabled { opacity: .5; }
.form-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.form-row > .field { margin-bottom: 0; }
.form-row + .form-row, .form-row + .field, .field + .form-row { margin-top: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0 14px; }
.inline-field { flex-direction: row; align-items: center; gap: 10px; max-width: 420px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.filters .input { width: auto; min-width: 180px; }

/* ───────────── Алерты, бейджи, чипы ───────────── */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: .92rem; margin-bottom: 16px; border: 1px solid transparent; }
.alert .icon { margin-top: 2px; }
.alert-error { background: var(--berry-50); color: var(--berry); border-color: color-mix(in srgb, var(--berry) 20%, transparent); }
.alert-ok { background: var(--teal-50); color: var(--teal); border-color: color-mix(in srgb, var(--teal) 20%, transparent); }
.alert-warn { background: var(--gold-50); color: #8a6306; border-color: color-mix(in srgb, var(--gold) 25%, transparent); }
.alert-info { background: var(--blue-50); color: var(--blue); border-color: color-mix(in srgb, var(--blue) 18%, transparent); }
[data-theme="dark"] .alert-warn { color: #f0c955; }
.alert a { text-decoration: underline; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 99px; font-size: .74rem; font-weight: 700; line-height: 1.4; white-space: nowrap; border: 0; font-family: inherit; }
.badge-ok { background: var(--teal-50); color: var(--teal); }
.badge-warn { background: var(--gold-50); color: #9a6f06; }
.badge-danger { background: var(--berry-50); color: var(--berry); }
.badge-info { background: var(--blue-50); color: var(--blue); }
.badge-muted { background: var(--bg-2); color: var(--muted); }
[data-theme="dark"] .badge-warn { color: #f0c955; }
.badge.clickable { cursor: pointer; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 99px; background: var(--bg-2); color: var(--ink-2); font-size: .78rem; font-weight: 650; }
.chip-accent { background: var(--primary-50); color: var(--primary-600); }
.chip-glass { position: absolute; top: 12px; right: 12px; background: rgba(255, 255, 255, .85); color: #1f1d2b; backdrop-filter: blur(6px); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.eyebrow { font-size: .8rem; font-weight: 700; color: var(--primary-600); letter-spacing: .02em; display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.count { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 6px; margin-left: 6px; border-radius: 99px; background: var(--bg-2); color: var(--muted); font-size: .72rem; font-weight: 700; }
.count-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--primary); color: #fff; font-size: .72rem; font-weight: 800; display: inline-grid; place-items: center; }
.filter-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.chip-btn { padding: 8px 16px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); font: inherit; font-size: .88rem; font-weight: 650; cursor: pointer; }
.chip-btn.active { background: var(--ink); border-color: var(--ink); color: var(--bg); }

/* ───────────── Карточки, таблицы, вкладки ───────────── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); margin-bottom: 18px; }
.card.compact { padding: 14px 16px; margin-bottom: 10px; }
.card-title { font-size: 1.05rem; display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.sticky { position: sticky; top: calc(var(--header-h) + 16px); }
.sticky-actions { display: flex; flex-direction: column; gap: 10px; }

.table-wrap { overflow-x: auto; padding: 0; }
.table-wrap.card { padding: 4px 0; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions > * { margin-left: 4px; }
.reorder { display: flex; flex-direction: column; gap: 0; width: 30px; }
.reorder .icon-btn { width: 28px; height: 20px; border-radius: 6px; }
.row-muted { opacity: .55; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tab { padding: 10px 14px; border: 0; background: none; font: inherit; font-weight: 650; font-size: .92rem; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; align-items: center; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); border-bottom-color: var(--primary); }
.segmented { display: inline-flex; background: var(--bg-2); border-radius: 12px; padding: 3px; gap: 2px; }
.segmented button { border: 0; background: transparent; padding: 6px 12px; border-radius: 9px; font: inherit; font-size: .82rem; font-weight: 650; color: var(--muted); cursor: pointer; }
.segmented button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.pager { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 18px; }

/* ───────────── Состояния ───────────── */
.state-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 44px 28px; text-align: center; box-shadow: var(--shadow); max-width: 560px; margin: 0 auto 24px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.state-icon { width: 72px; height: 72px; border-radius: 22px; display: grid; place-items: center; background: var(--bg-2); color: var(--ink-2); margin-bottom: 8px; }
.state-icon.ok { background: var(--teal-50); color: var(--teal); }
.state-icon.info { background: var(--blue-50); color: var(--blue); }
.state-icon.danger { background: var(--berry-50); color: var(--berry); }
.big-code { font-family: var(--font-display); font-size: 5rem; font-weight: 650; line-height: 1; background: linear-gradient(135deg, var(--primary), var(--berry)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.empty-state { text-align: center; padding: 48px 20px; border: 1.5px dashed var(--line-2); border-radius: var(--radius-lg); background: var(--surface-2); }
.empty-icon { width: 60px; height: 60px; margin: 0 auto 14px; border-radius: 18px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary-600); }
.empty-state h3 { margin-bottom: 6px; }
.empty-state .btn { margin-top: 10px; }
.skeleton { border-radius: var(--radius); background: linear-gradient(90deg, var(--bg-2) 25%, var(--surface-2) 37%, var(--bg-2) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.page-loading { display: grid; place-items: center; min-height: 40vh; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line-2); border-top-color: var(--primary); animation: spin .8s linear infinite; display: inline-block; }
.spinner.sm { width: 16px; height: 16px; border-width: 2px; border-color: rgba(255, 255, 255, .4); border-top-color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ───────────── Шапка ───────────── */
.site { min-height: 100vh; display: flex; flex-direction: column; }
.site-main { flex: 1; }
.site-header { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
.header-inner { height: var(--header-h); display: flex; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; }
.brand:hover { color: inherit; }
.brand-name { font-family: var(--font-display); font-size: 1.35rem; font-weight: 650; letter-spacing: -.02em; }
.main-nav { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.main-nav a { padding: 8px 12px; border-radius: 10px; font-weight: 650; font-size: .93rem; color: var(--ink-2); white-space: nowrap; }
.main-nav a:hover { background: var(--bg-2); color: var(--ink); }
.main-nav a.active { color: var(--primary-600); background: var(--primary-50); }
.header-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.only-dark { display: none; }
[data-theme="dark"] .only-dark { display: inline; }
[data-theme="dark"] .only-light { display: none; }
.culture-code { font-size: .68rem; font-weight: 800; position: absolute; bottom: 4px; right: 3px; }
.announcement { background: linear-gradient(90deg, var(--primary), var(--berry)); color: #fff; font-size: .9rem; font-weight: 600; }
.announcement .container { padding-top: 9px; padding-bottom: 9px; display: flex; gap: 8px; align-items: center; justify-content: center; }

.dropdown { position: relative; }
.dropdown > summary { list-style: none; cursor: pointer; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown-menu { position: absolute; top: calc(100% + 8px); left: 0; min-width: 220px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 60; animation: pop .14s ease; }
.dropdown-right { left: auto; right: 0; }
.dropdown-menu form { margin: 0; }
.dropdown-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 10px; border: 0; background: none; font: inherit; font-size: .92rem; font-weight: 600; color: var(--ink-2); cursor: pointer; text-align: left; }
.dropdown-item:hover { background: var(--bg-2); color: var(--ink); }
.dropdown-item.active { color: var(--primary-600); }
.dropdown-item.danger { color: var(--berry); }
.dropdown-caption { padding: 8px 12px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; display: flex; flex-direction: column; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }

.user-chip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); font-weight: 650; font-size: .9rem; }
.user-chip:hover { border-color: var(--line-2); }
.user-chip-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge-host { position: relative; }
.dot-badge { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--berry); color: #fff; font-size: .66rem; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--bg); }
.dot-badge.static { position: static; border: 0; margin-left: auto; }
.notif-host { position: relative; }
.click-catcher { position: fixed; inset: 0; z-index: 55; }
.notif-panel { position: absolute; right: 0; top: calc(100% + 8px); width: min(360px, 90vw); max-height: 70vh; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); z-index: 60; animation: pop .14s ease; }
.notif-head { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.notif-empty { padding: 18px 16px; margin: 0; }
.notif-list { list-style: none; margin: 0; padding: 6px; }
.notif-list a { display: flex; flex-direction: column; padding: 10px 12px; border-radius: 10px; font-size: .9rem; }
.notif-list a:hover { background: var(--bg-2); color: var(--ink); }
.notif-list li.unread a { background: var(--primary-50); }

/* ───────────── Подвал ───────────── */
.site-footer { border-top: 1px solid var(--line); background: var(--surface-2); padding: 48px 0 24px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.2fr; gap: 32px; }
.footer-grid h4 { font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 12px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: .93rem; }
.footer-grid ul a { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); }
.footer-brand p { max-width: 320px; margin-top: 12px; font-size: .92rem; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--line); margin-top: 36px; padding-top: 20px; font-size: .85rem; color: var(--muted); }
.powered { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.powered a { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: var(--ink-2); }
.powered a:hover { color: var(--primary); }

/* ───────────── Мобильная навигация ───────────── */
.mobile-nav { display: none; }

/* ───────────── Тосты ───────────── */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; max-width: min(380px, calc(100vw - 40px)); }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 10px 12px 14px; border-radius: 14px; background: var(--ink); color: var(--bg); box-shadow: var(--shadow-lg); font-size: .92rem; font-weight: 600; animation: slidein .2s ease; }
.toast .icon-btn { width: 28px; height: 28px; color: inherit; margin-left: auto; }
.toast-success .icon:first-child { color: #5fd3b5; }
.toast-error .icon:first-child { color: #ff8aa0; }
@keyframes slidein { from { opacity: 0; transform: translateY(10px); } }

/* ───────────── Модальные окна ───────────── */
.modal-backdrop { position: fixed; inset: 0; background: rgba(19, 18, 26, .5); backdrop-filter: blur(3px); z-index: 90; animation: fade .15s ease; }
.modal { position: fixed; z-index: 91; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 40px); display: flex; flex-direction: column; background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-lg); animation: modalin .18s ease; }
.modal-wide { width: min(880px, calc(100vw - 24px)); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 12px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; }
.modal-body { padding: 18px 20px; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
@keyframes modalin { from { opacity: 0; transform: translate(-50%, -46%); } }

/* ───────────── Главная ───────────── */
.hero { position: relative; overflow: hidden; padding: 72px 0 88px; }
.hero-ornament {
    position: absolute; inset: -20% -10% auto auto; width: 760px; height: 760px; opacity: .55; pointer-events: none;
    background:
        radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--primary) 35%, transparent), transparent 55%),
        radial-gradient(circle at 70% 60%, color-mix(in srgb, var(--berry) 25%, transparent), transparent 55%);
    filter: blur(20px);
}
.hero::before {
    content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cpath d='M32 8l6 18 18 6-18 6-6 18-6-18-18-6 18-6z' fill='none' stroke='%23e8743b' stroke-opacity='.12' stroke-width='1.2'/%3E%3C/svg%3E");
    mask-image: linear-gradient(180deg, #000, transparent 85%);
}
.hero-grid { position: relative; display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.display { font-family: var(--font-display); font-size: clamp(2.3rem, 5vw, 3.9rem); font-weight: 650; line-height: 1.08; letter-spacing: -.025em; margin: 18px 0 18px; }
.display em { font-style: italic; color: var(--primary); }
.display-sm { font-family: var(--font-display); font-size: clamp(1.9rem, 3.6vw, 2.8rem); font-weight: 650; line-height: 1.1; margin: 10px 0 12px; }
.lead { font-size: 1.12rem; color: var(--ink-2); max-width: 620px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin: 28px 0 22px; }
.hero-points { list-style: none; padding: 0; margin: 0; display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); font-size: .92rem; font-weight: 600; }
.hero-points li { display: flex; align-items: center; gap: 6px; }
.hero-points .icon { color: var(--teal); }

.hero-visual { position: relative; height: 460px; }
.hv-card { position: absolute; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-lg); padding: 16px; animation: float 6s ease-in-out infinite; }
.hv-lesson { left: 6%; top: 4%; width: 74%; }
.hv-lesson-head { display: flex; justify-content: space-between; margin-bottom: 12px; }
.hv-video { height: 170px; border-radius: 14px; background: linear-gradient(135deg, #2a2838, #4a3a52 60%, #b8324a); display: grid; place-items: center; }
.hv-play { width: 54px; height: 54px; border-radius: 50%; background: rgba(255, 255, 255, .92); color: var(--primary); display: grid; place-items: center; }
.hv-progress { height: 6px; background: var(--bg-2); border-radius: 99px; margin-top: 14px; overflow: hidden; }
.hv-progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--berry)); }
.hv-word { right: 0; top: 44%; display: flex; align-items: center; gap: 14px; animation-delay: -2s; }
.hv-term { font-weight: 800; font-size: 1.05rem; }
.hv-tr { color: var(--primary-600); font-weight: 700; }
.hv-speak { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary-600); }
.hv-quiz { left: 0; bottom: 6%; width: 58%; display: flex; flex-direction: column; gap: 8px; animation-delay: -4s; }
.hv-option { padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); font-size: .9rem; font-weight: 600; display: flex; gap: 6px; align-items: center; }
.hv-option.ok { border-color: var(--teal); background: var(--teal-50); color: var(--teal); }
.hv-call { right: 6%; bottom: 2%; display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: .9rem; animation-delay: -1s; }
.hv-live { width: 10px; height: 10px; border-radius: 50%; background: #2fbf71; box-shadow: 0 0 0 4px rgba(47, 191, 113, .2); }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 26px; transition: transform .2s, box-shadow .2s; }
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.feature-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary-600); margin-bottom: 16px; }
.feature:nth-child(3n+2) .feature-icon { background: var(--berry-50); color: var(--berry); }
.feature:nth-child(3n) .feature-icon { background: var(--teal-50); color: var(--teal); }
.feature p { margin: 0; font-size: .95rem; }

.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; counter-reset: step; }
.step { position: relative; padding: 24px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); }
.step p { margin: 0; font-size: .93rem; }
.step-num { width: 38px; height: 38px; border-radius: 12px; background: var(--ink); color: var(--bg); display: inline-grid; place-items: center; font-weight: 800; margin-bottom: 14px; flex: none; }
.step-num.sm { width: 26px; height: 26px; border-radius: 8px; font-size: .8rem; margin: 0; }

.faq { display: flex; flex-direction: column; gap: 10px; }
.faq-item { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 0 20px; }
.faq-item summary { list-style: none; cursor: pointer; padding: 18px 0; font-weight: 700; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item[open] summary .icon { transform: rotate(180deg); }
.faq-item summary .icon { transition: transform .2s; color: var(--muted); }
.faq-item p { color: var(--ink-2); padding-bottom: 18px; margin: 0; }

.cta-band { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; padding: 44px; border-radius: 28px; color: #fff; background: radial-gradient(circle at 85% 20%, rgba(255, 255, 255, .18), transparent 40%), linear-gradient(120deg, var(--primary), var(--berry)); box-shadow: var(--shadow-lg); }
.cta-band h2 { font-family: var(--font-display); font-size: 2rem; margin-bottom: 6px; }
.cta-band p { margin: 0; opacity: .9; }

/* ───────────── Курсы ───────────── */
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.course-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; transition: transform .2s, box-shadow .2s; }
.course-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); color: inherit; }
.course-cover { position: relative; aspect-ratio: 16 / 9; background: var(--bg-2); }
.course-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.course-cover-art { position: absolute; inset: 0; display: grid; place-items: center; background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, .25), transparent 45%), linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 50%, #1f1d2b)); }
.course-cover-art span { font-family: var(--font-display); font-size: 5rem; color: rgba(255, 255, 255, .9); font-weight: 650; }
.course-body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.course-body h3 { font-size: 1.15rem; }
.course-body p { font-size: .92rem; }
.course-meta { margin-top: auto; display: flex; gap: 14px; align-items: center; font-size: .84rem; color: var(--muted); font-weight: 600; flex-wrap: wrap; }
.course-meta span { display: inline-flex; align-items: center; gap: 5px; }
.course-price { margin-left: auto; color: var(--ink) !important; font-weight: 800; font-size: 1rem; }

.course-hero { padding: 36px 0 40px; background: radial-gradient(circle at 90% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 50%), var(--bg-2); border-bottom: 1px solid var(--line); }
.course-hero-grid { display: grid; grid-template-columns: 1fr 380px; gap: 40px; align-items: start; }
.breadcrumbs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: .85rem; color: var(--muted); margin-bottom: 12px; }
.breadcrumbs a:hover { color: var(--primary); }
.course-stats { display: flex; gap: 20px; flex-wrap: wrap; color: var(--ink-2); font-weight: 600; font-size: .93rem; }
.course-stats span { display: inline-flex; align-items: center; gap: 6px; }
.buy-card { position: sticky; top: calc(var(--header-h) + 16px); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; }
.buy-cover { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px; }
.buy-price { font-family: var(--font-display); font-size: 2rem; font-weight: 650; }
.buy-progress { display: flex; flex-direction: column; gap: 6px; }
.buy-features { list-style: none; padding: 12px 0 0; margin: 4px 0 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; font-size: .9rem; color: var(--ink-2); }
.buy-features li { display: flex; gap: 8px; align-items: center; }
.buy-features .icon { color: var(--primary); }
.course-content { display: grid; grid-template-columns: 1fr 380px; gap: 40px; }
.course-main { min-width: 0; }

.outline { display: flex; flex-direction: column; gap: 10px; }
.outline-chapter { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface-2); }
.outline-chapter summary { list-style: none; display: flex; align-items: center; gap: 14px; padding: 14px 16px; cursor: pointer; }
.outline-chapter summary::-webkit-details-marker { display: none; }
.outline-chapter[open] summary > .icon { transform: rotate(180deg); }
.outline-num { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary-600); font-weight: 800; flex: none; }
.outline-title { flex: 1; display: flex; flex-direction: column; }
.outline-desc { padding: 0 16px; margin: 0 0 8px; }
.outline-lessons { list-style: none; padding: 0 8px 10px; margin: 0; }
.outline-lessons a, .outline-lessons .locked { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; font-size: .93rem; }
.outline-lessons a:hover { background: var(--surface); }
.outline-lessons a > span:nth-of-type(1), .outline-lessons .locked > span:first-of-type { flex: 1; }
.outline-lessons .locked { color: var(--muted); }
.outline-lessons li.done .icon { color: var(--teal); }

.progress { height: 8px; border-radius: 99px; background: var(--bg-2); overflow: hidden; }
.progress-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--primary), var(--berry)); transition: width .4s ease; }

.avatar { display: inline-grid; place-items: center; border-radius: 50%; object-fit: cover; flex: none; font-weight: 800; color: #fff; background: hsl(var(--avatar-hue, 20) 55% 52%); }
.avatar-sm { width: 30px; height: 30px; font-size: .72rem; }
.avatar-md { width: 42px; height: 42px; font-size: .9rem; }
.avatar-lg { width: 60px; height: 60px; font-size: 1.2rem; }
.avatar-xl { width: 96px; height: 96px; font-size: 1.8rem; }

.teacher-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.teacher-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 26px 22px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.teacher-card h3 { margin: 10px 0 0; }
.teacher-card .chips { justify-content: center; }
.teacher-card .prose { text-align: left; margin-top: 8px; }
.teacher-headline { color: var(--muted); font-size: .92rem; margin: 0; }
.callout-box { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 28px; padding: 20px 22px; border-radius: var(--radius-lg); background: var(--primary-50); color: var(--primary-600); }
.callout-box > div { flex: 1; color: var(--ink); }
.callout-box p { margin: 0; }

/* ───────────── Оплата ───────────── */
.pay-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 18px; }
.pay-step { position: relative; padding-top: 26px; margin: 0; }
.pay-step .step-num { position: absolute; top: -14px; left: 22px; }
.bank-card { position: relative; overflow: hidden; border-radius: 18px; padding: 22px; color: #fff; aspect-ratio: 1.6; max-width: 380px; display: flex; flex-direction: column; justify-content: space-between; background: radial-gradient(circle at 85% 10%, rgba(255, 255, 255, .22), transparent 40%), linear-gradient(135deg, #2a2838, #5a3048 55%, var(--primary)); box-shadow: var(--shadow-lg); margin: 12px 0; }
.bank-card-top { display: flex; justify-content: space-between; align-items: center; font-weight: 700; opacity: .9; }
.bank-card-number { font-family: var(--font-mono); font-size: clamp(1.1rem, 2.4vw, 1.45rem); letter-spacing: .08em; }
.bank-card-holder { text-transform: uppercase; font-size: .85rem; letter-spacing: .1em; opacity: .85; }
.pay-copy { margin-bottom: 8px; }
.amount-row { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-radius: 12px; background: var(--bg-2); margin: 12px 0; }
.amount-row strong { font-size: 1.3rem; }
.dropzone { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 28px 18px; border: 2px dashed var(--line-2); border-radius: 16px; background: var(--surface-2); text-align: center; cursor: pointer; transition: border-color .15s, background .15s; margin-bottom: 16px; }
.dropzone:hover { border-color: var(--primary); background: var(--primary-50); }
.dropzone.has-file { border-style: solid; border-color: var(--teal); background: var(--teal-50); }
.dropzone .icon { color: var(--primary); }
.dropzone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.payment-cards { display: flex; flex-direction: column; gap: 12px; }
.payment-card { display: grid; grid-template-columns: 96px 1fr auto; gap: 18px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); align-items: center; }
.payment-card.pending { border-left: 4px solid var(--gold); }
.receipt-thumb { width: 96px; height: 96px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-2); overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: zoom-in; color: var(--muted); padding: 0; }
.receipt-thumb img { width: 100%; height: 100%; object-fit: cover; }
.payment-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.payment-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.payment-amount { font-size: 1.2rem; font-weight: 800; }
.receipt-full { width: 100%; border-radius: 12px; }
.receipt-pdf { width: 100%; height: 70vh; border: 0; border-radius: 12px; }

/* ───────────── Плеер урока ───────────── */
.learn { display: grid; grid-template-columns: 300px 1fr; gap: 0; max-width: 1360px; margin: 0 auto; min-height: calc(100vh - var(--header-h)); }
.learn-side { border-right: 1px solid var(--line); padding: 24px 18px; position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h)); overflow-y: auto; background: var(--surface-2); }
.learn-course { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 14px; }
.learn-progress { display: flex; flex-direction: column; gap: 6px; margin-bottom: 20px; }
.learn-outline-toggle { display: none; }
.lo-chapter { margin-bottom: 18px; }
.lo-chapter-title { font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 800; margin: 0 0 6px 8px; }
.lo-chapter ul { list-style: none; padding: 0; margin: 0; }
.lo-chapter a, .lo-chapter .locked { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; font-size: .9rem; line-height: 1.35; }
.lo-chapter a:hover { background: var(--bg-2); color: var(--ink); }
.lo-chapter li.current a { background: var(--primary-50); color: var(--primary-600); font-weight: 700; }
.lo-chapter li.done .icon { color: var(--teal); }
.lo-chapter .locked { color: var(--muted); }
.learn-main { padding: 32px clamp(20px, 4vw, 56px) 48px; min-width: 0; max-width: 900px; }
.learn-crumbs { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.learn-title { font-size: clamp(1.7rem, 3vw, 2.3rem); }
.learn-footer { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); }
.learn-footer > :last-child { justify-self: end; }
.locked-card { margin-top: 24px; }

/* ───────────── Защита материалов ───────────── */
.protected { position: relative; }
.protected.no-select { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.protected.no-select input, .protected.no-select textarea { -webkit-user-select: text; user-select: text; }
.wm-tile { position: absolute; inset: 0; pointer-events: none; z-index: 5; background-repeat: repeat; }
.wm-float { position: fixed; z-index: 6; pointer-events: none; font-size: 13px; font-weight: 700; color: rgba(120, 120, 120, .28); white-space: nowrap; animation: wm-move 37s linear infinite; text-shadow: 0 0 1px rgba(255, 255, 255, .2); }
@keyframes wm-move {
    0% { top: 18%; left: 8%; } 20% { top: 72%; left: 22%; } 40% { top: 36%; left: 64%; }
    60% { top: 82%; left: 58%; } 80% { top: 24%; left: 40%; } 100% { top: 18%; left: 8%; }
}
.protect-shield { display: none; position: fixed; inset: 0; z-index: 150; background: var(--bg); color: var(--muted); align-items: center; justify-content: center; gap: 10px; font-weight: 700; flex-direction: column; }
body.pg-hidden .protected > :not(.protect-shield), body.pg-shielded .protected > :not(.protect-shield) { filter: blur(18px); }
body.pg-shielded .protect-shield { display: flex; }
.protect-toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 300; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: .9rem; font-weight: 600; box-shadow: var(--shadow-lg); animation: slidein .2s ease; }
@media print {
    .protected, .site-header, .site-footer, .mobile-nav, .learn-side { display: none !important; }
    body::after { content: "Polyglot — printing is disabled / Տպելն արգելված է"; display: block; padding: 40px; font-size: 18px; }
}

/* ───────────── Блоки урока ───────────── */
.lesson-block { margin: 28px 0; }
.block-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.block-head h2 { margin: 0; font-size: 1.15rem; }
.block-icon { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary-600); flex: none; }
.block-instruction { color: var(--ink-2); font-weight: 600; }
.prose { font-size: 1.04rem; line-height: 1.75; overflow-wrap: anywhere; }
.prose.small { font-size: .92rem; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose h2, .prose h3 { margin-top: 1.6em; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin: .25em 0; }
.prose blockquote { margin: 1em 0; padding: 12px 18px; border-left: 4px solid var(--primary); background: var(--surface-2); border-radius: 0 12px 12px 0; color: var(--ink-2); }
.prose table { border-collapse: collapse; width: 100%; margin: 1em 0; font-size: .95rem; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
.prose th { background: var(--bg-2); }
.prose a { color: var(--primary-600); text-decoration: underline; text-underline-offset: 3px; }
.prose img { border-radius: 12px; }
.prose mark { background: var(--gold-50); color: inherit; padding: 0 3px; border-radius: 4px; }

.callout { display: flex; gap: 14px; padding: 16px 18px; border-radius: 16px; border: 1px solid transparent; }
.callout-icon { flex: none; margin-top: 2px; }
.callout .prose { font-size: .98rem; flex: 1; }
.callout-info { background: var(--blue-50); border-color: color-mix(in srgb, var(--blue) 15%, transparent); }
.callout-info .callout-icon { color: var(--blue); }
.callout-tip { background: var(--teal-50); border-color: color-mix(in srgb, var(--teal) 15%, transparent); }
.callout-tip .callout-icon { color: var(--teal); }
.callout-warning { background: var(--gold-50); border-color: color-mix(in srgb, var(--gold) 20%, transparent); }
.callout-warning .callout-icon { color: var(--gold); }
.callout-rule { background: var(--primary-50); border-color: color-mix(in srgb, var(--primary) 18%, transparent); }
.callout-rule .callout-icon { color: var(--primary-600); }

.media-figure { margin: 0; }
.media-figure figcaption { font-size: .88rem; color: var(--muted); margin-top: 8px; text-align: center; }
.video-frame { position: relative; border-radius: 18px; overflow: hidden; background: #000; box-shadow: var(--shadow); }
.video-frame video { width: 100%; display: block; max-height: 72vh; background: #000; }
.media-missing { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 36px; border-radius: 16px; background: var(--bg-2); color: var(--muted); font-size: .9rem; }
.lesson-image { width: 100%; border-radius: 16px; display: block; -webkit-user-drag: none; }
.transcript { margin-top: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; background: var(--surface); }
.transcript summary { cursor: pointer; padding: 10px 0; font-weight: 650; font-size: .9rem; }
.audio-card { display: flex; align-items: center; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.audio-card audio { flex: 1; min-width: 0; }
.audio-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--berry-50); color: var(--berry); flex: none; }
.file-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); flex-wrap: wrap; }
.file-card.compact { padding: 10px 12px; }
.file-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--blue-50); color: var(--blue); flex: none; }
.file-info { flex: 1; display: flex; flex-direction: column; min-width: 160px; }
.file-actions { display: flex; gap: 8px; }
.pdf-frame { margin-top: 12px; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); }
.pdf-frame iframe { width: 100%; height: 75vh; border: 0; display: block; }

.vocab-toolbar { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.vocab-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.vocab-item { display: grid; grid-template-columns: 38px 1fr 1fr; gap: 4px 14px; align-items: center; padding: 10px 14px 10px 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.vocab-term { font-size: 1.05rem; cursor: pointer; }
.vocab-tr { color: var(--ink-2); cursor: pointer; }
.vocab-example { grid-column: 2 / -1; font-size: .88rem; color: var(--muted); font-style: italic; }
.transcription { color: var(--muted); font-size: .85rem; margin-left: 8px; font-weight: 500; font-family: var(--font-mono); }
.is-hidden { color: transparent !important; background: var(--bg-2); border-radius: 8px; }
.is-hidden * { visibility: hidden; }
.speak { color: var(--primary-600); }

.game-result { text-align: center; padding: 28px 20px; border-radius: 18px; background: var(--surface-2); border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.game-result > .icon { color: var(--gold); }
.game-result.ok h3 { color: var(--teal); }
.game-result.fail h3 { color: var(--berry); }
.score-ring { --p: 0; width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--primary) calc(var(--p) * 1%), var(--bg-2) 0); margin-bottom: 8px; }
.score-ring span { width: 76px; height: 76px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-weight: 800; font-size: 1.2rem; }

.flash-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.flashcard { perspective: 1200px; height: 230px; cursor: pointer; outline: none; }
.flashcard-inner { position: relative; width: 100%; height: 100%; transition: transform .5s cubic-bezier(.2, .8, .2, 1); transform-style: preserve-3d; }
.flashcard.is-flipped .flashcard-inner { transform: rotateY(180deg); }
.flashcard-face { position: absolute; inset: 0; border-radius: 22px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 20px; text-align: center; backface-visibility: hidden; -webkit-backface-visibility: hidden; font-size: 1.6rem; font-weight: 800; box-shadow: var(--shadow); }
.flashcard-face small { font-size: .78rem; font-weight: 600; }
.flashcard-face.front { background: var(--surface); border: 1px solid var(--line); }
.flashcard-face.back { background: linear-gradient(135deg, var(--primary), var(--berry)); color: #fff; transform: rotateY(180deg); }
.flash-actions { display: flex; justify-content: center; gap: 10px; margin-top: 16px; }

.quiz-progress { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.quiz-progress .progress { flex: 1; }
.quiz-question { font-size: 1.2rem; }
.quiz-options { display: grid; gap: 10px; margin: 14px 0; }
.quiz-option { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; border-radius: 14px; border: 1.5px solid var(--line-2); background: var(--surface); font: inherit; font-size: 1rem; text-align: left; cursor: pointer; color: var(--ink); transition: border-color .15s, background .15s; }
.quiz-option:hover:not([disabled]) { border-color: var(--primary); }
.quiz-option[disabled] { cursor: default; }
.quiz-option.selected { border-color: var(--primary); background: var(--primary-50); }
.quiz-option.correct { border-color: var(--teal); background: var(--teal-50); color: var(--teal); }
.quiz-option.wrong { border-color: var(--berry); background: var(--berry-50); color: var(--berry); }
.quiz-mark { width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid currentColor; display: grid; place-items: center; flex: none; opacity: .7; }
.quiz-explanation { display: flex; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--gold-50); margin-bottom: 14px; font-size: .95rem; }
.quiz-explanation .icon { color: var(--gold); margin-top: 3px; }
.quiz-actions { display: flex; justify-content: flex-end; }

.match-meta { display: flex; justify-content: space-between; margin-bottom: 10px; }
.match-board { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.match-col { display: flex; flex-direction: column; gap: 8px; }
.match-tile { padding: 13px 14px; border-radius: 12px; border: 1.5px solid var(--line-2); background: var(--surface); font: inherit; font-weight: 650; cursor: pointer; color: var(--ink); transition: all .15s; }
.match-tile:hover:not([disabled]) { border-color: var(--primary); }
.match-tile.selected { border-color: var(--primary); background: var(--primary-50); color: var(--primary-600); }
.match-tile.wrong { border-color: var(--berry); background: var(--berry-50); animation: shake .35s; }
.match-tile.matched { border-color: transparent; background: var(--teal-50); color: var(--teal); opacity: .6; cursor: default; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

.fill-text { font-size: 1.1rem; line-height: 2.4; padding: 18px 20px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); margin-bottom: 14px; white-space: pre-wrap; }
.gap { display: inline-block; min-width: 4ch; padding: 2px 8px; margin: 0 3px; border: 0; border-bottom: 2px solid var(--primary); background: var(--primary-50); border-radius: 8px 8px 0 0; font: inherit; color: var(--ink); text-align: center; }
.gap:focus { outline: none; background: color-mix(in srgb, var(--primary) 20%, var(--surface)); }
.gap.correct { border-bottom-color: var(--teal); background: var(--teal-50); color: var(--teal); }
.gap.wrong { border-bottom-color: var(--berry); background: var(--berry-50); color: var(--berry); }
.gap-answer { font-size: .85rem; color: var(--teal); font-weight: 700; margin-right: 6px; }
.fill-result { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 12px; background: var(--bg-2); margin-bottom: 12px; font-weight: 650; }
.fill-result.ok { background: var(--teal-50); color: var(--teal); }

.order-meta { margin-bottom: 6px; }
.order-prompt { display: flex; gap: 8px; align-items: center; font-weight: 700; font-size: 1.05rem; }
.order-answer { min-height: 62px; padding: 10px; border-radius: 14px; border: 2px dashed var(--line-2); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; transition: border-color .2s, background .2s; }
.order-answer.correct { border-color: var(--teal); border-style: solid; background: var(--teal-50); }
.order-answer.wrong { border-color: var(--berry); border-style: solid; background: var(--berry-50); animation: shake .35s; }
.order-bank { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.word-chip { padding: 9px 14px; border-radius: 12px; border: 1.5px solid var(--line-2); background: var(--surface); font: inherit; font-weight: 650; cursor: pointer; color: var(--ink); box-shadow: 0 2px 0 var(--line-2); }
.word-chip:hover:not([disabled]) { border-color: var(--primary); }
.word-chip[disabled] { opacity: .25; cursor: default; box-shadow: none; }
.word-chip.picked { background: var(--primary-50); border-color: var(--primary); color: var(--primary-600); }
.order-solution { display: flex; gap: 8px; align-items: center; color: var(--teal); font-weight: 650; }

/* ───────────── Повторение ───────────── */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.stat > .icon { color: var(--primary); margin-bottom: 6px; }
.stat-value { font-size: 1.7rem; font-weight: 800; line-height: 1.1; }
.stat-label { font-size: .84rem; color: var(--muted); font-weight: 600; }
.stat-link:hover { border-color: var(--primary); color: inherit; }
.review-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.review-toolbar .switch { margin: 0; }
.review-card { min-height: 260px; border-radius: 26px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 18px; padding: 30px; text-align: center; margin-bottom: 18px; outline: none; }
.review-front { display: flex; align-items: center; gap: 10px; font-size: 2rem; font-weight: 800; }
.review-back { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 1.5rem; font-weight: 700; color: var(--primary-600); padding-top: 18px; border-top: 1px dashed var(--line-2); width: 100%; animation: fade .2s ease; }
.grade-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.grade { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 8px; border-radius: 14px; border: 1.5px solid var(--line-2); background: var(--surface); cursor: pointer; font: inherit; color: var(--ink); position: relative; }
.grade kbd { position: absolute; top: 6px; right: 6px; }
.grade-again { border-color: color-mix(in srgb, var(--berry) 45%, transparent); }
.grade-again strong { color: var(--berry); }
.grade-hard strong { color: var(--gold); }
.grade-good { border-color: color-mix(in srgb, var(--teal) 45%, transparent); }
.grade-good strong { color: var(--teal); }
.grade-easy strong { color: var(--blue); }
.grade:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

/* ───────────── Личный кабинет ───────────── */
.dash-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.dash-grid { display: grid; grid-template-columns: 1fr 340px; gap: 28px; align-items: start; }
.dash-main { min-width: 0; }
.dash-side { display: flex; flex-direction: column; }
.my-courses { display: flex; flex-direction: column; gap: 12px; }
.my-course { display: grid; grid-template-columns: 64px 1fr auto; gap: 16px; align-items: center; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.my-course-art { width: 64px; height: 64px; border-radius: 16px; display: grid; place-items: center; font-family: var(--font-display); font-size: 1.8rem; color: #fff; background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #1f1d2b)); }
.my-course-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.my-course-body h3 { margin: 0; }
.mini-list { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; }
.mini-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.mini-list li:last-child { border-bottom: 0; }
.mini-list li.active { background: var(--primary-50); border-radius: 10px; padding-left: 10px; padding-right: 10px; }

/* ───────────── Бронирование ───────────── */
.credit-strip { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; border-radius: 14px; background: var(--teal-50); color: var(--teal); font-weight: 650; margin-bottom: 18px; }
.booking-flow { display: flex; flex-direction: column; gap: 0; }
.booking-step { transition: opacity .2s; }
.booking-step.is-disabled { opacity: .45; pointer-events: none; }
.step-title { display: flex; align-items: center; gap: 10px; font-size: 1.05rem; margin-bottom: 14px; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.choice { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; border: 1.5px solid var(--line-2); background: var(--surface); text-align: left; font: inherit; color: var(--ink); cursor: pointer; transition: border-color .15s, background .15s; }
.choice:hover { border-color: var(--primary); }
.choice.active { border-color: var(--primary); background: var(--primary-50); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent); }
.choice-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--bg-2); color: var(--primary-600); flex: none; }
.choice-text { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }
.date-nav { display: flex; align-items: center; gap: 6px; margin-bottom: 16px; }
.date-strip { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px; flex: 1; scrollbar-width: thin; }
.date-cell { display: flex; flex-direction: column; align-items: center; gap: 0; min-width: 62px; padding: 8px 6px; border-radius: 14px; border: 1.5px solid var(--line-2); background: var(--surface); cursor: pointer; font: inherit; color: var(--ink); }
.date-cell strong { font-size: 1.25rem; }
.date-cell .tiny { color: var(--teal); font-weight: 700; }
.date-cell.empty { opacity: .4; cursor: default; }
.date-cell.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.date-cell.active .tiny { color: var(--bg); }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; }
.slot { padding: 10px; border-radius: 12px; border: 1.5px solid var(--line-2); background: var(--surface); font: inherit; font-weight: 700; cursor: pointer; color: var(--ink); }
.slot:hover { border-color: var(--primary); }
.slot.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.booking-confirm { border: 1.5px solid var(--primary); box-shadow: var(--shadow); }
.summary { display: grid; grid-template-columns: 140px 1fr; gap: 8px 16px; margin: 0 0 16px; }
.summary dt { color: var(--muted); font-size: .9rem; }
.summary dd { margin: 0; font-weight: 650; }
.package-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-top: 14px; }
.package-card { position: relative; padding: 22px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.package-card h3 { margin: 0; }
.package-save { position: absolute; top: 14px; right: 14px; background: var(--berry); color: #fff; font-size: .75rem; font-weight: 800; padding: 3px 8px; border-radius: 99px; }
.package-count { color: var(--ink-2); }
.package-count strong { font-size: 1.4rem; }
.package-price { font-family: var(--font-display); font-size: 1.7rem; font-weight: 650; }
.package-card .btn { margin-top: 10px; }
.booking-list { display: flex; flex-direction: column; gap: 10px; }
.booking-card { display: grid; grid-template-columns: 74px 1fr auto; gap: 16px; align-items: center; padding: 14px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.booking-date { display: flex; flex-direction: column; align-items: center; padding: 8px 4px; border-radius: 14px; background: var(--primary-50); color: var(--primary-600); line-height: 1.2; }
.booking-date strong { font-size: 1.5rem; }
.booking-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.booking-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.teacher-notes summary { cursor: pointer; font-size: .88rem; font-weight: 650; color: var(--primary-600); display: inline-flex; gap: 6px; align-items: center; }

/* ───────────── Чат ───────────── */
.chat-page { padding-top: 20px; padding-bottom: 20px; }
.chat { display: grid; grid-template-columns: 320px 1fr; height: calc(100vh - var(--header-h) - 60px); min-height: 480px; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); box-shadow: var(--shadow-sm); }
.chat-list { border-right: 1px solid var(--line); overflow-y: auto; background: var(--surface-2); }
.chat-list-head { padding: 18px 18px 8px; }
.chat-list-head h1 { font-size: 1.4rem; margin: 0; }
.chat-list ul { list-style: none; margin: 0; padding: 6px; }
.chat-conv { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 14px; }
.chat-conv:hover { background: var(--bg-2); color: inherit; }
.chat-conv.active { background: var(--primary-50); }
.chat-conv-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chat-thread { display: flex; flex-direction: column; min-width: 0; }
.chat-placeholder { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); gap: 10px; }
.chat-thread-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.chat-back { display: none; }
.chat-messages { flex: 1; overflow-y: auto; padding: 18px 16px; display: flex; flex-direction: column; gap: 6px; background: radial-gradient(circle at 10% 10%, color-mix(in srgb, var(--primary) 5%, transparent), transparent 40%), var(--bg); }
.chat-day { text-align: center; margin: 10px 0; }
.chat-day span { font-size: .74rem; font-weight: 700; color: var(--muted); background: var(--surface); padding: 3px 10px; border-radius: 99px; border: 1px solid var(--line); }
.msg { display: flex; align-items: flex-end; gap: 6px; max-width: 78%; }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.msg-bubble { padding: 9px 12px 6px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.msg.mine .msg-bubble { background: var(--primary); color: #fff; border-color: var(--primary); border-bottom-right-radius: 6px; }
.msg.theirs .msg-bubble { border-bottom-left-radius: 6px; }
.msg-text { font-size: .95rem; line-height: 1.5; }
.msg-text p { margin: 0 0 .4em; }
.msg.mine .msg-text a { color: #fff; }
.msg-meta { align-self: flex-end; font-size: .68rem; opacity: .7; display: inline-flex; gap: 4px; align-items: center; }
.msg-image { max-width: 260px; max-height: 260px; border-radius: 12px; display: block; }
.msg-file { display: inline-flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: rgba(0, 0, 0, .06); font-size: .9rem; }
.msg.mine .msg-file { background: rgba(255, 255, 255, .18); color: #fff; }
.msg-delete { opacity: 0; width: 28px; height: 28px; }
.msg:hover .msg-delete { opacity: .6; }
.chat-composer { border-top: 1px solid var(--line); padding: 10px 12px; background: var(--surface); }
.composer-file { display: inline-flex; align-items: center; gap: 6px; padding: 4px 4px 4px 10px; border-radius: 10px; background: var(--bg-2); font-size: .85rem; margin-bottom: 8px; }
.composer-file .icon-btn { width: 26px; height: 26px; }
.composer-row { display: flex; align-items: flex-end; gap: 8px; }
.composer-row textarea { max-height: 160px; }
.composer-attach { position: relative; overflow: hidden; cursor: pointer; flex: none; }
.composer-attach input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.chat-readonly { padding: 14px; text-align: center; border-top: 1px solid var(--line); }

/* ───────────── Видеозвонок ───────────── */
.call-shell { min-height: 100vh; background: #0e0d13; color: #f3efe8; }
.call-center { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.call-center .state-card { color: var(--ink); }
.call { position: relative; height: 100vh; display: flex; flex-direction: column; background: #0e0d13; }
.call-stage { position: relative; flex: 1; overflow: hidden; }
.call-remote { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; opacity: 0; transition: opacity .3s; }
body.call-connected .call-remote { opacity: 1; }
.call-waiting { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: #d5d0c7; background: radial-gradient(circle at 50% 40%, #2a2638, #0e0d13 70%); }
body.call-connected .call-waiting { display: none; }
.call-waiting .muted { color: #9c98aa; }
.call-local { position: absolute; right: 20px; bottom: 20px; width: clamp(120px, 22vw, 260px); aspect-ratio: 4 / 3; object-fit: cover; border-radius: 16px; border: 2px solid rgba(255, 255, 255, .15); background: #1d1c26; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); transform: scaleX(-1); z-index: 2; }
.call-top { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: flex-start; padding: 18px 22px; background: linear-gradient(180deg, rgba(0, 0, 0, .55), transparent); z-index: 3; }
.call-top > div { display: flex; flex-direction: column; }
.call-top .muted { color: #c9c4d4; }
.call-timer { font-family: var(--font-mono); background: rgba(255, 255, 255, .12); padding: 4px 10px; border-radius: 99px; font-size: .9rem; }
.call-controls { display: flex; justify-content: center; gap: 14px; padding: 16px; padding-bottom: max(16px, env(safe-area-inset-bottom)); background: #15141c; }
.call-btn { width: 56px; height: 56px; border-radius: 50%; border: 0; background: #2a2838; color: #fff; cursor: pointer; display: grid; place-items: center; transition: background .15s, transform .1s; }
.call-btn:hover { background: #3a3849; color: #fff; }
.call-btn:active { transform: scale(.96); }
.call-btn .off { display: none; }
.call-btn.is-off { background: #f3efe8; color: #1f1d2b; }
.call-btn.is-off .on { display: none; }
.call-btn.is-off .off { display: block; }
.call-btn.is-active { background: var(--primary); }
.call-btn.danger { background: #d93b56; }
.call-btn.danger:hover { background: #bf2f48; }

/* ───────────── Кабинет преподавателя ───────────── */
.subnav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 24px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; width: fit-content; max-width: 100%; overflow-x: auto; }
.subnav a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 10px; font-weight: 650; font-size: .9rem; color: var(--ink-2); white-space: nowrap; }
.subnav a:hover { background: var(--bg-2); }
.subnav a.active { background: var(--ink); color: var(--bg); }
.week-editor { display: flex; flex-direction: column; gap: 4px; margin-bottom: 18px; }
.week-day { display: grid; grid-template-columns: 140px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.week-day-name { font-weight: 700; }
.week-day-slots { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.time-range { display: inline-flex; align-items: center; gap: 6px; padding: 4px; border-radius: 12px; background: var(--bg-2); }
.time-range .input { width: 110px; }
.time-range .icon-btn { width: 30px; height: 30px; }
.profile-photo { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; }
.profile-photo > div { display: flex; gap: 8px; flex-wrap: wrap; }
.teacher-admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.teacher-admin { display: flex; flex-direction: column; gap: 12px; margin: 0; }

/* ───────────── Вход / регистрация ───────────── */
.auth { display: grid; grid-template-columns: 1fr 1fr; min-height: calc(100vh - var(--header-h)); }
.auth-card { width: 100%; max-width: 460px; margin: 0 auto; padding: 56px 24px; align-self: center; }
.auth-card h1 { margin-bottom: 4px; }
.auth-card > p.muted { margin-bottom: 26px; }
.auth-alt { margin-top: 22px; text-align: center; color: var(--muted); font-size: .93rem; }
.auth-alt a { color: var(--primary-600); font-weight: 700; }
.auth-art { position: relative; overflow: hidden; background: radial-gradient(circle at 80% 15%, rgba(255, 255, 255, .2), transparent 45%), linear-gradient(140deg, #2a2838 0%, #5a3048 45%, var(--primary) 100%); color: #fff; }
.auth-art-inner { position: absolute; inset: 0; }
.auth-art .ornament { position: absolute; inset: 0; opacity: .25; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cpath d='M40 10l7.5 22.5L70 40l-22.5 7.5L40 70l-7.5-22.5L10 40l22.5-7.5z' fill='none' stroke='%23fff' stroke-opacity='.5' stroke-width='1'/%3E%3C/svg%3E"); }
.floating-card { position: absolute; display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-radius: 18px; background: rgba(255, 255, 255, .95); color: #1f1d2b; font-weight: 700; box-shadow: 0 20px 50px -15px rgba(0, 0, 0, .5); animation: float 6s ease-in-out infinite; }
.fc-1 { top: 22%; left: 14%; font-size: 1.2rem; }
.fc-term { font-weight: 800; }
.fc-arrow { color: #b8b3c2; }
.fc-tr { color: #e8743b; }
.fc-2 { top: 44%; right: 12%; color: #1d8a7a; animation-delay: -2s; }
.fc-3 { top: 62%; left: 22%; color: #c99212; animation-delay: -4s; }
.auth-quote { position: absolute; left: 12%; right: 12%; bottom: 10%; font-family: var(--font-display); font-size: 1.5rem; line-height: 1.35; font-style: italic; opacity: .95; }

/* ───────────── Админка ───────────── */
.admin { display: grid; grid-template-columns: 240px 1fr; gap: 28px; padding-top: 28px; padding-bottom: 48px; align-items: start; }
.admin-side { position: sticky; top: calc(var(--header-h) + 20px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.admin-side-title { display: flex; align-items: center; gap: 8px; font-size: .76rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 6px 10px 10px; }
.admin-side nav { display: flex; flex-direction: column; gap: 2px; }
.admin-side nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; font-weight: 650; font-size: .92rem; color: var(--ink-2); }
.admin-side nav a:hover { background: var(--bg-2); color: var(--ink); }
.admin-side nav a.active { background: var(--primary-50); color: var(--primary-600); }
.admin-main { min-width: 0; }
.edit-grid { display: grid; grid-template-columns: 1fr 340px; gap: 22px; align-items: start; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 18px; align-items: start; }
.settings-grid .card { margin: 0; }
.preview-box { border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: var(--surface-2); min-height: 120px; }
.cover-preview { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px; margin-bottom: 8px; }

.structure { display: flex; flex-direction: column; gap: 16px; }
.chapter-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.chapter-card.add-chapter { border-style: dashed; text-align: center; }
.chapter-head { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.chapter-title { flex: 1; display: flex; align-items: center; gap: 10px; }
.chapter-title h2 { margin: 0; font-size: 1.08rem; }
.chapter-edit { flex: 1; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.lesson-rows { list-style: none; margin: 0; padding: 0; }
.lesson-row { display: flex; align-items: center; gap: 12px; padding: 8px 4px; border-radius: 10px; }
.lesson-row:hover { background: var(--surface-2); }
.lesson-row-title { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.lesson-row-flags { display: flex; gap: 6px; }
.add-lesson { display: flex; gap: 8px; padding-top: 10px; align-items: center; }
.add-lesson .input { max-width: 360px; }

.lesson-editor { display: grid; grid-template-columns: 1fr 320px; gap: 22px; align-items: start; }
.lesson-blocks { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.block-palette { margin-top: 10px; padding: 18px; border-radius: var(--radius); border: 1.5px dashed var(--line-2); background: var(--surface-2); }
.block-palette h3 { margin-bottom: 12px; }
.palette-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.palette-item { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; text-align: left; font: inherit; color: var(--ink); transition: border-color .15s, transform .1s; }
.palette-item:hover { border-color: var(--primary); transform: translateY(-1px); }
.palette-item .block-icon { margin-bottom: 4px; }

.block-editor { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); scroll-margin-top: calc(var(--header-h) + 16px); }
.block-editor.dirty { border-color: var(--gold); }
.be-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.be-toggle { display: inline-flex; align-items: center; gap: 10px; border: 0; background: none; cursor: pointer; font: inherit; color: var(--ink); padding: 0; flex: none; }
.be-type { font-weight: 750; font-size: .92rem; min-width: 110px; text-align: left; }
.be-title { flex: 1; min-width: 120px; }
.be-actions { display: flex; align-items: center; gap: 2px; }
.be-actions .icon-btn { width: 32px; height: 32px; }
.dirty-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--gold); margin-right: 6px; }
.be-tabs { display: flex; gap: 4px; padding: 0 12px; border-bottom: 1px solid var(--line); }
.be-tabs button { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border: 0; background: none; font: inherit; font-size: .85rem; font-weight: 650; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; }
.be-tabs button.active { color: var(--ink); border-bottom-color: var(--primary); }
.be-body { padding: 16px; }
.be-preview { padding: 6px; }
.be-preview .lesson-block { margin: 0; }
.be-foot { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }

.media-editor { display: flex; flex-direction: column; gap: 6px; }
.media-current { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; padding: 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); margin-bottom: 14px; }
.media-thumb { max-width: 100%; max-height: 260px; border-radius: 10px; }
.poster-thumb { height: 64px; border-radius: 8px; }
.large-upload { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.upload-progress { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.upload-progress .progress { flex: 1; }

.list-editor { display: flex; flex-direction: column; gap: 6px; }
.list-editor-head { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 800; color: var(--muted); }
.vocab-cols { display: grid; grid-template-columns: 1.1fr .9fr 1.1fr 1.4fr 70px; gap: 6px; align-items: center; }
.pair-cols { display: grid; grid-template-columns: 1fr 1fr 70px; gap: 6px; align-items: center; }
.row-actions { display: flex; gap: 2px; }
.row-actions .icon-btn { width: 30px; height: 30px; }
.bulk-box { padding: 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.quiz-editor { display: flex; flex-direction: column; gap: 12px; }
.quiz-q { padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); display: flex; flex-direction: column; gap: 8px; }
.quiz-q-head { display: flex; align-items: center; gap: 8px; }
.quiz-opt { display: flex; align-items: center; gap: 8px; padding-left: 34px; }
.quiz-opt .check input { margin-top: 0; }

/* ───────────── Адаптив ───────────── */
@media (max-width: 1100px) {
    .main-nav { display: none; }
    .course-hero-grid, .course-content { grid-template-columns: 1fr; }
    .course-content > aside { display: none; }
    .buy-card { position: static; }
    .edit-grid, .lesson-editor { grid-template-columns: 1fr; }
    .sticky { position: static; }
    .feature-grid { grid-template-columns: repeat(2, 1fr); }
    .steps { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
    :root { --header-h: 60px; }
    body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
    .hide-sm { display: none !important; }
    .user-chip-name { display: none; }
    .user-chip { padding: 3px; }
    .user-chip > .icon { display: none; }
    .hero { padding: 40px 0 56px; }
    .hero-grid { grid-template-columns: 1fr; }
    .hero-visual { height: 360px; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .dash-grid { grid-template-columns: 1fr; }
    .pay-grid { grid-template-columns: 1fr; gap: 28px; }
    .auth { grid-template-columns: 1fr; }
    .auth-art { display: none; }
    .admin { grid-template-columns: 1fr; }
    .admin-side { position: static; }
    .admin-side nav { flex-direction: row; overflow-x: auto; }
    .admin-side nav a { white-space: nowrap; }
    .learn { grid-template-columns: 1fr; }
    .learn-side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 16px 20px; }
    .learn-outline-toggle { display: inline-flex; }
    .learn-outline { display: none; margin-top: 12px; }
    .learn-side.open .learn-outline { display: block; }
    .learn-main { padding: 24px 20px 40px; }
    .learn-footer { grid-template-columns: 1fr 1fr; }
    .learn-footer > button, .learn-footer > .btn-soft { grid-column: 1 / -1; order: -1; }
    .chat { grid-template-columns: 1fr; height: calc(100vh - var(--header-h) - 100px); border-radius: 18px; }
    .chat.show-thread .chat-list { display: none; }
    .chat.show-list .chat-thread { display: none; }
    .chat-back { display: inline-grid; }
    .msg { max-width: 92%; }
    .payment-card { grid-template-columns: 72px 1fr; }
    .receipt-thumb { width: 72px; height: 72px; }
    .payment-side { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; flex-wrap: wrap; }
    .booking-card { grid-template-columns: 64px 1fr; }
    .booking-actions { grid-column: 1 / -1; justify-content: flex-start; }
    .my-course { grid-template-columns: 52px 1fr; }
    .my-course > .btn { grid-column: 1 / -1; }
    .my-course-art { width: 52px; height: 52px; }
    .week-day { grid-template-columns: 1fr; gap: 6px; }
    .vocab-cols { grid-template-columns: 1fr 1fr; }
    .vocab-cols.list-editor-head { display: none; }
    .grade-row { grid-template-columns: repeat(2, 1fr); }
    .cta-band { padding: 30px 24px; }

    .mobile-nav {
        display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
        background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px);
        border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    }
    .mobile-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border-radius: 12px; font-size: .66rem; font-weight: 700; color: var(--muted); text-align: center; line-height: 1.2; }
    .mobile-nav a.active { color: var(--primary-600); background: var(--primary-50); }
    .call-shell + .mobile-nav, .call-shell .mobile-nav { display: none; }
    .toasts { bottom: calc(80px + env(safe-area-inset-bottom)); right: 12px; left: 12px; max-width: none; }
}

@media (max-width: 600px) {
    .container { padding: 0 16px; }
    .feature-grid, .steps { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .match-board { gap: 8px; }
    .match-tile { padding: 11px 10px; font-size: .9rem; }
    .vocab-item { grid-template-columns: 34px 1fr; }
    .vocab-tr { grid-column: 2; }
    .summary { grid-template-columns: 1fr; gap: 2px; }
    .summary dd { margin-bottom: 8px; }
    .review-front { font-size: 1.6rem; }
    .flashcard-face { font-size: 1.3rem; }
    .settings-grid { grid-template-columns: 1fr; }
    .input.search { max-width: none; }
    .call-btn { width: 50px; height: 50px; }
    .call-controls { gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
    .wm-float { animation: none; top: 40%; left: 30%; }
}

/* Blazor: ошибка соединения/исключение */
#blazor-error-ui { display: none; position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 1000; background: var(--berry); color: #fff; padding: 12px 18px; border-radius: 14px; box-shadow: var(--shadow-lg); gap: 12px; align-items: center; font-weight: 600; }
#blazor-error-ui .reload { text-decoration: underline; color: #fff; }
#blazor-error-ui .dismiss { cursor: pointer; margin-left: 8px; }
.components-reconnect-show, .components-reconnect-failed, .components-reconnect-rejected { }

/* ===== Translations editor (admin) ===== */
.translations { border: 1px dashed var(--line); border-radius: 14px; padding: 14px 16px; margin: 6px 0 14px; background: color-mix(in srgb, var(--bg-2) 55%, transparent); }
.translations-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.translations-head .small { display: inline-flex; align-items: center; gap: 6px; }
.translations .segmented button { display: inline-flex; align-items: center; gap: 4px; }
.translations .field:last-of-type { margin-bottom: 6px; }
.be-culture { width: auto; min-width: 140px; max-width: 200px; flex: 0 0 auto; }
@media (max-width: 640px) { .be-culture { min-width: 0; max-width: 130px; } }
