:root {
  --bg: #0a0b10;
  --bg-2: #0e1017;
  --surface: #13151d;
  --surface-2: #181b25;
  --surface-3: #1f2330;
  --border: #252a38;
  --border-2: #313749;
  --border-hover: #454c63;
  --text: #e8eaf2;
  --muted: #a1a8bc;
  --faint: #7a8198;
  --accent: #8b5cf6;
  --accent-2: #22d3ee;
  --accent-soft: rgba(139, 92, 246, .14);
  --success: #22c55e;
  --success-soft: rgba(34, 197, 94, .13);
  --warn: #f59e0b;
  --warn-soft: rgba(245, 158, 11, .13);
  --danger: #f43f5e;
  --danger-soft: rgba(244, 63, 94, .13);
  --track: #232736;
  --grad: linear-gradient(135deg, var(--accent), var(--accent-2));
  /* Заливка под белым текстом: оба конца темнее, контраст >= 4.5:1 */
  --grad-cta: linear-gradient(135deg, #7c3aed, #0e7490);
  --danger-strong: #e11d48;

  /* Текст: по одному цвету на роль */
  --text-2: #cfd3e1;
  --on-accent: #ffffff;
  --on-success: #04230f;
  --accent-text: #c4b5fd;
  --accent-link: #b9a4ff;
  --accent-link-hover: #d4c7ff;
  --success-text: #4ade80;
  --warn-text: #fbbf24;
  --danger-text: #fb7185;
  --img-bg: #ffffff;

  /* Палитра меток: один цвет — один смысл (шаги урока, типы файлов, материалы) */
  --tone-theory: #a78bfa;
  --tone-lab: var(--accent-2);
  --tone-practice: #60a5fa;
  --tone-ai: #f0abfc;
  --tone-check: var(--warn-text);
  --tone-repeat: var(--success-text);
  --tone-soft: 14%;

  /* Скругления и слои */
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 99px;
  --z-sticky: 5;
  --z-topbar: 30;
  --z-backdrop: 35;
  --z-sidebar: 40;
  --z-modal: 50;
  --z-toast: 60;

  --shadow: 0 10px 40px rgba(0, 0, 0, .45);
  --focus-ring: 2px solid var(--accent-2);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  background-image: radial-gradient(1200px 600px at 85% -10%, rgba(139, 92, 246, .10), transparent 60%), radial-gradient(900px 500px at -10% 110%, rgba(34, 211, 238, .06), transparent 60%);
  background-attachment: fixed;
  color: var(--text);
  font: 15px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
:focus-visible { outline: var(--focus-ring); outline-offset: 2px; }
a { color: var(--accent-link); text-decoration: none; }
a:hover { color: var(--accent-link-hover); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: 30px; font-weight: 750; }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 650; }
p { margin: .4em 0; }
code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .88em; background: var(--surface-3); padding: 1px 6px; border-radius: var(--radius-xs); }
hr { border: 0; border-top: 1px solid var(--border); margin: 24px 0; }
::selection { background: rgba(139, 92, 246, .4); }
/* Подсказка в поле: браузерная по умолчанию дает контраст 4.1:1 — задаем свою. */
::placeholder { color: var(--faint); opacity: 1; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: var(--radius-sm); border: 2px solid var(--bg); }
.ic { width: 18px; height: 18px; flex: none; vertical-align: -3px; }
.ic.xl { width: 34px; height: 34px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.row { display: flex; align-items: center; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.row.gap { gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
[hidden] { display: none !important; }

/* Кнопки и поля */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: 14px; color: var(--text); background: var(--surface-3);
  cursor: pointer; transition: transform .15s, background .2s, border-color .2s, box-shadow .2s; white-space: nowrap; text-decoration: none;
}
.btn:hover { transform: translateY(-1px); color: var(--text); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--grad-cta); color: var(--on-accent); box-shadow: 0 6px 24px rgba(139, 92, 246, .35); }
.btn.primary:hover { box-shadow: 0 8px 30px rgba(139, 92, 246, .5); }
.btn.ghost { background: transparent; border-color: var(--border-2); }
.btn.ghost:hover { background: var(--surface-2); border-color: var(--border-hover); }
.btn.success { background: var(--success); color: var(--on-success); }
.btn.danger { background: var(--danger-strong); color: var(--on-accent); }
.btn.danger.ghost { background: transparent; color: var(--danger-text); border-color: rgba(244, 63, 94, .35); }
.btn.lg { padding: 12px 22px; font-size: 15px; }
.btn.sm { padding: 6px 11px; font-size: 13px; }
.btn.sm small { color: var(--muted); font-weight: 500; }
.btn.block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); cursor: pointer; transition: .2s; }
.icon-btn:hover { color: var(--text); border-color: var(--border-2); }
.icon-btn.sm { width: 30px; height: 30px; }
.field { display: flex; flex-direction: column; gap: 6px; margin: 0 0 14px; }
.field > span { font-size: 13px; color: var(--muted); font-weight: 550; }
.field.inline { flex-direction: row; align-items: center; margin: 0; }
input, textarea, select {
  width: 100%; font: inherit; color: var(--text); background: var(--bg-2);
  border: 1px solid var(--border-2); border-radius: var(--radius-sm); padding: 10px 12px; outline: none; transition: border-color .2s, box-shadow .2s;
}
textarea { resize: vertical; min-height: 44px; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
select { cursor: pointer; }
.switch-field { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-size: 14px; }
.switch-field input { display: none; }
.switch-field .sw { width: 40px; height: 22px; border-radius: var(--radius-pill); background: var(--surface-3); border: 1px solid var(--border-2); position: relative; transition: .2s; flex: none; }
.switch-field .sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: .2s; }
.switch-field input:checked + .sw { background: var(--accent); border-color: var(--accent); }
.switch-field input:checked + .sw::after { left: 20px; background: var(--on-accent); }
.switch-field.small { font-size: 12px; color: var(--muted); }

/* Загрузка */
.boot { min-height: 100vh; display: grid; place-items: center; }
.loading { display: flex; gap: 8px; justify-content: center; padding: 60px 0; }
.loading span { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); animation: bounce 1s infinite ease-in-out; }
.loading span:nth-child(2) { animation-delay: .15s; background: #6f7cf3; }
.loading span:nth-child(3) { animation-delay: .3s; background: var(--accent-2); }
@keyframes bounce { 0%, 80%, 100% { transform: scale(.5); opacity: .4; } 40% { transform: scale(1); opacity: 1; } }

/* Авторизация */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-art { padding: 64px; display: flex; flex-direction: column; justify-content: center; gap: 18px; background: radial-gradient(700px 500px at 20% 20%, rgba(139, 92, 246, .22), transparent 60%), radial-gradient(600px 400px at 80% 90%, color-mix(in srgb, var(--tone-lab) var(--tone-soft), transparent), transparent 60%); border-right: 1px solid var(--border); }
.auth-art h1 { font-size: 44px; background: linear-gradient(90deg, var(--on-accent), var(--accent-text) 60%, #67e8f9); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-art p { color: var(--muted); font-size: 17px; max-width: 520px; }
.auth-points { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 12px; }
.auth-points li { display: flex; gap: 12px; align-items: center; color: var(--text-2); }
.auth-points .ic { color: var(--accent-2); }
.auth-card { align-self: center; justify-self: center; width: min(420px, calc(100% - 32px)); background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 32px; box-shadow: var(--shadow); animation: rise .4s ease; }
.auth-card .muted { margin-bottom: 20px; }
.auth-card .switch { text-align: center; margin-top: 16px; color: var(--muted); font-size: 14px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 750; font-size: 17px; color: var(--text); letter-spacing: -.01em; }
.brand:hover { color: var(--text); }
.brand.big { font-size: 20px; }
.logo { display: grid; place-items: center; width: 34px; height: 34px; border-radius: var(--radius-sm); background: var(--grad-cta); color: var(--on-accent); box-shadow: 0 4px 18px rgba(139, 92, 246, .45); }
.brand.big .logo { width: 42px; height: 42px; }

/* Каркас */
.layout { display: grid; grid-template-columns: 280px 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 22px 16px; background: rgba(14, 16, 23, .85); backdrop-filter: blur(10px); border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
.sidebar > .brand { padding: 0 8px 16px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: var(--radius-sm); color: var(--muted); font-weight: 550; font-size: 14px; transition: .15s; position: relative; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--accent-soft); color: var(--on-accent); }
.nav a.active::before { content: ""; position: absolute; left: -16px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--grad); }
.badge { margin-left: auto; background: var(--danger-strong); color: var(--on-accent); font-size: 11px; font-weight: 700; min-width: 20px; height: 20px; border-radius: var(--radius-sm); display: grid; place-items: center; padding: 0 6px; font-style: normal; }
.nav-label { margin: 18px 12px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--faint); font-weight: 700; }
.weeks-nav a { padding: 7px 10px; font-size: 13px; }
.wk-dot { width: 26px; height: 26px; flex: none; border-radius: 8px; display: grid; place-items: center; font-size: 11px; font-weight: 750; background: var(--surface-3); color: var(--muted); font-variant-numeric: tabular-nums; }
.wk-dot .ic { width: 14px; height: 14px; }
.wk-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk.approved .wk-dot { background: var(--success-soft); color: var(--success); }
.wk.pending .wk-dot { background: var(--warn-soft); color: var(--warn); }
.wk.rejected .wk-dot { background: var(--danger-soft); color: var(--danger); }
.wk.open .wk-dot { background: var(--accent-soft); color: var(--accent-text); }
.wk.locked { opacity: .5; }
.side-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 8px; }
.me { flex: 1; display: flex; align-items: center; gap: 10px; color: var(--text); min-width: 0; padding: 6px; border-radius: var(--radius-sm); }
.me:hover { background: var(--surface-2); color: var(--text); }
.me b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me small { color: var(--muted); font-size: 12px; }
.avatar { width: 36px; height: 36px; flex: none; border-radius: 50%; background: var(--grad-cta); color: var(--on-accent); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.avatar.xl { width: 64px; height: 64px; font-size: 22px; }
.main { min-width: 0; }
.topbar { display: none; }
.content { max-width: 1180px; margin: 0 auto; padding: 36px 40px 80px; animation: fade .3s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }

/* Общие блоки */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.card.flush { padding: 0; overflow: hidden; }
.card.narrow { max-width: 460px; }
.card h2 { display: flex; align-items: center; gap: 10px; }
.section-title { display: flex; align-items: center; gap: 10px; margin: 36px 0 16px; font-size: 18px; }
.section-title .ic { color: var(--accent-2); }
.sub-title { margin: 22px 0 10px; font-size: 14px; color: var(--muted); font-weight: 650; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { display: flex; align-items: center; gap: 12px; }
.page-head h1 .ic { width: 28px; height: 28px; color: var(--accent); }
.crumbs { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.crumbs .ic { width: 14px; height: 14px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); }
.empty-state { text-align: center; padding: 80px 20px; max-width: 520px; margin: 0 auto; animation: rise .4s; }
.empty-state.small { padding: 40px 20px; }
.empty-ic { width: 72px; height: 72px; margin: 0 auto 20px; border-radius: 22px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.empty-ic .ic { width: 32px; height: 32px; }
.empty-state .btn { margin-top: 16px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 650; white-space: nowrap; background: var(--surface-3); color: var(--muted); border: 1px solid transparent; }
.chip .ic { width: 13px; height: 13px; }
.chip.open { background: var(--accent-soft); color: var(--accent-text); }
.chip.pending { background: var(--warn-soft); color: var(--warn-text); }
.chip.rejected { background: var(--danger-soft); color: var(--danger-text); }
.chip.approved { background: var(--success-soft); color: var(--success-text); }
.chip.ghost { background: transparent; border-color: var(--border-2); color: var(--muted); }
.bar { height: 6px; border-radius: var(--radius-pill); background: var(--track); overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: inherit; background: var(--grad); transition: width .6s cubic-bezier(.2, .8, .2, 1); }
.bar.lg { height: 8px; }
.bar.sm { height: 4px; flex: 1; min-width: 60px; }
.bar.approved span { background: var(--success); }
.bar.pending span { background: var(--warn); }
.callout { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); font-size: 14px; margin: 0 0 12px; }
.callout .ic { color: var(--accent-2); margin-top: 3px; }
.callout.accent { background: var(--accent-soft); border-color: rgba(139, 92, 246, .3); }
.callout.accent .ic { color: var(--accent-text); }
.ring { display: block; }
.ring-val { transition: stroke-dashoffset 1s cubic-bezier(.2, .8, .2, 1); }
.ring-text { fill: var(--text); font-weight: 750; font-size: 26px; font-family: var(--font); }

/* Главная */
.hero { display: flex; justify-content: space-between; align-items: center; gap: 30px; padding: 34px; border-radius: 22px; border: 1px solid var(--border); background: linear-gradient(135deg, rgba(139, 92, 246, .16), rgba(34, 211, 238, .06) 60%, transparent), var(--surface); position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -120px; top: -120px; width: 360px; height: 360px; border-radius: 50%; background: radial-gradient(circle, rgba(139, 92, 246, .25), transparent 70%); pointer-events: none; }
.hero h1 { font-size: 36px; }
.hero p { color: var(--text-2); max-width: 620px; margin-bottom: 20px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--accent-text); font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.hero-ring { display: flex; flex-direction: column; align-items: center; gap: 6px; z-index: 1; }
.hero-ring small { color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 18px; }
.stat { display: flex; align-items: center; gap: 14px; padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.stat-ic { width: 42px; height: 42px; border-radius: var(--radius-md); display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.stat b { display: block; font-size: 24px; font-weight: 750; line-height: 1.1; }
.stat b small { font-size: 14px; color: var(--muted); font-weight: 600; }
.stat span { font-size: 13px; color: var(--muted); }
.feedback { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.fb { display: block; padding: 16px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--success); color: var(--text); transition: .2s; }
.fb.rejected { border-left-color: var(--danger); }
.fb:hover { transform: translateY(-2px); color: var(--text); border-color: var(--border-2); }
.fb p { color: var(--text-2); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.roadmap { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.wcard { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 20px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); color: var(--text); overflow: hidden; transition: transform .2s, border-color .2s, box-shadow .2s; animation: rise .45s both; animation-delay: calc(var(--i) * 35ms); }
.wcard:hover { transform: translateY(-3px); border-color: var(--border-2); box-shadow: var(--shadow); color: var(--text); }
.wcard.open, .wcard.rejected { border-color: rgba(139, 92, 246, .45); box-shadow: 0 0 0 1px rgba(139, 92, 246, .15), 0 10px 40px rgba(139, 92, 246, .12); }
.wcard.approved { border-color: rgba(34, 197, 94, .3); }
.wcard.pending { border-color: rgba(245, 158, 11, .35); }
.wcard-top { display: flex; justify-content: space-between; align-items: center; }
.wnum { font-size: 34px; font-weight: 800; line-height: 1; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-variant-numeric: tabular-nums; }
.wnum.sm { font-size: 22px; }
.wcard h3 { font-size: 16px; margin: 0; min-height: 40px; }
.wmeta { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.wmeta .ic { width: 14px; height: 14px; }
.wmeta .ic + * { margin-right: 6px; }
.wgate { font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 0; }
.wgate b { color: var(--text-2); font-weight: 600; }
.wcard.locked > *:not(.lock-veil) { filter: grayscale(1); opacity: .35; }
.lock-veil { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 20px; text-align: center; font-size: 13px; color: var(--muted); background: linear-gradient(180deg, rgba(10, 11, 16, .2), rgba(10, 11, 16, .75)); opacity: 0; transition: opacity .2s; }
.lock-veil .ic { width: 26px; height: 26px; color: var(--accent-text); }
.wcard.locked:hover .lock-veil { opacity: 1; }

/* Неделя */
.week-head { display: grid; grid-template-columns: auto 1fr minmax(200px, 260px); align-items: center; gap: 24px; padding: 26px; border-radius: 20px; background: linear-gradient(135deg, rgba(139, 92, 246, .14), transparent 55%), var(--surface); border: 1px solid var(--border); }
.week-num { font-size: 64px; font-weight: 850; line-height: 1; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-variant-numeric: tabular-nums; }
.week-info h1 { font-size: 26px; margin-bottom: 12px; }
.week-prog { display: flex; flex-direction: column; gap: 8px; }
.tabs { display: flex; gap: 4px; margin: 22px 0 22px; padding: 5px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; position: sticky; top: 10px; z-index: var(--z-sticky); backdrop-filter: blur(10px); }
.tabs a { display: flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: var(--radius-sm); color: var(--muted); font-weight: 600; font-size: 14px; white-space: nowrap; transition: .15s; }
.tabs a:hover { color: var(--text); background: var(--surface-2); }
.tabs a.active { background: var(--surface-3); color: var(--on-accent); box-shadow: inset 0 0 0 1px var(--border-2); }
.tabs a.active .ic { color: var(--accent-2); }
.count { font-style: normal; font-size: 11px; font-weight: 700; background: var(--surface-3); color: var(--muted); padding: 1px 7px; border-radius: var(--radius-pill); }
.count.hot { background: var(--danger-strong); color: var(--on-accent); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.dot.open { background: var(--accent); }
.dot.pending { background: var(--warn); box-shadow: 0 0 0 4px var(--warn-soft); }
.dot.rejected { background: var(--danger); }
.dot.approved { background: var(--success); }
.tab-body { animation: fade .25s ease; }
.week-pager { display: flex; justify-content: space-between; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--border); }
.days { display: flex; flex-direction: column; gap: 12px; }
.check { display: inline-grid; cursor: pointer; }
.check input { display: none; }
.check span { width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--border-2); display: grid; place-items: center; color: transparent; transition: .2s; }
.check span .ic { width: 16px; height: 16px; stroke-width: 3; }
.check:hover span { border-color: var(--accent); }
.check input:checked + span { background: var(--success); border-color: var(--success); color: var(--on-success); transform: scale(1.05); }
.day.done .day-kicker { color: var(--success-text); background: var(--success-soft); }
.day.done .day-title { color: var(--muted); }
.chev { transition: transform .25s; color: var(--muted); }
.result { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--success-soft); border: 1px solid rgba(34, 197, 94, .25); margin-bottom: 10px; }
.result .ic { color: var(--success); margin-top: 2px; }
.result b { color: var(--success-text); font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
.result p { margin: 2px 0 0; font-size: 14px; }
.gate { display: flex; gap: 18px; margin-top: 24px; padding: 24px; border-radius: 18px; border: 1px solid rgba(139, 92, 246, .35); background: linear-gradient(135deg, rgba(139, 92, 246, .14), rgba(34, 211, 238, .05)), var(--surface); }
.gate.compact { margin-top: 0; margin-bottom: 20px; }
.gate-ic { width: 46px; height: 46px; flex: none; border-radius: var(--radius); display: grid; place-items: center; background: var(--grad-cta); color: var(--on-accent); }
.gate-body { flex: 1; min-width: 0; }
.gate-body h3 { font-size: 18px; }
.checklist { list-style: none; padding: 0; margin: 12px 0 16px; display: grid; gap: 8px; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--text-2); }
.checklist .ic { width: 16px; height: 16px; color: var(--accent-2); margin-top: 3px; }

/* Где ломается на практике */
.pitfalls { margin-top: 24px; padding: 20px 24px; border-radius: 18px; background: linear-gradient(135deg, rgba(245, 158, 11, .10), transparent 60%), var(--surface); border: 1px solid rgba(245, 158, 11, .3); }
.pitfalls h3 { display: flex; align-items: center; gap: 10px; font-size: 17px; }
.pitfalls h3 .ic { color: var(--warn); }
.pitfalls ul { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.pitfalls li { position: relative; padding-left: 20px; font-size: 14px; color: var(--text-2); }
.pitfalls li::before { content: ""; position: absolute; left: 4px; top: 9px; width: 6px; height: 6px; border-radius: 50%; background: var(--warn); }

/* Материалы */
.videos { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.vcard { display: flex; flex-direction: column; text-align: left; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); color: var(--text); overflow: hidden; transition: transform .2s, border-color .2s, box-shadow .2s; }
button.thumb { display: block; width: 100%; padding: 0; border: 0; font: inherit; color: inherit; cursor: pointer; }
button.thumb:focus-visible { outline: var(--focus-ring); outline-offset: -2px; }
.tstamp { position: absolute; z-index: 1; right: 10px; bottom: 10px; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: var(--radius-xs); background: var(--accent); color: var(--on-accent); font-variant-numeric: tabular-nums; }
.vcard:hover { transform: translateY(-3px); border-color: var(--border-2); box-shadow: var(--shadow); }
.thumb { position: relative; aspect-ratio: 16 / 9; background: var(--surface-3); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s; }
.vcard:hover .thumb img { transform: scale(1.05); }
.thumb-ph { position: absolute; inset: 0; display: grid; place-items: center; background: radial-gradient(circle at 30% 30%, rgba(139, 92, 246, .45), transparent 55%), radial-gradient(circle at 80% 80%, rgba(34, 211, 238, .35), transparent 55%), var(--surface-3); }
.thumb-ph span { font-weight: 750; font-size: 18px; color: rgba(255, 255, 255, .85); letter-spacing: .02em; }
.thumb.has-img .thumb-ph { display: none; }
.thumb::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, rgba(0, 0, 0, .6)); }
.play { position: absolute; z-index: 1; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; background: rgba(10, 11, 16, .6); backdrop-filter: blur(6px); border: 1px solid rgba(255, 255, 255, .25); color: var(--on-accent); transition: .2s; }
.play .ic { width: 22px; height: 22px; }
.vcard:hover .play { background: var(--accent); transform: translate(-50%, -50%) scale(1.08); border-color: transparent; }
.src { position: absolute; z-index: 1; left: 10px; bottom: 10px; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: var(--radius-xs); background: rgba(0, 0, 0, .6); color: var(--on-accent); }
.vbody { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 4px; }
.vbody b { font-size: 15px; }
.vbody p { margin: 0; font-size: 13px; line-height: 1.55; color: var(--muted); }
.vbody p a { color: var(--accent-link); }
.ptitle { color: var(--faint); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.links { display: grid; gap: 8px; }
.linkrow { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: var(--radius-md); background: var(--surface); border: 1px solid var(--border); color: var(--text); transition: .15s; }
.linkrow:hover { border-color: var(--border-2); background: var(--surface-2); color: var(--text); transform: translateX(3px); }
.linkrow > .ic { color: var(--muted); margin-left: auto; }
.fav { width: 34px; height: 34px; flex: none; border-radius: var(--radius-sm); display: grid; place-items: center; background: var(--surface-3); font-weight: 750; color: var(--accent-text); }
.lr-body { display: flex; flex-direction: column; min-width: 0; }
.lr-body b { font-size: 14px; font-weight: 600; }
.lr-body small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mats { display: grid; gap: 10px; }
.mat { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.mat-ic { width: 40px; height: 40px; flex: none; border-radius: var(--radius-md); display: grid; place-items: center; background: var(--surface-3); color: var(--muted); }
.mat-ic.task { background: var(--warn-soft); color: var(--warn-text); }
.mat-ic.file { background: var(--accent-soft); color: var(--accent-text); }
.mat-ic.video { background: var(--danger-soft); color: var(--danger-text); }
.mat-ic.link { background: rgba(34, 211, 238, .12); color: var(--accent-2); }
.mat-body { flex: 1; min-width: 0; }
.mat-body b { display: block; }
.mat-body p { margin: 2px 0; font-size: 14px; color: var(--text-2); }
.mat-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.prompt { position: relative; padding: 20px 22px; padding-right: 130px; border-radius: var(--radius); background: linear-gradient(135deg, rgba(240, 171, 252, .10), rgba(139, 92, 246, .08)), var(--surface); border: 1px solid rgba(240, 171, 252, .25); font-size: 15px; color: var(--text-2); }
.prompt p { margin: 0; white-space: pre-wrap; }
.prompt .copy { position: absolute; right: 14px; top: 14px; }

/* Тест */
.quiz-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; margin-bottom: 18px; }
.quiz-head h2 { display: flex; align-items: center; gap: 10px; }
.quiz-head h2 .ic { color: var(--accent-2); }
.quiz { display: flex; flex-direction: column; gap: 12px; }
.qitem { display: grid; grid-template-columns: 34px 1fr; gap: 8px 14px; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.qn { width: 34px; height: 34px; border-radius: var(--radius-sm); display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); font-weight: 750; }
.qq { align-self: center; font-weight: 600; }
.qitem textarea, .qa { grid-column: 2; }
.qa { color: var(--text-2); font-size: 14px; white-space: pre-wrap; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--bg-2); border: 1px solid var(--border); }
.quiz-attempt { margin-bottom: 10px; }
.quiz-attempt summary { cursor: pointer; }
.quiz-attempt .qitem { margin-top: 10px; background: var(--surface-2); }
.interview { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.iq { display: flex; gap: 12px; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); transition: .2s; }
.iq:hover { border-color: rgba(34, 211, 238, .35); }
.iq span { font-weight: 800; color: var(--accent-2); font-variant-numeric: tabular-nums; }
.iq p { margin: 0; font-size: 14px; }

/* Сдача */
.banner { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-radius: var(--radius-lg); margin-bottom: 20px; border: 1px solid; }
.banner > .ic { width: 28px; height: 28px; flex: none; }
.banner div { flex: 1; }
.banner p { margin: 2px 0 0; font-size: 14px; color: var(--text-2); white-space: pre-wrap; }
.banner.pending { background: var(--warn-soft); border-color: rgba(245, 158, 11, .35); }
.banner.pending > .ic { color: var(--warn); }
.banner.approved { background: var(--success-soft); border-color: rgba(34, 197, 94, .35); }
.banner.approved > .ic { color: var(--success); }
.banner.rejected { background: var(--danger-soft); border-color: rgba(244, 63, 94, .35); }
.banner.rejected > .ic { color: var(--danger); }
.submit-card h2 .ic { color: var(--accent-2); }
.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 34px 20px; margin: 16px 0; border: 2px dashed var(--border-2); border-radius: var(--radius-lg); text-align: center; cursor: pointer; background: var(--bg-2); transition: .2s; }
.dropzone .ic { color: var(--accent); transition: transform .2s; }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone.over .ic { transform: translateY(-4px) scale(1.1); }
.upl-list { display: grid; gap: 8px; margin-bottom: 16px; }
.upl-list:empty { display: none; }
.upl { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); font-size: 14px; }
.upl .ic { color: var(--muted); }
.upl.done .ic:first-child { color: var(--success); }
.upl.err { border-color: rgba(244, 63, 94, .4); }
.upl-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upl small { color: var(--muted); }
.err-text { color: var(--danger-text) !important; }
.ok-text { color: var(--success-text) !important; }
.history { display: grid; gap: 12px; }
.hist { padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--faint); }
.hist.pending { border-left-color: var(--warn); }
.hist.approved { border-left-color: var(--success); }
.hist.rejected { border-left-color: var(--danger); }
.hist .pre { color: var(--text-2); font-size: 14px; }
.files { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.file { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); color: var(--text); font-size: 13px; max-width: 100%; transition: .15s; }
.file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file small { color: var(--muted); }
.file .ic { color: var(--accent-2); width: 16px; height: 16px; }
.file:hover { border-color: var(--accent); color: var(--text); }
.review-note { display: flex; gap: 12px; margin-top: 12px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--bg-2); border: 1px solid var(--border); }
.review-note .ic { color: var(--accent-text); margin-top: 3px; }
.review-note p { margin: 2px 0 0; font-size: 14px; }

/* Библиотека и документы */
.search { display: flex; align-items: center; gap: 8px; padding: 0 12px; background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--radius-md); min-width: 260px; }
.search .ic { color: var(--muted); }
.search input { border: 0; background: transparent; box-shadow: none; padding: 10px 0; }
.docs { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.doc { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--radius-md); background: var(--surface); border: 1px solid var(--border); color: var(--text); transition: .15s; min-width: 0; }
.doc:hover { border-color: var(--border-2); background: var(--surface-2); color: var(--text); transform: translateY(-2px); }
.doc span:last-child { min-width: 0; }
.doc b { display: block; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc small { color: var(--muted); font-size: 12px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc.locked { opacity: .55; }
.doc-actions { display: flex; justify-content: space-between; margin-bottom: 14px; }
.prose { padding: 36px 44px; font-size: 16px; line-height: 1.75; }
.prose h1 { font-size: 28px; margin-bottom: 20px; }
.prose h2 { font-size: 21px; margin: 32px 0 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.prose h3 { margin: 22px 0 8px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin: 6px 0; }
.prose li::marker { color: var(--accent-text); }
.prose li.task { list-style: none; margin-left: -22px; display: flex; gap: 10px; align-items: flex-start; }
.prose .cb { width: 16px; height: 16px; border: 2px solid var(--border-2); border-radius: 4px; flex: none; margin-top: 6px; }
.prose .cb.on { background: var(--success); border-color: var(--success); }
.prose blockquote { margin: 18px 0; padding: 10px 18px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 10px 10px 0; color: var(--text-2); }
.prose pre { background: var(--bg-2); border: 1px solid var(--border); padding: 16px; border-radius: var(--radius-md); overflow-x: auto; }
.prose pre code { background: none; padding: 0; }
.prose img { max-width: 100%; border-radius: var(--radius-md); background: var(--img-bg); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; background: var(--surface-2); }
a.ext::after { content: "↗"; font-size: .8em; margin-left: 2px; opacity: .7; }
a.dl::after { content: "↓"; font-size: .8em; margin-left: 2px; opacity: .7; }

/* Админка */
.pills { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.pill { padding: 7px 14px; border-radius: var(--radius-pill); border: 1px solid var(--border-2); color: var(--muted); font-size: 13px; font-weight: 600; }
.pill:hover { color: var(--text); }
.pill.active { background: var(--accent-soft); color: var(--on-accent); border-color: rgba(139, 92, 246, .5); }
.reviews { display: grid; gap: 16px; }
.review { padding: 20px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); transition: opacity .25s, transform .25s; animation: rise .35s both; }
.review.pending { border-color: rgba(245, 158, 11, .3); }
.review.leaving { opacity: 0; transform: translateX(20px); }
.review header { margin-bottom: 12px; }
.gate-hint { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--muted); padding: 10px 12px; border-radius: var(--radius-sm); background: var(--bg-2); margin-bottom: 10px; }
.gate-hint .ic { color: var(--accent-2); width: 16px; height: 16px; margin-top: 2px; }
.gate-hint b { color: var(--text-2); }
.student-note { margin: 10px 0; }
.student-note p { margin: 4px 0 0; font-size: 14px; }
.review-comment { margin: 10px 0 12px; }
.toolbar { margin-bottom: 16px; }
.toolbar p { margin: 0; max-width: 700px; font-size: 14px; }
.users td { white-space: nowrap; }
.users tr:hover td { background: rgba(255, 255, 255, .015); }
.users tr.inactive { opacity: .5; }
.prog-cell { min-width: 160px; }
.prog-cell .row { margin-bottom: 6px; }
.user-head { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.user-head h2 { margin: 0; }
.user-head .row { margin-top: 12px; gap: 20px; }
.user-stats { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.user-stats .ring-text { font-size: 20px; }
.user-stats small { color: var(--muted); font-size: 12px; }
.uweeks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.uweek { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.uweek b { font-size: 14px; min-height: 40px; }
.uweek.locked { opacity: .75; }
.uweek.approved { border-color: rgba(34, 197, 94, .3); }
.uweek.pending { border-color: rgba(245, 158, 11, .35); }
.mat-form .field { margin-bottom: 12px; }
.seg { display: flex; gap: 4px; padding: 4px; background: var(--bg-2); border: 1px solid var(--border-2); border-radius: var(--radius-md); flex-wrap: wrap; }
.seg button { display: flex; align-items: center; gap: 6px; padding: 7px 12px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.seg button:hover { color: var(--text); }
.seg button.active { background: var(--surface-3); color: var(--on-accent); box-shadow: inset 0 0 0 1px var(--border-2); }
.seg button.active .ic { color: var(--accent-2); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cred { display: grid; gap: 10px; margin: 18px 0; padding: 16px; border-radius: var(--radius-md); background: var(--bg-2); border: 1px solid var(--border); }
.cred small { display: block; color: var(--muted); font-size: 12px; }
.cred b { font-family: ui-monospace, Consolas, monospace; font-size: 15px; user-select: all; overflow-wrap: anywhere; }

/* Модальные окна и уведомления */
.modal-backdrop { position: fixed; inset: 0; z-index: var(--z-modal); display: grid; place-items: center; padding: 16px; background: rgba(4, 5, 9, .7); backdrop-filter: blur(6px); opacity: 0; transition: opacity .2s; }
.modal-backdrop.show { opacity: 1; }
.modal { position: relative; width: min(480px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: var(--surface); border: 1px solid var(--border-2); border-radius: 20px; padding: 28px; box-shadow: var(--shadow); transform: translateY(12px) scale(.98); transition: transform .2s; }
.modal-backdrop.show .modal { transform: none; }
.modal.wide { width: min(960px, 100%); }
.modal h2 { display: flex; align-items: center; gap: 10px; padding-right: 36px; }
.modal h2 .ic { color: var(--success); }
.modal-close { position: absolute; right: 16px; top: 16px; }
.modal-title { font-size: 17px; }
/* #000 — рамка видео, #67e8f9 и #6f7cf3 ниже — декоративные точки градиента и загрузчика. */
.player { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #000; margin: 10px 0 12px; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
#toasts { position: fixed; right: 20px; bottom: 20px; z-index: var(--z-toast); display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.toast { display: flex; align-items: center; gap: 10px; max-width: 380px; padding: 12px 16px; border-radius: var(--radius-md); background: var(--surface-3); border: 1px solid var(--border-2); box-shadow: var(--shadow); font-size: 14px; transform: translateY(12px); opacity: 0; transition: .25s; }
.toast.show { transform: none; opacity: 1; }
.toast .ic { color: var(--accent-2); }
.toast.success .ic { color: var(--success); }
.toast.error { border-color: rgba(244, 63, 94, .45); }
.toast.error .ic { color: var(--danger); }

/* Адаптивность */
/* ---------- Коротко о главном, схемы и примеры ---------- */
.overview { margin: 8px 0; }
.overview .section-title { margin-top: 18px; }
.prose.flat { padding: 20px 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); font-size: 15px; }
.prose.flat > ul:first-child { margin-top: 0; }
.prose [id] { scroll-margin-top: 16px; }
.prose .flash { animation: flash 1.6s ease; }
@keyframes flash { 0%, 40% { color: var(--accent-2); } }
.figure { margin: 22px 0; text-align: center; }
.figure a { display: block; }
.figure img { display: block; margin: 0 auto; max-width: 100%; max-height: 520px; border-radius: var(--radius-md); background: var(--img-bg); padding: 8px; }
.figure figcaption { margin-top: 8px; font-size: 13px; color: var(--muted); }
.prose blockquote.callout-md { padding: 14px 18px 14px 20px; border-radius: var(--radius-md); border: 1px solid; border-left-width: 4px; color: var(--text); }
.prose blockquote.callout-md > p:first-child > strong:first-child { margin-right: 4px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.prose blockquote.example { background: rgba(34, 211, 238, .07); border-color: rgba(34, 211, 238, .35); }
.prose blockquote.example > p:first-child > strong:first-child { color: var(--accent-2); }
.prose blockquote.important { background: var(--warn-soft); border-color: rgba(245, 158, 11, .4); }
.prose blockquote.important > p:first-child > strong:first-child { color: var(--warn); }
.prose blockquote.mistake { background: var(--danger-soft); border-color: rgba(244, 63, 94, .4); }
.prose blockquote.mistake > p:first-child > strong:first-child { color: var(--danger-text); }
.prose blockquote pre { background: rgba(0, 0, 0, .25); }

/* ---------- Автотест ---------- */
.autotest { margin-bottom: 36px; }
.at-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; margin-bottom: 16px; }
.at-head h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; }
.at-head h2 .ic { color: var(--success); }
.at-head p { margin: 0; max-width: 720px; }
.at-best { display: flex; flex-direction: column; align-items: flex-end; padding: 10px 16px; border-radius: var(--radius-md); background: var(--surface); border: 1px solid var(--border); }
.at-best b { font-size: 22px; color: var(--danger-text); }
.at-best.ok b { color: var(--success); }
.at-best small { color: var(--muted); font-size: 12px; }
.at-form, .at-review { display: flex; flex-direction: column; gap: 12px; }
.tq { margin: 0; padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); min-width: 0; transition: border-color .2s; }
.tq.answered { border-color: rgba(139, 92, 246, .4); }
.tq legend, .tq-legend { display: flex; gap: 14px; align-items: flex-start; padding: 0; font-weight: 600; width: 100%; }
.tq legend { float: left; margin-bottom: 4px; }
.tq legend + * { clear: both; }
.tq-text { flex: 1; padding-top: 6px; }
.tq-hint { margin: 6px 0 10px 48px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.opts, .tf { display: flex; flex-direction: column; gap: 8px; margin-left: 48px; }
.opt { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 11px 14px; border-radius: var(--radius-sm); background: var(--bg-2); border: 1px solid var(--border); cursor: pointer; font-size: 15px; transition: .15s; }
label.opt:hover { border-color: var(--border-2); background: var(--surface-2); }
.opt input, .tf-btns input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.opt-mark { flex: none; width: 18px; height: 18px; margin-top: 2px; border: 2px solid var(--border-2); border-radius: 5px; transition: .15s; }
.opt-mark.single { border-radius: 50%; }
.opt input:checked + .opt-mark, .opt-mark.on { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 3px var(--bg-2); }
.opt input:focus-visible + .opt-mark { outline: var(--focus-ring); outline-offset: 2px; }
label.opt:has(input:checked) { border-color: rgba(139, 92, 246, .55); background: var(--accent-soft); }
.opt-text { flex: 1; min-width: 0; }
.opt-text small { display: block; margin-top: 2px; font-size: 12px; font-weight: 600; }
.tf-row { display: flex; align-items: center; gap: 14px; justify-content: space-between; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--bg-2); border: 1px solid var(--border); font-size: 15px; flex-wrap: wrap; }
.tf-text { flex: 1 1 320px; min-width: 0; }
.tf-btns { position: relative; display: inline-flex; gap: 4px; padding: 3px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); }
.tf-btns label { cursor: pointer; }
.tf-btns span { display: block; padding: 6px 12px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--muted); transition: .15s; }
.tf-btns label:first-child input:checked + span { background: var(--success-soft); color: var(--success); }
.tf-btns label:last-child input:checked + span { background: var(--danger-soft); color: var(--danger-text); }
.tf-btns input:focus-visible + span { outline: var(--focus-ring); }
.at-bar { position: sticky; bottom: 12px; z-index: 4; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--radius); background: rgba(19, 21, 29, .92); backdrop-filter: blur(10px); border: 1px solid var(--border-2); box-shadow: var(--shadow); }
.at-result { display: flex; gap: 22px; align-items: center; padding: 20px 24px; border-radius: var(--radius-lg); margin-bottom: 16px; border: 1px solid; }
.at-result.ok { background: var(--success-soft); border-color: rgba(34, 197, 94, .35); }
.at-result.fail { background: var(--danger-soft); border-color: rgba(244, 63, 94, .35); }
.at-result b { font-size: 19px; }
.at-result p { margin: 6px 0 12px; color: var(--text-2); font-size: 14px; }
.tq.result.ok { border-left: 3px solid var(--success); }
.tq.result.part { border-left: 3px solid var(--warn); }
.tq.result.bad { border-left: 3px solid var(--danger); }
.tq-legend { margin-bottom: 12px; }
.tq-score { flex: none; display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 700; background: var(--surface-3); color: var(--muted); }
.tq.result.ok .tq-score { background: var(--success-soft); color: var(--success); }
div.opt { cursor: default; }
.opt.right { border-color: rgba(34, 197, 94, .5); background: var(--success-soft); }
.opt.right small, .opt.missed small { color: var(--success); }
.opt.wrong { border-color: rgba(244, 63, 94, .5); background: var(--danger-soft); }
.opt.wrong small { color: var(--danger-text); }
.opt.missed { border-color: rgba(34, 197, 94, .5); border-style: dashed; }
.tf-row.right { border-color: rgba(34, 197, 94, .45); }
.tf-row.wrong { border-color: rgba(244, 63, 94, .5); background: var(--danger-soft); }
.tf-verdict { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--success); }
.tf-row.wrong .tf-verdict { color: var(--danger-text); }
.tq-explain, .tq-source { display: flex; gap: 12px; margin: 12px 0 0 48px; padding: 12px 14px; border-radius: var(--radius-sm); font-size: 14px; }
.tq-explain { background: var(--accent-soft); }
.tq-explain .ic { color: var(--accent-text); margin-top: 2px; flex: none; }
.tq-source { background: var(--bg-2); border: 1px solid var(--border); }
.tq-source .ic { color: var(--accent-2); margin-top: 2px; flex: none; }
.tq-explain p, .tq-source p { margin: 4px 0 0; color: var(--text-2); }
.tq-source a { color: var(--accent-link); }

@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .week-head { grid-template-columns: auto 1fr; }
  .week-prog { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-art { padding: 32px 20px 10px; border-right: 0; }
  .auth-art h1 { font-size: 32px; }
  .auth-points { display: none; }
  .auth-card { margin: 20px auto 40px; }
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: var(--z-sidebar); left: 0; top: 0; width: 280px; transform: translateX(-100%); transition: transform .25s; box-shadow: var(--shadow); background: var(--bg-2); }
  .sidebar.open { transform: none; }
  .topbar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: var(--z-topbar); background: rgba(10, 11, 16, .9); backdrop-filter: blur(10px); }
  .content { padding: 20px 16px 60px; }
  .hero { flex-direction: column-reverse; align-items: flex-start; padding: 22px; }
  .hero h1 { font-size: 28px; }
  .grid2 { grid-template-columns: 1fr; }
  .week-num { font-size: 44px; }
  .week-head { padding: 18px; gap: 16px; }
  .week-info h1 { font-size: 20px; }
  .prose { padding: 22px 18px; }
  .prose.flat { padding: 16px; }
  .tq { padding: 14px; }
  .tq-hint, .opts, .tf, .tq-explain, .tq-source { margin-left: 0; }
  .at-result { flex-direction: column; align-items: flex-start; }
  .prompt { padding-right: 22px; padding-top: 56px; }
  .search { min-width: 0; width: 100%; }
  .mat { flex-wrap: wrap; }
  .mat-actions { width: 100%; justify-content: flex-start; }
  .tabs a span { display: none; }
  .tabs a.active span { display: inline; }
}
/* ---------- Читаемость: крупнее текст, контрастнее второстепенный, строка не шире ~75 знаков ---------- */
body { font-size: 16px; line-height: 1.65; }
.lead { font-size: 15px; max-width: 72ch; margin: 0 0 16px; }
.section-title.first { margin-top: 8px; }
.section-title small { font-weight: 500; font-size: 14px; margin-left: 4px; }
.prose { font-size: 16px; }
.prose p, .prose li { max-width: 76ch; }
button.pill { background: none; font: inherit; font-size: 14px; cursor: pointer; }
.pill { font-size: 14px; padding: 8px 16px; }

/* ---------- План недели: главное, что сдать, файлы ---------- */
.week-top { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.wt-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 84px; }
.side-card { padding: 18px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); }
.side-card h3 { display: flex; align-items: center; gap: 8px; font-size: 16px; margin-bottom: 10px; }
.side-card h3 .ic { color: var(--accent-2); }
.side-card p { font-size: 15px; color: var(--text-2); margin: 0 0 14px; }
.side-card.deliver { border-color: rgba(139, 92, 246, .45); background: linear-gradient(135deg, rgba(139, 92, 246, .16), rgba(34, 211, 238, .05)), var(--surface); }

/* Карточки файлов: тип цветом и иконкой, понятное действие */
.fcards { display: grid; gap: 8px; }
.fcards.wide { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.fcard { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-md); background: var(--bg-2); border: 1px solid var(--border); color: var(--text); transition: .15s; min-width: 0; }
a.fcard:hover { border-color: var(--border-2); background: var(--surface-2); color: var(--text); }
.fbody { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fbody b { font-size: 15px; font-weight: 600; line-height: 1.35; }
.fbody small { font-size: 13px; color: var(--muted); }
.fbody small.fnote { color: var(--text-2); }
.fgo { color: var(--muted); }
.fkind { width: 36px; height: 36px; flex: none; border-radius: var(--radius-sm); display: grid; place-items: center; background: var(--surface-3); color: var(--muted); }
/* Цвет типа файла задан один раз — и для списка файлов, и для карточек скачивания. */
.fkind.task, .dkind.task { background: color-mix(in srgb, var(--tone-check) var(--tone-soft), transparent); color: var(--tone-check); }
.fkind.data, .dkind.data { background: color-mix(in srgb, var(--tone-lab) var(--tone-soft), transparent); color: var(--tone-lab); }
.fkind.example, .dkind.example { background: color-mix(in srgb, var(--tone-practice) var(--tone-soft), transparent); color: var(--tone-practice); }
.fkind.template, .dkind.template { background: color-mix(in srgb, var(--tone-repeat) var(--tone-soft), transparent); color: var(--tone-repeat); }
.fkind.guide, .dkind.guide { background: var(--accent-soft); color: var(--accent-text); }
.fkind.answers, .dkind.answers { background: color-mix(in srgb, var(--tone-ai) var(--tone-soft), transparent); color: var(--tone-ai); }

/* ---------- Уроки ---------- */
.lessons { display: flex; flex-direction: column; gap: 12px; }
.l-badge { width: 36px; height: 36px; border-radius: var(--radius-md); display: grid; place-items: center; font-weight: 800; background: var(--accent-soft); color: var(--accent-text); }
.l-title { display: flex; flex-direction: column; min-width: 0; }
.l-title small { font-size: 13px; color: var(--muted); }
.l-title b { font-size: 17px; font-weight: 700; line-height: 1.3; }
.goal { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--radius-md); background: var(--accent-soft); border: 1px solid rgba(139, 92, 246, .3); margin-bottom: 14px; }
.goal .ic { color: var(--accent-text); margin-top: 3px; }
.goal b, .l-result b { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--accent-text); }
.goal p, .l-result p { margin: 2px 0 0; font-size: 16px; max-width: 72ch; }
.lesson-note { font-size: 15px; color: var(--text-2); margin: 0 0 12px; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; counter-reset: step; }
.step { display: flex; gap: 14px; padding: 14px 16px; border-radius: var(--radius-md); background: var(--bg-2); border: 1px solid var(--border); border-left: 3px solid var(--c, var(--accent)); transition: opacity .2s; }
.step.checked { opacity: .62; }
.step-check { display: inline-grid; cursor: pointer; margin-top: 2px; }
.step-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.step-check span { width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--border-2); display: grid; place-items: center; color: transparent; transition: .2s; }
.step-check input:checked + span { background: var(--success); border-color: var(--success); color: var(--on-accent); }
.step-check input:focus-visible + span { outline: var(--focus-ring); outline-offset: 2px; }
.step-body { flex: 1; min-width: 0; }
.step-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.step-kind { font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--c, var(--accent)); }
.step-time { font-size: 13px; color: var(--muted); padding: 1px 8px; border-radius: var(--radius-pill); background: var(--surface-3); }
.step-body p { margin: 0; font-size: 16px; line-height: 1.65; color: var(--text); max-width: 78ch; }
.step-body a, .goal a, .l-result a, .pitfalls a, .side-card a:not(.btn) { color: var(--accent-link); text-decoration: underline; text-decoration-color: rgba(185, 164, 255, .35); text-underline-offset: 3px; }
a.yt-link { display: inline-flex; align-items: center; gap: 4px; padding: 0 8px 0 6px; border-radius: 7px; background: rgba(244, 63, 94, .12); color: var(--danger-text) !important; text-decoration: none !important; font-weight: 600; white-space: nowrap; }
a.yt-link::before { content: "▶"; font-size: 10px; }
a.yt-link:hover { background: rgba(244, 63, 94, .22); }
.side-card h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.l-result { display: flex; align-items: center; gap: 14px; margin-top: 16px; padding: 14px 16px; border-radius: var(--radius-md); background: var(--success-soft); border: 1px solid rgba(34, 197, 94, .28); }
.l-result > .ic { color: var(--success); flex: none; }
.l-result > div { flex: 1; }
.l-result b { color: var(--success-text); }

/* Видео: где смотреть в уроках */
.uses { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.uses small { color: var(--muted); font-size: 13px; width: 100%; }
a.chip-link { font-size: 13px; padding: 3px 10px; }
a.chip-link::before { content: none; }
a.chip-link .ic { width: 14px; height: 14px; }

/* Библиотека */
.lib-module .docs { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.doc .fkind { width: 36px; height: 36px; }
.doc b { white-space: normal; line-height: 1.35; }
.doc small { white-space: normal; }
.empty-note { text-align: center; padding: 30px 0; }

@media (max-width: 1100px) {
  .week-top { grid-template-columns: 1fr; }
  .wt-side { position: static; }
}
@media (max-width: 860px) {
  .l-title b { font-size: 16px; }
  .step { padding: 12px; gap: 10px; }
  .step-body p { font-size: 15px; }
  .l-result { flex-direction: column; align-items: stretch; }
  .fcards.wide, .lib-module .docs { grid-template-columns: 1fr; }
  a.yt-link { white-space: normal; }
}

.newbie { display: flex; align-items: center; gap: 14px; margin-top: 18px; padding: 16px 18px; border-radius: var(--radius-lg); border: 1px solid rgba(34, 211, 238, .35); background: rgba(34, 211, 238, .07); color: var(--text); }
.newbie:hover { color: var(--text); border-color: rgba(34, 211, 238, .6); }
.newbie span:nth-child(2) { flex: 1; display: flex; flex-direction: column; }
.newbie small { color: var(--text-2); font-size: 14px; }

/* ---------- Меню: неделя раскрывается уроками ---------- */
.wk-group { display: flex; flex-direction: column; }
.wk-row { display: flex; align-items: center; gap: 2px; }
.wk-row .wk { flex: 1; min-width: 0; }
.wk-toggle { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; }
.wk-toggle:hover { background: var(--surface-2); color: var(--text); }
.wk-toggle:focus-visible { outline: var(--focus-ring); }
.wk-toggle .ic { width: 16px; height: 16px; transition: transform .2s; }
.wk-group.open .wk-toggle .ic { transform: rotate(90deg); }
.sub-nav { display: flex; flex-direction: column; gap: 1px; margin: 2px 0 8px 22px; padding-left: 10px; border-left: 1px solid var(--border-2); }
.sub-nav a { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; font-size: 14px; color: var(--muted); line-height: 1.3; }
.sub-nav a:hover { background: var(--surface-2); color: var(--text); }
.sub-nav a.active { background: var(--accent-soft); color: var(--on-accent); }
.sub-nav a .ic { width: 15px; height: 15px; }
.sub-nav a > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.sn-dot { flex: none; width: 20px; height: 20px; border-radius: var(--radius-xs); display: grid; place-items: center; font-size: 11px; font-weight: 750; background: var(--surface-3); color: var(--muted); }
.sn-dot .ic { width: 12px; height: 12px; }
.lesson-link.done .sn-dot { background: var(--success-soft); color: var(--success); }

/* ---------- Экскурс ---------- */
.intro-text { font-size: 17px; }
.intro-text > p:first-child { font-size: 18px; color: var(--text); }
.lesson-cards { display: flex; flex-direction: column; gap: 10px; }
.lcard { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); color: var(--text); transition: .15s; }
.lcard:hover { border-color: var(--border-2); background: var(--surface-2); color: var(--text); transform: translateY(-1px); }
.lcard.next { border-color: rgba(139, 92, 246, .55); box-shadow: 0 0 0 3px var(--accent-soft); }
.lcard.done { border-left: 3px solid var(--success); }
.lcard.done .l-badge { background: var(--success-soft); color: var(--success); }
.lcard-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lcard-body small { font-size: 13px; color: var(--muted); }
.lcard-body b { font-size: 17px; line-height: 1.3; }
.lcard-goal { font-size: 15px; color: var(--text-2); }
.next-tag { color: var(--accent-text); }
.start-btn { margin: 16px 0 8px; width: 100%; justify-content: center; }
.side-link { display: flex; align-items: center; gap: 12px; color: var(--text); padding: 14px 16px; }
.side-link:hover { border-color: var(--border-2); color: var(--text); }
.side-link > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; }
.side-link small { color: var(--muted); font-size: 13px; }
.week-head.compact { padding: 16px 22px; }
.week-head.compact .week-num { font-size: 40px; }
.week-head.compact h1 { font-size: 20px; }

/* ---------- Страница урока ---------- */
.lesson-layout { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 28px; align-items: start; }
.lesson-toc { position: sticky; top: 84px; }
.toc-inner { padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
.toc-inner b { display: block; font-size: 12px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.toc-inner nav { display: flex; flex-direction: column; gap: 2px; }
.toc-inner a { font-size: 14px; color: var(--text-2); padding: 5px 8px; border-radius: 8px; line-height: 1.35; }
.toc-inner a:hover { background: var(--surface-2); color: var(--text); }
.lesson-toc.short { display: none; }
.lesson-page { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.lp-head small { font-size: 14px; color: var(--muted); }
.lp-head h2 { font-size: 26px; margin: 4px 0 14px; }
.lesson-material { padding: 26px 30px; font-size: 17px; line-height: 1.75; }
.lesson-material h2 { font-size: 21px; }
.lesson-material h2:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
.lesson-material .table-wrap { margin: 14px 0; }
.lesson-material table { font-size: 15px; }
.lesson-material th, .lesson-material td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.lesson-material pre { font-size: 14px; line-height: 1.55; }
.lesson-pager { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding-top: 8px; }
.prose blockquote.source { background: transparent; border-left-color: var(--border-2); color: var(--muted); font-size: 14px; }

/* ---------- Файлы недели ---------- */
.files-hero { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: 22px 24px; border-radius: 18px; border: 1px solid rgba(34, 211, 238, .35); background: linear-gradient(135deg, rgba(34, 211, 238, .12), rgba(139, 92, 246, .08)), var(--surface); margin-bottom: 8px; }
.files-hero h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; }
.files-hero p { margin: 0; color: var(--text-2); max-width: 62ch; }
.dgroup { margin-top: 26px; }
.dgroup h3 { font-size: 18px; margin: 0 0 2px; }
.dgroup > p { margin: 0 0 12px; font-size: 15px; }
.dcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
.dcard { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); transition: box-shadow .3s, border-color .3s; }
.dcard.flash-card { border-color: var(--accent-2); box-shadow: 0 0 0 4px rgba(34, 211, 238, .25); }
.dkind { flex: none; width: 52px; height: 56px; border-radius: var(--radius-md); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; background: var(--surface-3); color: var(--muted); }
.dkind small { font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.dbody { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.dbody b { font-size: 16px; line-height: 1.3; }
.dname { font-size: 13px; color: var(--text-2); background: none; padding: 0; overflow-wrap: anywhere; }
.dmeta { font-size: 14px; color: var(--muted); }
.dactions { display: flex; flex-direction: column; gap: 6px; }

/* ---------- Статистика и Telegram ---------- */
.stat-card { margin-bottom: 16px; }
.kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin: 16px 0; }
.kpis div { padding: 12px; border-radius: var(--radius-md); background: var(--bg-2); border: 1px solid var(--border); display: flex; flex-direction: column; }
.kpis b { font-size: 20px; }
.kpis span { font-size: 13px; color: var(--muted); }
.daybars { display: flex; align-items: flex-end; gap: 6px; height: 120px; padding: 8px 4px 0; border-bottom: 1px solid var(--border); overflow-x: auto; }
.daybar { flex: 1 0 28px; max-width: 48px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.daybar span { width: 100%; border-radius: var(--radius-xs) 6px 0 0; background: var(--grad); min-height: 4px; }
.daybar small { font-size: 11px; color: var(--muted); }
.stat-list { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; font-size: 15px; }
.stat-list li { display: flex; gap: 10px; align-items: flex-start; }
.stat-list .ic { color: var(--accent-2); margin-top: 3px; }
.warn-text { color: var(--warn-text); }
.tg-card { grid-column: 1 / -1; }
.tg-chats { display: grid; gap: 12px; margin: 12px 0 16px; }
.tg-chat { padding: 14px; border-radius: var(--radius-md); background: var(--bg-2); border: 1px solid var(--border); display: grid; gap: 12px; }
.tg-settings { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; }
.tg-settings input[type=time], .tg-chat select { width: auto; padding: 6px 10px; }
.steps-plain { padding-left: 20px; line-height: 1.7; }
#tg-link { margin-top: 14px; }

@media (max-width: 1100px) {
  .lesson-layout { grid-template-columns: 1fr; }
  .lesson-toc { display: none; }
  .kpis { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 860px) {
  .lesson-material { padding: 18px 16px; font-size: 16px; }
  .lp-head h2 { font-size: 22px; }
  .dcards { grid-template-columns: 1fr; }
  .dcard { flex-wrap: wrap; }
  .dactions { flex-direction: row; width: 100%; }
  .dactions .btn { flex: 1; }
  .files-hero .btn { width: 100%; }
  .lesson-pager .btn { flex: 1; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .lcard { padding: 14px; }
  .lcard-body b { font-size: 16px; }
  .wk-toggle { width: 40px; height: 40px; }
  .sub-nav a { padding: 9px 8px; }
}

/* ---------- Телефон: меню-шторка, крупные зоны нажатия, без горизонтальной прокрутки ---------- */
html { -webkit-text-size-adjust: 100%; }
.content, .prose, .tq, .vbody, .linkrow, .doc { overflow-wrap: anywhere; }
.side-backdrop { display: none; }
@media (max-width: 860px) {
  body { overflow-x: hidden; }
  body.nav-open { overflow: hidden; }
  .side-backdrop { display: block; position: fixed; inset: 0; z-index: var(--z-backdrop); background: rgba(4, 5, 9, .6); backdrop-filter: blur(2px); opacity: 0; pointer-events: none; transition: opacity .2s; }
  body.nav-open .side-backdrop { opacity: 1; pointer-events: auto; }
  .sidebar { width: min(300px, 86vw); padding-bottom: calc(22px + env(safe-area-inset-bottom)); }
  .topbar { padding-top: calc(12px + env(safe-area-inset-top)); }
  /* Вкладки недели липнут под верхней панелью, а не заезжают под нее. */
  .tabs { top: 64px; margin: 16px -16px; border-radius: 0; border-left: 0; border-right: 0; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a { padding: 10px 14px; }
  /* iOS увеличивает страницу при фокусе на поле со шрифтом меньше 16px. */
  input, textarea, select { font-size: 16px; }
  .icon-btn { width: 44px; height: 44px; }
  .btn { min-height: 44px; }
  .btn.sm { min-height: 36px; }
  .check span { width: 30px; height: 30px; }
  .page-head { align-items: stretch; }
  .page-head h1 { font-size: 24px; }
  .section-title { margin: 28px 0 12px; font-size: 17px; }
  .stats { gap: 10px; }
  .stat { padding: 14px; gap: 10px; }
  .stat b { font-size: 20px; }
  .hero-ring .ring { width: 120px; height: 120px; }
  .roadmap, .videos, .feedback, .interview, .docs, .uweeks { grid-template-columns: 1fr; }
  .week-head { grid-template-columns: 1fr; }
  .week-num { display: none; }
  .week-pager { gap: 10px; }
  .week-pager .btn { flex: 1; }
  .doc-actions { gap: 8px; flex-wrap: wrap; }
  .quiz-head .btn, .quiz-head .chip { width: 100%; justify-content: center; }
  .qitem { grid-template-columns: 1fr; padding: 14px; }
  .qitem textarea, .qa { grid-column: 1; }
  .gate { flex-direction: column; padding: 18px; }
  .gate .btn { width: 100%; }
  .pitfalls { padding: 16px; }
  .at-head { flex-direction: column; }
  .at-best { align-items: flex-start; width: 100%; }
  .tq legend, .tq-legend { gap: 10px; }
  .tq-legend { flex-wrap: wrap; }
  .tq-score { margin-left: 44px; }
  .tf-row { flex-direction: column; align-items: stretch; gap: 10px; }
  .tf-text { flex: none; }
  .tf-btns { display: grid; grid-template-columns: 1fr 1fr; }
  .tf-btns span { text-align: center; padding: 10px 12px; }
  .opt { padding: 12px; }
  .at-bar { bottom: calc(8px + env(safe-area-inset-bottom)); flex-direction: column; align-items: stretch; text-align: center; }
  .at-result { padding: 18px; }
  .modal-backdrop { padding: 0; align-items: end; }
  .modal { width: 100%; max-height: 92vh; border-radius: 20px 20px 0 0; padding: 22px 18px calc(22px + env(safe-area-inset-bottom)); }
  .modal.wide { width: 100%; }
  #toasts { left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); align-items: stretch; }
  .toast { max-width: none; }
  .prose { font-size: 15px; line-height: 1.7; }
  .prose h1 { font-size: 23px; }
  .prose h2 { font-size: 19px; }
  .prose pre { font-size: 13px; }
  .prose blockquote.callout-md { padding: 12px 14px; }
  .figure img { max-height: none; padding: 4px; }
  .dropzone { padding: 24px 14px; }
  .review header .row { flex-wrap: wrap; }
  .user-head { flex-direction: column; align-items: flex-start; }
  table.users th, table.users td { white-space: nowrap; }
  .auth-card { width: calc(100% - 32px); }
  .cred b { font-size: 14px; }
}
@media (max-width: 380px) {
  .stats { grid-template-columns: 1fr; }
  .content { padding: 16px 12px 60px; }
  .tabs { margin: 12px -12px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.tf-verdict.neutral { color: var(--muted); }
