/* Год до B2 — мобильный интерфейс. Базовая ширина: 360px (Galaxy S23), 384px (S23 Ultra). */

:root {
  --bg: #F2F3EF; --surface: #FFFFFF; --surface-2: #F6F7F3; --surface-3: #E9EBE5;
  --ink: #14181A; --ink-2: #4A5257; --ink-3: #7A838A; --line: #E1E4DC; --line-2: #CDD2C8;
  --accent: #1B4FD8; --accent-ink: #143FA8; --accent-soft: #E3E9FB; --on-accent: #FFFFFF;
  --ok: #1D8752; --ok-soft: #DDF2E5; --on-ok: #FFFFFF;
  --bad: #C0392B; --bad-soft: #FBE5E1;
  --warn: #A87B06; --warn-soft: #F7EDD0;
  --gold: #E0A30B; --flame: #EA5A0C; --ice: #3E9BD8;
  --shadow: 0 1px 2px rgba(20,24,26,.06), 0 10px 24px -16px rgba(20,24,26,.35);
  --shadow-up: 0 -8px 24px -16px rgba(20,24,26,.35);
  --r: 16px; --r-sm: 12px; --r-lg: 22px;
  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
  --font-ipa: "Noto Sans", "Segoe UI", "Lucida Grande", "DejaVu Sans", system-ui, sans-serif;
  --pair-0: #1B4FD8; --pair-1: #1D8752; --pair-2: #B45309; --pair-3: #9333EA; --pair-4: #DB2777; --pair-5: #0E7490;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E1113; --surface: #171B1E; --surface-2: #1D2226; --surface-3: #262C31;
    --ink: #ECEFEC; --ink-2: #AAB2B7; --ink-3: #737C82; --line: #283035; --line-2: #3A4247;
    --accent: #7FA3FF; --accent-ink: #A9C0FF; --accent-soft: #1A2645; --on-accent: #0A1128;
    --ok: #4CC38A; --ok-soft: #122E1E; --on-ok: #062012;
    --bad: #F07F72; --bad-soft: #3A1E1A;
    --warn: #E6B84E; --warn-soft: #33290F;
    --gold: #F2C14E; --flame: #FF8A3D; --ice: #6CC0F2;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 24px -16px rgba(0,0,0,.8);
    --shadow-up: 0 -8px 24px -16px rgba(0,0,0,.9);
    --pair-0: #7FA3FF; --pair-1: #4CC38A; --pair-2: #F59E0B; --pair-3: #C084FC; --pair-4: #F472B6; --pair-5: #22D3EE;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0E1113; --surface: #171B1E; --surface-2: #1D2226; --surface-3: #262C31;
  --ink: #ECEFEC; --ink-2: #AAB2B7; --ink-3: #737C82; --line: #283035; --line-2: #3A4247;
  --accent: #7FA3FF; --accent-ink: #A9C0FF; --accent-soft: #1A2645; --on-accent: #0A1128;
  --ok: #4CC38A; --ok-soft: #122E1E; --on-ok: #062012;
  --bad: #F07F72; --bad-soft: #3A1E1A;
  --warn: #E6B84E; --warn-soft: #33290F;
  --gold: #F2C14E; --flame: #FF8A3D; --ice: #6CC0F2;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 24px -16px rgba(0,0,0,.8);
  --shadow-up: 0 -8px 24px -16px rgba(0,0,0,.9);
  --pair-0: #7FA3FF; --pair-1: #4CC38A; --pair-2: #F59E0B; --pair-3: #C084FC; --pair-4: #F472B6; --pair-5: #22D3EE;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font);
  font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent; min-height: 100dvh;
}
body.player-page { overscroll-behavior-y: contain; }
h1, h2, h3, h4 { margin: 0; line-height: 1.22; text-wrap: balance; }
h1 { font-size: 26px; font-weight: 750; letter-spacing: -.02em; }
h2 { font-size: 20px; font-weight: 720; letter-spacing: -.01em; }
h3 { font-size: 17px; font-weight: 700; }
p { margin: 0; }
a { color: var(--accent-ink); text-underline-offset: 3px; }
img, svg { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.i.fill { fill: currentColor; stroke: none; }
.i.sm { width: 18px; height: 18px; }
.i.lg { width: 28px; height: 28px; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: 14px; }
.tiny { font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }

/* ---------- каркас ---------- */
.page {
  max-width: 560px; margin: 0 auto;
  padding: max(10px, var(--safe-t)) 16px calc(var(--nav-h) + var(--safe-b) + 28px);
}
.page.no-nav { padding-bottom: calc(28px + var(--safe-b)); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-lg { display: flex; flex-direction: column; gap: 20px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 10px; min-height: 52px; margin-bottom: 6px; }
.topbar h1 { flex: 1; min-width: 0; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 8px 2px 0; }
.section-title h2 { font-size: 18px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.card.pad-sm { padding: 12px 14px; }
.card.flat { box-shadow: none; }
.card.link { display: block; text-decoration: none; color: inherit; }
.card.link.row { display: flex; }
.card.link:active { transform: scale(.99); }
.divider { height: 1px; background: var(--line); margin: 4px 0; }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 20px; border-radius: 14px; border: 0;
  font-size: 16px; font-weight: 650; text-decoration: none; touch-action: manipulation;
  transition: transform .08s ease, background-color .15s ease, opacity .15s ease; user-select: none;
  background: var(--surface-2); color: var(--ink);
}
.btn:active { transform: scale(.98); }
.btn[disabled], .btn.disabled { opacity: .45; pointer-events: none; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-ok { background: var(--ok); color: var(--on-ok); }
.btn-bad { background: var(--bad); color: #fff; }
.btn-soft { background: var(--accent-soft); color: var(--accent-ink); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-line { background: transparent; border: 1.5px solid var(--line-2); color: var(--ink); }
.btn-block { width: 100%; }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: 14.5px; border-radius: 11px; }
.btn-icon { width: 44px; min-height: 44px; height: 44px; padding: 0; border-radius: 50%; background: transparent; color: var(--ink-2); }
.btn-icon:active { background: var(--surface-3); }
.btn-round { width: 56px; height: 56px; min-height: 56px; padding: 0; border-radius: 50%; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; font-weight: 650; color: var(--ink-2);
  white-space: nowrap;
}
.chip.accent { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }
.chip.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.chip.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.chip.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.chip.flame { color: var(--flame); }
.chip .i { width: 16px; height: 16px; }

.bar { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: inherit; background: var(--accent); width: 0; transition: width .4s ease; }
.bar.ok > span { background: var(--ok); }
.bar.thin { height: 5px; }

.stars { display: inline-flex; gap: 1px; color: var(--line-2); }
.stars .i { width: 16px; height: 16px; }
.stars .on { color: var(--gold); }

/* ---------- нижняя навигация ---------- */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, 1fr);
}
.nav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--ink-3); text-decoration: none; font-size: 11px; font-weight: 650; position: relative;
  min-height: 48px; touch-action: manipulation;
}
.nav a .i { width: 24px; height: 24px; }
.nav a.active { color: var(--accent); }
.nav a.active .pill { background: var(--accent-soft); }
.nav .pill { display: grid; place-items: center; width: 56px; height: 30px; border-radius: 999px; transition: background-color .2s; }
.nav .badge {
  position: absolute; top: 6px; left: calc(50% + 8px); min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--bad); color: #fff; font-size: 11px; line-height: 18px; text-align: center;
}
@media (min-width: 720px) {
  .nav { left: 50%; right: auto; width: 560px; transform: translateX(-50%); border: 1px solid var(--line); border-bottom: 0; border-radius: 18px 18px 0 0; }
}

/* ---------- экран «Сегодня» ---------- */
.today-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-top: 6px; }
.today-head .date { font-size: 14px; color: var(--ink-3); font-weight: 600; }
.today-head h1 { font-size: 23px; }
.streak-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); font-weight: 750; font-size: 15px; text-decoration: none; color: var(--ink);
}
.streak-pill .i { color: var(--flame); }
.streak-pill.cold .i { color: var(--ink-3); }

.hero {
  position: relative; overflow: hidden; border-radius: var(--r-lg); padding: 18px;
  background: var(--accent); color: var(--on-accent);
}
.hero::after {
  content: ""; position: absolute; right: -40px; top: -40px; width: 170px; height: 170px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255,255,255,.18), transparent); pointer-events: none;
}
.hero .eyebrow { color: inherit; opacity: .75; }
.hero h2 { font-size: 21px; margin-top: 6px; }
.hero p { opacity: .88; margin-top: 6px; font-size: 15px; }
.hero .btn { margin-top: 14px; background: var(--on-accent); color: var(--accent); }
:root[data-theme="dark"] .hero .btn { color: var(--accent-soft); background: var(--accent-ink); }
.hero.consolidation { background: var(--ok); color: var(--on-ok); }
.hero.consolidation .btn { color: var(--ok); }
.hero.exam { background: #8A5A00; color: #fff; }
.hero.exam .btn { color: #8A5A00; }
.hero .meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.hero .meta .chip { background: rgba(255,255,255,.16); color: inherit; border-color: transparent; }

.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.week .d { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11.5px; color: var(--ink-3); font-weight: 650; }
.week .dot {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-2); border: 1.5px solid var(--line); color: var(--ink-3); font-size: 13px; font-weight: 700;
}
.week .d.met .dot { background: color-mix(in srgb, var(--flame) 16%, var(--surface)); border-color: color-mix(in srgb, var(--flame) 40%, transparent); color: var(--flame); }
.week .d.frozen .dot { background: color-mix(in srgb, var(--ice) 16%, var(--surface)); border-color: color-mix(in srgb, var(--ice) 45%, transparent); color: var(--ice); }
.week .d.today .dot { border: 2px solid var(--accent); }
.week .d.rest .dot { border-style: dashed; }
.week .d.future .dot { opacity: .6; }

.plan { display: flex; flex-direction: column; }
.plan-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line);
  text-decoration: none; color: inherit; min-height: 60px;
}
.plan-item:first-child { border-top: 0; }
.plan-item .txt { flex: 1; min-width: 0; }
.plan-item .t { font-weight: 650; font-size: 15.5px; line-height: 1.3; }
.plan-item .s { font-size: 13.5px; color: var(--ink-3); line-height: 1.35; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.plan-item .m { font-size: 13px; color: var(--ink-3); font-weight: 650; white-space: nowrap; }
.plan-item.done .t { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--line-2); }
.tick {
  width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line-2); display: grid; place-items: center;
  flex: none; background: transparent; padding: 0; color: transparent; transition: .15s;
}
.tick .i { width: 18px; height: 18px; stroke-width: 3; }
.plan-item.done .tick, .tick.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.kind-ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); flex: none; }
.kind-ico.lesson { background: var(--accent-soft); color: var(--accent-ink); }
.kind-ico.reviews { background: color-mix(in srgb, var(--gold) 18%, var(--surface)); color: var(--warn); }
.kind-ico.speaking { background: var(--bad-soft); color: var(--bad); }
.kind-ico.input { background: var(--ok-soft); color: var(--ok); }

.ring { width: 58px; height: 58px; flex: none; }
.ring circle { fill: none; stroke-width: 7; }
.ring .bg { stroke: var(--surface-3); }
.ring .fg { stroke: var(--ok); stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dashoffset .6s ease; }
.ring-wrap { position: relative; }
.ring-wrap .val { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12.5px; font-weight: 750; }

.mod-card .can { margin-top: 10px; font-size: 14.5px; color: var(--ink-2); display: flex; gap: 8px; }
.mod-card .can .i { color: var(--ok); margin-top: 1px; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 10px; }
.stat b { display: block; font-size: 21px; font-weight: 780; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat span { display: block; font-size: 12px; color: var(--ink-3); line-height: 1.3; margin-top: 2px; }
.notice { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--warn-soft); color: var(--ink); font-size: 14.5px; }
.notice.info { background: var(--accent-soft); }
.notice.ok { background: var(--ok-soft); }
.notice .i { flex: none; margin-top: 1px; }

/* ---------- путь ---------- */
.quarter-head { display: flex; gap: 12px; align-items: center; }
.quarter-badge { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-weight: 800; font-size: 17px; background: var(--accent); color: var(--on-accent); flex: none; }
.quarter-badge.locked { background: var(--surface-3); color: var(--ink-3); }
.module { border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.module > summary { list-style: none; padding: 14px 16px; display: flex; gap: 12px; align-items: center; cursor: pointer; }
.module > summary::-webkit-details-marker { display: none; }
.module .mid { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 14px; background: var(--surface-2); color: var(--ink-2); flex: none; }
.module.current .mid { background: var(--accent-soft); color: var(--accent-ink); }
.module.complete .mid { background: var(--ok-soft); color: var(--ok); }
.module .chev { transition: transform .2s; color: var(--ink-3); }
.module[open] .chev { transform: rotate(90deg); }
.lesson-list { border-top: 1px solid var(--line); }
.lesson-row {
  display: flex; align-items: center; gap: 12px; padding: 11px 16px; text-decoration: none; color: inherit;
  border-top: 1px solid var(--line); min-height: 56px;
}
.lesson-row:first-child { border-top: 0; }
.lesson-row .lid { font-size: 12px; font-weight: 750; color: var(--ink-3); width: 38px; flex: none; font-variant-numeric: tabular-nums; }
.lesson-row .lt { flex: 1; min-width: 0; font-size: 15px; line-height: 1.3; }
.lesson-row.locked { color: var(--ink-3); }
.lesson-row.current { background: var(--accent-soft); }
.lesson-row .st { flex: none; }
.status-ico { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; }
.status-ico.passed { background: var(--ok); color: #fff; }
.status-ico.review { background: var(--warn-soft); color: var(--warn); }
.status-ico.locked { color: var(--ink-3); }
.status-ico.open { border: 2px solid var(--accent); color: var(--accent); }
.status-ico .i { width: 16px; height: 16px; stroke-width: 2.6; }
.cons-row { display: flex; gap: 10px; align-items: center; padding: 10px 16px; font-size: 13.5px; color: var(--ink-2); background: var(--surface-2); border-top: 1px solid var(--line); }
.outline .module { opacity: .8; }

/* ---------- плеер урока и теста ---------- */
.player { min-height: 100dvh; display: flex; flex-direction: column; max-width: 640px; margin: 0 auto; }
.player-head {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px;
  padding: max(8px, var(--safe-t)) 10px 8px; background: color-mix(in srgb, var(--bg) 94%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.player-head .bar { flex: 1; height: 10px; }
.player-head .count { font-size: 13px; font-weight: 700; color: var(--ink-3); min-width: 42px; text-align: right; font-variant-numeric: tabular-nums; }
.player-body { flex: 1; padding: 6px 16px 24px; }
.player-foot {
  position: sticky; bottom: 0; z-index: 20; padding: 12px 16px calc(12px + var(--safe-b));
  background: linear-gradient(to top, var(--bg) 70%, color-mix(in srgb, var(--bg) 0%, transparent));
  display: flex; gap: 10px;
}
.player-foot .btn { flex: 1; }
.step-label { display: flex; align-items: center; gap: 8px; margin: 6px 0 14px; }
.steps-dots { display: flex; gap: 5px; }

.prose { font-size: 17px; line-height: 1.62; }
.prose > * + * { margin-top: 12px; }
.prose h3 { font-size: 18px; margin-top: 20px; }
.prose ul, .prose ol { padding-left: 22px; margin: 10px 0; }
.prose li + li { margin-top: 6px; }
.prose strong { font-weight: 700; }
.prose code { font-size: .9em; background: var(--surface-2); border: 1px solid var(--line); padding: 1px 5px; border-radius: 6px; }
.prose blockquote { margin: 14px 0; padding: 10px 14px; border-left: 3px solid var(--accent); background: var(--surface); border-radius: 0 12px 12px 0; }
.prose blockquote p + p { margin-top: 8px; }
.prose s, .prose del { color: var(--bad); text-decoration-thickness: 1.5px; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 14px -16px; padding: 0 16px; }
.table-wrap table { border-collapse: separate; border-spacing: 0; min-width: 100%; font-size: 15px; line-height: 1.4; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.table-wrap th { background: var(--surface-2); font-size: 12.5px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.table-wrap th, .table-wrap td { padding: 9px 11px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.table-wrap td { min-width: 64px; }
.table-wrap tr:last-child td { border-bottom: 0; }
.ipa { font-family: var(--font-ipa); color: var(--accent-ink); white-space: nowrap; font-style: normal; }
em.say, .say { color: var(--accent-ink); text-decoration: underline dotted 1.5px; text-underline-offset: 4px; cursor: pointer; border-radius: 4px; }
em.say:active, .say.playing { background: var(--accent-soft); }
.say-para { display: flex; align-items: flex-start; gap: 10px; }
.say-para > span { flex: 1; }
.say-btn {
  width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--accent-soft); color: var(--accent-ink);
  display: grid; place-items: center; flex: none; padding: 0; touch-action: manipulation;
}
.say-btn .i { width: 18px; height: 18px; }
.say-btn.playing { background: var(--accent); color: var(--on-accent); }
.hint-tip { display: flex; gap: 8px; align-items: center; font-size: 13.5px; color: var(--ink-3); padding: 8px 12px; border-radius: 10px; background: var(--surface-2); }

.goal-card { text-align: left; }
.goal-card .big { font-size: 19px; font-weight: 700; line-height: 1.35; }
.can-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.can-list li { display: flex; gap: 10px; align-items: flex-start; font-size: 16px; }
.can-list .i { color: var(--ok); margin-top: 2px; }
.konspekt-box { font-size: 17px; padding: 16px; border-radius: var(--r); background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 25%, transparent); }
.konspekt-box p + p { margin-top: 8px; }

.words { display: flex; flex-direction: column; }
.word { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 13px 0; border-bottom: 1px solid var(--line); align-items: start; }
.word:last-child { border-bottom: 0; }
.word .en { font-size: 19px; font-weight: 700; line-height: 1.25; }
.word .ru { color: var(--ink-2); font-size: 15.5px; grid-column: 1; }
.word .ex { color: var(--ink-3); font-size: 14.5px; font-style: italic; grid-column: 1; }
.word .acts { grid-column: 2; grid-row: 1 / span 3; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.known-btn { border: 1.5px solid var(--line-2); background: transparent; border-radius: 999px; padding: 5px 10px; font-size: 12.5px; font-weight: 700; color: var(--ink-3); min-height: 32px; }
.known-btn.on { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.word.known { opacity: .6; }
.flip-card { perspective: 900px; }
.mini-card { border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); padding: 14px; min-height: 78px; display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.mini-card .kind { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.mini-card .back { display: none; color: var(--ink-2); border-top: 1px dashed var(--line-2); padding-top: 6px; }
.mini-card.open .back { display: block; }
.cloze { background: var(--accent-soft); color: var(--accent-ink); padding: 0 6px; border-radius: 6px; font-weight: 700; }
.cloze-ans { color: var(--accent-ink); }

.task { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.task .n { width: 26px; height: 26px; border-radius: 8px; background: var(--surface-2); display: grid; place-items: center; font-size: 13px; font-weight: 750; flex: none; }
.task.done { border-color: color-mix(in srgb, var(--ok) 50%, transparent); }
.task textarea { min-height: 130px; }
.lt-list { display: flex; flex-direction: column; gap: 8px; font-size: 14.5px; }
.lt-item { padding: 10px 12px; border-radius: 10px; background: var(--bad-soft); }
.lt-item .frag { font-weight: 700; color: var(--bad); }
.lt-item .fix { font-weight: 700; color: var(--ok); }

/* ---------- запись голоса ---------- */
.rec { display: flex; flex-direction: column; gap: 8px; }
.rec-row { display: flex; align-items: center; gap: 10px; }
.rec-btn { width: 48px; height: 48px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--bad-soft); color: var(--bad); flex: none; }
.rec-btn.on { background: var(--bad); color: #fff; animation: pulse 1.2s ease-in-out infinite; }
.rec-time { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink-2); min-width: 44px; }
.rec audio { width: 100%; height: 40px; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--bad) 45%, transparent); } 50% { box-shadow: 0 0 0 10px transparent; } }

/* ---------- вопросы ---------- */
.q-part { font-size: 12.5px; font-weight: 700; color: var(--ink-3); letter-spacing: .05em; text-transform: uppercase; }
.q-prompt { font-size: 21px; font-weight: 700; line-height: 1.35; margin: 8px 0 18px; }
.q-passage { font-size: 16px; line-height: 1.55; padding: 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); margin-bottom: 14px; max-height: 38dvh; overflow: auto; }
.q-audio { display: flex; gap: 12px; align-items: center; margin: 4px 0 18px; }
.q-audio .play { width: 72px; height: 72px; border-radius: 50%; border: 0; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; box-shadow: var(--shadow); }
.q-audio .play .i { width: 32px; height: 32px; }
.q-audio .slow { min-height: 44px; }
.opts { display: flex; flex-direction: column; gap: 10px; }
.opt {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 58px; padding: 12px 14px;
  border: 2px solid var(--line); border-radius: 14px; background: var(--surface); text-align: left;
  font-size: 17px; line-height: 1.35; box-shadow: 0 2px 0 var(--line); touch-action: manipulation; transition: .12s;
}
.opt .key { width: 28px; height: 28px; border-radius: 8px; background: var(--surface-2); color: var(--ink-3); display: grid; place-items: center; font-size: 13px; font-weight: 750; flex: none; }
.opt.sel { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 2px 0 var(--accent); }
.opt.sel .key { background: var(--accent); color: var(--on-accent); }
.opt.ok { border-color: var(--ok); background: var(--ok-soft); box-shadow: 0 2px 0 var(--ok); }
.opt.ok .key { background: var(--ok); color: #fff; }
.opt.bad { border-color: var(--bad); background: var(--bad-soft); box-shadow: 0 2px 0 var(--bad); }
.opt.bad .key { background: var(--bad); color: #fff; }
.opts.locked .opt { pointer-events: none; }
.q-input { font-size: 19px !important; }
.answer-line { min-height: 64px; display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start; padding: 10px 0 14px; border-bottom: 2px dashed var(--line-2); margin-bottom: 18px; }
.tokens { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.tok {
  min-height: 46px; padding: 8px 14px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface);
  font-size: 17px; box-shadow: 0 2px 0 var(--line); touch-action: manipulation;
}
.tok.used { visibility: hidden; }
.match { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.match .col { display: flex; flex-direction: column; gap: 10px; }
.m-item { min-height: 54px; padding: 8px 10px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); font-size: 16px; box-shadow: 0 2px 0 var(--line); text-align: center; touch-action: manipulation; }
.m-item.sel { border-color: var(--accent); background: var(--accent-soft); }
.m-item[data-pair] { border-color: var(--pc); background: color-mix(in srgb, var(--pc) 14%, var(--surface)); box-shadow: 0 2px 0 var(--pc); }
.m-item.ok { border-color: var(--ok); background: var(--ok-soft); }
.m-item.bad { border-color: var(--bad); background: var(--bad-soft); }

/* ---------- нижний лист: результат ответа, подсказка ---------- */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(8,10,12,.4); z-index: 60; opacity: 0; pointer-events: none; transition: opacity .2s; }
.sheet-backdrop.open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 61; max-width: 640px; margin: 0 auto;
  padding: 18px 16px calc(16px + var(--safe-b)); border-radius: 22px 22px 0 0; background: var(--surface);
  box-shadow: var(--shadow-up); transform: translateY(105%); transition: transform .24s cubic-bezier(.2,.9,.3,1);
  max-height: 86dvh; overflow: auto;
}
.sheet.open { transform: translateY(0); }
.sheet.ok { background: var(--ok-soft); }
.sheet.bad { background: var(--bad-soft); }
.sheet .grab { width: 40px; height: 4px; border-radius: 4px; background: var(--line-2); margin: -6px auto 12px; }
.sheet .res-title { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 780; }
.sheet.ok .res-title { color: var(--ok); }
.sheet.bad .res-title { color: var(--bad); }
.sheet .res-body { margin: 10px 0 14px; font-size: 16px; }
.sheet .res-body .prose { font-size: 16px; }

/* ---------- повторения ---------- */
.flash {
  min-height: min(52dvh, 420px); border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow); padding: 22px 18px; display: flex; flex-direction: column; justify-content: center;
  align-items: center; text-align: center; gap: 12px; position: relative;
}
.flash .kind { position: absolute; top: 12px; left: 14px; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.flash .new-tag { position: absolute; top: 10px; right: 12px; }
.flash .front { font-size: 26px; font-weight: 750; line-height: 1.3; }
.flash .front.long { font-size: 20px; }
.flash .back { font-size: 20px; color: var(--ink); line-height: 1.4; }
.flash .back .prose { font-size: 17px; text-align: left; }
.flash .sub { color: var(--ink-2); font-size: 16px; }
.flash .ex { color: var(--ink-3); font-style: italic; font-size: 15px; }
.flash .answer { width: 100%; border-top: 1px dashed var(--line-2); padding-top: 14px; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.rates { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: 100%; }
.rate { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 60px; padding: 8px 4px; border-radius: 14px; border: 0; font-weight: 700; font-size: 14.5px; }
.rate small { font-weight: 600; font-size: 11.5px; opacity: .8; }
.rate.r1 { background: var(--bad-soft); color: var(--bad); }
.rate.r2 { background: var(--warn-soft); color: var(--warn); }
.rate.r3 { background: var(--ok-soft); color: var(--ok); }
.rate.r4 { background: var(--accent-soft); color: var(--accent-ink); }
.review-top { display: flex; gap: 8px; align-items: center; }

/* ---------- экран «Я» ---------- */
.heat-wrap { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
.heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 13px); gap: 3px; width: max-content; }
.heat i { width: 13px; height: 13px; border-radius: 3px; background: var(--surface-3); display: block; }
.heat i[data-l="-1"] { background: transparent; }
.heat i[data-l="1"] { background: color-mix(in srgb, var(--ok) 25%, var(--surface-3)); }
.heat i[data-l="2"] { background: color-mix(in srgb, var(--ok) 50%, var(--surface-3)); }
.heat i[data-l="3"] { background: color-mix(in srgb, var(--ok) 75%, var(--surface-3)); }
.heat i[data-l="4"] { background: var(--ok); }
.heat i[data-l="5"] { background: var(--ice); }
.heat-legend { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--ink-3); margin-top: 8px; }
.heat-legend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; vertical-align: -1px; margin-right: 4px; }
.bars { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; align-items: end; height: 120px; }
.bars .b { display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.bars .b span { width: 100%; max-width: 30px; border-radius: 6px 6px 3px 3px; background: color-mix(in srgb, var(--accent) 45%, var(--surface-3)); min-height: 3px; }
.bars .b.cur span { background: var(--accent); }
.bars .b small { font-size: 10.5px; color: var(--ink-3); white-space: nowrap; }
.bars .b em { font-style: normal; font-size: 11px; font-weight: 700; color: var(--ink-2); }
.ach-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ach { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line); text-align: center; }
.ach .ico { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--gold) 20%, var(--surface)); color: var(--warn); }
.ach .t { font-size: 13px; font-weight: 700; line-height: 1.25; }
.ach .d { font-size: 11.5px; color: var(--ink-3); line-height: 1.3; }
.ach.locked .ico { background: var(--surface-2); color: var(--ink-3); }
.ach.locked { opacity: .55; }
.level-ladder { display: flex; flex-direction: column; gap: 0; }
.level-step { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.level-step:first-child { border-top: 0; }
.level-step .lv { width: 46px; height: 32px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; font-size: 13px; background: var(--surface-2); color: var(--ink-2); flex: none; }
.level-step.ready .lv { background: var(--accent-soft); color: var(--accent-ink); }

/* ---------- формы ---------- */
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 650; color: var(--ink-2); }
input[type=text], input[type=password], input[type=number], input[type=time], input[type=date], select, textarea {
  width: 100%; min-height: 50px; padding: 12px 14px; border: 1.5px solid var(--line-2); border-radius: 12px;
  background: var(--surface); color: var(--ink); font-size: 17px; font-weight: 500; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { resize: vertical; line-height: 1.5; }
.days { display: flex; flex-direction: column; }
.day-row { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.day-row:first-child { border-top: 0; }
.day-row .dn { font-weight: 750; color: var(--ink-2); }
.stepper { display: flex; align-items: center; gap: 4px; }
.stepper button { width: 44px; height: 44px; border-radius: 12px; border: 0; background: var(--surface-2); display: grid; place-items: center; }
.stepper output { min-width: 78px; text-align: center; font-weight: 750; font-variant-numeric: tabular-nums; }
.day-bar { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.day-bar span { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.seg { display: flex; padding: 4px; border-radius: 13px; background: var(--surface-2); border: 1px solid var(--line); }
.seg label { flex: 1; position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; }
.seg span { display: block; text-align: center; padding: 9px 6px; border-radius: 10px; font-size: 14.5px; font-weight: 650; color: var(--ink-2); }
.seg input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); }
.switch-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); min-height: 56px; }
.switch-row:first-child { border-top: 0; }
.switch-row .txt { flex: 1; }
.switch-row .txt small { display: block; color: var(--ink-3); font-size: 13px; }
.switch { position: relative; width: 52px; height: 32px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--line-2); transition: .2s; pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.choice-list { display: flex; flex-direction: column; gap: 10px; }
.choice {
  display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: var(--r); background: var(--surface);
  border: 2px solid var(--line); cursor: pointer; position: relative;
}
.choice input { position: absolute; opacity: 0; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice .t { font-weight: 700; }
.choice .s { font-size: 13.5px; color: var(--ink-3); }

/* ---------- авторизация и онбординг ---------- */
.auth { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: 24px 20px calc(24px + var(--safe-b)); max-width: 420px; margin: 0 auto; gap: 22px; }
.logo { display: flex; align-items: center; gap: 12px; }
.logo .mark { width: 52px; height: 52px; border-radius: 16px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-weight: 850; font-size: 20px; letter-spacing: -.03em; }
.error-box { padding: 12px 14px; border-radius: 12px; background: var(--bad-soft); color: var(--bad); font-size: 15px; font-weight: 600; }
.onb-step { display: none; }
.onb-step.active { display: flex; flex-direction: column; gap: 16px; }
.onb-dots { display: flex; gap: 6px; justify-content: center; }
.onb-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); }
.onb-dots i.on { width: 22px; border-radius: 8px; background: var(--accent); }
.baseline-text { font-size: 18px; line-height: 1.6; padding: 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }

/* ---------- тосты и праздник ---------- */
#toasts { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + var(--safe-b) + 12px); z-index: 80; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.no-nav #toasts, body.player-page #toasts { bottom: calc(96px + var(--safe-b)); }
.toast { max-width: 520px; padding: 12px 16px; border-radius: 14px; background: var(--ink); color: var(--bg); font-size: 15px; font-weight: 600; box-shadow: var(--shadow); animation: toast-in .25s ease; }
.toast.bad { background: var(--bad); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
.celebrate { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 24px; background: rgba(8,10,12,.5); animation: fade .2s ease; }
.celebrate .box { width: 100%; max-width: 340px; border-radius: 24px; background: var(--surface); padding: 26px 20px 20px; text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center; animation: pop .35s cubic-bezier(.2,1.4,.4,1); }
.celebrate .medal { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--gold) 22%, var(--surface)); color: var(--warn); }
.celebrate .medal .i { width: 42px; height: 42px; }
@keyframes pop { from { transform: scale(.7); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 95; }
.result-hero { text-align: center; padding: 18px 0 6px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.result-hero .pct { font-size: 54px; font-weight: 850; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.result-hero .stars .i { width: 36px; height: 36px; }
.result-hero .stars .on { animation: star-in .5s cubic-bezier(.2,1.6,.4,1) both; }
.result-hero .stars .on:nth-child(2) { animation-delay: .15s; }
.result-hero .stars .on:nth-child(3) { animation-delay: .3s; }
@keyframes star-in { from { transform: scale(0) rotate(-40deg); opacity: 0; } }

.chat { display: flex; flex-direction: column; gap: 10px; padding-bottom: 8px; }
.msg { max-width: 86%; padding: 10px 14px; border-radius: 18px; font-size: 16.5px; line-height: 1.45; white-space: pre-wrap; }
.msg.a { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.msg.u { align-self: flex-end; background: var(--accent); color: var(--on-accent); border-bottom-right-radius: 6px; }
.chat-input { display: flex; gap: 8px; align-items: flex-end; }
.chat-input textarea { min-height: 50px; max-height: 140px; }

.offline-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 70; padding: calc(6px + var(--safe-t)) 12px 6px; text-align: center; font-size: 13px; font-weight: 700; background: var(--warn); color: #fff; }

@media (min-width: 720px) {
  .page { padding-top: 24px; }
  h1 { font-size: 30px; }
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
  .ach-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
