/* ─────────────────────────────────────────────────────────────
   Тренажёр ЦЭ/ЦТ — оформление.
   Тёмная тема по умолчанию, светлая включается системной настройкой.
   Переменные --bg/--card/--text/--muted/--line/--accent переопределяет
   telegram.js, когда приложение открыто внутри Telegram.
   ───────────────────────────────────────────────────────────── */

:root {
  --bg: #080b18;
  --bg-2: #0d1226;
  --card: #131a30;
  --card-2: #1a2240;
  --text: #f2f5ff;
  --muted: #8f9cc4;
  --line: #232d52;
  --accent: #7c5cff;
  --accent-2: #00d4ff;
  --accent-text: #060a18;
  --brand: #7c5cff;
  --brand-2: #9a6bff;
  --brand-3: #00d4ff;
  --brand-grad: linear-gradient(135deg, #7c5cff 0%, #9a6bff 52%, #00d4ff 130%);
  --good: #3ddc97;
  --good-bg: rgba(61, 220, 151, 0.14);
  --bad: #ff7a8a;
  --bad-bg: rgba(255, 122, 138, 0.14);
  --warn: #ffb020;
  --warn-bg: rgba(255, 176, 32, 0.14);
  --shadow: 0 18px 44px rgba(3, 6, 18, 0.55);
  --shadow-soft: 0 8px 24px rgba(3, 6, 18, 0.35);
  --glow: 0 0 0 1px rgba(124, 92, 255, 0.35), 0 12px 40px rgba(124, 92, 255, 0.28);
  --radius: 20px;
  --font-display: "Unbounded", "Manrope", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --tg-top: 0px;
  --tg-bottom: 0px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  /* Подложка чертежей: строго непрозрачная, чтобы линии и подписи читались */
  --fig-bg: #0d1226;
  --fig-ink: #eef2ff;
  --fig-muted: #a8b3d6;
  --fig-accent: #8f7bff;
  --fig-grid: #2a3560;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f5fc;
    --bg-2: #eceffb;
    --card: #ffffff;
    --card-2: #f1f3fc;
    --text: #10142a;
    --muted: #5b6480;
    --line: #dfe2f2;
    --accent: #6244f0;
    --accent-2: #0aa6d6;
    --accent-text: #ffffff;
    --good: #0f8a5b;
    --good-bg: rgba(15, 138, 91, 0.12);
    --bad: #c62d42;
    --bad-bg: rgba(198, 45, 66, 0.1);
    --warn: #a86200;
    --warn-bg: rgba(168, 98, 0, 0.12);
    --shadow: 0 14px 34px rgba(20, 28, 68, 0.1);
    --shadow-soft: 0 8px 22px rgba(20, 28, 68, 0.07);
    --glow: 0 0 0 1px rgba(98, 68, 240, 0.25), 0 10px 30px rgba(98, 68, 240, 0.18);
    --fig-bg: #ffffff;
    --fig-ink: #10142a;
    --fig-muted: #4d5775;
    --fig-accent: #4f37d6;
    --fig-grid: #dfe3f2;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--font-body);
  overscroll-behavior-y: contain;
  -webkit-tap-highlight-color: transparent;
  padding-bottom: calc(84px + var(--safe-bottom) + var(--tg-bottom));
  background-image: radial-gradient(900px 420px at 50% -10%, rgba(124, 92, 255, 0.26), transparent 70%), radial-gradient(700px 380px at 110% 8%, rgba(0, 212, 255, 0.14), transparent 65%);
  background-attachment: fixed;
}

h1, h2, .hero .num-big b, .brand-text, .price-big { font-family: var(--font-display); }
h1 { font-size: 27px; line-height: 1.2; letter-spacing: -0.02em; margin: 8px 0 12px; text-wrap: balance; font-weight: 700; }
h2 { font-size: 17px; letter-spacing: -0.01em; margin: 0 0 10px; font-weight: 700; }
h3 { font-size: 16px; margin: 0 0 8px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.note { font-size: 13px; color: var(--muted); margin: 12px 0 0; }
.error { color: var(--bad); }
.ok { color: var(--good); }
a { color: var(--accent); }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

/* ── Верхняя панель */
.top-wrap {
  position: sticky; top: 0; z-index: 20;
  padding-top: var(--tg-top);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: 760px; margin: 0 auto; padding: 10px 16px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; }
.brand .logo {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 11px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-size: 12px; font-weight: 800; letter-spacing: -0.02em;
}
.brand-text { font-size: 16px; }
.brand-text i { display: block; font-style: normal; font-size: 11px; font-weight: 500; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }
.top-right { display: flex; align-items: center; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line);
  font-size: 13px; font-weight: 600; color: var(--text); text-decoration: none;
  white-space: nowrap;
}
.chip.hot { border-color: color-mix(in srgb, var(--warn) 55%, transparent); color: var(--warn); }

/* ── Нижнее меню */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  max-width: 760px; margin: 0 auto;
  padding: 8px 8px calc(8px + var(--safe-bottom));
  background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
}
.tabs[hidden] { display: none; }
.tabs a {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 2px; border-radius: 12px;
  color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 600;
  touch-action: manipulation;
}
.tabs svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tabs a.active { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }

main { max-width: 760px; margin: 0 auto; padding: 16px 16px 24px; }

/* ── Карточки */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.card.flat { box-shadow: none; }
.card.tight { padding: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.card-head h2 { margin: 0; }

.tile {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
}

/* ── Кнопки */
button, .btn {
  font: inherit; font-weight: 650;
  border: 0; border-radius: 14px;
  padding: 13px 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px;
  touch-action: manipulation;
  transition: transform 0.08s ease, filter 0.15s ease;
}
button:active, .btn:active { transform: scale(0.98); }
button:disabled { opacity: 0.5; cursor: default; transform: none; }
button.ghost, .btn.ghost {
  background: transparent; color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line);
}
button.soft, .btn.soft { background: var(--card-2); color: var(--text); box-shadow: none; }
button.wide, .btn.wide { width: 100%; }
button.link { background: none; box-shadow: none; padding: 0; min-height: 0; color: var(--muted); font-size: 13px; text-decoration: underline; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 10px; }

/* ── Поля */
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; }
input[type=text], input[type=date], input[type=number], textarea, select {
  font: inherit; width: 100%;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--bg);
  color: var(--text);
}
input:focus, textarea:focus, select:focus { outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 1px; }
textarea { min-height: 84px; resize: vertical; }
.field { margin-bottom: 13px; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; }
.switch input { width: 22px; height: 22px; accent-color: var(--accent); }

/* ── Метки */
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 600;
  padding: 4px 10px; border-radius: 999px;
  background: var(--card-2); border: 1px solid var(--line); color: var(--muted);
  margin: 0 6px 10px 0;
}
.tag.accent { background: color-mix(in srgb, var(--accent) 16%, transparent); border-color: transparent; color: var(--accent); }
.tag.ok { background: var(--good-bg); border-color: transparent; color: var(--good); }
.tag.warn { background: var(--warn-bg); border-color: transparent; color: var(--warn); }
.pill { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--card-2); color: var(--muted); border: 1px solid var(--line); }
.pill.on { background: var(--good-bg); color: var(--good); border-color: transparent; }

/* ── Прогноз: большое число и кольцо */
.hero { display: flex; align-items: center; gap: 18px; margin: 2px 0 14px; }
.hero .num-big { display: flex; flex-direction: column; }
.hero .num-big span { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.hero .num-big b { font-size: 58px; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.hero .goal-line { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.hero .goal-line b { font-size: 20px; color: var(--text); }
.ring {
  --p: 40;
  position: relative; flex: 0 0 auto;
  width: 92px; height: 92px; border-radius: 50%;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--line) 0);
  display: grid; place-items: center;
  margin-left: auto;
}
.ring::after {
  content: ""; position: absolute; inset: 8px; border-radius: 50%; background: var(--card);
}
.ring b { position: relative; z-index: 1; font-size: 19px; font-variant-numeric: tabular-nums; }

/* ── Статистика */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 13px; }
.stat b { display: block; font-size: 24px; line-height: 1.1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--muted); }
.stat b.sm { font-size: 17px; }

/* ── Календарь занятий */
.cal { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; margin: 10px 0 4px; }
.cal i {
  display: block; height: 26px; border-radius: 6px;
  background: var(--card-2); box-shadow: inset 0 0 0 1px var(--line);
}
.cal i.done { background: linear-gradient(180deg, var(--good), color-mix(in srgb, var(--good) 70%, #000)); box-shadow: none; }
.cal i.today { outline: 2px solid var(--accent); outline-offset: 1px; }
.cal-legend { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }

/* ── Мини-график прогноза */
.spark { display: block; width: 100%; height: 34px; }
.spark-wrap { display: flex; align-items: center; gap: 10px; margin: 12px 0 4px; }
.spark-wrap .spark { flex: 1; }

/* ── Прогресс */
.bar { height: 7px; border-radius: 4px; background: var(--line); overflow: hidden; }
.bar.big { height: 10px; }
.bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.bar i.mid { background: var(--warn); }
.bar i.low { background: var(--bad); }
.bar i.good { background: var(--good); }

/* ── Список уроков пути */
.lesson-card { display: block; text-decoration: none; color: inherit; }
.lesson-card .top-line { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.lesson-card .top-line .pill:first-child { margin-left: auto; }
.lesson-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.lesson-row:last-child { border-bottom: 0; }
.lesson-row .idx { font-size: 12px; color: var(--muted); width: 22px; font-variant-numeric: tabular-nums; }
.lesson-row .name { flex: 1; font-size: 15px; }
.lesson-row .stars { font-size: 13px; }

.skill { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: 14px; }
.skill .tag { margin: 0 0 0 auto; }
.stars { color: var(--warn); letter-spacing: 1px; white-space: nowrap; }
.stars i { font-style: normal; color: var(--line); }

a.topic { color: inherit; text-decoration: none; }
.topic { display: grid; grid-template-columns: 1fr 52px; gap: 4px 12px; align-items: center; margin-bottom: 12px; }
.topic .name { font-size: 14px; }
.topic .pct { text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; color: var(--muted); }
.topic .bar { grid-column: 1 / -1; }

/* ── Математика: дроби, степени, корни */
.frac {
  display: inline-flex; flex-direction: column; align-items: center;
  vertical-align: middle; margin: 0 2px; line-height: 1.15;
  font-size: 0.94em; text-align: center;
}
.frac-n { padding: 0 3px; border-bottom: 1.6px solid currentColor; }
.frac-d { padding: 0 3px; }
sup { font-size: 0.72em; line-height: 0; vertical-align: super; }
.sqrt { display: inline-flex; align-items: stretch; margin: 0 1px; white-space: nowrap; }
.sqrt-b { border-top: 1.6px solid currentColor; padding: 1px 3px 0 2px; margin-top: 0.55em; }
.task-text .frac { font-size: 1em; }
.option .frac { font-size: 0.98em; }
/* ── План на неделю и акценты оплаты */
.plan-card .week { display: flex; gap: 6px; margin: 10px 0 4px; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
.week-day {
  display: flex; flex-direction: column; gap: 3px; align-items: center; text-align: center;
  padding: 8px 4px; border-radius: 12px; background: var(--card-2); border: 1px solid var(--line);
  font-size: 11px; color: var(--muted); min-height: 64px; justify-content: center;
}
.week-day span { font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; font-size: 10px; }
.week-day b { font-size: 11px; color: var(--text); line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.week-day.empty { opacity: 0.55; }
@media (max-width: 480px) {
  .week-day b { font-size: 10px; }
  .week-day { padding: 6px 3px; min-height: 58px; }
}

.pay-hero { border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line)); }
.pay-hero .price-big { font-size: 40px; font-weight: 800; letter-spacing: -0.03em; margin: 4px 0 6px; }
.pay-off { opacity: 0.72; border-style: dashed; }
.plans.disabled { opacity: 0.6; }
.plans.disabled .plan { pointer-events: none; }
.hint-card.pay { background: color-mix(in srgb, var(--accent) 10%, var(--card)); border-left-color: var(--accent); }
.hint-card.pay .btn { margin-top: 8px; }
/* ── Подсказки под задачей */
.hints { margin-top: 12px; }
.small-btn { min-height: 38px; padding: 8px 12px; font-size: 14px; }
.hint-card {
  margin-top: 8px; padding: 12px 14px; border-radius: 13px;
  background: color-mix(in srgb, var(--warn) 10%, var(--card));
  border-left: 3px solid var(--warn);
}
.hint-card b { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--warn); margin-bottom: 4px; }
.hint-card p { margin: 0; font-size: 15px; }
/* ── Класс: 10 или 11 */
.grades { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.grades.four { grid-template-columns: repeat(4, 1fr); }
.grade {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px; border-radius: 13px; background: var(--card-2);
  border: 1px solid var(--line); color: var(--text); margin: 0;
  cursor: pointer; font-weight: 600; text-align: center;
}
.grade input { position: absolute; opacity: 0; pointer-events: none; }
.grade:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 40%, transparent); color: var(--accent); }

/* ── Задача */
.task-text { font-size: 18px; line-height: 1.45; margin-bottom: 16px; }
.options { display: grid; gap: 8px; margin-bottom: 14px; }
.option {
  display: flex; align-items: center; gap: 11px;
  padding: 13px 14px; border: 1px solid var(--line); border-radius: 13px;
  cursor: pointer; font-size: 16px; color: var(--text); margin: 0;
  background: var(--card);
}
.option:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 40%, transparent); }
.option input { accent-color: var(--accent); width: 18px; height: 18px; margin: 0; }
.verdict { border-radius: 13px; padding: 13px 15px; margin-bottom: 12px; font-weight: 650; }
.verdict.ok { background: var(--good-bg); color: var(--good); }
.verdict.no { background: var(--bad-bg); color: var(--bad); }
.solution { border-left: 3px solid var(--line); padding-left: 14px; margin-bottom: 14px; }
.rule { background: var(--card-2); border: 1px solid var(--line); border-radius: 13px; padding: 13px 15px; margin-bottom: 14px; }
.ai { white-space: pre-wrap; background: var(--card-2); border: 1px solid var(--line); border-radius: 13px; padding: 14px; margin: 12px 0; }
.ai.me { background: transparent; border-style: dashed; }
.thumb { display: block; max-width: 100%; max-height: 320px; border-radius: 13px; border: 1px solid var(--line); margin: 12px 0; object-fit: contain; }
.hint { margin: 10px 0 0; font-size: 14px; }
.dots { display: flex; gap: 6px; margin-bottom: 12px; }
.dots i { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.dots i.done { background: var(--good); }
.dots i.cur { background: var(--accent); }
ol.steps { margin: 8px 0 0; padding-left: 22px; }
ol.steps li { margin-bottom: 6px; }

/* ── Экзамен */
.exam-head {
  position: sticky; top: calc(56px + var(--tg-top)); z-index: 10;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  padding: 10px 0; margin-bottom: 8px;
}
.exam-head b { font-size: 20px; font-variant-numeric: tabular-nums; }
.exam-head button { padding: 9px 14px; min-height: 42px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 6px; margin-bottom: 16px; }
.num {
  padding: 9px 0; font-size: 13px; font-weight: 650; border-radius: 10px;
  background: var(--card); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line);
}
.num.done { color: var(--text); box-shadow: inset 0 0 0 2px var(--line); font-weight: 800; }
.num.cur { box-shadow: inset 0 0 0 2px var(--accent); color: var(--text); }
@media (max-width: 480px) {
  .exam-head b { font-size: 18px; }
  .exam-head .muted { font-size: 12px; }
}

/* ── Аккаунт и профиль */
.account {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; margin-bottom: 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
}
.account img, .account .avatar { width: 46px; height: 46px; border-radius: 50%; flex: 0 0 auto; object-fit: cover; }
.account .avatar {
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-weight: 800; font-size: 19px;
}
.account b { display: block; line-height: 1.3; }
.account span { font-size: 13px; color: var(--muted); }
.account .tag { margin: 0 0 0 auto; }

.profile-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }\n.profile-head .who { flex: 1 1 150px; min-width: 0; }\n.profile-head .who span { display: block; line-height: 1.35; }
.profile-head .avatar-lg {
  width: 64px; height: 64px; border-radius: 22px; flex: 0 0 auto;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-size: 26px; font-weight: 800;
  box-shadow: 0 10px 26px rgba(108, 140, 255, 0.35);
}
.profile-head .who b { display: block; font-size: 21px; letter-spacing: -0.02em; }
.profile-head .who span { font-size: 13px; color: var(--muted); }

.ach { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ach div {
  display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
  padding: 10px 6px; border-radius: 14px; background: var(--card-2); border: 1px solid var(--line);
  font-size: 11px; color: var(--muted);
}
.ach div span { font-size: 20px; filter: grayscale(1); opacity: 0.45; }
.ach div.done { border-color: color-mix(in srgb, var(--accent) 45%, transparent); color: var(--text); }
.ach div.done span { filter: none; opacity: 1; }
.ach-new { border-left: 3px solid var(--good); }
.ach-new b { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--good); }
.ach-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--card-2); border: 1px solid var(--line); font-size: 14px; font-weight: 600; }

/* ── Шпаргалка и теория */
.cheat { display: grid; gap: 6px; margin: 8px 0 0; }
.cheat code {
  display: block; padding: 9px 12px; border-radius: 11px;
  background: var(--card-2); border: 1px solid var(--line);
  font: 13px/1.45 ui-monospace, "SF Mono", Consolas, monospace; color: var(--text);
}
details { border-top: 1px solid var(--line); padding: 12px 0; }
details summary { cursor: pointer; font-weight: 650; }
details .task-text { font-size: 16px; margin: 12px 0; }
ul.rules { margin: 0; padding-left: 20px; }
ul.rules li { margin-bottom: 8px; }
ol.list { margin: 0; padding-left: 20px; }
ol.list li { margin-bottom: 8px; }

/* ── Тарифы и оплата */
.plans { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 12px 0; }
.plan {
  position: relative;
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  text-align: left; padding: 16px 14px; border-radius: 16px;
  background: var(--card-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line);
  min-height: 0;
}
.plan b { font-size: 25px; letter-spacing: -0.03em; }
.plan b s { font-size: 13px; font-weight: 500; text-decoration-thickness: 1px; }
.plan span { font-size: 14px; font-weight: 650; }
.plan em { font-style: normal; font-size: 12px; color: var(--muted); line-height: 1.35; }
.plan.accent { box-shadow: inset 0 0 0 2px var(--brand); background: color-mix(in srgb, var(--brand) 12%, var(--card)); }
.plan .badge {
  position: absolute; top: -10px; right: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff;
  font-size: 10px; font-weight: 800; padding: 3px 9px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.paywall {
  border: 1px solid var(--line);
  border-left: 3px solid var(--warn);
  background: var(--card); border-radius: 16px; padding: 15px 16px; margin: 12px 0;
}
.paywall b { display: block; margin-bottom: 6px; }
.paywall .btn, .paywall button { margin-top: 6px; }
.pay-panel { border: 1px dashed var(--line); border-radius: 16px; padding: 15px; margin: 12px 0; background: var(--card-2); }
.pay-panel p { margin: 0 0 8px; }
.pay-qr { display: block; margin: 10px auto; border-radius: 14px; background: #fff; padding: 10px; width: 220px; height: 220px; }
.pay-account { font-size: 15px; }
.pay-account code { font-size: 19px; font-weight: 800; letter-spacing: 0.06em; }

/* ── Цели при онбординге */
.goals { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.goal {
  display: block; text-align: center; padding: 14px 0;
  border: 1px solid var(--line); border-radius: 14px;
  font-size: 18px; font-weight: 700; color: var(--text); cursor: pointer; margin: 0;
  background: var(--card-2);
}
.goal input { position: absolute; opacity: 0; pointer-events: none; }
.goal:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 45%, transparent); color: var(--accent); }

/* ── Вход и привязка Telegram */
.steps-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--muted); }
.step-dot {
  display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent);
  font-size: 12px; font-weight: 800;
}
.steps-row span:not(.step-dot) { margin-right: 6px; }

/* ── Вход на сайт */
.login-code {
  font: 700 34px/1.1 ui-monospace, "SF Mono", Consolas, monospace;
  letter-spacing: 0.16em; margin: 4px 0 14px; color: var(--text);
}
pre.report {
  white-space: pre-wrap; font: 14px/1.6 ui-monospace, Consolas, monospace;
  background: var(--card-2); border: 1px solid var(--line); border-radius: 14px;
  padding: 15px; margin: 0 0 14px;
}

/* ── Рисунки к задачам: чертежи, тела и графики */
.figure {
  display: block; width: 100%; margin: 0 0 16px; padding: 10px 10px 6px;
  background: var(--fig-bg); border: 1px solid var(--line); border-radius: 14px;
  cursor: zoom-in; text-align: center;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--fig-ink) 6%, transparent);
}
.figure:active { box-shadow: 0 0 0 2px var(--accent) inset; }
.figure-svg { display: block; width: 100%; height: auto; }
.figure-hint { display: block; margin-top: 2px; font-size: 12px; font-weight: 400; color: var(--muted); }

.figure-svg .fig-shape { fill: var(--fig-accent); fill-opacity: .18; stroke: var(--fig-accent); stroke-width: 1.9; stroke-linejoin: round; }
.figure-svg .fig-face { fill: var(--fig-accent); fill-opacity: .18; stroke: var(--fig-accent); stroke-width: 1.9; stroke-linejoin: round; }
.figure-svg .fig-face-top { fill-opacity: .32; }
.figure-svg .fig-face-side { fill-opacity: .1; }
.figure-svg .fig-line { fill: none; stroke: var(--fig-ink); stroke-width: 1.8; stroke-linecap: round; }
.figure-svg .fig-mark { fill: none; stroke: var(--fig-muted); stroke-width: 1.3; }
.figure-svg .fig-label {
  fill: var(--fig-ink);
  font: 600 12px system-ui, -apple-system, "Segoe UI", sans-serif;
  paint-order: stroke fill; stroke: var(--fig-bg); stroke-width: 3.4px; stroke-linejoin: round;
}
.figure-svg .fig-tick {
  fill: var(--fig-muted);
  font: 10px system-ui, -apple-system, "Segoe UI", sans-serif;
  paint-order: stroke fill; stroke: var(--fig-bg); stroke-width: 2.6px;
}
.figure-modal .figure-svg .fig-label { stroke: var(--fig-bg); }
.figure-modal .figure-svg .fig-tick { stroke: var(--fig-bg); }
.figure-svg .fig-point { fill: var(--fig-ink); }
.figure-svg .fig-grid { stroke: var(--fig-grid); stroke-width: .8; }
.figure-svg .fig-axis { stroke: var(--fig-muted); stroke-width: 1.4; }
.figure-svg .fig-axis-fill { fill: var(--fig-muted); }
.figure-svg .fig-curve { stroke: var(--fig-ink); stroke-width: 2.4; stroke-linecap: round; }
.figure-svg .fig-tangent { stroke: var(--fig-accent); stroke-width: 2; stroke-dasharray: 7 4; }
.figure-svg .fig-guide { stroke: var(--fig-muted); stroke-width: 1.1; stroke-dasharray: 3 3; }

.figure-overlay {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center; padding: 16px;
  background: rgba(3, 6, 16, .82);
  backdrop-filter: blur(3px);
}
.figure-modal {
  width: min(100%, 560px); max-height: 90vh; overflow: auto;
  background: var(--card); border-radius: 20px; padding: 16px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .45);
}
.figure-modal .figure-svg { width: 100%; height: auto; }
.figure-modal .note { margin: 10px 0 14px; }
.figure-modal .btn { display: block; width: 100%; text-align: center; }

/* ── Мобильная адаптация */
@media (max-width: 480px) {
  h1 { font-size: 25px; }
  .card { padding: 15px; }
  .hero .num-big b { font-size: 52px; }
  .ring { width: 80px; height: 80px; }
  .plans { grid-template-columns: 1fr; }
  .ach { grid-template-columns: repeat(3, 1fr); }
  .cal { gap: 3px; }
  .cal i { height: 22px; }
  pre.report { font-size: 13px; line-height: 1.5; padding: 12px; }
  .login-code { font-size: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

@media print {
  .top-wrap, .tabs, .noprint { display: none !important; }
  body { background: #fff; padding: 0; background-image: none; }
  .card { box-shadow: none; border-color: #ddd; }
}

/* ─────────────────────────────────────────────────────────────
   Слой «конфетка»: анимации, крупная кнопка подписки, огонь серии
   ───────────────────────────────────────────────────────────── */
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes floatSlow { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes glowPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(124, 92, 255, 0.35); } 50% { box-shadow: 0 0 0 12px rgba(124, 92, 255, 0); } }
@keyframes flameWobble { 0%, 100% { transform: rotate(-3deg) scale(1); } 50% { transform: rotate(3deg) scale(1.08); } }
@keyframes shimmer { 0% { background-position: 0% 50%; } 100% { background-position: 200% 50%; } }

main > * { animation: fadeUp 0.36s cubic-bezier(0.2, 0.7, 0.3, 1) both; }
main > *:nth-child(2) { animation-delay: 0.03s; }
main > *:nth-child(3) { animation-delay: 0.06s; }
main > *:nth-child(4) { animation-delay: 0.09s; }
main > *:nth-child(5) { animation-delay: 0.12s; }
main > *:nth-child(n+6) { animation-delay: 0.15s; }

.card { border-radius: var(--radius); border-color: color-mix(in srgb, var(--line) 85%, transparent); }
.card:hover { border-color: color-mix(in srgb, var(--accent) 25%, var(--line)); }

/* Главная кнопка: градиент, блик и пульс */
button:not(.ghost):not(.link):not(.num):not(.figure):not(.plan):not(.option):not(.goal):not(.grade),
.btn:not(.ghost):not(.link):not(.plan) {
  background: var(--brand-grad);
  background-size: 160% 160%;
  box-shadow: 0 10px 26px rgba(124, 92, 255, 0.32);
  transition: transform 0.12s ease, box-shadow 0.2s ease, background-position 0.4s ease;
}
button:not(.ghost):not(.link):not(.num):not(.figure):not(.plan):not(.option):not(.goal):not(.grade):hover,
.btn:not(.ghost):not(.link):not(.plan):hover {
  background-position: 100% 50%;
  box-shadow: 0 14px 32px rgba(124, 92, 255, 0.4);
}
button.wide:not(.ghost), .btn.wide:not(.ghost) { animation: glowPulse 3.2s ease-in-out infinite; }
button:not(.num):not(.figure):active, .btn:active { transform: scale(0.975); }
.grid .num { background: var(--card); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.grid .num.done { background: var(--card); color: var(--text); box-shadow: inset 0 0 0 2px var(--line); }
.grid .num.cur { background: color-mix(in srgb, var(--brand) 16%, var(--card)); color: var(--text); box-shadow: inset 0 0 0 2px var(--brand); }
.figure { background: var(--fig-bg); }

/* Шапка: логотип-градиент и крупная кнопка подписки */
.brand .logo {
  border-radius: 13px;
  background: linear-gradient(135deg, #7c5cff, #00d4ff);
  box-shadow: 0 6px 18px rgba(124, 92, 255, 0.45);
  animation: floatSlow 5s ease-in-out infinite;
}
.top-right { gap: 8px; }
.chip { border-radius: 999px; transition: transform 0.12s ease, border-color 0.2s ease; }
.chip:active { transform: scale(0.96); }
.chip.hot {
  border-color: transparent;
  background: linear-gradient(135deg, rgba(255, 176, 32, 0.22), rgba(255, 92, 60, 0.18));
  color: #ffb020;
  font-weight: 800;
}
.chip.hot span.flame { display: inline-block; animation: flameWobble 1.6s ease-in-out infinite; }
.chip.cta {
  background: var(--brand-grad);
  color: #fff;
  border: 0;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 8px 22px rgba(124, 92, 255, 0.4);
  min-height: 40px;
}
.chip.cta::after { content: " →"; }

/* Промо подписки внутри приложения */
.promo-sub {
  position: relative;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--brand) 50%, var(--line));
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 20%, var(--card)), var(--card) 72%);
}
.promo-sub::before {
  content: "";
  position: absolute; inset: -40% -10% auto auto;
  width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 212, 255, 0.35), transparent 65%);
  pointer-events: none;
}
.promo-sub h2 { font-size: 21px; }
.promo-sub .price-line { font-size: 30px; font-weight: 850; letter-spacing: -0.03em; margin: 2px 0 4px; font-family: var(--font-display); }
.promo-sub ul { margin: 8px 0 12px; padding-left: 18px; font-size: 14px; color: var(--muted); }
.promo-sub li { margin-bottom: 4px; }

/* Экран знакомства */
.intro-stage { display: flex; flex-direction: column; gap: 14px; min-height: 60vh; justify-content: center; }
.intro-art {
  display: grid; place-items: center;
  height: 190px; border-radius: 26px;
  background: radial-gradient(120% 120% at 20% 0%, rgba(124, 92, 255, 0.35), transparent 60%),
              radial-gradient(120% 120% at 90% 100%, rgba(0, 212, 255, 0.28), transparent 55%),
              var(--card);
  border: 1px solid var(--line);
  font-size: 64px;
  animation: floatSlow 6s ease-in-out infinite;
}
.intro-dots { display: flex; gap: 6px; justify-content: center; margin: 4px 0 6px; }
.intro-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.intro-dots i.on { background: var(--accent); width: 20px; border-radius: 4px; }
.intro-skip { text-align: center; }

/* Связка/привязка аккаунта */
.link-hero { text-align: center; padding: 6px 0 2px; }
.link-hero .ico { font-size: 44px; display: block; margin-bottom: 6px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}@media (max-width: 430px) {
  .brand-text { font-size: 15px; }
  .brand-text i { display: none; }
  .chip.cta { padding: 9px 13px; font-size: 13px; }
  .chip.hot { padding: 6px 9px; }
}
/* «ИИ думает»: пульсирующий шар, этапы и полоска прогресса */
.thinking { display: flex; gap: 14px; align-items: center; padding: 14px 16px; margin: 0 0 14px; border-radius: 16px; background: var(--card, rgba(124,92,255,.08)); border: 1px solid rgba(124,92,255,.35); }
.think-orb { position: relative; width: 44px; height: 44px; flex: none; }
.think-orb span { position: absolute; inset: 0; border-radius: 50%; border: 3px solid transparent; border-top-color: #7c5cff; animation: think-spin 1.1s linear infinite; }
.think-orb span:nth-child(2) { inset: 6px; border-top-color: #00d4ff; animation-duration: .8s; animation-direction: reverse; }
.think-orb span:nth-child(3) { inset: 14px; background: radial-gradient(circle, #9a6bff, #7c5cff); border: 0; animation: think-pulse 1.2s ease-in-out infinite; }
.think-body { flex: 1; min-width: 0; display: grid; gap: 6px; }
.think-body b { font-size: 15px; }
.think-bar { height: 6px; border-radius: 3px; background: rgba(124,92,255,.15); overflow: hidden; }
.think-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #7c5cff, #00d4ff); transition: width .25s linear; }
@keyframes think-spin { to { transform: rotate(360deg); } }
@keyframes think-pulse { 0%, 100% { transform: scale(.75); opacity: .7; } 50% { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .think-orb span { animation: none; } }
.paywall.offer .offer-list { list-style: none; padding: 0; margin: 8px 0 10px; display: grid; gap: 6px; font-size: 14px; }

/* Первый экран: что внутри тренажёра */
.intro-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 14px 0 10px; }
.intro-tile { display: grid; gap: 2px; padding: 12px; border-radius: 16px; background: var(--card, #fff); border: 1px solid var(--line, rgba(124,92,255,.18)); }
.intro-tile span { font-size: 24px; line-height: 1; margin-bottom: 4px; }
.intro-tile b { font-size: 15px; }
.intro-tile small { color: var(--muted, #6b7393); font-size: 12.5px; line-height: 1.35; }

/* Поддержка: переписка */
.sup-thread { display: flex; flex-direction: column; gap: 8px; max-height: 50vh; overflow-y: auto; margin-bottom: 12px; }
.sup-msg { max-width: 85%; padding: 8px 12px; border-radius: 14px; white-space: pre-wrap; word-wrap: break-word; font-size: 14.5px; }
.sup-msg.me { align-self: flex-end; background: rgba(124,92,255,.18); border: 1px solid rgba(124,92,255,.4); }
.sup-msg.them { align-self: flex-start; background: var(--card-2, rgba(0,0,0,.04)); border: 1px solid var(--line, rgba(0,0,0,.08)); }
.sup-msg span { display: block; font-size: 11px; opacity: .65; margin-top: 4px; }
#supText { width: 100%; }

/* План недели: несколько уроков в дне, отметка «сделано» */
.week-day b + b { margin-top: 3px; }
.week-day b { display: block; }
.week-day.today { border-color: var(--accent, #7c5cff); }
.week-day .done-mark { color: var(--good, #3ddc97); }

/* Результат диагностики: первый урок наверху */
.first-lesson { border: 1px solid var(--accent, #7c5cff); }
.first-lesson h2 { margin: 8px 0 4px; }
.start-point { margin: 10px 0; }

/* Прогресс урока: зелёная точка — верно, красная — ошибка, тонкая — повтор с другими числами */
.dots i.bad { background: var(--bad, #ff7a8a); }
.dots i.skip { background: var(--muted, #8f9cc4); opacity: .5; }
.dots i.retry { height: 4px; align-self: center; }

/* E-POS не подключён и реквизитов нет — карточку не показываем (оплата звёздами и Boosty) */
.card.pay-off { display: none; }

/* Всплывающие подсказки и форма отзыва: лист снизу */
.sheet-pop { position: fixed; inset: 0; z-index: 50; background: rgba(5, 8, 20, .55); display: flex; align-items: flex-end; justify-content: center; animation: pop-fade .2s ease; }
.sheet-card { width: min(100%, 520px); background: var(--card, #fff); border-radius: 22px 22px 0 0; padding: 20px 18px calc(18px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 40px rgba(0,0,0,.25); animation: pop-up .25s ease; display: grid; gap: 10px; }
.sheet-card h3 { margin: 0; font-size: 20px; }
.sheet-card p { margin: 0; color: var(--muted, #6b7393); }
.pop-emoji { font-size: 40px; line-height: 1; }
.fb-kinds { display: flex; gap: 6px; flex-wrap: wrap; }
.fb-kinds .on { background: var(--accent, #7c5cff); color: #fff; }
.fb-stars { display: flex; gap: 4px; }
.fb-stars button { background: none; border: 0; font-size: 30px; color: #ffb020; padding: 0 2px; min-height: 0; box-shadow: none; }
#fbText { width: 100%; }
@keyframes pop-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pop-fade { from { opacity: 0; } to { opacity: 1; } }

/* ── Компактная полоса недели (вариант A) */
.week-dots { display: flex; gap: 6px; margin: 8px 0 10px; }
.week-dot {
  flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 8px 2px 6px; border-radius: 12px; background: var(--card-2);
  border: 1px solid transparent; min-width: 0;
}
.week-dot span { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.week-dot i {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-style: normal; font-size: 11px; font-weight: 800;
  background: color-mix(in srgb, var(--text) 8%, transparent); color: var(--muted);
}
.week-dot.has i { background: color-mix(in srgb, var(--brand) 30%, transparent); color: var(--text); }
.week-dot.today { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 14%, var(--card-2)); }
.week-dot.today i { background: var(--brand-grad); color: #fff; }
.week-dot.today span { color: var(--text); font-weight: 700; }
.week-today { font-size: 14px; color: var(--muted); margin: 0 0 6px; }
.week-today b { color: var(--text); }
.plan-card details summary { cursor: pointer; margin-top: 6px; }
.plan-card .week { margin-top: 10px; }
/* ── Скелетон первого кадра: пока подписка и прогресс едут из сети */
.hero-skeleton .num-big b { opacity: .35; }
.skeleton-card { display: flex; flex-direction: column; gap: 10px; }
.sk-line {
  height: 12px; border-radius: 8px;
  background: linear-gradient(90deg, var(--card-2), color-mix(in srgb, var(--text) 12%, var(--card-2)), var(--card-2));
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
.sk-line.w40 { width: 40%; }
.sk-line.w60 { width: 60%; }
.sk-line.w80 { width: 80%; }
.sk-btn { height: 46px; border-radius: 14px; background: color-mix(in srgb, var(--text) 8%, var(--card-2)); }
/* ── План недели списком: ровные строки, ничего не вылезает */
.plan-list { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 8px; }
.plan-row {
  display: grid; grid-template-columns: 84px 1fr auto; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 12px; background: var(--card-2);
  font-size: 14px; min-width: 0;
}
.plan-row.today { background: color-mix(in srgb, var(--brand) 16%, var(--card-2)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 55%, transparent); }
.plan-when { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); white-space: nowrap; }
.plan-row.today .plan-when { color: var(--text); font-weight: 700; }
.plan-topic { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.plan-count { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* ── Динамический верхний блок */
.lead-card { border: 1px solid color-mix(in srgb, var(--brand) 40%, var(--line)); background: linear-gradient(160deg, color-mix(in srgb, var(--brand) 14%, var(--card)), var(--card) 72%); }
.lead-card h2 { font-size: 21px; line-height: 1.25; margin: 6px 0 6px; }
.lead-task { border-color: color-mix(in srgb, var(--accent-2) 40%, var(--line)); }
/* ── Теория: поиск и аккуратные строки тем */
.search-row { margin: 4px 0 14px; }
.search-row input {
  width: 100%; padding: 12px 14px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--line); color: var(--text); font-size: 15px;
}
.theory-block { padding-bottom: 8px; }
.theory-topics { display: flex; flex-direction: column; }
.theory-row {
  display: grid; grid-template-columns: 1fr 90px 46px; align-items: center; gap: 10px;
  padding: 11px 2px; border-top: 1px solid var(--line); color: var(--text); text-decoration: none;
  min-width: 0;
}
.theory-row:first-child { border-top: 0; }
.theory-row:hover .theory-name { color: var(--brand); }
.theory-name { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.theory-bar { height: 6px; border-radius: 4px; background: var(--card-2); overflow: hidden; }
.theory-bar i { display: block; height: 100%; background: var(--brand-grad); border-radius: 4px; }
.theory-bar i.mid { background: linear-gradient(90deg, #ffb020, #ff8a3d); }
.theory-bar i.low { background: linear-gradient(90deg, #ff7a8a, #ff5c8a); }
.theory-pct { font-size: 12px; color: var(--muted); text-align: right; }
.theory-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.theory-head h1 { margin: 4px 0 0; }
.theory-level { font-size: 13px; color: var(--muted); }
.rules.numbered { counter-reset: r; padding-left: 0; list-style: none; }
.rules.numbered li { counter-increment: r; position: relative; padding-left: 30px; margin-bottom: 10px; }
.rules.numbered li::before {
  content: counter(r); position: absolute; left: 0; top: 1px;
  width: 20px; height: 20px; border-radius: 7px; display: grid; place-items: center;
  font-size: 11px; font-weight: 800; color: var(--brand);
  background: color-mix(in srgb, var(--brand) 16%, transparent);
}
.warn-card { border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); background: color-mix(in srgb, var(--warn) 7%, var(--card)); }
/* ── Профиль: шапка, сетка статистики, сворачиваемые группы */
.profile-sub { flex: 0 0 auto; margin-left: auto; }\n@media (max-width: 420px) { .profile-sub { margin-left: 78px; } }
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 12px 0; }
@media (min-width: 420px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }
.stat-grid .stat { padding: 10px 12px; }
.stat-grid .stat b { font-size: 20px; }
details.card > summary { cursor: pointer; padding: 4px 0; font-size: 15px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
details.card[open] > summary { margin-bottom: 4px; }
details.card > summary::marker { color: var(--muted); }
/* ── «Первый шаг»: идея, прогресс, задачи */
.rule-line { font-size: 19px; line-height: 1.45; margin: 8px 0 2px; }
.mini-progress { display: flex; gap: 6px; margin: 8px 0 14px; }
.mini-progress i { flex: 1; height: 6px; border-radius: 4px; background: var(--card-2); }
.mini-progress i.cur { background: color-mix(in srgb, var(--brand) 55%, var(--card-2)); }
.mini-progress i.ok { background: var(--good); }
.mini-progress i.no { background: var(--bad); }
/* ── Экзамен и диагностика: одна полоса состояния, компактная сетка, аккуратные действия */
.exam-bar {
  position: sticky; top: calc(var(--tg-top) + 62px); z-index: 6;
  display: flex; align-items: center; gap: 12px; margin: 0 0 12px;
  padding: 10px 12px; border-radius: 16px;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(12px); border: 1px solid var(--line);
}
.exam-timer { display: flex; flex-direction: column; line-height: 1.1; min-width: 74px; }
.exam-timer b { font-size: 17px; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.exam-progress { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.exam-progress .bar { margin: 0; }
.exam-bar .chip { flex: 0 0 auto; }

/* Номера заданий: сетка без горизонтального скролла */
.exam-strip {
  display: grid; grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 4px; margin-bottom: 14px;
}
.exam-strip[data-count="10"], .exam-strip[data-count="20"] { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.exam-strip .num {
  width: 100%; height: 32px; border-radius: 9px; padding: 0; font-size: 11px; font-weight: 700;
  background: var(--card); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line);
}
.exam-strip .num.done { color: var(--text); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--good) 65%, transparent); }
.exam-strip .num.cur { color: var(--text); box-shadow: inset 0 0 0 2px var(--brand); background: color-mix(in srgb, var(--brand) 16%, var(--card)); }

.exam-card { padding: 18px 16px; }
.exam-card .task-text { margin: 12px 0 14px; }
.exam-actions { display: flex; gap: 8px; margin-top: 14px; }
.exam-actions button { flex: 1 1 auto; }
.exam-actions .ghost { flex: 0 0 auto; padding-left: 14px; padding-right: 14px; }
/* ── Инструменты под задачей: подсказка и формулы как аккуратные кнопки, а не «технодемка» */
.tool-row { display: flex; gap: 8px; margin-top: 12px; }
.tool {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 13px; border-radius: 12px; font-size: 13.5px; font-weight: 600;
  background: var(--card-2); color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line); border: 0; cursor: pointer;
  transition: box-shadow .15s ease, transform .1s ease;
}
.tool:hover { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 55%, var(--line)); }
.tool:active { transform: scale(.97); }
.tool:disabled { opacity: .5; }
.tool-ico { font-size: 15px; line-height: 1; }
.tool-meta {
  font-size: 11px; font-weight: 800; padding: 2px 6px; border-radius: 999px;
  background: color-mix(in srgb, var(--brand) 18%, transparent); color: var(--brand);
}
.tool-meta.empty { background: color-mix(in srgb, var(--bad) 16%, transparent); color: var(--bad); }
.tool-meta:empty { display: none; }
/* ── Вторичные кнопки: заметные, но не конкурируют с главной */
button.ghost, .btn.ghost, a.ghost {
  background: color-mix(in srgb, var(--card-2) 92%, var(--text) 4%);
  color: var(--text);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--line) 70%, var(--text) 22%);
  font-weight: 600;
  min-height: 42px;
  transition: box-shadow .15s ease, background .15s ease, transform .1s ease;
}
button.ghost:hover, .btn.ghost:hover, a.ghost:hover {
  background: color-mix(in srgb, var(--card-2) 82%, var(--brand) 8%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 55%, var(--line));
}
button.ghost:active, .btn.ghost:active { transform: scale(.98); }
button.ghost:disabled { opacity: .45; box-shadow: inset 0 0 0 1px var(--line); }

/* мелкие ссылки-кнопки (Назад, Другая тема) — с иконкой-стрелкой и фоном */
.btn.ghost, a.btn.ghost { display: inline-flex; align-items: center; gap: 6px; }

/* кнопки-таблетки в шапке */
.chip { font-weight: 600; }
/* ── Промокод на странице оплаты: заметная полоса сверху */
.promo-bar {
  border: 1px dashed color-mix(in srgb, var(--brand) 55%, var(--line));
  background: color-mix(in srgb, var(--brand) 8%, var(--card));
  border-radius: 16px; padding: 12px 14px; margin: 0 0 14px;
}
.promo-bar.on {
  border-style: solid;
  border-color: color-mix(in srgb, var(--good) 60%, var(--line));
  background: color-mix(in srgb, var(--good) 10%, var(--card));
}
.promo-bar-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 15px; margin-bottom: 8px; }
.promo-ico { font-size: 18px; line-height: 1; }
.promo-form { display: flex; gap: 8px; }
.promo-form input {
  flex: 1 1 auto; min-width: 0; padding: 11px 13px; border-radius: 12px;
  background: var(--card-2); border: 1px solid var(--line); color: var(--text);
  font-size: 15px; letter-spacing: .04em; text-transform: uppercase;
}
.promo-form input::placeholder { text-transform: none; letter-spacing: 0; color: var(--muted); }
.promo-form button { flex: 0 0 auto; }
.promo-bar .note { margin: 8px 0 0; }