/* ============ NaNO — дизайн-система ============ */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f1f2f5;
  --surface-3: #e8e9ee;
  --border: #e4e6eb;
  --border-strong: #d2d5dc;
  --text: #16181d;
  --muted: #5e6472;
  --faint: #9aa0ac;
  --accent: #6d5dfc;
  --accent-hover: #5b4ae8;
  --accent-soft: rgba(109, 93, 252, 0.1);
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --info: #0891b2;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow: 0 4px 16px -4px rgba(16, 24, 40, 0.1), 0 2px 4px -2px rgba(16, 24, 40, 0.05);
  --shadow-lg: 0 20px 40px -12px rgba(16, 24, 40, 0.25);
  --radius: 14px;
  --radius-sm: 10px;
  --sidebar: 252px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}
:root[data-theme='dark'] {
  --bg: #0e0f13;
  --surface: #16171c;
  --surface-2: #1e2027;
  --surface-3: #272a33;
  --border: #262830;
  --border-strong: #353844;
  --text: #ecedf1;
  --muted: #9a9fac;
  --faint: #636875;
  --accent: #7b6dff;
  --accent-hover: #8e82ff;
  --accent-soft: rgba(123, 109, 255, 0.14);
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #22d3ee;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 4px 16px -4px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 20px 40px -12px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14.5px; line-height: 1.55; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
img, video { display: block; max-width: 100%; }
::selection { background: var(--accent-soft); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
h1, h2, h3 { font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
h1 { font-size: clamp(24px, 2.6vw, 30px); }
h2 { font-size: 20px; }
h3 { font-size: 15.5px; font-weight: 650; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.grad-text { color: var(--accent); }
.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
i[data-icon] { font-style: normal; display: inline-grid; place-items: center; }

/* Плашка с иконкой */
.ic-tile { --c: var(--accent); --s: 44px; width: var(--s); height: var(--s); border-radius: calc(var(--s) * 0.27); display: inline-grid; place-items: center; flex: none;
  background: color-mix(in srgb, var(--c) 12%, transparent); color: var(--c); }
.ic-tile .icon { width: calc(var(--s) * 0.46); height: calc(var(--s) * 0.46); }
.stat-ic { --c: var(--accent); width: 40px; height: 40px; border-radius: 11px; background: color-mix(in srgb, var(--c) 12%, transparent); color: var(--c); flex: none; }
.empty-ic { width: 56px; height: 56px; border-radius: 16px; background: var(--surface-2); color: var(--faint); margin: 0 auto 14px; display: grid !important; }
.empty-ic .icon { width: 26px; height: 26px; }

.bg-orbs, .bg-grid { display: none; }

/* ---------- Каркас ---------- */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 2px; padding: 18px 12px; border-right: 1px solid var(--border); background: var(--surface); z-index: 30; overflow-y: auto; }
.logo { display: flex; align-items: center; gap: 10px; padding: 4px 10px 16px; }
.logo-mark { width: 32px; height: 32px; border-radius: 9px; background: var(--accent); display: grid; place-items: center; font-weight: 800; color: #fff; font-size: 15px; }
.logo-text { font-weight: 800; font-size: 19px; letter-spacing: -0.03em; }
.logo-text b { color: var(--accent); }
.nav-label { font-size: 11.5px; color: var(--faint); padding: 14px 12px 6px; font-weight: 600; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 8px 12px; border-radius: 9px; color: var(--muted); font-weight: 550; transition: background 0.15s, color 0.15s; }
.nav-item .icon { width: 18px; height: 18px; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); }
.nav-item .count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 11.5px; display: grid; place-items: center; font-weight: 700; }
.nav-item .live-dot { margin-left: auto; }
.nav-item .count.warn { background: var(--warning); }
.nav { display: flex; flex-direction: column; gap: 6px; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-group + .nav-group { padding-top: 6px; border-top: 1px solid var(--border); }
.nav-group .nav-label { padding-top: 8px; }
.side-user-row .icon { width: 16px; height: 16px; }
.side-user-row:hover .side-user-name { color: var(--accent); }
.side-user { margin-top: auto; padding: 12px; border-radius: 12px; background: var(--surface-2); display: flex; flex-direction: column; gap: 9px; }
.side-user-row { display: flex; align-items: center; gap: 10px; }
.side-user-name { font-weight: 650; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user .icon { width: 14px; height: 14px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 12px 28px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.topbar .menu-btn { display: none; }
.search { position: relative; flex: 1; max-width: 440px; }
.search input { width: 100%; padding: 9px 14px 9px 38px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); outline: none; transition: border-color 0.15s, box-shadow 0.15s; }
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search > .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); width: 17px; height: 17px; }
.search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; padding: 6px; display: none; }
.search-results.open { display: block; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--border); color: var(--muted); transition: 0.15s; position: relative; }
.icon-btn .icon { width: 18px; height: 18px; }
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }
.icon-btn .dot { position: absolute; top: 8px; right: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 2px var(--surface); }
.view { padding: 28px 28px 60px; max-width: 1320px; width: 100%; margin: 0 auto; animation: viewIn 0.25s ease; }
@keyframes viewIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- Базовые компоненты ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; position: relative; box-shadow: var(--shadow-sm); }
.card.hover { transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s; cursor: pointer; }
.card.hover:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h3 { display: flex; align-items: center; gap: 8px; }
.card-head a { font-size: 13px; color: var(--muted); font-weight: 550; display: flex; align-items: center; gap: 2px; }
.card-head a .icon { width: 15px; height: 15px; }
.card-head a:hover { color: var(--accent); }
.glass { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 16px; border-radius: 10px; font-weight: 600; font-size: 14px; transition: background 0.15s, border-color 0.15s, color 0.15s; white-space: nowrap; border: 1px solid transparent; user-select: none; }
.btn .icon { width: 17px; height: 17px; }
.btn:disabled { opacity: 0.5; pointer-events: none; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-soft { background: var(--surface); border-color: var(--border); color: var(--text); box-shadow: var(--shadow-sm); }
.btn-soft:hover { border-color: var(--border-strong); background: var(--surface-2); }
.btn-ghost { color: var(--muted); }
.btn-ghost:hover { color: var(--text); background: var(--surface-2); }
.btn-danger { background: color-mix(in srgb, var(--danger) 10%, transparent); color: var(--danger); }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 16%, transparent); }
.btn-success { background: var(--success); color: #fff; }
.btn-lg { padding: 12px 22px; font-size: 15px; border-radius: 12px; }
.btn-sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }

.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.chip .icon { width: 13px; height: 13px; }
.chip.accent { background: var(--accent-soft); color: var(--accent); }
.chip.success { background: color-mix(in srgb, var(--success) 12%, transparent); color: var(--success); }
.chip.warning { background: color-mix(in srgb, var(--warning) 13%, transparent); color: var(--warning); }
.chip.danger { background: color-mix(in srgb, var(--danger) 11%, transparent); color: var(--danger); }
.chip.cyan { background: color-mix(in srgb, var(--info) 12%, transparent); color: var(--info); }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filter { padding: 6px 13px; border-radius: 999px; font-weight: 550; font-size: 13.5px; color: var(--muted); background: var(--surface); border: 1px solid var(--border); transition: 0.15s; }
.filter:hover { color: var(--text); border-color: var(--border-strong); }
.filter.active { background: var(--text); color: var(--surface); border-color: var(--text); }

.avatar { --size: 40px; width: var(--size); height: var(--size); border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 700; color: #fff; font-size: calc(var(--size) * 0.38); position: relative; background: var(--c); }
.avatar.online::after { content: ''; position: absolute; right: 0; bottom: 0; width: 27%; height: 27%; min-width: 8px; min-height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 2px var(--surface); }
.avatar-stack { display: flex; }
.avatar-stack .avatar { margin-left: -8px; box-shadow: 0 0 0 2px var(--surface); }
.avatar-stack .avatar:first-child { margin-left: 0; }

.input, .textarea, .select { width: 100%; padding: 10px 13px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border-strong); outline: none; transition: border-color 0.15s, box-shadow 0.15s; }
.input:focus, .textarea:focus, .select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input:disabled { background: var(--surface-2); color: var(--muted); }
.textarea { resize: vertical; min-height: 88px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 13px; font-weight: 600; }
.form { display: flex; flex-direction: column; gap: 16px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }

.progress { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width 0.6s ease; }
.progress.cool > i { background: var(--info); }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 36px; }
.mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin-top: 6px; max-width: 620px; }
.page-head p code { font-size: 12.5px; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 550; margin-bottom: 14px; font-size: 13.5px; }
.back .icon { width: 16px; height: 16px; }
.back:hover { color: var(--text); }

.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty h3 { color: var(--text); margin-bottom: 4px; }

.tabs { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--surface-2); flex-wrap: wrap; }
.tab { padding: 6px 14px; border-radius: 8px; font-weight: 550; font-size: 13.5px; color: var(--muted); transition: 0.15s; display: inline-flex; align-items: center; gap: 6px; }
.tab .icon { width: 15px; height: 15px; }
.tab:hover { color: var(--text); }
.tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.list-item { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 10px; transition: background 0.15s; }
.list-item:hover { background: var(--surface-2); }
.list-item .title { font-weight: 600; }
.list-item .sub { font-size: 12.5px; color: var(--muted); }

.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); animation: pulse 1.6s infinite; display: inline-block; flex: none; }
.live-dot.green { background: var(--success); }
@keyframes pulse { 50% { opacity: 0.35; } }

.loader { display: grid; place-items: center; padding: 80px; }
.spinner { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--surface-3); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Тосты и модалки ---------- */
#toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: 12px; align-items: center; padding: 12px 14px; min-width: 280px; max-width: 380px; animation: toastIn 0.3s ease; cursor: pointer; }
.toast.out { animation: toastOut 0.25s forwards; }
.toast-title { font-weight: 650; font-size: 14px; }
.toast-text { font-size: 13px; color: var(--muted); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(20px); } }

.modal-backdrop { position: fixed; inset: 0; z-index: 150; background: rgba(10, 12, 20, 0.45); display: grid; place-items: center; padding: 20px; animation: fade 0.15s; }
.modal { width: 100%; max-width: 500px; max-height: 90vh; overflow-y: auto; padding: 24px; animation: pop 0.2s ease; }
.modal.wide { max-width: 720px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal-head .icon-btn { border: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(0.97); } }

.dropdown { position: absolute; right: 0; top: calc(100% + 8px); width: 360px; max-height: 460px; overflow-y: auto; padding: 8px; z-index: 50; animation: pop 0.15s; }
.notif { display: flex; gap: 12px; padding: 10px; border-radius: 10px; align-items: flex-start; }
.notif:hover { background: var(--surface-2); }

/* ---------- Лендинг и авторизация ---------- */
.landing { min-height: 100vh; display: flex; flex-direction: column; background: radial-gradient(1200px 500px at 70% -10%, var(--accent-soft), transparent 70%); }
.land-nav { display: flex; align-items: center; justify-content: space-between; padding: 20px 40px; max-width: 1240px; margin: 0 auto; width: 100%; }
.hero { max-width: 1240px; margin: 0 auto; padding: 50px 40px 30px; display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px; align-items: center; width: 100%; }
.hero h1 { font-size: clamp(36px, 4.6vw, 58px); line-height: 1.05; letter-spacing: -0.04em; font-weight: 800; }
.hero-sub { font-size: 17px; color: var(--muted); margin: 20px 0 30px; max-width: 520px; }
.hero-badge { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 6px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); font-size: 13px; font-weight: 550; margin-bottom: 22px; box-shadow: var(--shadow-sm); }
.hero-badge span { background: var(--accent); color: #fff; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 700; }
.hero-stats { display: flex; gap: 36px; margin-top: 40px; }
.hero-stats b { display: block; font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.hero-stats span { color: var(--muted); font-size: 13px; }
.auth-card { padding: 30px; box-shadow: var(--shadow-lg); }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 22px; width: 100%; }
.auth-tabs .tab { justify-content: center; }
.role-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.role-pick label { padding: 14px; border-radius: 12px; border: 1.5px solid var(--border); cursor: pointer; text-align: center; font-weight: 600; transition: 0.15s; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.role-pick label .icon { width: 22px; height: 22px; color: var(--muted); }
.role-pick input { display: none; }
.role-pick input:checked + label { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.role-pick input:checked + label .icon { color: var(--accent); }
.demo-logins { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.demo-logins button { padding: 9px; border-radius: 10px; border: 1px dashed var(--border-strong); font-size: 13px; font-weight: 600; color: var(--muted); transition: 0.15s; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.demo-logins button .icon { width: 16px; height: 16px; }
.demo-logins button:hover { color: var(--accent); border-color: var(--accent); }
.features { max-width: 1240px; margin: 0 auto; padding: 40px 40px 80px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; width: 100%; }
.feature { padding: 22px; }
.feature .ic-tile { margin-bottom: 14px; }
.feature h3 { margin-bottom: 4px; }
.feature p { color: var(--muted); font-size: 13.5px; }
.error-msg { color: var(--danger); font-size: 13px; font-weight: 550; min-height: 20px; }
.consent-check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.consent-check input { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--accent); flex: none; }
.consent-check a, .data-note a { color: var(--accent); font-weight: 600; }

/* ---------- Дашборд ---------- */
.hero-card { padding: 26px 28px; display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: center; }
.hero-card h1 { margin-bottom: 6px; }
.level-ring { width: 140px; height: 140px; position: relative; display: grid; place-items: center; }
.level-ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.level-ring .lv { text-align: center; }
.level-ring .lv b { font-size: 36px; font-weight: 800; display: block; line-height: 1; letter-spacing: -0.03em; }
.level-ring .lv span { font-size: 12px; color: var(--muted); font-weight: 550; }
.stat-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.stat { padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); display: flex; align-items: center; gap: 12px; min-width: 128px; }
.stat b { font-size: 18px; font-weight: 700; display: block; line-height: 1.15; letter-spacing: -0.02em; }
.stat span { font-size: 12px; color: var(--muted); }
.quick-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.qa { padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; font-weight: 650; transition: 0.15s; box-shadow: var(--shadow-sm); }
.qa:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.course-mini { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 10px; transition: background 0.15s; }
.course-mini:hover { background: var(--surface-2); }

.grade { --g: var(--muted); width: 34px; height: 34px; border-radius: 9px; display: inline-grid; place-items: center; font-weight: 700; font-size: 15px; color: var(--g); background: color-mix(in srgb, var(--g) 12%, transparent); flex: none; position: relative; }
.grade.g5 { --g: #16a34a; } .grade.g4 { --g: #0891b2; } .grade.g3 { --g: #d97706; } .grade.g2, .grade.g1 { --g: #dc2626; }
.grade.sm { width: 28px; height: 28px; font-size: 13px; border-radius: 8px; }
.grade.clickable { cursor: pointer; transition: transform 0.15s; }
.grade.clickable:hover { transform: scale(1.1); }
.grade.auto::after { content: ''; position: absolute; top: -2px; right: -2px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--surface); }

.lb-item { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; }
.lb-item.me { background: var(--accent-soft); }
.lb-place { width: 24px; height: 24px; border-radius: 7px; display: inline-grid; place-items: center; font-weight: 700; font-size: 12.5px; color: var(--muted); flex: none; }
.lb-place.p1 { background: #f59e0b; color: #fff; }
.lb-place.p2 { background: #94a3b8; color: #fff; }
.lb-place.p3 { background: #d97757; color: #fff; }
.lb-place.sm { width: 18px; height: 18px; font-size: 11px; border-radius: 5px; }
.lb-xp { margin-left: auto; font-weight: 650; font-size: 13.5px; }

/* ---------- Курсы ---------- */
.course-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.course-cover { height: 120px; position: relative; display: grid; place-items: center; overflow: hidden; background: color-mix(in srgb, var(--c) 12%, var(--surface)); color: var(--c); }
.course-cover::before { content: ''; position: absolute; inset: 0; background-image: radial-gradient(color-mix(in srgb, var(--c) 30%, transparent) 1px, transparent 1px); background-size: 16px 16px; opacity: 0.6; }
.cover-ic { position: relative; width: 64px; height: 64px; border-radius: 18px; background: var(--surface); display: grid; place-items: center; box-shadow: var(--shadow); transition: transform 0.25s; }
.cover-ic .icon { width: 30px; height: 30px; }
.course-card:hover .cover-ic { transform: scale(1.06); }
.course-cover .chip { position: absolute; top: 12px; left: 12px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.course-cover .done-badge { position: absolute; top: 12px; right: 12px; background: var(--success); color: #fff; border-radius: 99px; padding: 3px 9px; font-size: 12px; font-weight: 600; }
.course-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.course-body p { color: var(--muted); font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.course-meta { display: flex; flex-wrap: wrap; row-gap: 6px; gap: 14px; font-size: 12.5px; color: var(--muted); margin-top: auto; }
.course-meta span { white-space: nowrap; display: flex; align-items: center; gap: 5px; }
.course-meta .icon { width: 14px; height: 14px; }
.course-layout { display: grid; grid-template-columns: 300px 1fr; gap: 20px; align-items: start; }
.lesson-side { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 14px; }
.lesson-link { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 9px; font-weight: 550; font-size: 13.5px; color: var(--muted); transition: 0.15s; }
.lesson-link:hover { background: var(--surface-2); color: var(--text); }
.lesson-link.active { background: var(--accent-soft); color: var(--text); }
.lesson-num { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; border: 1.5px solid var(--border-strong); flex: none; }
.lesson-link.done .lesson-num { background: var(--success); color: #fff; border-color: transparent; }
.lesson-link.active .lesson-num { border-color: var(--accent); color: var(--accent); }
.prose { font-size: 15.5px; line-height: 1.75; max-width: 760px; }
.prose h2 { font-size: 20px; margin: 28px 0 10px; }
.prose h2:first-child { margin-top: 0; }
.prose p { margin: 12px 0; }
.prose ul, .prose ol { margin: 12px 0 12px 22px; }
.prose li { margin: 5px 0; }
.prose code { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 0.87em; background: var(--surface-2); padding: 2px 6px; border-radius: 6px; }
.prose pre { background: #14151b; color: #e4e5ec; padding: 16px 18px; border-radius: 12px; overflow-x: auto; margin: 16px 0; }
.prose pre code { background: none; padding: 0; font-size: 13.5px; }
.prose blockquote { margin: 18px 0; padding: 12px 16px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 10px 10px 0; }

/* ---------- Викторины ---------- */
.quiz-stage { max-width: 740px; margin: 0 auto; }
.quiz-top { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.quiz-timer { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14.5px; padding: 7px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.quiz-timer .icon { width: 16px; height: 16px; }
.quiz-timer.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.question-card { padding: 30px; animation: qIn 0.3s ease; }
@keyframes qIn { from { opacity: 0; transform: translateX(12px); } }
.question-text { font-size: clamp(18px, 2.2vw, 22px); font-weight: 650; line-height: 1.35; margin: 10px 0 24px; letter-spacing: -0.01em; }
.options { display: grid; gap: 10px; }
.option { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 12px; background: var(--surface); border: 1.5px solid var(--border); text-align: left; font-weight: 550; font-size: 15px; transition: 0.15s; width: 100%; }
.option:hover { border-color: var(--border-strong); background: var(--surface-2); }
.option .letter { width: 30px; height: 30px; border-radius: 8px; background: var(--surface-2); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; color: var(--muted); }
.option.selected { border-color: var(--accent); background: var(--accent-soft); }
.option.selected .letter { background: var(--accent); color: #fff; }
.option.correct { border-color: var(--success); background: color-mix(in srgb, var(--success) 9%, transparent); }
.option.correct .letter { background: var(--success); color: #fff; }
.option.wrong { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, transparent); }
.option.wrong .letter { background: var(--danger); color: #fff; }
.result-hero { text-align: center; padding: 36px 28px; }
.score-ring { width: 170px; height: 170px; margin: 0 auto 18px; position: relative; display: grid; place-items: center; }
.score-ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.score-ring b { font-size: 40px; font-weight: 800; letter-spacing: -0.03em; }
.review-item { padding: 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); }
.review-item.ok { border-left: 3px solid var(--success); }
.review-item.bad { border-left: 3px solid var(--danger); }
.review-item .muted .icon { width: 16px; height: 16px; color: var(--warning); }
.big-grade { width: 76px; height: 76px; font-size: 36px; border-radius: 20px; }

/* ---------- Конструктор ---------- */
.q-editor { padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 12px; }
.q-editor-head { display: flex; align-items: center; justify-content: space-between; }
.q-num { font-weight: 700; color: var(--accent); font-size: 13.5px; }
.opt-row { display: flex; align-items: center; gap: 10px; }
.opt-row input[type='radio'] { width: 18px; height: 18px; accent-color: var(--success); flex: none; cursor: pointer; }
.icon-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 6px; }
.icon-picker button { height: 38px; border-radius: 9px; border: 1px solid var(--border); color: var(--muted); display: grid; place-items: center; transition: 0.15s; }
.icon-picker button .icon { width: 18px; height: 18px; }
.icon-picker button:hover { color: var(--text); border-color: var(--border-strong); }
.icon-picker button.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.color-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.color-picker button { width: 28px; height: 28px; border-radius: 50%; background: var(--c); border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border); transition: 0.15s; }
.color-picker button.active { box-shadow: 0 0 0 2px var(--c); }

/* ---------- Группы ---------- */
.group-card { overflow: hidden; padding: 0; }
.group-banner { height: 72px; position: relative; background: color-mix(in srgb, var(--c) 14%, var(--surface)); }
.group-banner::after { content: ''; position: absolute; inset: 0; background-image: radial-gradient(color-mix(in srgb, var(--c) 35%, transparent) 1px, transparent 1px); background-size: 14px 14px; opacity: 0.6; }
.group-emoji { position: absolute; left: 18px; bottom: -22px; width: 50px; height: 50px; border-radius: 14px; background: var(--c); color: #fff; display: grid; place-items: center; border: 3px solid var(--surface); z-index: 1; }
.group-emoji .icon { width: 22px; height: 22px; }
.group-body { padding: 32px 18px 18px; display: flex; flex-direction: column; gap: 8px; }
.group-body p { color: var(--muted); font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.group-hero { padding: 0; overflow: hidden; }
.group-hero .group-banner { height: 120px; }
.group-hero .group-emoji { width: 72px; height: 72px; bottom: -30px; left: 26px; border-radius: 20px; border-width: 4px; }
.group-hero .group-emoji .icon { width: 32px; height: 32px; }
.group-hero-body { padding: 44px 26px 24px; display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: flex-end; }
.invite-code { font-size: 18px; font-weight: 700; letter-spacing: 0.14em; padding: 6px 14px; border-radius: 10px; background: var(--surface-2); border: 1px dashed var(--border-strong); font-variant-numeric: tabular-nums; }
.join-box { display: flex; gap: 8px; }
.join-box .input { text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; max-width: 180px; }

/* ---------- Чаты ---------- */
.chat-layout { display: grid; grid-template-columns: 320px 1fr; height: calc(100vh - 63px - 56px); min-height: 480px; padding: 0; overflow: hidden; }
.view.flush { padding-bottom: 28px; }
.chat-list { border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.chat-list-head { padding: 16px 16px 10px; display: flex; flex-direction: column; gap: 12px; }
.chat-items { overflow-y: auto; flex: 1; padding: 0 8px 8px; }
.chat-item { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 10px; transition: background 0.15s; cursor: pointer; }
.chat-item:hover { background: var(--surface-2); }
.chat-item.active { background: var(--accent-soft); }
.chat-item-title { font-weight: 600; font-size: 14px; }
.chat-item-last { font-size: 12.5px; color: var(--muted); }
.chat-item-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; font-size: 11.5px; color: var(--faint); flex: none; }
.unread { min-width: 19px; height: 19px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.chat-main { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--bg); }
.chat-head { padding: 12px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; background: var(--surface); }
.chat-head-title { font-weight: 650; }
.chat-head-sub { font-size: 12.5px; color: var(--muted); }
.call-banner { margin: 10px 18px 0; padding: 9px 12px; border-radius: 10px; background: color-mix(in srgb, var(--success) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--success) 30%, transparent); display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 13.5px; }
.messages { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 3px; }
.msg-day { align-self: center; font-size: 12px; font-weight: 600; color: var(--muted); padding: 3px 10px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); margin: 14px 0 8px; }
.msg-system { align-self: center; font-size: 12.5px; color: var(--muted); padding: 4px 12px; margin: 6px 0; text-align: center; }
.msg { display: flex; gap: 8px; max-width: 70%; align-items: flex-end; animation: msgIn 0.2s ease; }
@keyframes msgIn { from { opacity: 0; transform: translateY(4px); } }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.msg .avatar { --size: 30px; }
.msg.cont .avatar { visibility: hidden; }
.bubble { padding: 8px 12px; border-radius: 14px 14px 14px 4px; background: var(--surface); border: 1px solid var(--border); word-wrap: break-word; overflow-wrap: anywhere; white-space: pre-wrap; }
.msg.mine .bubble { background: var(--accent); color: #fff; border-color: transparent; border-radius: 14px 14px 4px 14px; }
.bubble-author { font-size: 12px; font-weight: 650; margin-bottom: 1px; }
.bubble-time { font-size: 10.5px; opacity: 0.6; margin-left: 8px; float: right; margin-top: 5px; }
.msg-gap { margin-top: 10px; }
.typing { font-size: 12.5px; color: var(--muted); padding: 0 20px 6px; height: 22px; display: flex; align-items: center; gap: 6px; }
.typing-dots { display: inline-flex; gap: 3px; }
.typing-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--muted); animation: bounce 1.2s infinite; }
.typing-dots i:nth-child(2) { animation-delay: 0.15s; } .typing-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes bounce { 0%, 60%, 100% { transform: none; } 30% { transform: translateY(-3px); } }
.composer { display: flex; align-items: flex-end; gap: 8px; padding: 12px 14px 14px; border-top: 1px solid var(--border); position: relative; background: var(--surface); }
.composer textarea { flex: 1; resize: none; max-height: 140px; min-height: 42px; padding: 10px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid transparent; outline: none; line-height: 1.4; }
.composer textarea:focus { border-color: var(--accent); background: var(--surface); }
.composer .icon-btn { width: 42px !important; height: 42px !important; border: 0; background: transparent; }
.send-btn { width: 42px; height: 42px; border-radius: 12px; background: var(--accent); color: #fff; display: grid; place-items: center; flex: none; transition: background 0.15s; }
.send-btn .icon { width: 18px; height: 18px; }
.send-btn:hover { background: var(--accent-hover); }
.emoji-pop { position: absolute; bottom: 64px; left: 14px; padding: 8px; display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; z-index: 5; }
.emoji-pop button { font-size: 20px; padding: 4px; border-radius: 8px; }
.emoji-pop button:hover { background: var(--surface-2); }
.chat-empty { flex: 1; display: grid; place-items: center; text-align: center; color: var(--muted); padding: 30px; }

/* ---------- Звонки ---------- */
.call-overlay { position: fixed; inset: 0; z-index: 120; background: #0b0c10; color: #fff; display: flex; flex-direction: column; animation: fade 0.2s; }
.call-header { display: flex; align-items: center; gap: 12px; padding: 16px 22px; }
.call-header .title { font-weight: 650; font-size: 16px; }
.call-timer { font-variant-numeric: tabular-nums; color: rgba(255,255,255,0.6); font-weight: 550; }
.call-header .chip { background: rgba(255,255,255,0.08) !important; color: rgba(255,255,255,0.8) !important; }
.call-grid { flex: 1; display: grid; gap: 12px; padding: 6px 22px; grid-template-columns: repeat(var(--cols, 1), 1fr); grid-auto-rows: 1fr; min-height: 0; }
.tile { position: relative; border-radius: 16px; overflow: hidden; background: #17181e; border: 2px solid transparent; display: grid; place-items: center; min-height: 0; transition: border-color 0.2s; }
.tile.speaking { border-color: #22c55e; }
.tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; max-width: none; }
.tile:not(.has-video) video { opacity: 0; }
.tile.local video { transform: scaleX(-1); }
.tile.local.screen video { transform: none; object-fit: contain; }
.tile .avatar { --size: 88px; z-index: 0; }
.tile.has-video .avatar { display: none; }
.tile-name { position: absolute; left: 10px; bottom: 10px; padding: 4px 10px; border-radius: 8px; background: rgba(0,0,0,0.55); font-size: 12.5px; font-weight: 600; display: flex; align-items: center; gap: 6px; z-index: 2; }
.tile-name .icon { width: 14px; height: 14px; color: #f87171; }
.call-controls { display: flex; justify-content: center; gap: 12px; padding: 20px; }
.ctrl { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,0.1); color: #fff; transition: background 0.15s; }
.ctrl:hover { background: rgba(255,255,255,0.18); }
.ctrl.off { background: #fff; color: #111; }
.ctrl.hangup { background: #ef4444; width: 64px; border-radius: 26px; }
.ctrl.hangup:hover { background: #dc2626; }
.ctrl .icon { width: 22px; height: 22px; }
.call-overlay.minimized { inset: auto 20px 20px auto; width: 320px; height: 230px; border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; }
.call-overlay.minimized .call-header { padding: 10px 14px; }
.call-overlay.minimized .call-header .title { font-size: 13.5px; }
.call-overlay.minimized .call-grid { padding: 0 10px; gap: 6px; }
.call-overlay.minimized .call-controls { padding: 10px; gap: 8px; }
.call-overlay.minimized .ctrl { width: 38px; height: 38px; }
.call-overlay.minimized .ctrl .icon { width: 17px; height: 17px; }
.call-overlay.minimized .ctrl.hangup { width: 48px; }
.call-overlay.minimized .tile .avatar { --size: 44px; }
.call-overlay.minimized .tile-name, .call-overlay.minimized .hide-min { display: none; }
.incoming { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 130; padding: 14px 16px; display: flex; align-items: center; gap: 14px; min-width: 360px; animation: drop 0.3s ease; }
@keyframes drop { from { opacity: 0; transform: translate(-50%, -16px); } }
.incoming .avatar { --size: 48px; animation: ring 1.2s infinite; }
@keyframes ring { 0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.45); } 50% { box-shadow: 0 0 0 9px rgba(34,197,94,0); } }
.round-btn { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: #fff; transition: filter 0.15s; }
.round-btn .icon { width: 19px; height: 19px; }
.round-btn:hover { filter: brightness(1.1); }
.round-btn.green { background: #16a34a; }
.round-btn.red { background: #dc2626; }
.round-btn.blue { background: var(--accent); }

/* ---------- Журнал ---------- */
.journal-table-wrap { overflow-x: auto; padding: 8px 12px; }
.journal-table { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 640px; }
.journal-table th { text-align: left; font-size: 12px; color: var(--faint); padding: 10px 12px; font-weight: 600; border-bottom: 1px solid var(--border); }
.journal-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.journal-table tr:last-child td { border-bottom: 0; }
.journal-table tbody tr:hover td { background: var(--surface-2); }
.grades-cell { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.avg { font-weight: 700; font-size: 17px; }
.grade-pick { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.grade-pick button { height: 56px; font-size: 22px; border-radius: 12px; width: 100%; }
.grade-pick button.active { box-shadow: 0 0 0 2px var(--g); }
.dist { display: flex; align-items: flex-end; gap: 10px; height: 110px; padding-top: 10px; }
.dist-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.dist-bar { width: 100%; border-radius: 6px 6px 3px 3px; min-height: 4px; transition: height 0.6s; }

/* ---------- Учителя ---------- */
.teacher-card { text-align: center; padding: 24px 20px 20px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.teacher-card .avatar { --size: 76px; }
.teacher-card p { color: var(--muted); font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.stars { color: #f59e0b; letter-spacing: 1px; font-size: 14px; }
.t-stats { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; gap: 8px; padding: 12px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin: 6px 0; }
.t-stats b { display: block; font-size: 17px; font-weight: 700; }
.t-stats span { font-size: 12px; color: var(--muted); }

/* ---------- Достижения ---------- */
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.ach { padding: 22px 18px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ach-medal { --t: #d97757; width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; color: #fff; margin-bottom: 4px; position: relative;
  background: linear-gradient(145deg, color-mix(in srgb, var(--t) 75%, #fff), var(--t)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--t) 18%, transparent); }
.ach-medal .icon { width: 30px; height: 30px; stroke-width: 1.9; }
.tier-gold { --t: #f59e0b; } .tier-silver { --t: #94a3b8; } .tier-bronze { --t: #d97757; }
.ach.locked .ach-medal { background: var(--surface-2); color: var(--faint); box-shadow: inset 0 0 0 1.5px var(--border-strong); }
.ach h3 { font-size: 14.5px; }
.ach p { font-size: 13px; color: var(--muted); }
.ach .progress { width: 100%; height: 5px; margin-top: 4px; }
.ach-xp { font-size: 12px; font-weight: 650; color: var(--warning); }
.badges-row { display: flex; gap: 8px; flex-wrap: wrap; }
.badge-mini { --t: #d97757; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; flex: none; background: linear-gradient(145deg, color-mix(in srgb, var(--t) 75%, #fff), var(--t)); }
.badge-mini .icon { width: 18px; height: 18px; }
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 12px; align-items: end; max-width: 600px; margin: 0 auto 24px; }
.podium-col { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.podium-col .avatar { --size: 58px; }
.podium-col.first .avatar { --size: 74px; box-shadow: 0 0 0 3px #f59e0b; }
.crown-ic { color: #f59e0b; }
.crown-ic .icon { width: 26px; height: 26px; }
.podium-block { width: 100%; border-radius: 12px 12px 4px 4px; display: grid; place-items: center; font-size: 28px; font-weight: 800; color: #fff; }
.podium-col.first .podium-block { height: 130px; background: #f59e0b; }
.podium-col.second .podium-block { height: 95px; background: #94a3b8; }
.podium-col.third .podium-block { height: 70px; background: #d97757; }
.podium-name { font-weight: 650; font-size: 14px; }

/* ---------- Турниры ---------- */
.tour-card.live { border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.countdown { display: flex; gap: 6px; }
.countdown div { text-align: center; padding: 6px 8px; border-radius: 9px; background: var(--surface-2); min-width: 50px; }
.countdown b { font-size: 17px; font-weight: 700; display: block; line-height: 1.15; font-variant-numeric: tabular-nums; }
.countdown span { font-size: 10.5px; color: var(--muted); font-weight: 550; }
.arena { max-width: 940px; margin: 0 auto; }
.arena-head { text-align: center; padding: 30px 20px; }
.big-ic { display: flex; justify-content: center; margin-bottom: 14px; }
.players-cloud { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding: 10px; }
.player-pill { display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 99px; background: var(--surface-2); font-weight: 600; font-size: 13.5px; animation: popIn 0.3s ease; }
.player-pill .avatar { --size: 28px; }
@keyframes popIn { from { opacity: 0; transform: scale(0.8); } }
.tour-timer { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin: 12px 0 22px; }
.tour-timer i { display: block; height: 100%; background: linear-gradient(90deg, #16a34a, #f59e0b, #dc2626); background-size: 300% 100%; border-radius: inherit; }
.tour-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tour-opt { min-height: 84px; border-radius: 14px; padding: 16px 18px; display: flex; align-items: center; gap: 14px; color: #fff; font-weight: 650; font-size: 16px; text-align: left; transition: filter 0.15s, transform 0.1s; position: relative; }
.tour-opt:hover:not([disabled]) { filter: brightness(1.08); }
.tour-opt:active:not([disabled]) { transform: scale(0.98); }
.tour-opt .shape { font-size: 20px; width: 32px; text-align: center; flex: none; opacity: 0.9; }
.tour-opt.o0 { background: #e5484d; } .tour-opt.o1 { background: #3b82f6; } .tour-opt.o2 { background: #e5a000; } .tour-opt.o3 { background: #16a34a; }
.tour-opt.dim { opacity: 0.3; }
.tour-opt.picked { box-shadow: 0 0 0 3px var(--surface), 0 0 0 6px var(--text); }
.tour-opt .count { margin-left: auto; font-size: 20px; font-weight: 800; }
.tour-opt[disabled] { cursor: default; }
.answer-feedback { text-align: center; padding: 22px; font-size: 22px; font-weight: 750; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.answer-feedback .icon { width: 30px; height: 30px; }
.answer-feedback.ok { color: var(--success); }
.answer-feedback.bad { color: var(--danger); }
.score-float { font-size: 16px; color: var(--warning); }

/* ---------- Профиль ---------- */
.profile-hero { padding: 0; overflow: hidden; }
.profile-cover { height: 130px; background: color-mix(in srgb, var(--c) 16%, var(--surface)); position: relative; }
.profile-cover::after { content: ''; position: absolute; inset: 0; background-image: radial-gradient(color-mix(in srgb, var(--c) 40%, transparent) 1px, transparent 1px); background-size: 16px 16px; opacity: 0.6; }
.profile-main { padding: 0 28px 26px; display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap; margin-top: -46px; position: relative; }
.profile-main > :not(.avatar) { padding-top: 58px; }
.profile-main .avatar { --size: 104px; box-shadow: 0 0 0 4px var(--surface); font-size: 38px; }

#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 300; }

/* ---------- Адаптив ---------- */
@media (max-width: 1200px) {
  .features { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 270px; transform: translateX(-100%); transition: transform 0.25s; }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .topbar .menu-btn { display: grid; }
  .topbar { padding: 10px 16px; }
  .create-btn span { display: none; }
  .view { padding: 20px 16px 50px; }
  .hero { grid-template-columns: 1fr; padding: 24px 16px; gap: 32px; }
  .land-nav { padding: 16px; }
  .features { padding: 16px 16px 60px; }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .course-layout { grid-template-columns: minmax(0, 1fr); }
  .lesson-side { position: static; }
  .chat-layout { grid-template-columns: minmax(0, 1fr); height: calc(100dvh - 59px - 40px - 64px); }
  .chat-layout.has-chat .chat-list { display: none; }
  .chat-layout:not(.has-chat) .chat-main { display: none; }
  .quick-actions { grid-template-columns: repeat(2, 1fr); }
  .hero-card { grid-template-columns: 1fr; }
  .level-ring { display: none; }
  .msg { max-width: 86%; }
}
@media (max-width: 600px) {
  .features { grid-template-columns: 1fr; }
  .tour-options { grid-template-columns: 1fr; }
  .hero-stats { gap: 20px; }
  .topbar .search { display: none; }
  .call-grid { padding: 8px; grid-template-columns: 1fr !important; }
  .incoming { min-width: 0; width: calc(100% - 32px); }
  .dropdown { position: fixed; left: 16px; right: 16px; top: 64px; width: auto; }
  .podium-col .avatar { --size: 44px; }
  .podium-col.first .avatar { --size: 56px; }
}
.scrim { position: fixed; inset: 0; background: rgba(10, 12, 20, 0.4); z-index: 25; display: none; }
.scrim.open { display: block; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ---------- Первые шаги ---------- */
.onb-steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.onb-step { display: flex; align-items: flex-start; gap: 12px; padding: 12px; border-radius: 12px; border: 1px solid var(--border); }
.onb-check { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--muted); }
.onb-check .icon { width: 15px; height: 15px; }
.onb-step.done { background: var(--surface-2); border-color: transparent; }
.onb-step.done .onb-check { background: var(--success); color: #fff; }
.onb-step.done .onb-title { text-decoration: line-through; color: var(--muted); }
.onb-title { font-weight: 600; }
@media (max-width: 760px) { .onb-steps { grid-template-columns: 1fr; } }
.kbd-hint { margin-top: 14px; font-size: 12.5px; color: var(--faint); }
kbd { font-family: inherit; font-size: 11.5px; font-weight: 600; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--border-strong); border-bottom-width: 2px; background: var(--surface); color: var(--muted); }
@media (max-width: 760px) { .kbd-hint { display: none; } }

/* ============ Дополнительные темы ============ */
:root[data-theme='ocean'] {
  --bg: #eaf4fb; --surface: #ffffff; --surface-2: #e3eff7; --surface-3: #d3e5f1;
  --border: #d5e5f0; --border-strong: #bcd4e5; --text: #0c2233; --muted: #4c6577; --faint: #8aa2b3;
  --accent: #0284c7; --accent-hover: #0369a1; --accent-soft: rgba(2, 132, 199, 0.11);
}
:root[data-theme='forest'] {
  --bg: #f1f4ec; --surface: #fbfcf8; --surface-2: #e9eee2; --surface-3: #dce4d2;
  --border: #dde4d3; --border-strong: #c6d1b8; --text: #1c2a1e; --muted: #56655a; --faint: #93a092;
  --accent: #3f7d4e; --accent-hover: #336a41; --accent-soft: rgba(63, 125, 78, 0.12);
  --font: 'Inter', system-ui, sans-serif;
}
:root[data-theme='sunset'] {
  --bg: #fdf2ec; --surface: #ffffff; --surface-2: #fbe9df; --surface-3: #f6dbcc;
  --border: #f3dfd3; --border-strong: #e9c8b6; --text: #2b1710; --muted: #7a5a4d; --faint: #b8958a;
  --accent: #e2583e; --accent-hover: #c94a32; --accent-soft: rgba(226, 88, 62, 0.11);
}

/* ---------- Выбор темы ---------- */
.theme-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.theme-card { display: flex; flex-direction: column; gap: 8px; padding: 8px; border-radius: 12px; border: 1.5px solid var(--border); text-align: left; transition: border-color 0.15s, transform 0.15s; }
.theme-card:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.theme-card.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.theme-name { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; padding: 0 2px; }
.pro-badge { font-size: 10px; font-weight: 800; letter-spacing: 0.04em; padding: 1px 6px; border-radius: 6px; color: #fff; background: linear-gradient(120deg, #8b5cf6, #ec4899 50%, #22d3ee); }
.theme-preview { display: block; position: relative; height: 62px; border-radius: 8px; background: var(--p-bg); overflow: hidden; box-shadow: inset 0 0 0 1px rgba(127, 127, 127, 0.18); }
.theme-preview i { position: absolute; left: 0; top: 0; bottom: 0; width: 26%; background: var(--p-surface); }
.theme-preview b { position: absolute; left: 34%; right: 8%; height: 14px; border-radius: 4px; background: var(--p-surface); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
.theme-preview b:first-of-type { top: 10px; }
.theme-preview b:last-of-type { top: 30px; right: 30%; }
.theme-preview em { position: absolute; left: 34%; bottom: 8px; width: 28%; height: 9px; border-radius: 4px; background: var(--p-accent); }
.theme-preview.big { height: 140px; border-radius: 12px; }
.theme-dropdown { width: 380px; }
@media (max-width: 600px) { .theme-grid { grid-template-columns: repeat(2, 1fr); } .theme-dropdown { width: auto; } }

/* ---------- Уроки: код, запуск, проверь себя, практика ---------- */
.prose pre[data-lang]::before { content: attr(data-lang); display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: #8b8fa3; margin-bottom: 6px; font-family: var(--font); }
.prose pre.code-output, .code-output { background: var(--surface-2); color: var(--text); border: 1px dashed var(--border-strong); padding: 10px 14px; border-radius: 10px; margin: 8px 0 14px; font-size: 13.5px; white-space: pre-wrap; font-family: 'JetBrains Mono', ui-monospace, monospace; }
.run-out::before { content: 'Результат запуска'; display: block; font-family: var(--font); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint); margin-bottom: 4px; }
.code-output.error { border-color: color-mix(in srgb, var(--danger) 45%, transparent); color: var(--danger); }
.code-block { margin: 16px 0; }
.code-block pre { margin: 0 !important; border-radius: 12px 12px 0 0 !important; }
.code-actions { display: flex; gap: 8px; align-items: flex-start; padding: 8px; background: var(--surface-2); border: 1px solid var(--border); border-top: 0; border-radius: 0 0 12px 12px; }
.code-actions .btn { margin-left: auto; }
.code-stdin { flex: 1; min-width: 0; resize: vertical; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 13px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); outline: none; }
.code-block .run-out { margin: 8px 0 0; border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); background: var(--accent-soft); border-style: solid; }
.code-edit { display: block; width: 100%; min-height: 110px; resize: vertical; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 13.5px; line-height: 1.55; padding: 14px 16px; border-radius: 12px 12px 0 0; border: 1px solid var(--border); border-bottom: 0; background: #14151b; color: #e4e5ec; outline: none; tab-size: 4; }
.code-edit:focus { box-shadow: inset 0 0 0 1px var(--accent); }
.spoiler { background: var(--text); color: transparent; border-radius: 5px; padding: 0 4px; cursor: pointer; transition: 0.2s; user-select: none; }
.spoiler.open { background: var(--accent-soft); color: var(--text); user-select: auto; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent); }
.lesson-section { margin-top: 34px; padding-top: 26px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 14px; max-width: 760px; }
.lesson-section-head { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.lesson-section-head h2 { font-size: 19px; }
.self-q { padding: 16px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; gap: 10px; }
.self-q-title { font-weight: 600; }
.self-q pre, .task-card pre { background: #14151b; color: #e4e5ec; padding: 12px 14px; border-radius: 10px; overflow-x: auto; font-size: 13.5px; font-family: 'JetBrains Mono', ui-monospace, monospace; }
.self-q .options { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.self-q .option { padding: 10px 12px; font-size: 14px; }
.self-q .opt-text { font-family: 'JetBrains Mono', ui-monospace, monospace; white-space: pre-wrap; }
.self-q-expl { font-size: 13.5px; color: var(--muted); display: flex; gap: 6px; align-items: flex-start; }
.self-q-expl .icon { width: 16px; height: 16px; color: var(--warning); margin-top: 2px; }
.task-card { padding: 18px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; gap: 10px; }
.task-text { font-size: 14.5px; }
.task-text p { margin: 4px 0; }
.task-editor { margin: 4px 0; }
details.reveal { flex: 1 1 100%; }
details.reveal summary { cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13.5px; color: var(--accent); padding: 4px 0; list-style: none; }
details.reveal summary::-webkit-details-marker { display: none; }
details.reveal summary .icon { width: 16px; height: 16px; }
details.reveal[open] summary { margin-bottom: 6px; }
@media (max-width: 600px) { .self-q .options { grid-template-columns: 1fr; } }

/* ---------- Главная (упрощённая) ---------- */
.dash-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.level-pill { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); transition: border-color 0.15s; }
.level-pill:hover { border-color: var(--accent); }
.lv-badge { width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 800; flex: none; }
.lv-text { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.next-card { display: flex; align-items: center; gap: 18px; padding: 22px 24px; margin-bottom: 4px; transition: border-color 0.15s, box-shadow 0.15s; border-left: 4px solid var(--c); }
.next-card:hover { box-shadow: var(--shadow); }
.next-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--c); }
.next-title { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; margin: 2px 0; }
.quick-actions .qa { flex-direction: row; align-items: center; gap: 12px; padding: 14px; }
.section-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: -6px 0 18px; overflow-x: auto; }
.section-tabs a { display: inline-flex; align-items: center; gap: 7px; padding: 10px 14px; font-weight: 600; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; transition: color 0.15s; }
.section-tabs a .icon { width: 17px; height: 17px; }
.section-tabs a:hover { color: var(--text); }
.section-tabs a.active { color: var(--accent); border-bottom-color: var(--accent); }
.section-desc { color: var(--muted); margin: 0 0 20px; max-width: 680px; font-size: 14px; }
@media (max-width: 600px) { .next-card { flex-wrap: wrap; } .next-card .btn { width: 100%; } }
.lesson-card { padding: 30px 34px; }
.lesson-course { display: flex; gap: 12px; align-items: center; padding: 6px 8px 14px; margin-bottom: 6px; border-bottom: 1px solid var(--border); }
.lesson-course-title { font-weight: 700; font-size: 14.5px; line-height: 1.3; }
.lesson-num .icon { width: 14px; height: 14px; }
.lesson-tabs { margin: 0 0 22px; }
.lesson-panel .lesson-section { margin-top: 0; padding-top: 0; border-top: 0; }
@media (max-width: 600px) { .lesson-card { padding: 22px 18px; } }
[hidden] { display: none !important; }
@media (max-width: 760px) { .onb-step.done { display: none; } }

/* ============ Обсидиан (премиум, флагман) ============ */
@property --gold-angle { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
:root[data-theme='obsidian'] {
  --bg: #08070a; --surface: rgba(255, 240, 210, 0.035); --surface-2: rgba(255, 240, 210, 0.065); --surface-3: rgba(255, 240, 210, 0.1);
  --border: rgba(212, 175, 95, 0.14); --border-strong: rgba(212, 175, 95, 0.32);
  --text: #f6efe2; --muted: #bcb09a; --faint: #7f7564;
  --accent: #d9b465; --accent-hover: #ecd08a; --accent-soft: rgba(217, 180, 101, 0.13);
  --success: #7dd3a0; --warning: #f0c060; --danger: #f0857a; --info: #8ec5e8;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.6); --shadow: 0 14px 40px -14px rgba(0, 0, 0, 0.85); --shadow-lg: 0 34px 80px -24px rgba(0, 0, 0, 0.9);
  --gold: linear-gradient(110deg, #9c7531 0%, #e9cd84 22%, #fff3cc 34%, #c99a42 52%, #f4dc98 70%, #a47b35 100%);
  --serif: 'Playfair Display', Georgia, serif;
  color-scheme: dark;
}
:root[data-theme='obsidian'] ::selection { background: rgba(217, 180, 101, 0.35); }
:root[data-theme='obsidian'] ::-webkit-scrollbar-thumb { background: rgba(217, 180, 101, 0.35); background-clip: padding-box; border: 3px solid transparent; }

/* тёплое свечение и золотая пыль */
:root[data-theme='obsidian'] body::before {
  content: ''; position: fixed; inset: -10%; z-index: -2; pointer-events: none;
  background:
    radial-gradient(40% 45% at 12% 8%, rgba(201, 154, 66, 0.22), transparent 70%),
    radial-gradient(35% 40% at 92% 95%, rgba(120, 40, 50, 0.28), transparent 70%),
    radial-gradient(50% 50% at 70% 20%, rgba(255, 220, 150, 0.06), transparent 70%);
  animation: obsGlow 18s ease-in-out infinite alternate;
}
:root[data-theme='obsidian'] body::after {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0.55;
  background-image:
    radial-gradient(1.5px 1.5px at 40px 60px, rgba(255, 225, 160, 0.9), transparent),
    radial-gradient(1px 1px at 160px 120px, rgba(255, 225, 160, 0.7), transparent),
    radial-gradient(2px 2px at 260px 220px, rgba(240, 200, 120, 0.8), transparent),
    radial-gradient(1px 1px at 330px 30px, rgba(255, 235, 190, 0.8), transparent),
    radial-gradient(1.5px 1.5px at 90px 280px, rgba(230, 190, 110, 0.7), transparent);
  background-size: 380px 340px;
  animation: goldDust 60s linear infinite;
}
@keyframes obsGlow { 0% { transform: translate(0, 0) scale(1); } 100% { transform: translate(3%, 2%) scale(1.08); } }
@keyframes goldDust { from { background-position: 0 0; } to { background-position: 120px -680px; } }

/* типографика: золотая фольга */
:root[data-theme='obsidian'] h1, :root[data-theme='obsidian'] .hero h1, :root[data-theme='obsidian'] .next-title,
:root[data-theme='obsidian'] .page-head h1, :root[data-theme='obsidian'] .prose h2 { font-family: var(--serif); letter-spacing: 0; font-weight: 700; }
:root[data-theme='obsidian'] h1, :root[data-theme='obsidian'] .logo-text b, :root[data-theme='obsidian'] .grad-text {
  background: var(--gold); background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: goldShine 7s ease-in-out infinite;
}
:root[data-theme='obsidian'] .hero h1 { background: none; color: var(--text); animation: none; }
:root[data-theme='obsidian'] .hero h1 span { background: var(--gold); background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: goldShine 7s ease-in-out infinite; font-style: italic; }
@keyframes goldShine { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
:root[data-theme='obsidian'] h2, :root[data-theme='obsidian'] h3 { color: #f3e6c8; }

/* карточки: тёмное стекло, луч под курсором, золотая рамка */
:root[data-theme='obsidian'] .card, :root[data-theme='obsidian'] .stat, :root[data-theme='obsidian'] .qa, :root[data-theme='obsidian'] .q-editor,
:root[data-theme='obsidian'] .review-item, :root[data-theme='obsidian'] .self-q, :root[data-theme='obsidian'] .task-card, :root[data-theme='obsidian'] .onb-step, :root[data-theme='obsidian'] .level-pill {
  background: linear-gradient(160deg, rgba(255, 245, 220, 0.06), rgba(255, 245, 220, 0.012));
  backdrop-filter: blur(14px) saturate(120%); -webkit-backdrop-filter: blur(14px) saturate(120%);
  box-shadow: inset 0 1px 0 rgba(255, 235, 190, 0.07), var(--shadow);
}
:root[data-theme='obsidian'] .card::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity 0.35s;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(233, 205, 132, 0.11), transparent 45%);
}
:root[data-theme='obsidian'] .card:hover::before { opacity: 1; }
:root[data-theme='obsidian'] .card::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: conic-gradient(from var(--gold-angle), rgba(212, 175, 95, 0.15), rgba(255, 236, 180, 0.9), rgba(212, 175, 95, 0.15) 30%, rgba(212, 175, 95, 0.15) 70%, rgba(255, 236, 180, 0.6), rgba(212, 175, 95, 0.15));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0.45; transition: opacity 0.35s;
}
:root[data-theme='obsidian'] .card.hover:hover::after, :root[data-theme='obsidian'] .next-card:hover::after { opacity: 1; animation: goldSpin 4s linear infinite; }
@keyframes goldSpin { to { --gold-angle: 360deg; } }
:root[data-theme='obsidian'] .card.hover:hover { transform: translateY(-3px); box-shadow: 0 24px 60px -22px rgba(201, 154, 66, 0.45), inset 0 1px 0 rgba(255, 235, 190, 0.1); }
:root[data-theme='obsidian'] .next-card { border-left: 0; }

/* каркас */
:root[data-theme='obsidian'] .sidebar { background: rgba(10, 9, 12, 0.72); backdrop-filter: blur(20px); border-right-color: rgba(212, 175, 95, 0.12); }
:root[data-theme='obsidian'] .topbar { background: rgba(8, 7, 10, 0.55); border-bottom-color: rgba(212, 175, 95, 0.1); }
:root[data-theme='obsidian'] .glass { background: rgba(18, 16, 14, 0.95); backdrop-filter: blur(24px); border-color: rgba(212, 175, 95, 0.28); }
:root[data-theme='obsidian'] .chat-main, :root[data-theme='obsidian'] .landing { background: transparent; }
:root[data-theme='obsidian'] .chat-head, :root[data-theme='obsidian'] .composer { background: rgba(255, 240, 210, 0.025); }
:root[data-theme='obsidian'] .input, :root[data-theme='obsidian'] .textarea, :root[data-theme='obsidian'] .select, :root[data-theme='obsidian'] .search input,
:root[data-theme='obsidian'] .composer textarea, :root[data-theme='obsidian'] .code-stdin { background: rgba(255, 240, 210, 0.04); border-color: rgba(212, 175, 95, 0.2); }
:root[data-theme='obsidian'] .nav-item.active { background: linear-gradient(90deg, rgba(217, 180, 101, 0.16), transparent); color: #f3dc9e; box-shadow: inset 2px 0 0 #d9b465; }
:root[data-theme='obsidian'] .nav-item.active .icon { color: #ecd08a; filter: drop-shadow(0 0 6px rgba(236, 208, 138, 0.6)); }
:root[data-theme='obsidian'] .section-tabs a.active { color: #ecd08a; border-bottom-color: #d9b465; }

/* золотые кнопки с бликом */
:root[data-theme='obsidian'] .btn-primary, :root[data-theme='obsidian'] .send-btn, :root[data-theme='obsidian'] .logo-mark,
:root[data-theme='obsidian'] .nav-item .count, :root[data-theme='obsidian'] .lv-badge, :root[data-theme='obsidian'] .unread {
  background: var(--gold); background-size: 250% 100%; color: #1c1408; font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 10px 28px -12px rgba(217, 180, 101, 0.8);
  animation: goldShine 6s ease-in-out infinite;
}
:root[data-theme='obsidian'] .btn-primary { position: relative; overflow: hidden; }
:root[data-theme='obsidian'] .btn-primary::after { content: ''; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.55), transparent); transform: skewX(-20deg); }
:root[data-theme='obsidian'] .btn-primary:hover::after { animation: goldSweep 0.9s ease; }
@keyframes goldSweep { to { left: 130%; } }
:root[data-theme='obsidian'] .btn-soft { background: rgba(255, 240, 210, 0.05); border-color: rgba(212, 175, 95, 0.25); color: #f3e6c8; }
:root[data-theme='obsidian'] .btn-soft:hover { border-color: rgba(236, 208, 138, 0.6); }

/* мелкие акценты */
:root[data-theme='obsidian'] .progress { background: rgba(255, 240, 210, 0.07); }
:root[data-theme='obsidian'] .progress > i, :root[data-theme='obsidian'] .dist-bar { background: var(--gold); background-size: 250% 100%; box-shadow: 0 0 10px rgba(217, 180, 101, 0.55); }
:root[data-theme='obsidian'] .level-ring circle:last-child, :root[data-theme='obsidian'] .score-ring circle:last-child { stroke: #d9b465; filter: drop-shadow(0 0 6px rgba(217, 180, 101, 0.7)); }
:root[data-theme='obsidian'] .filter.active, :root[data-theme='obsidian'] .tab.active { background: var(--gold); background-size: 250% 100%; color: #1c1408; border-color: transparent; }
:root[data-theme='obsidian'] .ic-tile, :root[data-theme='obsidian'] .stat-ic { background: rgba(217, 180, 101, 0.1); color: #e9cd84; box-shadow: inset 0 0 0 1px rgba(217, 180, 101, 0.28); }
:root[data-theme='obsidian'] .avatar { box-shadow: 0 0 0 2px rgba(217, 180, 101, 0.45); }
:root[data-theme='obsidian'] .chip.accent { background: rgba(217, 180, 101, 0.14); color: #ecd08a; }
:root[data-theme='obsidian'] .course-cover, :root[data-theme='obsidian'] .group-banner, :root[data-theme='obsidian'] .profile-cover {
  background: radial-gradient(90% 140% at 20% 0%, rgba(217, 180, 101, 0.2), transparent 65%), rgba(255, 240, 210, 0.02); color: #e9cd84;
}
:root[data-theme='obsidian'] .course-cover::before, :root[data-theme='obsidian'] .group-banner::after, :root[data-theme='obsidian'] .profile-cover::after { background-image: radial-gradient(rgba(217, 180, 101, 0.3) 1px, transparent 1px); }
:root[data-theme='obsidian'] .cover-ic, :root[data-theme='obsidian'] .group-emoji { background: rgba(14, 12, 10, 0.85); color: #ecd08a; border-color: rgba(217, 180, 101, 0.4); box-shadow: 0 0 30px -8px rgba(217, 180, 101, 0.6); }
:root[data-theme='obsidian'] .msg.mine .bubble { background: linear-gradient(135deg, #b8893b, #e3c47a); color: #1c1408; }
:root[data-theme='obsidian'] .prose pre, :root[data-theme='obsidian'] .code-edit, :root[data-theme='obsidian'] .self-q pre, :root[data-theme='obsidian'] .task-card pre { background: rgba(0, 0, 0, 0.55); border: 1px solid rgba(212, 175, 95, 0.15); }
:root[data-theme='obsidian'] .prose blockquote { border-left-color: #d9b465; background: rgba(217, 180, 101, 0.07); }
:root[data-theme='obsidian'] .spoiler:not(.open) { background: var(--gold); }
:root[data-theme='obsidian'] .toast.achievement { border-color: rgba(217, 180, 101, 0.5); box-shadow: 0 0 40px -12px rgba(217, 180, 101, 0.7); }
@media (prefers-reduced-motion: reduce) { :root[data-theme='obsidian'] body::before, :root[data-theme='obsidian'] body::after { animation: none; } }

/* превью и блок «Премиум» в выборе темы */
.theme-group-label { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 14px 2px 8px; }
.theme-group-label .icon { width: 15px; height: 15px; color: #d9b465; }
.premium-grid { grid-template-columns: repeat(2, 1fr); }
.premium-grid .theme-preview { height: 78px; }
.theme-preview.obsidian { background:
    radial-gradient(60% 80% at 15% 10%, rgba(201, 154, 66, 0.45), transparent 70%),
    radial-gradient(50% 70% at 95% 100%, rgba(120, 40, 50, 0.5), transparent 70%), #08070a; }
.theme-preview.obsidian i, .theme-preview.obsidian b { background: rgba(255, 240, 210, 0.07); box-shadow: inset 0 0 0 1px rgba(212, 175, 95, 0.35); }
.theme-preview.obsidian em { background: linear-gradient(110deg, #9c7531, #fff3cc 40%, #c99a42 60%, #f4dc98); box-shadow: 0 0 10px rgba(217, 180, 101, 0.8); }
.theme-card.premium .theme-name { font-weight: 700; }
:root[data-theme='obsidian'] .next-label { color: #d9b465; }
:root[data-theme='obsidian'] .glass { background: rgba(16, 14, 12, 0.985); }

/* ---------- Нижнее меню телефона ---------- */
.bottom-nav { display: none; }
@media (max-width: 980px) {
  .bottom-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(16px); border-top: 1px solid var(--border);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .bottom-nav a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; border-radius: 10px; font-size: 11px; font-weight: 600; color: var(--muted); }
  .bottom-nav a .icon { width: 22px; height: 22px; }
  .bottom-nav a.active { color: var(--accent); }
  .bottom-nav a.active .icon { stroke-width: 2.4; }
  .bottom-nav .count { position: absolute; top: 2px; left: 50%; margin-left: 6px; min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; }
  .bottom-nav .count.warn { background: var(--warning); }
  .bottom-nav .live-dot { position: absolute; top: 4px; left: 50%; margin-left: -16px; }
  .view { padding-bottom: calc(90px + env(safe-area-inset-bottom)); }
  .view.flush { padding-bottom: 16px; }
  #toasts { bottom: calc(76px + env(safe-area-inset-bottom)); right: 12px; left: 12px; }
  .toast { min-width: 0; max-width: none; }
}

/* ---------- Список уроков: сворачивается на телефоне ---------- */
.lesson-toc > summary { list-style: none; cursor: pointer; }
.lesson-toc > summary::-webkit-details-marker { display: none; }
.toc-toggle { display: none; color: var(--muted); transition: transform 0.2s; }
.lesson-toc[open] .toc-toggle { transform: rotate(90deg); }
.lesson-toc:not([open]) > summary.lesson-course { border-bottom: 0; margin-bottom: 0; padding-bottom: 6px; }
@media (max-width: 980px) { .toc-toggle { display: grid; } }
@media (min-width: 981px) { .lesson-toc > summary { pointer-events: none; } }

/* ---------- Скелетоны при загрузке ---------- */
.sk { display: flex; flex-direction: column; gap: 14px; }
.sk-line, .sk-card { border-radius: 10px; background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: skShimmer 1.2s ease-in-out infinite; }
.sk-line { height: 14px; }
.sk-title { height: 30px; width: 38%; }
.sk-sub { width: 26%; }
.sk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; margin-top: 10px; }
.sk-card { height: 170px; border-radius: var(--radius); }
@keyframes skShimmer { to { background-position: -200% 0; } }

/* ---------- Фокус с клавиатуры ---------- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.input:focus-visible, .textarea:focus-visible, .select:focus-visible, .search input:focus-visible, .composer textarea:focus-visible { outline: none; }
@media (max-width: 980px) {
  body.in-chat .bottom-nav { display: none; }
  body.in-chat .chat-layout { height: calc(100dvh - 59px - 40px); }
}
@media (max-width: 600px) {
  .lesson-tabs a { flex: 1; justify-content: center; padding: 10px 4px; font-size: 13px; }
  .lesson-tabs a .icon { display: none; }
}

/* превью новых тем */
.premium-grid { grid-template-columns: repeat(2, 1fr); }
.theme-dropdown { max-height: min(84vh, 680px); }

/* ============ Курсы в стиле «Python Arena» (Duolingo-подобные) ============ */
:root { --node-off: #e5e7eb; --node-offd: #cfd4da; --node-off-ic: #aab0b8; }
:root[data-theme='dark'], :root[data-theme='obsidian'], :root[data-theme='sapphire'], :root[data-theme='emerald'] { --node-off: #2b333d; --node-offd: #1c222a; --node-off-ic: #5f6b78; }

/* баннер раздела */
.unit, .unit-card { --uc: var(--accent); --ud: color-mix(in srgb, var(--uc) 78%, #000); background: var(--uc); color: #fff; border-radius: 18px; box-shadow: 0 5px 0 var(--ud); }
.unit { display: flex; align-items: center; gap: 14px; padding: 16px 18px; }
.unit-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; flex: none; background: rgba(255, 255, 255, 0.22); color: #fff; }
.unit-icon .icon { width: 26px; height: 26px; stroke-width: 2.4; }
.unit-label { font-size: 11.5px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.88; }
.unit-title { font-size: 19px; font-weight: 800; line-height: 1.2; letter-spacing: -0.01em; }
.unit-bar { height: 8px; border-radius: 8px; background: rgba(255, 255, 255, 0.3); margin-top: 8px; overflow: hidden; }
.unit-bar div { height: 100%; border-radius: 8px; background: #fff; transition: width 0.6s; }
.unit-count { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; font-size: 14px; padding: 4px 11px; border-radius: 20px; background: rgba(255, 255, 255, 0.22); white-space: nowrap; }
.unit-count .icon { width: 15px; height: 15px; stroke-width: 3; }

/* карточка курса в каталоге */
.unit-card { display: flex; flex-direction: column; gap: 6px; padding: 18px; min-height: 220px; transition: transform 0.12s, box-shadow 0.12s; }
.unit-card:hover { transform: translateY(-2px); box-shadow: 0 7px 0 var(--ud); }
.unit-card:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ud); }
.unit-card .unit-label { margin-top: 10px; }
.unit-desc { font-size: 13.5px; opacity: 0.92; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.unit-foot { margin-top: auto; padding-top: 8px; font-size: 12.5px; font-weight: 700; opacity: 0.92; display: flex; flex-direction: column; gap: 6px; }
.unit-foot .unit-bar { margin-top: 0; }

/* объёмная кнопка */
.btn-duo { --uc: var(--accent); --ud: color-mix(in srgb, var(--uc) 78%, #000);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 22px; border-radius: 16px; border: 0;
  background: var(--uc); color: #fff; font-weight: 800; font-size: 15px; letter-spacing: 0.02em; text-transform: uppercase;
  box-shadow: 0 4px 0 var(--ud); transition: transform 0.08s, box-shadow 0.08s, filter 0.15s; cursor: pointer; }
.btn-duo .icon { width: 19px; height: 19px; stroke-width: 2.6; }
.btn-duo:hover { filter: brightness(1.06); }
.btn-duo:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ud); }
.btn-duo:disabled { opacity: 0.55; pointer-events: none; }
.course-layout .btn-duo, .map-wrap .btn-duo { --uc: inherit; }
.course-layout, .map-wrap { --uc: var(--accent); --ud: color-mix(in srgb, var(--uc) 78%, #000); }
.course-layout .btn-duo, .map-wrap .btn-duo { background: var(--uc); box-shadow: 0 4px 0 var(--ud); }

/* карта курса */
.map-wrap { max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; align-items: stretch; }
.map-desc { color: var(--muted); margin: 14px 4px 16px; font-size: 14.5px; }
.map-cta { align-self: center; margin-bottom: 8px; }
.map-done { align-self: center; display: inline-flex; align-items: center; gap: 8px; font-weight: 800; color: var(--uc); }
.map-done .icon { width: 22px; height: 22px; }
.path { position: relative; padding: 40px 0 20px; }
.roads { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }
.road { fill: none; stroke-width: 9; stroke-linecap: round; }
.road.done { stroke: var(--uc); opacity: 0.55; }
.road.todo { stroke: var(--node-off); stroke-dasharray: 1 17; stroke-width: 10; }
.node-row { display: flex; justify-content: center; margin-bottom: 30px; }
.node-row.is-current { padding-top: 38px; }
.node-wrap { position: relative; display: flex; flex-direction: column; align-items: center; width: 180px; transform: translateX(var(--x)); }
.node { position: relative; z-index: 1; width: 74px; height: 74px; border-radius: 50%; display: grid; place-items: center;
  background: var(--uc); color: #fff; box-shadow: 0 6px 0 var(--ud); transition: transform 0.08s, box-shadow 0.08s; }
.node .icon { width: 32px; height: 32px; stroke-width: 2.6; }
.node:hover { filter: brightness(1.05); }
.node:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--ud); }
.node.todo { background: var(--node-off); color: var(--node-off-ic); box-shadow: 0 6px 0 var(--node-offd); }
.node.final { width: 90px; height: 90px; background: #ffc800; box-shadow: 0 7px 0 #d4a600; color: #fff; }
.node.final.todo { background: var(--node-off); box-shadow: 0 7px 0 var(--node-offd); color: var(--node-off-ic); }
.node.final .icon { width: 40px; height: 40px; }
.node.current::before { content: ''; position: absolute; inset: -11px; border-radius: 50%; border: 4px solid var(--uc); animation: nodeRing 1.8s ease-out infinite; }
@keyframes nodeRing { 0% { transform: scale(0.92); opacity: 0.6; } 100% { transform: scale(1.3); opacity: 0; } }
.map-bubble { position: absolute; z-index: 3; top: -46px; padding: 7px 15px; border-radius: 12px; white-space: nowrap;
  background: var(--surface); color: var(--uc); font-weight: 800; font-size: 14px; letter-spacing: 0.04em; text-transform: uppercase;
  box-shadow: 0 0 0 2px var(--border-strong), 0 3px 0 var(--border-strong); animation: bubbleBob 1.5s ease-in-out infinite; }
.map-bubble::after { content: ''; position: absolute; left: 50%; bottom: -7px; width: 12px; height: 12px; margin-left: -6px; background: var(--surface); transform: rotate(45deg); box-shadow: 2px 2px 0 var(--border-strong); }
@keyframes bubbleBob { 50% { transform: translateY(-5px); } }
.node-title { position: relative; z-index: 1; margin-top: 12px; padding: 2px 9px; border-radius: 9px; text-align: center; font-size: 13.5px; font-weight: 700; line-height: 1.25; background: var(--bg); }
.node-row.todo .node-title { color: var(--muted); font-weight: 600; }
.node-meta { position: relative; z-index: 1; margin-top: 3px; padding: 0 7px; border-radius: 8px; font-size: 12px; color: var(--faint); background: var(--bg); }
@media (max-width: 600px) { .node-wrap { width: 150px; transform: translateX(calc(var(--x) * 0.6)); } }

/* шапка урока: круглый значок в цвете курса */
.lesson-head { display: flex; gap: 14px; align-items: center; }
.lesson-badge { width: 56px; height: 56px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--uc); color: #fff; box-shadow: 0 4px 0 var(--ud); }
.lesson-badge .icon { width: 28px; height: 28px; stroke-width: 2.4; }
.lesson-link.active { background: color-mix(in srgb, var(--uc) 12%, transparent); }
.lesson-link.active .lesson-num { border-color: var(--uc); color: var(--uc); }
.lesson-link.done .lesson-num { background: var(--uc); }
.course-layout .progress > i, .map-wrap .progress > i { background: var(--uc); }

/* в премиум-темах баннеры остаются цветными, но с мягким свечением */
:root[data-theme='obsidian'] .unit, :root[data-theme='obsidian'] .unit-card { background: linear-gradient(150deg, color-mix(in srgb, var(--uc) 55%, #1a140a), #120f0b); box-shadow: 0 5px 0 #000, inset 0 0 0 1px rgba(217, 180, 101, 0.35); }
:root[data-theme='obsidian'] .unit-icon { color: #ecd08a; }

/* ---------- Условия прохождения урока и автопроверка ---------- */
.lesson-foot { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 16px; }
.req-list:empty { display: none; }
.req-list { display: flex; flex-direction: column; gap: 8px; }
.req-title { font-size: 13px; font-weight: 700; color: var(--muted); }
.req-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 14px; border-radius: 12px; background: var(--surface-2); text-align: left; font-weight: 600; transition: background 0.15s; }
.req-item:hover { background: var(--surface-3); }
.req-item .icon { color: var(--faint); }
.req-item b { font-variant-numeric: tabular-nums; }
.req-item.ok { background: color-mix(in srgb, var(--success) 10%, transparent); }
.req-item.ok .icon, .req-item.ok b { color: var(--success); }
.btn-duo:disabled { opacity: 1; background: var(--node-off); color: var(--node-off-ic); box-shadow: 0 4px 0 var(--node-offd); pointer-events: none; }
.course-layout .btn-duo:disabled { background: var(--node-off); box-shadow: 0 4px 0 var(--node-offd); }

.quiz-banner { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 12px; background: var(--surface-2); font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.quiz-banner .icon { flex: none; color: var(--muted); }
.quiz-banner.ok { background: color-mix(in srgb, var(--success) 11%, transparent); color: var(--success); }
.quiz-banner.ok .icon { color: var(--success); }
.quiz-banner.bad { background: color-mix(in srgb, var(--danger) 9%, transparent); color: var(--danger); flex-wrap: wrap; }
.quiz-banner.bad .icon { color: var(--danger); }

.btn-duo.btn-check { padding: 8px 14px; font-size: 13px; border-radius: 10px; box-shadow: 0 3px 0 var(--ud); }
.course-layout .btn-duo.btn-check { box-shadow: 0 3px 0 var(--ud); }
.check-results { display: flex; flex-direction: column; gap: 8px; }
.check-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-weight: 700; font-size: 14px; }
.check-head .icon { width: 18px; height: 18px; }
.check-head.ok { background: color-mix(in srgb, var(--success) 12%, transparent); color: var(--success); }
.check-head.bad { background: color-mix(in srgb, var(--danger) 9%, transparent); color: var(--danger); }
.check-case { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 10px; border: 1px dashed var(--border-strong); font-size: 13px; }
.check-case > div { display: flex; gap: 10px; align-items: flex-start; }
.check-case span { width: 86px; flex: none; color: var(--muted); font-weight: 600; }
.check-case code { font-family: 'JetBrains Mono', ui-monospace, monospace; background: var(--surface-2); padding: 2px 6px; border-radius: 6px; white-space: pre-wrap; word-break: break-word; }
.sol-locked { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--faint); font-weight: 600; padding: 4px 0; }
.sol-locked .icon { width: 15px; height: 15px; }
.task-card.solved { border-color: color-mix(in srgb, var(--success) 45%, transparent); }

/* ============ Премиум-коллекция: Сапфир, Изумруд, Жемчуг ============
   Общий каркас «дорогих» тем (как у «Обсидиана»): металлическая фольга, тонкие вращающиеся рамки,
   луч света под курсором, зернистая фактура. Каждая тема задаёт только свои токены --lux-*. */
:root[data-theme='sapphire'] {
  --bg: #05080f; --surface: rgba(190, 210, 255, 0.04); --surface-2: rgba(190, 210, 255, 0.07); --surface-3: rgba(190, 210, 255, 0.11);
  --border: rgba(170, 195, 255, 0.13); --border-strong: rgba(200, 215, 255, 0.28);
  --text: #eef2fb; --muted: #a6b1c9; --faint: #69738c;
  --accent: #b8cbef; --accent-hover: #dbe6fa; --accent-soft: rgba(140, 175, 255, 0.13);
  --success: #7fd6b0; --warning: #f2c76e; --danger: #f08a8a; --info: #8fd0ff;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.6); --shadow: 0 16px 44px -16px rgba(0, 0, 0, 0.85); --shadow-lg: 0 36px 90px -26px rgba(0, 0, 0, 0.9);
  --lux-metal: linear-gradient(110deg, #7f8ea8 0%, #dfe7f5 22%, #ffffff 33%, #a9b7cf 50%, #eef3fb 68%, #7a8aa6 100%);
  --lux-foil: var(--lux-metal); --lux-ink: #0b1424;
  --lux-glow: rgba(90, 140, 255, 0.15); --lux-c1: rgba(150, 180, 255, 0.12); --lux-c2: rgba(235, 242, 255, 0.95);
  --lux-bgglow: radial-gradient(45% 40% at 8% 4%, rgba(40, 90, 220, 0.3), transparent 70%), radial-gradient(40% 45% at 96% 100%, rgba(25, 45, 130, 0.5), transparent 70%), radial-gradient(28% 28% at 70% 28%, rgba(170, 195, 255, 0.07), transparent 70%);
  --lux-glass1: rgba(200, 220, 255, 0.065); --lux-glass2: rgba(200, 220, 255, 0.015); --lux-inset: rgba(220, 232, 255, 0.09);
  --lux-side: rgba(6, 10, 20, 0.76); --lux-top: rgba(5, 8, 15, 0.55); --lux-panel: rgba(10, 15, 28, 0.97); --lux-code: rgba(0, 0, 0, 0.5);
  --lux-bubble: linear-gradient(135deg, #2b4f9e, #4c74c9); --lux-unit: #0a1224;
  --lux-display: 'Tenor Sans', var(--font); --lux-grain: 0.05; --lux-blend: overlay;
  color-scheme: dark;
}
:root[data-theme='emerald'] {
  --bg: #04110d; --surface: rgba(225, 255, 240, 0.035); --surface-2: rgba(225, 255, 240, 0.065); --surface-3: rgba(225, 255, 240, 0.1);
  --border: rgba(216, 190, 130, 0.15); --border-strong: rgba(216, 190, 130, 0.32);
  --text: #f2f1e8; --muted: #b9c2b2; --faint: #76806f;
  --accent: #d9bf86; --accent-hover: #ecd7a6; --accent-soft: rgba(217, 191, 134, 0.13);
  --success: #8fd6a8; --warning: #e9c46a; --danger: #e8897a; --info: #9fcfc0;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.6); --shadow: 0 16px 44px -16px rgba(0, 0, 0, 0.8); --shadow-lg: 0 36px 90px -26px rgba(0, 0, 0, 0.9);
  --lux-metal: linear-gradient(110deg, #9c8048 0%, #ead6a4 24%, #fff7e4 34%, #c4a465 52%, #f0deb2 70%, #957a44 100%);
  --lux-foil: var(--lux-metal); --lux-ink: #0e1a12;
  --lux-glow: rgba(217, 191, 134, 0.12); --lux-c1: rgba(216, 190, 130, 0.14); --lux-c2: rgba(255, 240, 200, 0.9);
  --lux-bgglow: radial-gradient(50% 45% at 14% 0%, rgba(16, 96, 66, 0.55), transparent 70%), radial-gradient(40% 45% at 100% 100%, rgba(8, 64, 46, 0.6), transparent 70%), radial-gradient(32% 28% at 66% 24%, rgba(217, 191, 134, 0.07), transparent 70%);
  --lux-glass1: rgba(230, 255, 240, 0.06); --lux-glass2: rgba(230, 255, 240, 0.012); --lux-inset: rgba(255, 245, 215, 0.07);
  --lux-side: rgba(4, 16, 12, 0.78); --lux-top: rgba(4, 17, 13, 0.55); --lux-panel: rgba(7, 24, 18, 0.97); --lux-code: rgba(0, 0, 0, 0.45);
  --lux-bubble: linear-gradient(135deg, #1d6b4f, #2f8a67); --lux-unit: #072019;
  --lux-display: 'Prata', Georgia, serif; --lux-grain: 0.075; --lux-blend: overlay;
  color-scheme: dark;
}
:root[data-theme='pearl'] {
  --bg: #f6f2ec; --surface: rgba(255, 255, 255, 0.82); --surface-2: #efe9e0; --surface-3: #e6ded2;
  --border: #e4dccf; --border-strong: #d3c8b7;
  --text: #1e1a16; --muted: #6e665c; --faint: #a59b8e;
  --accent: #a8705c; --accent-hover: #8f5a47; --accent-soft: rgba(168, 112, 92, 0.1);
  --success: #3d8a63; --warning: #b9822a; --danger: #b8483e; --info: #4b7d93;
  --shadow-sm: 0 1px 2px rgba(90, 60, 40, 0.06); --shadow: 0 16px 40px -20px rgba(90, 60, 40, 0.3); --shadow-lg: 0 36px 80px -30px rgba(90, 60, 40, 0.38);
  --lux-metal: linear-gradient(110deg, #c99c87 0%, #f4e3d8 22%, #ffffff 32%, #e3d3ee 45%, #d3e9ec 57%, #f2dbcd 72%, #b9897a 100%);
  --lux-foil: linear-gradient(110deg, #6b4335 0%, #a8705c 28%, #7d5a8c 50%, #a8705c 72%, #5e3a2e 100%); --lux-ink: #2b1f19;
  --lux-glow: rgba(205, 160, 180, 0.18); --lux-c1: rgba(200, 170, 150, 0.28); --lux-c2: rgba(185, 150, 220, 0.95);
  --lux-bgglow: radial-gradient(40% 40% at 92% 0%, rgba(242, 208, 218, 0.6), transparent 70%), radial-gradient(40% 40% at 0% 100%, rgba(205, 226, 236, 0.6), transparent 70%), radial-gradient(34% 34% at 55% 45%, rgba(232, 216, 246, 0.35), transparent 70%);
  --lux-glass1: rgba(255, 255, 255, 0.9); --lux-glass2: rgba(255, 255, 255, 0.68); --lux-inset: rgba(255, 255, 255, 1);
  --lux-side: rgba(251, 248, 243, 0.86); --lux-top: rgba(246, 242, 236, 0.8); --lux-panel: rgba(255, 253, 250, 0.98); --lux-code: #1f1b18;
  --lux-bubble: linear-gradient(135deg, #b07f6c, #c99d8b);
  --lux-display: 'Cormorant Garamond', Georgia, serif; --lux-grain: 0.07; --lux-blend: multiply;
  color-scheme: light;
}

:root[data-theme='sakura'] {
  --bg: #a9cdf2; --surface: rgba(255, 255, 255, 0.74); --surface-2: rgba(255, 240, 246, 0.85); --surface-3: rgba(250, 222, 234, 0.9);
  --border: rgba(255, 255, 255, 0.75); --border-strong: rgba(225, 160, 190, 0.6);
  --text: #2a2140; --muted: #5f5675; --faint: #9a90ad;
  --accent: #d9487e; --accent-hover: #c1336a; --accent-soft: rgba(217, 72, 126, 0.12);
  --success: #2f9a6a; --warning: #c9861f; --danger: #d0404f; --info: #3d82c4;
  --shadow-sm: 0 1px 2px rgba(60, 40, 90, 0.08); --shadow: 0 18px 44px -20px rgba(60, 50, 120, 0.35); --shadow-lg: 0 36px 80px -30px rgba(60, 50, 120, 0.45);
  --lux-metal: linear-gradient(110deg, #e88fb0 0%, #ffe1ec 22%, #ffffff 32%, #f5b8cf 48%, #cfe3fb 64%, #f7c6d8 78%, #d9628f 100%);
  --lux-foil: linear-gradient(110deg, #a8285b 0%, #d9487e 30%, #8a5fc4 52%, #d9487e 74%, #9b2352 100%); --lux-ink: #3a1027;
  --lux-glow: rgba(255, 170, 205, 0.25); --lux-c1: rgba(255, 190, 215, 0.5); --lux-c2: rgba(255, 255, 255, 0.95);
  --lux-bgglow: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 238, 245, 0.42)), url('/img/sakura.jpg') center / cover no-repeat;
  --lux-glass1: rgba(255, 255, 255, 0.8); --lux-glass2: rgba(255, 246, 250, 0.62); --lux-inset: rgba(255, 255, 255, 1);
  --lux-side: rgba(255, 250, 253, 0.72); --lux-top: rgba(255, 250, 253, 0.6); --lux-panel: rgba(255, 252, 254, 0.97); --lux-code: #241c33;
  --lux-bubble: linear-gradient(135deg, #e0608f, #f08fb2);
  --lux-display: 'Cormorant Garamond', Georgia, serif; --lux-grain: 0.025; --lux-blend: multiply;
  color-scheme: light;
}
/* фотография неба: не «плывёт» как свечение других тем, только едва дышит */
:root[data-theme='sakura'] body::before { inset: -3%; animation: sakuraBreath 30s ease-in-out infinite alternate; }
@keyframes sakuraBreath { from { transform: scale(1); } to { transform: scale(1.04); } }
:root[data-theme='sakura'] h1, :root[data-theme='sakura'] .next-title, :root[data-theme='sakura'] .prose h2 { font-weight: 700; }
:root[data-theme='sakura'] h1 { font-size: clamp(30px, 3.2vw, 40px); }
:root[data-theme='sakura'] .card, :root[data-theme='sakura'] .stat, :root[data-theme='sakura'] .sidebar, :root[data-theme='sakura'] .topbar { backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3); }
:root[data-theme='sakura'] .unit, :root[data-theme='sakura'] .unit-card { background: linear-gradient(150deg, color-mix(in srgb, var(--uc) 72%, #ffffff), color-mix(in srgb, var(--uc) 78%, #5a2a55)); box-shadow: 0 5px 0 color-mix(in srgb, var(--uc) 45%, #3a1a3a), 0 18px 40px -20px rgba(80, 40, 90, 0.5); }
.theme-preview.sakura { background: url('/img/sakura-thumb.jpg') center / cover; }
.theme-preview.sakura i, .theme-preview.sakura b { background: rgba(255, 255, 255, 0.85); }
.theme-preview.sakura em { background: linear-gradient(110deg, #d9487e, #ffd1e1 45%, #d9487e); }
/* падающие лепестки */
.petals { position: fixed; inset: 0; pointer-events: none; z-index: 1; overflow: hidden; }
.petals i { position: absolute; top: -40px; border-radius: 150% 0 150% 0; background: linear-gradient(135deg, #ffe4ee, #f7a8c4 60%, #ee8db2);
  box-shadow: 0 2px 6px rgba(220, 110, 150, 0.25); animation-name: petalFall, petalSway; animation-timing-function: linear, ease-in-out; animation-iteration-count: infinite; }
@keyframes petalFall { from { transform: translate3d(0, -40px, 0) rotate(0deg); } to { transform: translate3d(-160px, 110vh, 0) rotate(560deg); } }
@keyframes petalSway { 0%, 100% { margin-left: 0; } 50% { margin-left: 46px; } }

/* фон: мягкий свет и фактура */
:root[data-lux] body::before { content: ''; position: fixed; inset: -10%; z-index: -2; pointer-events: none; background: var(--lux-bgglow); animation: obsGlow 22s ease-in-out infinite alternate; }
:root[data-lux] body::after {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: var(--lux-grain); mix-blend-mode: var(--lux-blend);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
:root[data-lux] ::selection { background: var(--accent-soft); }

/* типографика: фольга и разрядка */
:root[data-lux] h1, :root[data-lux] .next-title, :root[data-lux] .prose h2, :root[data-lux] .lesson-section-head h2 { font-family: var(--lux-display); font-weight: 400; letter-spacing: 0.005em; }
:root[data-theme='pearl'] h1, :root[data-theme='pearl'] .next-title, :root[data-theme='pearl'] .prose h2 { font-weight: 600; }
:root[data-theme='pearl'] h1 { font-size: clamp(30px, 3.2vw, 38px); }
:root[data-lux] h1, :root[data-lux] .logo-text b, :root[data-lux] .grad-text {
  background: var(--lux-foil); background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: goldShine 9s ease-in-out infinite;
}
:root[data-lux] .hero h1 { background: none; color: var(--text); animation: none; }
:root[data-lux] .hero h1 span { background: var(--lux-foil); background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: goldShine 9s ease-in-out infinite; font-style: italic; }
:root[data-lux] .nav-label, :root[data-lux] .unit-label, :root[data-lux] .next-label, :root[data-lux] .req-title, :root[data-lux] .theme-group-label { letter-spacing: 0.14em; text-transform: uppercase; font-size: 11px; }
:root[data-lux] .next-label { color: var(--accent); }

/* карточки: стекло, луч под курсором, тонкая вращающаяся рамка */
:root[data-lux] .card, :root[data-lux] .stat, :root[data-lux] .qa, :root[data-lux] .q-editor, :root[data-lux] .review-item,
:root[data-lux] .self-q, :root[data-lux] .task-card, :root[data-lux] .onb-step, :root[data-lux] .level-pill {
  background: linear-gradient(160deg, var(--lux-glass1), var(--lux-glass2));
  backdrop-filter: blur(16px) saturate(125%); -webkit-backdrop-filter: blur(16px) saturate(125%);
  box-shadow: inset 0 1px 0 var(--lux-inset), var(--shadow);
}
:root[data-lux] .card::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity 0.35s;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), var(--lux-glow), transparent 45%);
}
:root[data-lux] .card:hover::before { opacity: 1; }
:root[data-lux] .card::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: conic-gradient(from var(--gold-angle), var(--lux-c1), var(--lux-c2), var(--lux-c1) 30%, var(--lux-c1) 70%, var(--lux-c2), var(--lux-c1));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0.4; transition: opacity 0.35s;
}
:root[data-lux] .card.hover:hover::after, :root[data-lux] .next-card:hover::after { opacity: 1; animation: goldSpin 5s linear infinite; }
:root[data-lux] .card.hover:hover { transform: translateY(-3px); box-shadow: 0 26px 60px -24px var(--lux-glow), inset 0 1px 0 var(--lux-inset); }
:root[data-lux] .next-card { border-left: 0; }

/* каркас */
:root[data-lux] .sidebar { background: var(--lux-side); backdrop-filter: blur(20px); }
:root[data-lux] .topbar { background: var(--lux-top); }
:root[data-lux] .glass { background: var(--lux-panel); backdrop-filter: blur(24px); border-color: var(--border-strong); }
:root[data-lux] .chat-main, :root[data-lux] .landing { background: transparent; }
:root[data-lux] .chat-head, :root[data-lux] .composer { background: var(--surface); }
:root[data-lux] .input, :root[data-lux] .textarea, :root[data-lux] .select, :root[data-lux] .search input, :root[data-lux] .composer textarea, :root[data-lux] .code-stdin { background: var(--surface); border-color: var(--border-strong); }
:root[data-lux] .nav-item.active { background: linear-gradient(90deg, var(--accent-soft), transparent); color: var(--accent); box-shadow: inset 2px 0 0 var(--accent); }
:root[data-lux] .section-tabs a.active { color: var(--accent); border-bottom-color: var(--accent); }
:root[data-lux] .bottom-nav a.active { color: var(--accent); }

/* металлические кнопки с бликом */
:root[data-lux] .btn-primary, :root[data-lux] .send-btn, :root[data-lux] .logo-mark, :root[data-lux] .nav-item .count, :root[data-lux] .lv-badge,
:root[data-lux] .unread, :root[data-lux] .filter.active, :root[data-lux] .tab.active, :root[data-lux] .bottom-nav .count {
  background: var(--lux-metal); background-size: 250% 100%; color: var(--lux-ink); border-color: transparent; font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 10px 26px -12px var(--lux-glow); animation: goldShine 8s ease-in-out infinite;
}
:root[data-lux] .btn-primary { position: relative; overflow: hidden; }
:root[data-lux] .btn-primary::after { content: ''; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.6), transparent); transform: skewX(-20deg); }
:root[data-lux] .btn-primary:hover::after { animation: goldSweep 0.9s ease; }
:root[data-lux] .btn-soft { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
:root[data-lux] .btn-soft:hover { border-color: var(--accent); }

/* детали */
:root[data-lux] .progress > i, :root[data-lux] .dist-bar { background: var(--lux-metal); background-size: 250% 100%; }
:root[data-lux] .level-ring circle:last-child, :root[data-lux] .score-ring circle:last-child { stroke: var(--accent); }
:root[data-lux] .ic-tile, :root[data-lux] .stat-ic { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px var(--border-strong); }
:root[data-lux] .chip.accent { background: var(--accent-soft); color: var(--accent); }
:root[data-lux] .avatar { box-shadow: 0 0 0 2px var(--border-strong); }
:root[data-lux] .msg.mine .bubble { background: var(--lux-bubble); color: #fff; }
:root[data-lux] .course-cover, :root[data-lux] .group-banner, :root[data-lux] .profile-cover { background: radial-gradient(90% 140% at 20% 0%, var(--accent-soft), transparent 65%), var(--surface); color: var(--accent); }
:root[data-lux] .course-cover::before, :root[data-lux] .group-banner::after, :root[data-lux] .profile-cover::after { background-image: radial-gradient(var(--border-strong) 1px, transparent 1px); }
:root[data-lux] .cover-ic, :root[data-lux] .group-emoji { background: var(--lux-panel); color: var(--accent); border-color: var(--border-strong); }
:root[data-lux] .prose pre, :root[data-lux] .code-edit, :root[data-lux] .self-q pre, :root[data-lux] .task-card pre { background: var(--lux-code); border: 1px solid var(--border); }
:root[data-lux] .prose blockquote { border-left-color: var(--accent); background: var(--accent-soft); }
:root[data-lux] .spoiler:not(.open) { background: var(--lux-metal); }
:root[data-lux] .toast.achievement { border-color: var(--border-strong); box-shadow: 0 0 40px -14px var(--lux-glow); }
/* баннеры курсов в тёмных темах — приглушённые, с тонкой рамкой; в «Жемчуге» остаются цветными */
:root[data-lux='dark'] .unit, :root[data-lux='dark'] .unit-card { background: linear-gradient(150deg, color-mix(in srgb, var(--uc) 42%, var(--lux-unit)), var(--lux-unit)); box-shadow: 0 5px 0 #000, inset 0 0 0 1px var(--border-strong); }
:root[data-lux='dark'] .unit-icon { color: var(--accent); }
:root[data-theme='pearl'] .unit, :root[data-theme='pearl'] .unit-card { background: linear-gradient(150deg, color-mix(in srgb, var(--uc) 58%, #8a776c), color-mix(in srgb, var(--uc) 48%, #3d302a)); box-shadow: 0 5px 0 color-mix(in srgb, var(--uc) 30%, #2a201b), 0 18px 40px -20px rgba(60, 40, 30, 0.45); }
@media (prefers-reduced-motion: reduce) { :root[data-lux] body::before { animation: none; } }

/* превью в выборе темы */
.theme-preview.sapphire { background: radial-gradient(60% 80% at 10% 5%, rgba(40, 90, 220, 0.55), transparent 70%), radial-gradient(50% 70% at 100% 100%, rgba(25, 45, 130, 0.7), transparent 70%), #05080f; }
.theme-preview.sapphire i, .theme-preview.sapphire b { background: rgba(200, 220, 255, 0.08); box-shadow: inset 0 0 0 1px rgba(200, 215, 255, 0.35); }
.theme-preview.sapphire em { background: linear-gradient(110deg, #7f8ea8, #ffffff 40%, #a9b7cf 60%, #eef3fb); box-shadow: 0 0 10px rgba(160, 190, 255, 0.7); }
.theme-preview.emerald { background: radial-gradient(60% 80% at 15% 0%, rgba(16, 96, 66, 0.8), transparent 70%), radial-gradient(50% 70% at 100% 100%, rgba(8, 64, 46, 0.8), transparent 70%), #04110d; }
.theme-preview.emerald i, .theme-preview.emerald b { background: rgba(230, 255, 240, 0.07); box-shadow: inset 0 0 0 1px rgba(216, 190, 130, 0.4); }
.theme-preview.emerald em { background: linear-gradient(110deg, #9c8048, #fff7e4 40%, #c4a465 60%, #f0deb2); box-shadow: 0 0 10px rgba(217, 191, 134, 0.7); }
.theme-preview.pearl { background: radial-gradient(55% 70% at 95% 0%, rgba(242, 208, 218, 0.9), transparent 70%), radial-gradient(55% 70% at 0% 100%, rgba(205, 226, 236, 0.9), transparent 70%), #f6f2ec; }
.theme-preview.pearl i, .theme-preview.pearl b { background: rgba(255, 255, 255, 0.95); box-shadow: inset 0 0 0 1px #e4dccf; }
.theme-preview.pearl em { background: linear-gradient(110deg, #c99c87, #ffffff 35%, #e3d3ee 50%, #d3e9ec 62%, #b9897a); }
.pro-badge { background: linear-gradient(110deg, #9c7531, #f3d98b 45%, #c99a42 70%); color: #1c1408; }

/* ---------- Карточки «следят» за курсором ----------
   Карточка наклоняется к мыши, иконка внутри смещается навстречу, по поверхности скользит блик. */
.card.hover, .unit-card, .next-card, .qa, .teacher-card { transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s, border-color 0.3s; }
.unit-card, .qa { position: relative; }
.tilting { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(-4px) scale(1.01) !important; transition: transform 0.12s ease-out, box-shadow 0.3s !important; will-change: transform; z-index: 2; }
.tilting .ic-tile, .tilting .unit-icon, .tilting .cover-ic, .tilting .lesson-badge, .tilting > .avatar, .tilting .teacher-card .avatar { transform: translate(var(--px, 0), var(--py, 0)); transition: transform 0.12s ease-out; }
.tilting .unit-title, .tilting h3 { transform: translate(calc(var(--px, 0px) * 0.35), calc(var(--py, 0px) * 0.35)); transition: transform 0.12s ease-out; }
/* блик при наклоне — только в премиум-темах */
:root { --tilt-glare: rgba(255, 255, 255, 0.55); --tilt-blend: soft-light; }
:root[data-theme='obsidian'] .unit-card.tilting::before, :root[data-lux] .unit-card.tilting::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 3; opacity: 1;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), var(--tilt-glare), transparent 55%); mix-blend-mode: var(--tilt-blend);
}
.unit-card.tilting { box-shadow: 0 5px 0 var(--ud), 0 24px 44px -18px color-mix(in srgb, var(--uc) 70%, transparent) !important; }
@media (hover: none), (prefers-reduced-motion: reduce) { .tilting { transform: none !important; } }

/* ============ NaNO PRO ============ */
:root { --pro-gold: linear-gradient(110deg, #9c7531, #f3d98b 40%, #fff3cc 50%, #c99a42 70%, #f4dc98); }
.pro-tag { display: inline-flex; align-items: center; vertical-align: middle; font-size: 10px; font-weight: 800; letter-spacing: 0.06em; padding: 2px 6px; border-radius: 6px; color: #1c1408; background: var(--pro-gold); background-size: 200% 100%; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5); line-height: 1.2; }
/* золотая рамка аватара */
.avatar.pro { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px #d9b465, 0 0 14px rgba(217, 180, 101, 0.55); }
.avatar.pro.online::after { box-shadow: 0 0 0 2px var(--surface); }
/* кнопка в шапке */
.pro-btn { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px; border-radius: 10px; font-weight: 700; font-size: 13.5px; color: #1c1408; background: var(--pro-gold); background-size: 220% 100%; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 6px 18px -8px rgba(201, 154, 66, 0.8); animation: goldShine 7s ease-in-out infinite; white-space: nowrap; }
.pro-btn .icon { width: 17px; height: 17px; }
.pro-btn.on { padding: 0 10px; }
@media (max-width: 600px) { .pro-btn span { display: none; } .pro-btn { padding: 0 10px; } }
.pro-row { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--border-strong); font-weight: 600; }
.pro-row > .icon:first-child { color: #c99a42; }
.pro-row:hover { border-color: #c99a42; }
.pro-mini { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.pro-mini div { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.pro-mini .icon { width: 17px; height: 17px; color: #c99a42; flex: none; }
.modal-head h2 .icon { color: #c99a42; width: 22px; height: 22px; vertical-align: -3px; }

/* страница PRO */
.pro-hero { text-align: center; padding: 48px 28px 40px; overflow: hidden; background: radial-gradient(70% 90% at 50% 0%, rgba(217, 180, 101, 0.22), transparent 70%), var(--surface); }
.pro-crown { width: 76px; height: 76px; margin: 0 auto 12px; border-radius: 22px; display: grid; place-items: center; color: #1c1408; background: var(--pro-gold); background-size: 220% 100%; animation: goldShine 6s ease-in-out infinite; box-shadow: 0 16px 40px -14px rgba(201, 154, 66, 0.9), inset 0 1px 0 rgba(255,255,255,.6); }
.pro-crown .icon { width: 38px; height: 38px; }
.pro-kicker { font-size: 12px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: #b8893b; }
.pro-title { font-family: 'Playfair Display', Georgia, serif; font-size: clamp(36px, 5vw, 54px); margin: 6px 0 10px; background: linear-gradient(110deg, #7a5a20, #c99a42 35%, #e9cd84 50%, #a8792f 65%, #6b4e1a); background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: goldShine 8s ease-in-out infinite; }
.pro-sub { max-width: 560px; margin: 0 auto 22px; color: var(--muted); font-size: 16px; }
.pro-status { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 99px; background: color-mix(in srgb, var(--success) 12%, transparent); color: var(--success); font-weight: 700; font-size: 14px; margin-bottom: 18px; }
.pro-feature { display: flex; flex-direction: column; gap: 8px; }
.pro-feature p { font-size: 14px; }
.pro-themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.pro-theme { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.pro-theme b { font-size: 15px; }

/* статистика */
.stats-top { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-big { display: flex; align-items: center; gap: 14px; padding: 18px; }
.stat-big > .icon { width: 30px; height: 30px; color: var(--accent); flex: none; }
.stat-big.streak > .icon { color: #f97316; }
.stat-big b { display: block; font-size: 26px; font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; }
.stat-big span { font-size: 13px; color: var(--muted); }
.heatmap { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 14px); grid-auto-columns: 14px; gap: 4px; overflow-x: auto; padding-bottom: 4px; justify-content: start; }
.heatmap i, .heat-legend i { display: block; width: 14px; height: 14px; border-radius: 4px; background: var(--surface-3); }
.heatmap i.empty { background: transparent; }
.heatmap i.today { outline: 2px solid var(--text); outline-offset: 1px; }
.heatmap i.l1, .heat-legend i.l1 { background: color-mix(in srgb, var(--accent) 30%, var(--surface-3)); }
.heatmap i.l2, .heat-legend i.l2 { background: color-mix(in srgb, var(--accent) 55%, var(--surface-3)); }
.heatmap i.l3, .heat-legend i.l3 { background: color-mix(in srgb, var(--accent) 80%, var(--surface-3)); }
.heatmap i.l4, .heat-legend i.l4 { background: var(--accent); }
.heat-legend { display: flex; align-items: center; gap: 4px; font-size: 12px; }
.heat-legend i { width: 11px; height: 11px; border-radius: 3px; }
.week-bars { display: flex; align-items: flex-end; gap: 8px; height: 180px; }
.week-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.week-col div { width: 100%; min-height: 3px; border-radius: 6px 6px 3px 3px; background: var(--accent); }
.week-col span { font-size: 11px; font-weight: 700; color: var(--muted); }
.week-col em { font-style: normal; font-size: 10.5px; color: var(--faint); white-space: nowrap; }
@media (max-width: 980px) { .stats-top { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* закрытая статистика без PRO */
.pro-lock { position: relative; overflow: hidden; min-height: 360px; display: grid; place-items: center; }
.pro-lock-demo { position: absolute; inset: 24px; display: grid; grid-template-columns: repeat(20, 1fr); gap: 6px; filter: blur(3px); opacity: 0.6; }
.pro-lock-demo i { border-radius: 5px; background: var(--accent); aspect-ratio: 1; }
.pro-lock-msg { position: relative; z-index: 1; text-align: center; max-width: 440px; padding: 28px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; align-items: center; gap: 8px; }

/* заметки к урокам */
.notes-card { display: flex; flex-direction: column; gap: 10px; padding: 14px; }
.notes-card h3 { display: flex; align-items: center; gap: 6px; font-size: 14.5px; }
.notes-card h3 .icon { width: 16px; height: 16px; color: var(--accent); }
.notes-text { width: 100%; min-height: 150px; resize: vertical; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--surface-2); outline: none; font-size: 14px; line-height: 1.5; }
.notes-text:focus { border-color: var(--accent); background: var(--surface); }
.notes-status { font-size: 12px; }
.notes-card.locked { flex-direction: row; align-items: center; gap: 12px; text-align: left; cursor: pointer; }
.notes-card.locked > .icon { color: #c99a42; }
.notes-card.locked .grow { display: flex; flex-direction: column; font-size: 13px; }
.notes-card.locked b { font-size: 14px; }

/* сертификат */
.map-cert { align-self: center; margin-top: 10px; }
.cert-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.cert-actions .back { margin: 0; }
.cert { max-width: 900px; margin: 0 auto; aspect-ratio: 1.414; padding: 22px; border-radius: 6px; background: linear-gradient(135deg, #fbf6ea, #f3ead4); box-shadow: var(--shadow-lg); color: #2b2318; }
.cert-inner { height: 100%; border: 2px solid #c9a55c; outline: 1px solid #c9a55c; outline-offset: -10px; border-radius: 3px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 30px 40px; gap: 6px; position: relative;
  background: radial-gradient(60% 60% at 50% 40%, rgba(255, 255, 255, 0.7), transparent 70%); }
.cert-logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; letter-spacing: -0.02em; margin-bottom: 8px; }
.cert-logo .logo-mark { width: 30px; height: 30px; font-size: 14px; background: linear-gradient(135deg, #b8893b, #e9cd84) !important; color: #fff !important; box-shadow: none !important; animation: none !important; }
.cert-kicker { font-family: 'Playfair Display', Georgia, serif; font-size: clamp(30px, 5vw, 52px); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #9c7531; }
.cert-line { font-size: 15px; color: #6b5a40; }
.cert-name { font-family: 'Playfair Display', Georgia, serif; font-style: italic; font-size: clamp(26px, 4.4vw, 46px); font-weight: 600; margin: 4px 0; border-bottom: 1px solid #c9a55c; padding: 0 30px 6px; }
.cert-course { font-size: clamp(18px, 2.4vw, 24px); font-weight: 700; color: #2b2318; }
.cert-meta { font-size: 13px; color: #8a7655; }
.cert-foot { display: flex; align-items: center; justify-content: space-between; width: 100%; margin-top: 22px; }
.cert-foot > div:not(.cert-seal) { display: flex; flex-direction: column; font-size: 13px; min-width: 150px; }
.cert-foot span { color: #8a7655; font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; }
.cert-seal { width: 74px; height: 74px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: radial-gradient(circle at 35% 30%, #f3d98b, #c99a42 55%, #8a6424); box-shadow: 0 6px 16px rgba(120, 80, 20, 0.35); }
.cert-seal .icon { width: 34px; height: 34px; }
.cert-sign { position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); font-size: 12px; color: #8a7655; }
@media print {
  body * { visibility: hidden !important; }
  .cert, .cert * { visibility: visible !important; }
  .cert { position: fixed; inset: 0; margin: 0; max-width: none; box-shadow: none; border-radius: 0; }
  body::before, body::after { display: none !important; }
  @page { size: A4 landscape; margin: 0; }
}

:root[data-theme='dark'] .pro-title, :root[data-lux='dark'] .pro-title, :root[data-theme='obsidian'] .pro-title { background: var(--pro-gold); background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; }

/* ============ Эффекты ============ */
/* волна от нажатия */
.has-ripple { overflow: hidden; isolation: isolate; }
.ripple { position: absolute; border-radius: 50%; pointer-events: none; background: currentColor; opacity: 0.18; transform: scale(0); animation: rippleOut 0.6s ease-out forwards; z-index: 0; }
@keyframes rippleOut { to { transform: scale(1); opacity: 0; } }
/* магнитные кнопки двигаются отдельным свойством translate — не мешают нажатию и наклону */
.btn-primary, .btn-duo, .pro-btn, .send-btn { transition: translate 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.08s, box-shadow 0.15s, filter 0.15s, background 0.15s; }
/* плавное появление */
.reveal { opacity: 0; translate: 0 14px; }
.reveal.in { opacity: 1; translate: 0 0; transition: opacity 0.5s ease var(--rd, 0ms), translate 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) var(--rd, 0ms), transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s, border-color 0.3s; }
/* искры */
.spark { position: fixed; z-index: 400; width: 7px; height: 7px; border-radius: 2px; pointer-events: none; transform: translate(-50%, -50%); animation: sparkFly 0.75s cubic-bezier(0.15, 0.7, 0.3, 1) forwards; }
@keyframes sparkFly { 0% { opacity: 1; transform: translate(-50%, -50%) rotate(0) scale(1); } 100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) rotate(var(--rot)) scale(0.4); } }
/* свет за курсором в тёмных темах */
.cursor-aura { position: fixed; left: 0; top: 0; width: 600px; height: 600px; border-radius: 50%; pointer-events: none; z-index: 0; opacity: 0; transition: opacity 0.4s;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%); mix-blend-mode: screen; will-change: transform; }
.cursor-aura.on { opacity: 1; }
:root[data-theme='obsidian'] .cursor-aura { background: radial-gradient(circle, rgba(217, 180, 101, 0.1), transparent 60%); }
/* живой фон: свечение смещается за мышью */
:root[data-theme='obsidian'] body::before, :root[data-lux] body::before { translate: var(--bgx, 0) var(--bgy, 0); transition: translate 0.6s ease-out; }
/* иконки меню оживают при наведении */
.nav-item:hover .icon, .bottom-nav a:hover .icon { animation: iconPop 0.45s ease; }
@keyframes iconPop { 0% { transform: scale(1); } 40% { transform: scale(1.18) rotate(-6deg); } 70% { transform: scale(0.95) rotate(3deg); } 100% { transform: scale(1); } }
/* блик пробегает по карточке курса */
.unit-card { overflow: hidden; }
:root[data-theme='obsidian'] .unit-card::after, :root[data-lux] .unit-card::after { content: ''; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%; pointer-events: none; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.28), transparent); transform: skewX(-18deg); }
:root[data-theme='obsidian'] .unit-card:hover::after, :root[data-lux] .unit-card:hover::after { animation: cardSheen 1s ease; }
@keyframes cardSheen { to { left: 130%; } }
/* пульс у текущего урока и мягкое «дыхание» у кнопки «Продолжить» на главной */
.next-card .btn { animation: ctaBreath 3.2s ease-in-out infinite; }
@keyframes ctaBreath { 50% { box-shadow: 0 0 0 6px var(--accent-soft), 0 10px 26px -12px var(--accent); } }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; translate: none; } .cursor-aura { display: none; } }

/* ============ Эффекты только для премиум-тем ============ */
/* кинематографичный переход между страницами */
:root:is([data-theme='obsidian'], [data-lux]) .view { animation: luxViewIn 0.6s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes luxViewIn { from { opacity: 0; filter: blur(8px); transform: scale(0.985); } to { opacity: 1; filter: blur(0); transform: none; } }
/* заголовки проявляются слева направо из размытия */
:root:is([data-theme='obsidian'], [data-lux]) :is(.page-head h1, .dash-head h1, .hero h1, .pro-title) { animation: luxTitle 1.1s cubic-bezier(0.2, 0.8, 0.2, 1) both, goldShine 9s ease-in-out 1.1s infinite; }
@keyframes luxTitle { from { clip-path: inset(0 100% 0 0); filter: blur(6px); opacity: 0.4; } to { clip-path: inset(0 0 0 0); filter: blur(0); opacity: 1; } }
/* металлическое свечение полей при фокусе */
:root:is([data-theme='obsidian'], [data-lux]) :is(.input, .textarea, .select, .search input, .composer textarea, .notes-text, .code-stdin):focus {
  border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 0 22px -6px var(--accent);
}
/* курсор-кольцо */
.lux-ring { position: fixed; left: -18px; top: -18px; width: 36px; height: 36px; border-radius: 50%; pointer-events: none; z-index: 500;
  border: 1.5px solid var(--accent); opacity: 0; transition: opacity 0.3s, width 0.25s, height 0.25s, left 0.25s, top 0.25s, background 0.25s, border-color 0.25s; }
.lux-ring.on { opacity: 0.85; }
.lux-ring.hover { width: 56px; height: 56px; left: -28px; top: -28px; background: color-mix(in srgb, var(--accent) 10%, transparent); }
.lux-ring.down { width: 24px; height: 24px; left: -12px; top: -12px; background: color-mix(in srgb, var(--accent) 25%, transparent); }
:root[data-theme='obsidian'] .lux-ring { border-color: #d9b465; }
/* полоса прокрутки */
.lux-progress { position: fixed; left: 0; right: 0; top: 0; height: 2px; z-index: 450; transform-origin: 0 50%; transform: scaleX(0); pointer-events: none;
  background: var(--lux-metal, linear-gradient(90deg, #9c7531, #f3d98b, #c99a42)); box-shadow: 0 0 10px var(--accent); transition: transform 0.12s linear; }
/* церемония нового уровня */
.lux-level { position: fixed; inset: 0; z-index: 420; display: grid; place-items: center; background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(6px); opacity: 0; transition: opacity 0.45s; cursor: pointer; }
.lux-level.show { opacity: 1; }
.lux-level-card { text-align: center; transform: scale(0.85); transition: transform 0.6s cubic-bezier(0.2, 1.3, 0.3, 1); }
.lux-level.show .lux-level-card { transform: none; }
.lux-level-kicker { font-size: 13px; font-weight: 800; letter-spacing: 0.3em; text-transform: uppercase; color: #f3e6c8; }
.lux-level-num { font-family: 'Playfair Display', Georgia, serif; font-size: clamp(120px, 22vw, 220px); font-weight: 700; line-height: 1; margin: 6px 0;
  background: var(--lux-metal, var(--gold)); background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: goldShine 4s ease-in-out infinite; filter: drop-shadow(0 10px 40px rgba(0, 0, 0, 0.5)); }
:root[data-theme='obsidian'] .lux-level-num { background-image: var(--gold); }
.lux-level-sub { color: rgba(255, 255, 255, 0.75); font-size: 16px; }
@media (prefers-reduced-motion: reduce) { :root:is([data-theme='obsidian'], [data-lux]) .view, :root:is([data-theme='obsidian'], [data-lux]) .page-head h1 { animation: none; } }

/* ============ Цель дня (PRO) ============ */
.daily-pill { display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); text-align: left; }
.daily-pill:hover { border-color: var(--accent); }
.daily-pill svg { width: 42px; height: 42px; transform: rotate(-90deg); flex: none; }
.daily-pill circle { fill: none; stroke-width: 5; stroke-linecap: round; }
.daily-pill .track { stroke: var(--surface-3); }
.daily-pill .fill { stroke: var(--accent); transition: stroke-dashoffset 1s cubic-bezier(0.2, 0.8, 0.2, 1); }
.daily-pill.done .fill { stroke: var(--success); }
.daily-text { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); }
.daily-text b { font-size: 14px; color: var(--text); }
.daily-streak { display: inline-flex; align-items: center; gap: 3px; margin-left: 4px; padding: 4px 9px; border-radius: 99px; background: var(--surface-2); font-weight: 800; font-size: 14px; color: var(--faint); }
.daily-streak .icon { width: 17px; height: 17px; }
.daily-streak.on { background: color-mix(in srgb, #f97316 14%, transparent); color: #f97316; }
.daily-streak.on .icon { animation: flameFlicker 1.6s ease-in-out infinite; }
@keyframes flameFlicker { 50% { transform: scale(1.12) rotate(-4deg); } }
.goal-pick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 14px; }
.goal-opt { display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: 12px; border: 1.5px solid var(--border); text-align: left; }
.goal-opt b { font-size: 18px; }
.goal-opt span { font-size: 13px; color: var(--muted); }
.goal-opt.active, .goal-opt:hover { border-color: var(--accent); background: var(--accent-soft); }

/* ============ Фокус-таймер (PRO) ============ */
.focus-timer { position: fixed; left: 272px; bottom: 20px; z-index: 160; display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 8px; border-radius: 18px; animation: pop 0.25s ease; }
.focus-ring { width: 48px; height: 48px; transform: rotate(-90deg); flex: none; }
.focus-ring circle { fill: none; stroke-width: 4; stroke-linecap: round; }
.focus-ring .track { stroke: var(--surface-3); }
.focus-ring .fill { stroke: var(--accent); transition: stroke-dashoffset 1s linear; }
.focus-timer[data-mode='break'] .focus-ring .fill { stroke: var(--success); }
.focus-info { display: flex; flex-direction: column; min-width: 64px; margin-right: 2px; }
.focus-info b { font-size: 18px; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.focus-info span { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.focus-timer .icon-btn { width: 32px; height: 32px; border: 0; background: var(--surface-2); }
.focus-timer .icon-btn .icon { width: 16px; height: 16px; }
@media (max-width: 980px) { .focus-timer { left: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); } }

/* ============ Учительский PRO ============ */
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 980px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* тарифы */
.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.plans.one { grid-template-columns: minmax(0, 520px); justify-content: center; }
.plan { position: relative; display: flex; flex-direction: column; gap: 14px; padding: 24px; }
.plan.current { border-color: var(--success); }
.plan-teacher { border: 1.5px solid #c99a42; box-shadow: 0 18px 50px -24px rgba(201, 154, 66, 0.55); }
.plan-ribbon { position: absolute; top: 16px; right: 16px; padding: 4px 10px; border-radius: 99px; font-size: 11.5px; font-weight: 800; letter-spacing: 0.04em; color: #3b2a0a; background: var(--pro-gold); background-size: 250% 100%; }
.plan-head { display: flex; align-items: center; gap: 12px; }
.plan-head h3 { font-size: 20px; }
.plan-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.plan-list li { display: flex; align-items: center; gap: 9px; font-size: 14.5px; }
.plan-list .icon { width: 17px; height: 17px; color: var(--success); flex: none; }
.plan-list li.muted .icon { color: var(--muted); }
.plan > .btn, .plan > .chip { align-self: flex-start; }
@media (max-width: 760px) { .plans { grid-template-columns: minmax(0, 1fr); } }
/* закреплённое объявление */
.pinned-card { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: 14px; border: 1px solid color-mix(in srgb, #c99a42 45%, var(--border)); background: color-mix(in srgb, #c99a42 8%, var(--surface)); }
.pinned-card > .icon { width: 20px; height: 20px; color: #b7862f; margin-top: 2px; flex: none; }
.pinned-card.empty-pin { border-style: dashed; background: var(--surface); }
.pinned-label { font-size: 12px; font-weight: 700; color: #b7862f; text-transform: uppercase; letter-spacing: 0.04em; }
.pinned-text { white-space: pre-wrap; margin-top: 2px; font-size: 15px; }
/* курсы-задания */
.assign-card { padding: 18px; }
.assign-students { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px 18px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.assign-st { display: flex; align-items: center; gap: 10px; }
.assign-st .progress { height: 6px; margin-top: 4px; }
.progress.done i { background: var(--success); }
.assign-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; max-height: 340px; overflow-y: auto; padding: 2px; }
.assign-opt { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; border: 1.5px solid var(--border); cursor: pointer; }
.assign-opt input { display: none; }
.assign-opt > span { display: flex; flex-direction: column; font-size: 13px; min-width: 0; }
.assign-opt b { font-size: 14px; }
.assign-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
/* аналитика */
.an-table td { vertical-align: middle; }
.spark-bars { display: flex; align-items: flex-end; gap: 2px; height: 28px; width: 98px; }
.spark-bars i { flex: 1; border-radius: 2px; background: var(--surface-3); }
.spark-bars i.on { background: var(--accent); }
.attention-card { border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }
.attention-card h3 { display: flex; align-items: center; gap: 8px; color: var(--danger); }
.attention-card h3 .icon { width: 19px; height: 19px; }
.progress.hard { height: 7px; }
.an-test { border-top: 1px solid var(--border); }
.an-test:first-of-type { border-top: 0; }
.an-test summary { display: flex; align-items: center; gap: 12px; padding: 10px 2px; cursor: pointer; list-style: none; }
.an-test summary::-webkit-details-marker { display: none; }
.an-test summary > .icon { transition: transform 0.2s; }
.an-test[open] summary > .icon { transform: rotate(90deg); }
.an-res { gap: 10px; padding: 7px 4px 7px 50px; font-size: 14px; }
.an-lock-demo { position: absolute; inset: 20px; filter: blur(5px); opacity: 0.55; pointer-events: none; }
/* отчёт для родителей */
.report { max-width: 860px; margin: 0 auto; background: #fff; color: #1a1a2e; border-radius: 18px; padding: 40px 44px; box-shadow: var(--shadow-lg); }
.report .muted { color: #6b7280; }
.report-head { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 20px; border-bottom: 2px solid #eef0f4; }
.report-kicker { font-size: 12px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: #6d5dfc; }
.report-head h1 { font-size: 32px; margin: 4px 0; color: #1a1a2e; }
.report-logo { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 13px; }
.report-logo .logo-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: #6d5dfc; color: #fff; font-weight: 800; }
.report-kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin: 22px 0; }
.report-kpis > div { padding: 14px; border-radius: 12px; background: #f6f7fb; display: flex; flex-direction: column; }
.report-kpis b { font-size: 26px; }
.report-kpis span { font-size: 12.5px; color: #6b7280; }
.report h3 { margin: 26px 0 10px; font-size: 17px; color: #1a1a2e; }
.report-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.report-table th { text-align: left; font-size: 12px; color: #6b7280; font-weight: 700; padding: 8px 10px; border-bottom: 1px solid #e5e7eb; }
.report-table td { padding: 9px 10px; border-bottom: 1px solid #f0f1f5; }
.report-courses { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 24px; font-size: 14px; }
.report-courses .progress { margin-top: 5px; background: #eef0f4; }
.report-foot { display: flex; justify-content: space-between; margin-top: 30px; padding-top: 16px; border-top: 2px solid #eef0f4; font-size: 13.5px; }
@media (max-width: 760px) { .report { padding: 24px 18px; } .report-kpis { grid-template-columns: repeat(2, 1fr); } .report-courses { grid-template-columns: 1fr; } .report-head { flex-direction: column; } .report-logo { align-items: flex-start; } }
@media print {
  .report, .report * { visibility: visible !important; }
  .report { position: absolute; left: 0; top: 0; width: 100%; box-shadow: none; border-radius: 0; padding: 0; max-width: none; page: report; }
  .no-print { display: none !important; }
}
@page report { size: A4 portrait; margin: 14mm; }

/* фирменный значок вместо буквы N — одинаковый во всех темах */
.logo-mark.img, .cert-logo .logo-mark.img, .report-logo .logo-mark.img { background: none !important; padding: 0; overflow: hidden; border-radius: 9px; box-shadow: 0 4px 12px -4px rgba(20, 20, 40, 0.45) !important; animation: none !important; }
.logo-mark.img img { width: 100%; height: 100%; display: block; }
.logo-mark.img::before, .logo-mark.img::after { display: none !important; }

/* ============ Типы вопросов ============ */
.kind-pick { display: flex; flex-wrap: wrap; gap: 4px; margin-left: auto; margin-right: 6px; }
.kind-pick button { display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border-radius: 8px; font-size: 12.5px; font-weight: 600; color: var(--muted); border: 1px solid transparent; }
.kind-pick button .icon { width: 14px; height: 14px; }
.kind-pick button:hover { background: var(--surface-2); color: var(--text); }
.kind-pick button.active { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
@media (max-width: 760px) { .kind-pick button span { display: none; } }
.q-editor .opt-row input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--success); flex: none; }
.q-editor .opt-row > .icon { flex: none; }
.order-num { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--surface-2); font-weight: 800; font-size: 13px; color: var(--muted); flex: none; }
/* прохождение */
.option.multi .letter { border-radius: 7px; }
.option.multi .letter .icon { width: 16px; height: 16px; }
.answer-input { font-size: 18px; padding: 16px 18px; }
.match-play { display: flex; flex-direction: column; gap: 10px; }
.match-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px; }
.match-left { padding: 13px 16px; border-radius: 12px; background: var(--surface-2); font-weight: 600; }
@media (max-width: 640px) { .match-row { grid-template-columns: 1fr; gap: 6px; } .match-row > .icon { display: none; } }
.order-play { display: flex; flex-direction: column; gap: 8px; }
.order-row { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 14px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--surface); font-weight: 550; }
.order-row .icon-btn { width: 34px; height: 34px; }
.order-row [data-down] .icon { transform: rotate(180deg); }
.order-row.sm { padding: 7px 10px; margin-bottom: 6px; font-size: 14px; }
.order-row.ok { border-color: color-mix(in srgb, var(--success) 50%, transparent); }
.order-row.bad { border-color: color-mix(in srgb, var(--danger) 50%, transparent); }
/* разбор */
.rv-lines { display: flex; flex-direction: column; gap: 6px; }
.rv-lines > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; padding: 9px 12px; border-radius: 10px; background: var(--surface-2); font-size: 14px; }
.rv-lines span { color: var(--muted); min-width: 120px; font-weight: 600; }
.rv-lines b.ok { color: var(--success); }
.rv-lines b.bad { color: var(--danger); text-decoration: line-through; text-decoration-thickness: 1px; }
.rv-lines em { font-style: normal; color: var(--success); font-size: 13px; }
/* варианты и банк */
.variant-box { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 12px; background: var(--surface-2); }
.check-row { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.check-row input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.check-row > span { display: flex; flex-direction: column; font-size: 14px; }
.check-row .muted { font-size: 12.5px; }
.bank-list { display: flex; flex-direction: column; gap: 6px; max-height: 420px; overflow-y: auto; }
.bank-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--border); cursor: pointer; }
.bank-item input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.bank-item.on { border-color: var(--accent); background: var(--accent-soft); }
/* работа над ошибками */
.review-start { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; padding: 26px; }
.review-start h2 { font-size: 22px; }
.review-banner { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-color: color-mix(in srgb, var(--accent) 30%, var(--border)); }
#rv-feedback .review-item > .row-between > b { visibility: hidden; }

/* ============ Файлы и домашние задания ============ */
.file-list { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px; margin-top: 10px; }
.file-thumb { position: relative; width: 120px; height: 120px; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); }
.file-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.25s; }
.file-thumb:hover img { transform: scale(1.04); }
.file-chip { position: relative; display: flex; align-items: center; max-width: 320px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); }
.file-chip a { display: flex; align-items: center; gap: 9px; padding: 10px 14px; min-width: 0; font-weight: 600; font-size: 14px; }
.file-chip a .icon { width: 18px; height: 18px; color: var(--accent); flex: none; }
.file-chip em { font-style: normal; color: var(--faint); font-size: 12px; font-weight: 500; flex: none; }
.file-x { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, 0.6); color: #fff; }
.file-x .icon { width: 13px; height: 13px; }
.file-chip .file-x { position: static; margin-right: 8px; background: var(--surface-2); color: var(--muted); }
.file-drop { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 14px 16px; border-radius: 12px; border: 1.5px dashed var(--border-strong); color: var(--muted); font-weight: 600; font-size: 14px; cursor: pointer; transition: 0.15s; }
.file-drop em { font-style: normal; font-weight: 400; color: var(--faint); }
.file-drop .icon { width: 20px; height: 20px; color: var(--accent); flex: none; }
.file-drop:hover, .file-drop-wrap.drag .file-drop { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.hw-text { white-space: pre-wrap; line-height: 1.6; font-size: 15px; }
.hw-sub.missing { opacity: 0.65; }
.hw-graded { border-color: color-mix(in srgb, var(--success) 40%, var(--border)); }

/* ============ Расписание ============ */
.sc-range { min-width: 230px; text-align: center; font-size: 15px; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.week-day { display: flex; flex-direction: column; gap: 8px; min-height: 200px; padding: 10px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); }
.week-day.today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.week-head { display: flex; align-items: baseline; justify-content: space-between; padding: 2px 4px 6px; border-bottom: 1px solid var(--border); }
.week-head span { font-size: 20px; font-weight: 800; color: var(--muted); }
.week-day.today .week-head span { color: var(--accent); }
.week-empty { color: var(--faint); text-align: center; padding: 18px 0; }
.lesson-slot { position: relative; padding: 9px 10px 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--c) 10%, var(--surface)); border-left: 3px solid var(--c); font-size: 13px; }
.lesson-slot.live { box-shadow: 0 0 0 2px color-mix(in srgb, var(--success) 50%, transparent); }
.lesson-slot.past { opacity: 0.55; }
.slot-time { font-weight: 800; font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.slot-title { font-weight: 700; font-size: 14px; margin-top: 2px; }
.slot-group { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 4px; }
.slot-group .icon { width: 12px; height: 12px; }
.slot-note { color: var(--muted); font-size: 12px; margin-top: 4px; }
.lesson-slot .btn-sm { padding: 5px 9px; font-size: 12px; }
.icon-btn.sm { width: 28px; height: 28px; }
.icon-btn.sm .icon { width: 14px; height: 14px; }
@media (max-width: 1100px) { .week { grid-template-columns: repeat(2, minmax(0, 1fr)); } .week-day { min-height: 0; } }
@media (max-width: 600px) { .week { grid-template-columns: 1fr; } }
.today-card .card-head h3 { display: flex; align-items: center; gap: 8px; }
.today-card .card-head h3 .icon { width: 18px; height: 18px; color: var(--accent); }

/* ============ Лиги ============ */
.gem { position: relative; display: grid; place-items: center; width: 46px; height: 46px; flex: none; border-radius: 14px; color: #fff;
  background: linear-gradient(145deg, color-mix(in srgb, var(--g) 70%, #fff), var(--g) 55%, color-mix(in srgb, var(--g) 70%, #000)); box-shadow: 0 6px 16px -8px var(--g), inset 0 1px 0 rgba(255, 255, 255, 0.4); }
.gem .icon { width: 22px; height: 22px; }
.gem span { position: absolute; bottom: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--surface); color: var(--text); font-size: 11px; font-weight: 800; display: grid; place-items: center; box-shadow: var(--shadow-sm); }
.gem.big { width: 84px; height: 84px; border-radius: 24px; }
.gem.big .icon { width: 40px; height: 40px; }
.gem.big span, .gem.sm span { display: none; }
.gem.sm { width: 38px; height: 38px; border-radius: 11px; }
.gem.sm .icon { width: 18px; height: 18px; }
.gem.locked { filter: grayscale(1); opacity: 0.35; }
.gem.passed { opacity: 0.8; }
.gem.current { transform: scale(1.12); box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--g), 0 10px 24px -8px var(--g); }
.league-hero { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; padding: 26px; background: linear-gradient(120deg, color-mix(in srgb, var(--g) 14%, var(--surface)), var(--surface) 60%); }
.league-kicker { font-size: 12px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.league-hero h2 { font-size: 30px; }
.league-xp { display: flex; flex-direction: column; align-items: center; padding: 12px 20px; border-radius: 16px; background: var(--surface-2); }
.league-xp b { font-size: 30px; }
.league-xp span { font-size: 12.5px; color: var(--muted); }
.league-tiers { display: flex; justify-content: space-between; gap: 8px; padding: 14px 18px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); overflow-x: auto; }
.league-table { padding: 10px; }
.lg-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; }
.lg-row.me { background: var(--accent-soft); }
.lg-row.up .lg-place { color: var(--success); }
.lg-row.down .lg-place { color: var(--danger); }
.lg-place { width: 28px; text-align: center; font-weight: 800; color: var(--muted); }
.lg-place .icon { width: 18px; height: 18px; color: #eab308; }
.lg-xp { font-variant-numeric: tabular-nums; }
.zone-line { display: flex; align-items: center; gap: 10px; margin: 6px 12px; font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; }
.zone-line::before, .zone-line::after { content: ''; flex: 1; height: 1px; }
.zone-line.up { color: var(--success); } .zone-line.up::before, .zone-line.up::after { background: color-mix(in srgb, var(--success) 40%, transparent); }
.zone-line.down { color: var(--danger); } .zone-line.down::before, .zone-line.down::after { background: color-mix(in srgb, var(--danger) 40%, transparent); }
.league-pill { display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.league-pill:hover { border-color: var(--g); }
.lp-gem { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; color: #fff; background: linear-gradient(145deg, color-mix(in srgb, var(--g) 70%, #fff), var(--g)); }
.lp-gem .icon { width: 20px; height: 20px; }
.league-pill > span:last-child { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); }
.league-pill b { font-size: 14px; color: var(--text); }
.zone-line .icon { width: 13px; height: 13px; }
.zone-line.down .icon { transform: rotate(180deg); }

/* ============ Магазин: рамки, значки, монеты ============ */
.avatar.framed::before { content: ''; position: absolute; inset: calc(var(--size) * -0.12); border-radius: 50%; padding: calc(var(--size) * 0.07); pointer-events: none;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.frame-f-fire::before { background: conic-gradient(from 0deg, #ff3d00, #ffb300, #ff6d00, #ffd54f, #ff3d00); filter: drop-shadow(0 0 4px #ff6d00); animation: frameSpin 3s linear infinite; }
.frame-f-ice::before { background: conic-gradient(#b3e5fc, #e1f5fe, #4fc3f7, #ffffff, #81d4fa, #b3e5fc); filter: drop-shadow(0 0 4px #4fc3f7); }
.frame-f-rainbow::before { background: conic-gradient(#ff4d4d, #ffb84d, #f9f871, #4dff88, #4dd2ff, #8f6bff, #ff4dd2, #ff4d4d); animation: frameSpin 4s linear infinite; }
.frame-f-neon::before { background: linear-gradient(135deg, #00f5ff, #b400ff); animation: neonPulse 1.6s ease-in-out infinite; }
.frame-f-galaxy::before { background: conic-gradient(#1a0b3d, #6a2cff, #1a0b3d 30%, #ff6bd6, #1a0b3d 60%, #4fd1ff, #1a0b3d); animation: frameSpin 6s linear infinite; filter: drop-shadow(0 0 5px #6a2cff); }
.frame-f-leaf::before { background: repeating-conic-gradient(#2e7d32 0 10deg, #8bc34a 10deg 20deg, #d4af37 20deg 24deg); filter: drop-shadow(0 0 3px #d4af37); }
@keyframes frameSpin { to { transform: rotate(360deg); } }
@keyframes neonPulse { 50% { filter: drop-shadow(0 0 7px #00f5ff) drop-shadow(0 0 2px #b400ff); } }
.name-badge { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 6px; vertical-align: -3px; background: var(--accent-soft); color: var(--accent); margin-left: 2px; }
.name-badge .icon { width: 12px; height: 12px; }
.name-badge.big { width: 30px; height: 30px; border-radius: 9px; }
.name-badge.big .icon { width: 18px; height: 18px; }
.coins-mini { display: inline-flex; align-items: center; gap: 3px; color: #d99a0b; }
.coins-mini .icon { width: 13px; height: 13px; }
.shop-hero { display: flex; align-items: center; gap: 20px; padding: 24px; background: linear-gradient(120deg, color-mix(in srgb, #f5b70b 14%, var(--surface)), var(--surface) 60%); }
.coin-big { display: grid; place-items: center; width: 74px; height: 74px; border-radius: 50%; color: #fff; background: radial-gradient(circle at 35% 30%, #ffe27a, #f5b70b 55%, #b9780a); box-shadow: 0 10px 24px -10px #d99a0b; flex: none; }
.coin-big .icon { width: 40px; height: 40px; }
.coin-count { font-size: 38px; display: block; line-height: 1.1; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.shop-item { display: flex; flex-direction: column; gap: 10px; padding: 18px; }
.shop-item.equipped { border-color: var(--success); }
.shop-item h3 { font-size: 16px; }
.shop-item p { font-size: 13.5px; margin: 2px 0 0; }
.shop-preview { display: grid; place-items: center; height: 92px; border-radius: 14px; background: var(--surface-2); }
.shop-buy { display: flex; justify-content: flex-end; }
.freeze-ic { display: flex; align-items: center; gap: 10px; color: #0ea5e9; font-weight: 800; font-size: 18px; }
.freeze-ic .icon { width: 40px; height: 40px; }
/* приложение и уведомления */
.app-row { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }
.app-row > .icon { width: 22px; height: 22px; color: var(--accent); flex: none; }
.app-row .muted { font-size: 13px; }
#app-card h3 { display: flex; align-items: center; gap: 8px; }
#app-card h3 .icon { width: 18px; height: 18px; color: var(--accent); }

/* ============ Конструктор курса ============ */
.lesson-ed.closed { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 18px; text-align: left; }
.lesson-ed.closed:hover { border-color: var(--accent); }
.lesson-ed.open { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.lesson-num { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-weight: 800; flex: none; }
.lesson-ed .tab { cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.lesson-ed .tab .icon { width: 15px; height: 15px; }
.textarea.mono, .mono { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 13.5px; }
.cases { display: flex; flex-direction: column; gap: 8px; }
.case-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.case-row .textarea { min-height: 44px; }
.try-res { padding: 10px 12px; border-radius: 10px; font-weight: 600; font-size: 14px; }
.try-res .icon { width: 16px; height: 16px; vertical-align: -3px; }
.try-res.ok { background: color-mix(in srgb, var(--success) 12%, transparent); color: var(--success); }
.try-res.bad { background: color-mix(in srgb, var(--danger) 9%, transparent); color: var(--danger); }

/* ============ Доска на видеоуроке ============ */
.call-overlay.with-board { display: grid; grid-template-columns: minmax(0, 1fr) 240px; grid-template-rows: auto minmax(0, 1fr) auto; }
.call-overlay.with-board .call-header { grid-column: 1 / -1; }
.call-overlay.with-board .board { grid-column: 1; grid-row: 2; }
.call-overlay.with-board .call-grid { grid-column: 2; grid-row: 2; display: flex !important; flex-direction: column; gap: 8px; overflow-y: auto; padding: 0 12px 0 0; }
.call-overlay.with-board .call-grid .tile { width: 100%; aspect-ratio: 16 / 10; height: auto !important; flex: none; }
.call-overlay.with-board .call-controls { grid-column: 1 / -1; }
.board { display: flex; flex-direction: column; gap: 10px; min-height: 0; padding: 0 12px 0 16px; }
.board-bar { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 8px; border-radius: 14px; background: rgba(255, 255, 255, 0.08); }
.board-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.board .bt { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; color: #e5e7eb; }
.board .bt .icon { width: 18px; height: 18px; }
.board .bt:hover { background: rgba(255, 255, 255, 0.1); }
.board .bt.active { background: #fff; color: #111827; }
.bcolor { width: 24px; height: 24px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25); }
.bcolor.active { box-shadow: 0 0 0 2px #111827, 0 0 0 4px #fff; }
.bsize { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; }
.bsize i { border-radius: 50%; background: #e5e7eb; }
.bsize.active { background: rgba(255, 255, 255, 0.18); }
.bsep { width: 1px; height: 22px; background: rgba(255, 255, 255, 0.15); margin: 0 4px; }
.board-stage { flex: 1; min-height: 0; display: grid; place-items: center; }
.board canvas { background: #fff; border-radius: 12px; touch-action: none; cursor: crosshair; box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.7); }
.ctrl.active { background: #fff; color: #111827; }
@media (max-width: 760px) {
  .call-overlay.with-board { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr) 110px auto; }
  .call-overlay.with-board .call-grid { grid-column: 1; grid-row: 3; flex-direction: row; padding: 0 12px; }
  .call-overlay.with-board .call-grid .tile { width: 150px; }
  .board { padding: 0 8px; }
}
.call-overlay.minimized .board { display: none; }
.call-overlay.minimized.with-board { display: block; }
/* вход через сервисы */
.oauth-box { display: flex; flex-direction: column; gap: 8px; }
.oauth-box:empty { display: none; }
.oauth-sep { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: 12.5px; margin: 2px 0; }
.oauth-sep::before, .oauth-sep::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.oauth-btn { display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 600; }
.oauth-btn svg { flex: none; }

/* ===== 3D-класс ===== */
.vr-card { padding: 16px 18px; }
.vr-card h3 { font-size: 16px; }
.invite-code.sm { font-size: 12.5px; padding: 1px 7px; letter-spacing: .08em; }
.vr-lobby { max-width: 560px; margin: 8px auto 0; text-align: center; padding: 32px 24px; }
.vr-lobby-art { width: 84px; height: 84px; margin: 0 auto 14px; border-radius: 26px; display: grid; place-items: center;
  background: linear-gradient(135deg, #6d5dfc, #22d3ee); color: #fff; box-shadow: 0 14px 40px rgba(109, 93, 252, .35); }
.vr-lobby-art .icon { width: 44px; height: 44px; }
.vr-scenes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.vr-scene { display: grid; justify-items: center; gap: 6px; padding: 14px 6px; border-radius: 14px; border: 2px solid var(--border); background: var(--surface-2); color: var(--text); font: 600 13px/1.2 inherit; cursor: pointer; }
.vr-scene .icon { width: 26px; height: 26px; color: var(--accent); }
.vr-scene.active { border-color: var(--accent); background: var(--accent-soft); }

body.in-vr { overflow: hidden; }
.vr-root { position: fixed; inset: 0; z-index: 900; background: #05060f; }
.vr { position: absolute; inset: 0; overflow: hidden; color: #f3f4ff; font-family: Inter, system-ui, sans-serif; user-select: none; -webkit-user-select: none; }
.vr-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.vr-canvas:active { cursor: grabbing; }
.vr-top { position: absolute; left: 12px; right: 12px; top: calc(12px + env(safe-area-inset-top, 0px)); display: flex; align-items: center; justify-content: space-between; gap: 10px; pointer-events: none; }
.vr-top > * { pointer-events: auto; }
.vr-title, .vr-btn, .vr-ctrl, .vr-panel, .vr-help, .vr-select { background: rgba(14, 16, 32, .72); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, .12); }
.vr-title { display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; min-width: 0; max-width: 70%; }
.vr-title b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vr-count { color: #b9bfe0; font-size: 13px; white-space: nowrap; }
.vr-btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 999px; color: #fff; font: 600 14px/1 inherit; cursor: pointer; }
.vr-btn.danger { background: rgba(239, 68, 68, .85); border-color: transparent; }
.vr-btn .icon, .vr-ctrl .icon { width: 20px; height: 20px; }
.vr-help { position: absolute; left: 50%; top: calc(64px + env(safe-area-inset-top, 0px)); transform: translateX(-50%); padding: 8px 14px; border-radius: 12px; font-size: 13px; color: #dfe3ff; text-align: center; transition: opacity .6s; width: max-content; max-width: calc(100% - 24px); pointer-events: none; }
.vr-help.gone { opacity: 0; }
.vr-controls { position: absolute; left: 12px; right: 12px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: center; pointer-events: none; }
.vr-controls > * { pointer-events: auto; }
.vr-ctrl { position: relative; width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; color: #fff; cursor: pointer; }
.vr-ctrl.off { background: rgba(255, 255, 255, .9); color: #1f2433; }
.vr-ctrl.active { background: #6d5dfc; border-color: transparent; }
.vr-ctrl.danger { background: rgba(239, 68, 68, .85); border-color: transparent; }
.vr-ctrl.speaking { box-shadow: 0 0 0 3px #4ade80; }
/* панель кнопок: стеклянная полоса, у каждой кнопки подпись */
.vr-dock { display: flex; align-items: center; gap: 4px; padding: 6px; border-radius: 22px; background: rgba(14, 16, 32, .72); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, .12); box-shadow: 0 10px 40px rgba(0, 0, 0, .35); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.vr-dock::-webkit-scrollbar { display: none; }
.vr-dock .vr-ctrl { width: 62px; height: 56px; border-radius: 15px; background: transparent; border: 0; backdrop-filter: none; -webkit-backdrop-filter: none; flex: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; transition: background .15s, transform .1s; }
.vr-dock .vr-ctrl:hover { background: rgba(255, 255, 255, .09); }
.vr-dock .vr-ctrl:active { transform: scale(.94); }
.vr-dock .vr-ctrl.off { background: rgba(255, 255, 255, .92); color: #1f2433; }
.vr-dock .vr-ctrl.active { background: #6d5dfc; }
.vr-dock .vr-ctrl.danger { background: rgba(239, 68, 68, .9); }
.vr-lbl { font: 600 10.5px/1 Inter, system-ui, sans-serif; letter-spacing: .01em; white-space: nowrap; opacity: .9; }
.vr-sep { width: 1px; height: 34px; background: rgba(255, 255, 255, .14); margin: 0 3px; flex: none; }
.vr-dock .vr-select { height: 44px; border-radius: 14px; background: rgba(255, 255, 255, .08); border-color: transparent; backdrop-filter: none; flex: none; }
.vr-dock .vr-badge { top: 3px; right: 8px; }
/* всплывающие меню над панелью: реакции и «Собрать класс» */
.vr-pop { position: absolute; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 4; padding: 8px; border-radius: 20px;
  background: rgba(14, 16, 32, .86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid rgba(255, 255, 255, .12); box-shadow: 0 16px 50px rgba(0, 0, 0, .45); animation: vr-pop .16s ease-out; }
@keyframes vr-pop { from { opacity: 0; transform: translate(-50%, 8px) scale(.97); } }
.vr-react { display: flex; gap: 4px; }
.vr-emoji { width: 64px; padding: 8px 0 6px; border: 0; border-radius: 14px; background: transparent; color: #dfe3ff; cursor: pointer; display: grid; justify-items: center; gap: 3px; }
.vr-emoji span { font-size: 30px; line-height: 1; transition: transform .15s; }
.vr-emoji small { font-size: 10.5px; font-weight: 600; }
.vr-emoji:hover { background: rgba(255, 255, 255, .08); } .vr-emoji:hover span { transform: scale(1.2) translateY(-2px); }
.vr-gather { display: grid; gap: 4px; width: min(320px, calc(100vw - 24px)); }
.vr-gather > b { padding: 6px 10px 4px; font-size: 13px; color: #b9bfe0; }
.vr-gather-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 0; border-radius: 13px; background: transparent; color: #fff; text-align: left; cursor: pointer; }
.vr-gather-item:hover { background: rgba(255, 255, 255, .08); }
.vr-gather-item .icon { width: 22px; height: 22px; color: #a5b4fc; flex: none; }
.vr-gather-item span { display: grid; gap: 2px; } .vr-gather-item b { font-size: 14px; } .vr-gather-item small { font-size: 12px; color: #9aa1c7; }
.vr-fly { position: absolute; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); font-size: 44px; pointer-events: none; animation: vr-fly 2.4s ease-out forwards; transform: translateX(-50%); z-index: 4; }
@keyframes vr-fly { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.6); } 15% { opacity: 1; transform: translate(-50%, -10px) scale(1.1); } 100% { opacity: 0; transform: translate(-50%, -160px) scale(1); } }
.vr-hands { margin: 4px 0 8px; padding: 8px 10px; border-radius: 14px; background: rgba(250, 204, 21, .12); border: 1px solid rgba(250, 204, 21, .3); }
.vr-hands > b { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #fde68a; } .vr-hands > b .icon { width: 16px; height: 16px; }
.vr-num { width: 22px; height: 22px; border-radius: 50%; background: rgba(250, 204, 21, .25); color: #fde68a; display: grid; place-items: center; font: 700 12px/1 inherit; flex: none; }
.vr-model-move { display: grid; gap: 8px; margin-top: 10px; font-size: 12.5px; }
.vr-ctrl.xr { width: auto; padding: 0 16px; border-radius: 25px; display: flex; gap: 8px; font-weight: 700; background: #6d5dfc; border-color: transparent; }
.vr-badge { position: absolute; top: -3px; right: -3px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: #ef4444; font: 700 11px/19px inherit; }
.vr-select { height: 50px; border-radius: 25px; padding: 0 14px; color: #fff; font: 600 14px inherit; }
.vr-select option { color: #111; }
.vr-panel { position: absolute; right: 12px; top: calc(66px + env(safe-area-inset-top, 0px)); bottom: calc(100px + env(safe-area-inset-bottom, 0px)); width: min(340px, calc(100% - 24px)); border-radius: 18px; display: flex; flex-direction: column; overflow: hidden; }
.vr-panel[hidden] { display: none; }
.vr-panel-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.vr-x { width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .08); color: #fff; display: grid; place-items: center; cursor: pointer; }
.vr-x .icon { width: 16px; height: 16px; }
.vr-msgs { flex: 1; overflow-y: auto; padding: 10px 14px; display: flex; flex-direction: column; gap: 8px; user-select: text; -webkit-user-select: text; }
.vr-msg { font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.vr-send { display: flex; gap: 8px; padding: 10px; border-top: 1px solid rgba(255, 255, 255, .1); }
.vr-send .input { flex: 1; min-width: 0; background: rgba(255, 255, 255, .08); color: #fff; border-color: rgba(255, 255, 255, .15); }
.vr-people-list { overflow-y: auto; padding: 6px 10px; }
.vr-person { display: flex; align-items: center; gap: 10px; padding: 8px 4px; font-size: 14px; }
.vr-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.vr-ic { color: #8b90b3; display: grid; } .vr-ic.on { color: #4ade80; }
.vr-ic .icon { width: 17px; height: 17px; }
.vr-stick { position: absolute; left: 22px; bottom: calc(150px + env(safe-area-inset-bottom, 0px)); width: 120px; height: 120px; border-radius: 50%; background: rgba(255, 255, 255, .12); border: 2px solid rgba(255, 255, 255, .25); touch-action: none; display: none; }
.vr-stick span { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; background: rgba(255, 255, 255, .85); box-shadow: 0 4px 14px rgba(0, 0, 0, .35); }
@media (pointer: coarse) { .vr-stick { display: block; bottom: calc(170px + env(safe-area-inset-bottom, 0px)); } .vr:has(.vr-panel:not([hidden]), .vr-insp, .vrb) .vr-stick { display: none; } .vr-btn span { display: none; } }
@media (max-width: 560px) { .vr-controls { gap: 8px; } .vr-ctrl { width: 46px; height: 46px; } .vr-select { height: 46px; max-width: 130px; } .vr-scenes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .vr-dock { flex-wrap: wrap; justify-content: center; overflow: visible; gap: 2px; padding: 5px; border-radius: 20px; }
  .vr-dock .vr-ctrl { width: 46px; height: 46px; border-radius: 14px; } .vr-lbl { display: none; } .vr-sep { display: none; }
  .vr-dock .vr-select { height: 40px; max-width: 120px; } .vr-pop { bottom: calc(132px + env(safe-area-inset-bottom, 0px)); } .vr-emoji { width: 50px; } .vr-emoji small { display: none; }
  .vr-fly { bottom: calc(132px + env(safe-area-inset-bottom, 0px)); } .vr-panel { bottom: calc(128px + env(safe-area-inset-bottom, 0px)); } }

/* доска 3D-класса крупно — поверх комнаты */
.vrb { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; background: rgba(6, 8, 20, .82); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  padding: calc(64px + env(safe-area-inset-top, 0px)) 12px calc(84px + env(safe-area-inset-bottom, 0px)); gap: 10px; }
.vrb-bar { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.vrb-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 6px; border-radius: 16px; background: rgba(14, 16, 32, .8); border: 1px solid rgba(255, 255, 255, .12); }
.vrb-tools:empty { display: none; }
.vrb-bt, .vrb-pill { height: 38px; min-width: 38px; border-radius: 11px; border: 0; background: transparent; color: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; font: 600 13px inherit; }
.vrb-bt .icon, .vrb-pill .icon { width: 19px; height: 19px; }
.vrb-bt.active, .vrb-pill.active { background: #6d5dfc; }
.vrb-pill { padding: 0 12px; background: rgba(255, 255, 255, .08); }
.vrb-color { width: 26px; height: 26px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .35); background: var(--c); cursor: pointer; }
.vrb-color.active { box-shadow: 0 0 0 3px #6d5dfc; border-color: #fff; }
.vrb-size { width: 34px; height: 34px; border-radius: 10px; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; }
.vrb-size i { border-radius: 50%; background: #fff; display: block; }
.vrb-size.active { background: rgba(255, 255, 255, .15); }
.vrb-sep { width: 1px; height: 24px; background: rgba(255, 255, 255, .15); margin: 0 2px; }
.vrb-stage { flex: 1; min-height: 0; display: grid; place-items: center; }
.vrb-canvas { display: block; border-radius: 10px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); touch-action: none; cursor: crosshair; background: #2f5d46; }
.vrb-note { text-align: center; color: #b9bfe0; font-size: 13px; min-height: 1em; }
.vrb-note:empty { display: none; }
@media (max-width: 560px) { .vrb-pill span { display: none; } .vrb-color { width: 22px; height: 22px; } }

/* 3D-модели: панель учителя и «Рассмотреть» */
.vr-models-body { overflow-y: auto; padding: 8px 12px 14px; }
.vr-model-group { margin: 12px 2px 6px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #9aa1c7; }
.vr-model-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.vr-model { padding: 9px 10px; border-radius: 11px; border: 1px solid rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .06); color: #fff; font: 600 13px/1.25 inherit; text-align: left; cursor: pointer; display: flex; align-items: center; gap: 6px; }
.vr-model .icon { width: 16px; height: 16px; flex: none; }
.vr-model.active { background: #6d5dfc; border-color: transparent; }
.vr-model.add { border-style: dashed; color: #c7cbea; }
.vr-model-now { padding: 10px; border-radius: 14px; background: rgba(109, 93, 252, .18); border: 1px solid rgba(109, 93, 252, .45); }
.vr-model-cap { font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.vr-model-ctrls { display: flex; flex-wrap: wrap; gap: 6px; }
.vr-model-ctrls .vr-x { width: 36px; height: 36px; font: 700 18px/1 inherit; }
.vr-model-ctrls .vr-x.on { background: #6d5dfc; }
.vr-model-hint { color: #9aa1c7; font-size: 12.5px; line-height: 1.4; margin: 10px 2px 0; }
.vr-insp { position: absolute; inset: 0; z-index: 6; background: radial-gradient(circle at 50% 40%, #2a2f55, #0b0d1c 70%); }
.vr-insp canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.vr-insp-top { position: absolute; left: 12px; right: 12px; top: calc(12px + env(safe-area-inset-top, 0px)); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.vr-insp-top b { padding: 9px 14px; border-radius: 999px; background: rgba(14, 16, 32, .72); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vr-insp-hint { position: absolute; left: 12px; right: 12px; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); text-align: center; color: #b9bfe0; font-size: 13px; pointer-events: none; }

/* снимок для фигурки 3D-класса */
.scan { position: fixed; inset: 0; z-index: 1000; background: #070914; color: #f3f4ff; display: grid; place-items: center; padding: 16px; overflow-y: auto; }
.scan-close { position: absolute; top: calc(14px + env(safe-area-inset-top, 0px)); right: 14px; z-index: 3; width: 42px; height: 42px; }
.scan-card { width: min(520px, 100%); text-align: center; display: grid; gap: 12px; justify-items: center; }
.scan-card.wide { width: min(760px, 100%); }
.scan-card h2 { font-size: 24px; }
.scan-card p { color: #c9cdea; line-height: 1.5; }
.scan-card .faint { color: #8d93b8; font-size: 13px; }
.scan-art { width: 84px; height: 84px; border-radius: 26px; display: grid; place-items: center; background: linear-gradient(135deg, #6d5dfc, #22d3ee); }
.scan-art.warn { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.scan-art .icon { width: 44px; height: 44px; color: #fff; }
.scan-live { position: absolute; inset: 0; }
.scan-live video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }   /* как в зеркале — так проще поворачиваться */
.scan-guide { position: absolute; left: 50%; top: 50%; width: min(52vw, 46vh); height: min(84vh, 92vw); transform: translate(-50%, -50%); border: 3px dashed rgba(255, 255, 255, .55); border-radius: 46% 46% 18% 18% / 30% 30% 12% 12%; pointer-events: none; }
.scan-step { position: absolute; left: 12px; right: 12px; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 4px; justify-items: center; text-align: center; padding: 14px; border-radius: 18px; background: rgba(8, 10, 24, .72); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.scan-step b { font-size: 20px; }
.scan-step span { color: #c9cdea; font-size: 14px; }
.scan-dots { display: flex; gap: 6px; margin-bottom: 4px; }
.scan-dots i { width: 28px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .25); }
.scan-dots i.on { background: #6d5dfc; }
.scan-count { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); font: 800 120px/1 Inter, system-ui, sans-serif; color: #fff; text-shadow: 0 6px 30px rgba(0, 0, 0, .6); pointer-events: none; }
.scan-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.scan-flash.go { animation: scan-flash .45s ease-out; }
@keyframes scan-flash { from { opacity: .85; } to { opacity: 0; } }
.scan-result { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; width: 100%; }
.scan-result figure { margin: 0; display: grid; gap: 6px; }
.scan-result img { width: 100%; height: 230px; object-fit: contain; border-radius: 14px;
  background: repeating-conic-gradient(#1c2037 0 25%, #252a46 0 50%) 0 0 / 18px 18px; }
.scan-result figcaption { font-size: 12.5px; color: #9aa1c7; }
@media (max-width: 560px) { .scan-result { grid-template-columns: repeat(2, minmax(0, 1fr)); } .scan-result img { height: 170px; } }
.scan-thumbs { display: flex; gap: 4px; flex: none; }
.scan-thumb { width: 30px; height: 44px; border-radius: 6px; overflow: hidden; background: repeating-conic-gradient(var(--surface-2) 0 25%, var(--border) 0 50%) 0 0 / 10px 10px; display: grid; place-items: center; }
.scan-thumb img { width: 100%; height: 100%; object-fit: contain; }
.scan-thumbs.big { justify-content: center; }
.scan-thumbs.big .scan-thumb { width: 74px; height: 110px; border-radius: 10px; }
.vr-me, .vr-review { text-align: center; }
.vr-review { text-align: left; }
.vr-review h3, .vr-me h3 { display: flex; align-items: center; gap: 8px; justify-content: center; }
.vr-review h3 { justify-content: flex-start; }
.scan-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.scan-row .grow { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.scan-acts { display: flex; gap: 6px; }
.scan-acts .vr-x, .vr-person-scan .vr-x { background: var(--surface-2); color: var(--text); }
.vr-person-scan .vr-x { background: rgba(255, 255, 255, .08); color: #fff; }
.vr-x.ok { background: #16a34a !important; color: #fff !important; }
.vr-person-scan { display: flex; align-items: center; gap: 6px; padding: 0 4px 8px 26px; }
.vr-switch { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; cursor: pointer; }
.vr-switch input { width: 18px; height: 18px; accent-color: #6d5dfc; }

/* Виды домашки и ответы по пунктам */
.hw-kinds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.hw-kind { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px; border-radius: 12px; border: 1px solid var(--border); text-align: left; color: var(--text); background: var(--surface); }
.hw-kind .icon { width: 20px; height: 20px; color: var(--muted); }
.hw-kind b { font-size: 14px; }
.hw-kind span { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.hw-kind:hover { background: var(--surface-2); }
.hw-kind.active { border-color: var(--accent); background: var(--accent-soft); }
.hw-kind.active .icon { color: var(--accent); }
.hw-item .input[data-key] { max-width: 42%; }
.hw-field { display: grid; grid-template-columns: minmax(90px, 30%) 1fr; gap: 10px; align-items: center; font-weight: 600; font-size: 14px; }
.hw-answers { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.hw-ans { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); font-size: 14px; }
.hw-ans-q { font-weight: 700; min-width: 70px; max-width: 35%; }
.hw-ans-a { flex: 1; white-space: pre-wrap; min-width: 0; overflow-wrap: anywhere; }
.hw-ans .icon { width: 16px; height: 16px; flex: none; }
.hw-ans.ok { background: color-mix(in srgb, var(--success) 10%, var(--surface-2)); }
.hw-ans.ok .icon { color: var(--success); }
.hw-ans.bad { background: color-mix(in srgb, var(--danger) 9%, var(--surface-2)); }
.hw-ans.bad .icon { color: var(--danger); }
.hw-ans-key { font-size: 12.5px; color: var(--muted); }
@media (max-width: 640px) {
  .hw-kinds { grid-template-columns: 1fr; }
  .hw-item { flex-wrap: wrap; }
  .hw-item .input[data-key] { max-width: none; }
  .hw-field { grid-template-columns: 1fr; gap: 4px; }
}

/* Контрольная с наблюдением */
.watch-note { display: flex; gap: 12px; text-align: left; max-width: 520px; margin-left: auto; margin-right: auto; padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--warning) 11%, transparent); }
.watch-note > .icon { width: 22px; height: 22px; color: var(--warning); flex: none; margin-top: 2px; }
.watch-note b { display: block; font-size: 14.5px; }
.watch-note span { font-size: 13px; color: var(--muted); }
.lb-item.clickable { cursor: pointer; border-radius: 10px; }
.lb-item.clickable:hover { background: var(--surface-2); }
.watch-log { display: flex; flex-direction: column; gap: 4px; max-height: 360px; overflow: auto; }
.watch-ev { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 8px; background: var(--surface-2); font-size: 13.5px; }
.watch-ev .icon { width: 15px; height: 15px; flex: none; color: var(--muted); }
.watch-ev.warning .icon { color: var(--warning); }
.watch-ev.danger .icon { color: var(--danger); }
.watch-t { font-variant-numeric: tabular-nums; font-weight: 700; min-width: 42px; color: var(--muted); }

/* Развёрнутый ответ */
.open-answer { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; font-size: 14.5px; padding: 10px 14px; border-radius: 10px; background: var(--surface-2); }
textarea.answer-input { font-size: 15.5px; line-height: 1.55; min-height: 150px; }
.check-q { padding: 14px; border-radius: 12px; border: 1px solid var(--border); }
.mark-pick { display: inline-flex; gap: 4px; padding: 3px; border-radius: 10px; background: var(--surface-2); }
.mark-pick button { display: inline-flex; align-items: center; gap: 5px; padding: 6px 11px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.mark-pick button .icon { width: 14px; height: 14px; }
.mark-pick button.success.active { background: color-mix(in srgb, var(--success) 16%, var(--surface)); color: var(--success); }
.mark-pick button.warning.active { background: color-mix(in srgb, var(--warning) 16%, var(--surface)); color: var(--warning); }
.mark-pick button.danger.active { background: color-mix(in srgb, var(--danger) 14%, var(--surface)); color: var(--danger); }
.q-num { white-space: nowrap; }

/* Уведомление о cookie */
.cookie-bar { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 300; display: flex; align-items: center; gap: 14px; width: min(680px, calc(100vw - 32px)); padding: 14px 16px; border-radius: 16px; animation: toastIn 0.3s ease; }
.cookie-bar p { margin: 0; flex: 1; font-size: 13.5px; line-height: 1.45; color: var(--muted); }
.cookie-bar a { color: var(--accent); font-weight: 600; }
.cookie-ic { font-size: 24px; flex: none; }
@media (max-width: 640px) {
  .cookie-bar { bottom: 16px; flex-wrap: wrap; gap: 10px; }
  .cookie-bar .btn { width: 100%; }
}

/* Аудио: устные ответы */
.file-audio { display: flex; align-items: center; gap: 6px; max-width: 100%; }
.file-audio audio { height: 40px; max-width: min(360px, 100%); }
.file-audio .file-x { position: static; background: var(--surface-2); color: var(--muted); }
.recorder { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px; border-radius: 14px; background: var(--surface-2); }
.rec-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--danger); animation: recPulse 1s ease-in-out infinite; }
@keyframes recPulse { 50% { opacity: 0.3; } }
.rec-time { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 18px; }
.hw-return { border-color: color-mix(in srgb, var(--warning) 45%, var(--border)); background: color-mix(in srgb, var(--warning) 6%, var(--surface)); }

/* Картинка к вопросу */
.q-img { display: block; margin: 4px 0 14px; max-width: 100%; }
.q-img img { display: block; max-width: 100%; max-height: 360px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); object-fit: contain; }
.q-img-edit { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.q-img-edit .q-img { margin: 0; }
.q-img-edit .q-img img { max-height: 160px; }
.q-img-add { align-self: flex-start; cursor: pointer; }
.review-item .q-img img { max-height: 220px; }
.grade.few { opacity: 0.5; }
