/* ════════════════════════════════════════════════════════════════════════
   Тренажёр «Интеграл» — дизайн-система.
   Опирается на стиль лендинга: Geologica (300/400/500/700) + Rubik (600/700)
   из /styles/fonts.css, фиолетовые градиенты #7663F2 → #2200FF, большие
   скругления 28–35px, мягкие тени, «завитушки», 3D-иконки из тарифов.
   Веса Geologica 600 локально нет — используем только 300/400/500/700.
   ════════════════════════════════════════════════════════════════════════ */

:root {
  --brand:   #5941F2;
  --brand-2: #7663F2;
  --lav:     #ABA0F2;
  --lav-2:   #D9D3FF;
  --lav-3:   #EEEBFF;
  --lav-4:   #F6F4FF;
  --neon:    #2200FF;

  --ink:   #12102A;
  --ink-2: #3B3755;
  --muted: #7B7794;
  --line:  #E7E4F3;
  --bg:    #F2F2F2;
  --card:  #FFFFFF;

  --ok:      #12A06C;
  --ok-2:    #19B37A;
  --ok-bg:   #E7F8F1;
  --ok-line: #9BE3C6;
  --bad:      #E0344B;
  --bad-bg:   #FDECEF;
  --bad-line: #F6B4BF;
  --warn:    #F5A524;
  --warn-bg: #FFF5E0;

  --grad:      linear-gradient(149.51deg, #7663F2 15.46%, #2200FF 84.54%);
  --grad-btn:  linear-gradient(134deg, #7663F2 0%, #5941F2 40%, #0D05F2 100%);
  --grad-soft: linear-gradient(180deg, #9587F2 0%, #5941F2 69.71%);

  --r-xl: 34px;
  --r-lg: 28px;
  --r-md: 20px;
  --r-sm: 14px;
  --r-xs: 10px;

  --sh-card: 0 0 60px rgba(30, 20, 90, .07);
  --sh-lift: 0 24px 50px -24px rgba(43, 27, 158, .45);
  --sh-hero: 0 44px 78px -34px rgba(43, 27, 158, .55);
  --sh-btn:  0 14px 26px -12px rgba(34, 0, 255, .55);

  --ease-out:    cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);

  --topbar-h: 64px;
  --tabbar-h: 66px;
  --gutter: 16px;
}
@media (min-width: 900px) {
  :root { --topbar-h: 78px; --gutter: 32px; }
}

/* ── база ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Geologica', system-ui, -apple-system, sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
}
@media (min-width: 900px) { body { padding-bottom: 0; } }
body.is-focus { padding-bottom: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
.num { font-family: 'Rubik', 'Geologica', sans-serif; font-weight: 700; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.i { width: 1.15em; height: 1.15em; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.i--fill { fill: currentColor; stroke: none; }
[hidden] { display: none !important; }
.nobr { white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 var(--gutter); }

/* ── фоновые завитушки (как на лендинге) ───────────────────────────────── */
.bg-deco { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg-deco svg { position: absolute; opacity: .22; filter: blur(.4px); }
.bg-deco .sq1 { width: 620px; right: -230px; top: 90px; animation: drift 38s ease-in-out infinite alternate; }
.bg-deco .sq2 { width: 520px; left: -260px; top: 55vh; animation: drift 46s ease-in-out infinite alternate-reverse; }
@media (max-width: 899px) {
  .bg-deco .sq1 { width: 420px; right: -250px; }
  .bg-deco .sq2 { width: 380px; left: -230px; }
}

/* ── верхняя панель ────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  height: var(--topbar-h);
  background: rgba(242, 242, 242, .78);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, box-shadow .3s;
}
.topbar.is-scrolled { border-bottom-color: rgba(89, 65, 242, .08); box-shadow: 0 10px 30px -22px rgba(43, 27, 158, .35); }
.topbar .wrap { height: 100%; display: flex; align-items: center; gap: 12px; }
.brand-pill {
  display: inline-flex; align-items: center; gap: 10px;
  height: 44px; padding: 0 16px 0 8px; border-radius: 999px;
  background: var(--grad); color: #fff;
  box-shadow: 0 0 16px 2px rgba(57, 40, 242, .25);
  transition: transform .25s var(--ease-spring), box-shadow .25s;
  flex: none;
}
.brand-pill:hover { transform: translateY(-1px) scale(1.02); box-shadow: 0 8px 26px rgba(57, 40, 242, .35); }
.brand-pill img { height: 30px; width: auto; }
.brand-pill__tag { font-size: 12px; font-weight: 500; padding: 3px 9px; border-radius: 999px; background: rgba(255,255,255,.18); letter-spacing: .01em; }
@media (min-width: 900px) { .brand-pill { height: 50px; } .brand-pill img { height: 34px; } }

.topnav { display: none; gap: 4px; margin: 0 auto; padding: 5px; border-radius: 999px; background: rgba(255,255,255,.6); box-shadow: inset 0 0 0 1px rgba(89,65,242,.06); }
@media (min-width: 900px) { .topnav { display: flex; } }
.topnav a {
  position: relative; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  padding: 9px 16px; border-radius: 999px; font-size: 15px; font-weight: 500; color: var(--ink-2);
  transition: color .2s, background .2s, box-shadow .2s;
}
.topnav a:hover { color: var(--brand); background: rgba(89, 65, 242, .07); }
.topnav a.is-active { color: var(--brand); background: #fff; box-shadow: 0 6px 18px -8px rgba(43, 27, 158, .35); }
.topnav .badge { margin-left: 2px; }

.topbar__right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
@media (min-width: 900px) { .topbar__right { margin-left: 0; } }
.to-cab { display: none; align-items: center; gap: 8px; height: 42px; padding: 0 16px; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--ink-2); background: #fff; box-shadow: inset 0 0 0 1px var(--line); transition: color .2s, box-shadow .2s, transform .2s; }
.to-cab:hover { color: var(--brand); box-shadow: inset 0 0 0 1px var(--lav); transform: translateY(-1px); }
@media (min-width: 640px) { .to-cab { display: inline-flex; white-space: nowrap; } }
@media (min-width: 900px) and (max-width: 1179px) { .topnav a { padding: 9px 12px; font-size: 14px; } body.is-staff .to-cab { display: none; } }
.avatar {
  width: 42px; height: 42px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #EEEBFF, #D9D3FF); color: var(--brand);
  font-weight: 700; font-size: 15px; box-shadow: inset 0 0 0 2px #fff, 0 6px 16px -8px rgba(43,27,158,.5);
  transition: transform .25s var(--ease-spring);
}
.avatar:hover { transform: scale(1.06); }

.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; line-height: 1; }
.badge--brand { background: var(--brand); }

/* ── нижняя панель (телефон) ──────────────────────────────────────────── */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding: 6px 10px env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(1.5) blur(16px);
  -webkit-backdrop-filter: saturate(1.5) blur(16px);
  box-shadow: 0 -10px 30px -18px rgba(43, 27, 158, .35);
  border-radius: 22px 22px 0 0;
  transition: transform .35s var(--ease-out);
}
@media (min-width: 900px) { .tabbar { display: none; } }
body.is-focus .tabbar { transform: translateY(110%); }
.tabbar a {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border-radius: 16px; font-size: 11px; font-weight: 500; color: var(--muted);
  transition: color .2s;
}
.tabbar a .i { width: 23px; height: 23px; transition: transform .35s var(--ease-spring); }
.tabbar a.is-active { color: var(--brand); }
.tabbar a.is-active .i { transform: translateY(-2px) scale(1.08); }
.tabbar a.is-active::before {
  content: ''; position: absolute; inset: 4px 10px; border-radius: 14px; background: var(--lav-3); z-index: -1;
  animation: pop .45s var(--ease-spring) both;
}
.tabbar .badge { position: absolute; top: 4px; left: calc(50% + 6px); }

/* ── область просмотра и переходы между экранами ──────────────────────── */
.view { padding: 18px 0 40px; min-height: calc(100vh - var(--topbar-h)); overflow-x: clip; }
@media (min-width: 900px) { .view { padding: 26px 0 64px; } }
.view.view-out { animation: viewOut .16s ease-in both; }
.view.view-in  { animation: viewIn .5s var(--ease-out) backwards; }

.reveal { animation: rise .6s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 70ms); }

/* ── типографика ──────────────────────────────────────────────────────── */
.page-head { margin: 4px 0 18px; }
.page-title { font-size: 28px; line-height: 1.1; font-weight: 700; letter-spacing: -.02em; }
.page-sub { margin-top: 6px; color: var(--muted); font-size: 15px; }
@media (min-width: 900px) { .page-title { font-size: 40px; } .page-sub { font-size: 17px; } }
.sec-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 30px 0 14px; font-size: 22px; line-height: 1.15; font-weight: 700; letter-spacing: -.01em; }
.sec-title small { font-size: 14px; font-weight: 400; color: var(--muted); letter-spacing: 0; }
@media (min-width: 900px) { .sec-title { font-size: 28px; margin: 40px 0 18px; } }
.link { display: inline-flex; align-items: center; gap: 6px; color: var(--brand); font-weight: 500; font-size: 15px; transition: gap .25s var(--ease-out), opacity .2s; }
.link:hover { gap: 10px; }

/* ── кнопки ───────────────────────────────────────────────────────────── */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 22px; border-radius: 999px;
  font-size: 15px; font-weight: 500; line-height: 1; white-space: nowrap;
  transition: transform .25s var(--ease-spring), box-shadow .25s, background-position .5s, background-color .2s, color .2s, opacity .2s;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.btn:active { transform: scale(.97); }
.btn .i { width: 18px; height: 18px; }
.btn-lg { height: 54px; padding: 0 26px; font-size: 16px; }
.btn-sm { height: 38px; padding: 0 16px; font-size: 14px; }
.btn-block { width: 100%; }
.btn-primary { color: #fff; background: var(--grad-btn); background-size: 160% 100%; background-position: 0 0; box-shadow: var(--sh-btn); }
.btn-primary:hover { background-position: 100% 0; transform: translateY(-2px); box-shadow: 0 18px 30px -12px rgba(34, 0, 255, .6); }
.btn-white { color: #000; background: #fff; box-shadow: 0 10px 24px -14px rgba(10, 0, 80, .6); }
.btn-white:hover { transform: translateY(-2px); box-shadow: 0 16px 30px -14px rgba(10, 0, 80, .7); }
.btn-glass { color: #fff; background: rgba(255, 255, 255, .13); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.btn-glass:hover { background: rgba(255, 255, 255, .22); transform: translateY(-2px); }
.btn-ghost { color: var(--ink); background: #fff; box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-ghost:hover { color: var(--brand); box-shadow: inset 0 0 0 1.5px var(--lav); transform: translateY(-1px); }
.btn-soft { color: var(--brand); background: var(--lav-3); }
.btn-soft:hover { background: var(--lav-2); transform: translateY(-1px); }
.btn-ok { color: #fff; background: linear-gradient(135deg, #1DC28A, #0E9A68); box-shadow: 0 14px 26px -12px rgba(14, 154, 104, .6); }
.btn[disabled], .btn.is-disabled { opacity: .45; pointer-events: none; }
.btn .arrow { transition: transform .3s var(--ease-out); }
.btn:hover .arrow { transform: translateX(4px); }

.icon-btn {
  width: 42px; height: 42px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  background: #fff; color: var(--ink-2); box-shadow: inset 0 0 0 1.5px var(--line);
  transition: color .2s, box-shadow .2s, transform .25s var(--ease-spring), background .2s;
}
.icon-btn:hover { color: var(--brand); box-shadow: inset 0 0 0 1.5px var(--lav); transform: scale(1.06); }
.icon-btn.is-on { color: #fff; background: var(--warn); box-shadow: none; }
.icon-btn .i { width: 19px; height: 19px; }
.link-btn { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); transition: color .2s; }
.link-btn:hover { color: var(--bad); }

/* ── чипы и теги ──────────────────────────────────────────────────────── */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 500; background: var(--lav-4); color: var(--ink-2); white-space: nowrap; }
.chip .i { width: 15px; height: 15px; }
.chip--brand { background: var(--lav-3); color: var(--brand); }
.chip--glass { color: #fff; background: rgba(255, 255, 255, .14); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); backdrop-filter: blur(6px); }
.chip--ok { background: var(--ok-bg); color: var(--ok); }
.chip--bad { background: var(--bad-bg); color: var(--bad); }
.chip--warn { background: var(--warn-bg); color: #A86400; }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .02em; vertical-align: middle; }
.tag--new { color: #fff; background: var(--grad); box-shadow: 0 6px 14px -6px rgba(34, 0, 255, .6); }
.tag--moved { color: #A86400; background: var(--warn-bg); }
.tag--soon { color: var(--muted); background: #EDEBF5; }

/* ── карточки ─────────────────────────────────────────────────────────── */
.card { position: relative; background: var(--card); border-radius: var(--r-lg); box-shadow: var(--sh-card); padding: 20px; }
@media (min-width: 900px) { .card { padding: 28px; } }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card__title { font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
@media (min-width: 900px) { .card__title { font-size: 22px; } }
.glass { background: rgba(255, 255, 255, .13); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }

/* ── герой главной (как герой лендинга) ───────────────────────────────── */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  border-radius: var(--r-xl); padding: 26px 20px 20px; color: #fff;
  background: var(--grad); box-shadow: var(--sh-hero);
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px;
}
@media (min-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr); align-items: center; gap: 36px; padding: 48px 48px 44px; min-height: 420px; }
}
.hero__sq { position: absolute; z-index: -1; pointer-events: none; opacity: .5; }
.hero__sq--1 { width: 520px; right: -140px; top: -110px; animation: drift 30s ease-in-out infinite alternate; }
.hero__sq--2 { width: 420px; left: -180px; bottom: -220px; animation: drift 36s ease-in-out infinite alternate-reverse; }
.hero__math { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.hero__math span {
  position: absolute; bottom: -40px; font-family: 'Times New Roman', serif; font-style: italic;
  color: rgba(255, 255, 255, .16); font-size: var(--fs, 34px); line-height: 1;
  animation: mathFloat var(--d, 14s) linear infinite; animation-delay: var(--dl, 0s);
}
.hero__chip { margin-bottom: 16px; }
.hero__title { font-size: 38px; line-height: .9; font-weight: 700; text-transform: uppercase; letter-spacing: -.02em; }
@media (min-width: 900px) { .hero__title { font-size: 66px; } }
@media (min-width: 1100px) { .hero__title { font-size: 74px; } }
.hero__sub { margin-top: 14px; max-width: 460px; font-size: 16px; line-height: 1.45; color: rgba(255, 255, 255, .86); }
@media (min-width: 900px) { .hero__sub { font-size: 18px; margin-top: 18px; } }
.hero__btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
@media (min-width: 900px) { .hero__btns { margin-top: 30px; gap: 14px; } }
@media (max-width: 420px) { .hero__btns .btn { flex: 1 1 100%; min-width: 0; max-width: 100%; height: auto; min-height: 54px; padding: 10px 18px; white-space: normal; text-align: center; line-height: 1.25; } }
.hero__right { display: grid; gap: 12px; }
.forecast { display: flex; align-items: center; gap: 18px; border-radius: var(--r-lg); padding: 16px 18px; }
@media (min-width: 900px) { .forecast { padding: 22px 26px; gap: 24px; } }
.forecast__txt b { display: block; font-size: 21px; font-weight: 700; line-height: 1.15; white-space: nowrap; }
@media (min-width: 900px) and (max-width: 1099px) { .forecast { gap: 16px; padding: 18px; } .forecast__txt small { display: none; } }
.forecast__txt span { display: block; margin-top: 4px; font-size: 14px; color: rgba(255, 255, 255, .86); }
.forecast__txt small { display: block; margin-top: 8px; font-size: 12px; color: rgba(255, 255, 255, .6); }
.hero__tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tile { border-radius: 22px; padding: 14px 12px; min-height: 96px; display: flex; flex-direction: column; justify-content: space-between; }
@media (min-width: 900px) { .tile { border-radius: var(--r-md); padding: 16px; min-height: 118px; } }
.tile b { font-size: 28px; line-height: 1; }
@media (min-width: 900px) { .tile b { font-size: 34px; } }
.tile span { font-size: 12px; line-height: 1.3; color: rgba(255, 255, 255, .85); display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.flame { display: inline-flex; color: #FFC94D; animation: flame 1.6s ease-in-out infinite; transform-origin: 50% 90%; }
.flame .i { width: 15px; height: 15px; fill: currentColor; stroke: none; }

/* ── кольцо прогресса ─────────────────────────────────────────────────── */
.ring { position: relative; width: var(--size); height: var(--size); flex: none; }
.ring svg { transform: rotate(-90deg); display: block; overflow: visible; }
.ring__track { fill: none; stroke: var(--lav-3); }
.ring__bar { fill: none; stroke: url(#trn-grad); stroke-linecap: round; transition: stroke-dashoffset 1.4s var(--ease-out); }
.ring--white .ring__track { stroke: rgba(255, 255, 255, .18); }
.ring--white .ring__bar { stroke: #fff; filter: drop-shadow(0 0 8px rgba(255, 255, 255, .55)); }
.ring--ok .ring__bar { stroke: var(--ok-2); }
.ring--bad .ring__bar { stroke: var(--bad); }
.ring--warn .ring__bar { stroke: var(--warn); }
.ring__label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1; }
.ring__label b { font-size: calc(var(--size) * .3); }
.ring__label small { display: block; margin-top: 4px; font-size: max(10px, calc(var(--size) * .1)); font-weight: 500; opacity: .75; }

/* ── переключатель экзаменов ──────────────────────────────────────────── */
.exam-switch { display: flex; gap: 8px; margin-top: 16px; overflow-x: auto; scrollbar-width: none; padding: 4px 2px 6px; margin-left: -2px; }
.exam-switch::-webkit-scrollbar { display: none; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; flex: none;
  height: 42px; padding: 0 16px; border-radius: 999px; font-size: 14px; font-weight: 500;
  background: #fff; color: var(--ink-2); box-shadow: inset 0 0 0 1.5px var(--line);
  transition: transform .25s var(--ease-spring), box-shadow .2s, color .2s;
}
.pill:hover { transform: translateY(-1px); }
.pill.is-active { color: #fff; background: var(--grad); box-shadow: 0 10px 22px -12px rgba(34, 0, 255, .7); }
.pill.is-soon { color: var(--muted); }
.pill em { font-style: normal; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: #EDEBF5; color: var(--muted); }

/* ── баннер «работа от преподавателя» ─────────────────────────────────── */
.assign {
  position: relative; display: grid; grid-template-columns: 64px 1fr; gap: 14px; align-items: center;
  margin-top: 14px; padding: 16px; border-radius: var(--r-lg); background: #fff; box-shadow: var(--sh-card);
  transition: transform .3s var(--ease-out), box-shadow .3s;
  overflow: hidden;
}
.assign::after { content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; background: linear-gradient(120deg, rgba(118, 99, 242, .7), rgba(34, 0, 255, .0) 40%, rgba(171, 160, 242, .7)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
.assign:hover { transform: translateY(-3px); box-shadow: var(--sh-lift); }
@media (min-width: 720px) { .assign { grid-template-columns: 84px 1fr auto; padding: 18px 22px; gap: 20px; } }
.assign__ico { width: 64px; height: 64px; animation: floaty 5s ease-in-out infinite; }
@media (min-width: 720px) { .assign__ico { width: 84px; height: 84px; } }
.assign__top { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 500; color: var(--brand); text-transform: uppercase; letter-spacing: .04em; }
.assign__title { margin-top: 4px; font-size: 18px; font-weight: 700; line-height: 1.2; }
.assign__meta { margin-top: 4px; font-size: 14px; color: var(--muted); }
.assign .bar { margin-top: 10px; }
.assign .btn { grid-column: 1 / -1; }
@media (min-width: 720px) { .assign .btn { grid-column: auto; } }
.dot-live { width: 8px; height: 8px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 0 0 rgba(224, 52, 75, .5); animation: pulseRed 1.6s infinite; }

.bar { position: relative; height: 8px; border-radius: 999px; background: var(--lav-3); overflow: hidden; }
.bar > i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: inherit; background: var(--grad); width: 0; transition: width 1.2s var(--ease-out); }
.bar > i::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent); background-size: 200% 100%; animation: shimmer 2.2s linear infinite; }

/* ── карточки режимов ─────────────────────────────────────────────────── */
.modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 900px) { .modes { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; } }
.mode {
  --rx: 0deg; --ry: 0deg; --ty: 0px;
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; min-height: 196px; padding: 16px;
  border-radius: var(--r-lg); background: #fff; box-shadow: var(--sh-card);
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)) translateY(var(--ty));
  transition: transform .35s var(--ease-out), box-shadow .35s;
  will-change: transform;
}
@media (min-width: 900px) { .mode { min-height: 236px; padding: 24px; } }
.mode:hover { --ty: -6px; box-shadow: var(--sh-lift); }
.mode::before { content: ''; position: absolute; z-index: -1; right: -40px; top: -40px; width: 170px; height: 170px; border-radius: 50%; background: radial-gradient(circle, var(--glow, rgba(171, 160, 242, .35)), transparent 70%); transition: transform .5s var(--ease-out); }
.mode:hover::before { transform: scale(1.35); }
.mode__ico { width: 76px; height: 76px; margin: -2px 0 6px -4px; animation: floaty 6s ease-in-out infinite; animation-delay: calc(var(--i, 0) * -.9s); transition: transform .45s var(--ease-spring); filter: drop-shadow(0 12px 14px rgba(43, 27, 158, .22)); }
@media (min-width: 900px) { .mode__ico { width: 104px; height: 104px; position: absolute; right: 16px; top: 14px; margin: 0; } }
.mode:hover .mode__ico { transform: scale(1.08) rotate(-6deg); }
.mode h3 { font-size: 17px; line-height: 1.15; font-weight: 700; letter-spacing: -.01em; }
@media (min-width: 900px) { .mode h3 { font-size: 23px; margin-top: 44px; max-width: 70%; } }
.mode p { margin-top: 6px; font-size: 13px; line-height: 1.4; color: var(--muted); }
@media (min-width: 900px) { .mode p { font-size: 15px; max-width: 92%; } }
.mode__foot { margin-top: auto; padding-top: 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mode__foot .chip { height: 26px; font-size: 12px; padding: 0 10px; }
.mode__go { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--grad); box-shadow: var(--sh-btn); flex: none; transition: transform .35s var(--ease-spring); }
.mode__go .i { width: 18px; height: 18px; }
.mode:hover .mode__go { transform: translateX(4px) rotate(-45deg); }
@media (max-width: 420px) { .mode__foot .chip { display: none; } }
.mode--accent { background: var(--grad); color: #fff; }
.mode--accent p { color: rgba(255, 255, 255, .82); }
.mode--accent .mode__go { background: #fff; color: var(--brand); }
.mode--accent .chip { background: rgba(255,255,255,.16); color: #fff; }
.mode--accent::before { --glow: rgba(255, 255, 255, .25); }
.mode .badge { position: absolute; top: 14px; right: 14px; z-index: 2; height: 24px; min-width: 24px; font-size: 12px; animation: pop .5s var(--ease-spring) .6s both; }
@media (min-width: 900px) { .mode .badge { top: 16px; left: 24px; right: auto; } }

/* ── мини-тепловая карта и полная ─────────────────────────────────────── */
.progress-card { display: grid; gap: 18px; margin-top: 20px; }
@media (min-width: 900px) { .progress-card { grid-template-columns: 1fr auto; align-items: center; } }
.heat { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; }
@media (min-width: 900px) { .heat { gap: 8px; } }
.heat--big { grid-template-columns: repeat(5, 1fr); gap: 8px; }
@media (min-width: 640px) { .heat--big { grid-template-columns: repeat(10, 1fr); } }
.heat__cell {
  position: relative; aspect-ratio: 1; border-radius: 12px; display: grid; place-items: center;
  font-family: 'Rubik', sans-serif; font-weight: 700; font-size: 13px;
  opacity: 0; animation: tileIn .55s var(--ease-spring) both; animation-delay: calc(var(--i, 0) * 35ms + 150ms);
  transition: transform .25s var(--ease-spring), box-shadow .25s;
}
.heat--big .heat__cell { border-radius: 16px; font-size: 16px; aspect-ratio: auto; min-height: 74px; flex-direction: column; gap: 2px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.heat__cell small { font-family: 'Geologica', sans-serif; font-weight: 500; font-size: 11px; opacity: .8; }
.heat__cell:hover { transform: translateY(-3px) scale(1.04); box-shadow: 0 12px 22px -12px rgba(43, 27, 158, .6); z-index: 2; }
.m0 { background: #F1F0F6; color: #A8A4BE; }
.m1 { background: var(--bad-bg); color: #C2223B; box-shadow: inset 0 0 0 1.5px var(--bad-line); }
.m2 { background: var(--lav-3); color: #4B33D6; }
.m3 { background: #C9C1FF; color: #2E1BA8; }
.m4 { background: var(--grad); color: #fff; }
.heat-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 14px; font-size: 12px; color: var(--muted); }
.heat-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 6px; vertical-align: -2px; }
.part-sep { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; margin: 8px 0 2px; font-size: 12px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.part-sep::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* ── каталог по номерам ───────────────────────────────────────────────── */
.seg { position: relative; display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 5px; border-radius: 999px; background: #fff; box-shadow: var(--sh-card); }
.seg a, .seg button { position: relative; z-index: 1; height: 40px; padding: 0 18px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 14px; font-weight: 500; color: var(--ink-2); transition: color .25s; white-space: nowrap; }
.seg .is-active { color: #fff; }
.seg__thumb { position: absolute; z-index: 0; top: 5px; bottom: 5px; border-radius: 999px; background: var(--grad); box-shadow: 0 8px 18px -10px rgba(34, 0, 255, .7); transition: left .45s var(--ease-spring), width .45s var(--ease-spring); }
.seg small { font-size: 12px; opacity: .7; }
.seg { max-width: 100%; }
@media (max-width: 480px) { .seg a, .seg button { padding: 0 13px; } .seg small { display: none; } }

.num-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 16px; }
.num-row {
  position: relative; display: grid; grid-template-columns: 52px 1fr; gap: 12px 14px; align-items: center;
  padding: 14px; border-radius: var(--r-md); background: #fff; box-shadow: var(--sh-card);
  transition: transform .3s var(--ease-out), box-shadow .3s;
}
.num-row:hover { transform: translateY(-2px); box-shadow: var(--sh-lift); }
@media (min-width: 900px) { .num-row { grid-template-columns: 60px minmax(0, 1fr) auto auto auto auto; padding: 16px 20px; gap: 20px; } }
.num-badge {
  width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center;
  font-family: 'Rubik', sans-serif; font-weight: 700; font-size: 22px; color: var(--brand); background: var(--lav-3);
  transition: transform .35s var(--ease-spring), background .3s, color .3s;
}
@media (min-width: 900px) { .num-badge { width: 60px; height: 60px; font-size: 26px; border-radius: 18px; } }
.num-row:hover .num-badge { transform: rotate(-6deg) scale(1.06); background: var(--grad); color: #fff; }
.num-row--long .num-badge { background: #FFF1DC; color: #B46A00; }
.num-title { font-size: 16px; font-weight: 700; line-height: 1.2; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; }
@media (min-width: 900px) { .num-title { font-size: 18px; } }
.num-topics { margin-top: 3px; font-size: 13px; color: var(--muted); }
.num-actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; }
@media (min-width: 900px) { .num-actions { display: contents; } }
.num-actions .btn { margin-left: auto; }
@media (min-width: 900px) { .num-actions .btn { margin-left: 0; } }
.num-aux { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.num-actions .num-aux .btn { margin-left: 0; }
@media (max-width: 899px) { .num-actions.has-video { flex-wrap: wrap; row-gap: 8px; } }
@media (min-width: 900px) { .num-aux { margin-left: 0; justify-content: flex-end; } }
.num-stat { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); line-height: 1.25; }
.num-stat b { display: block; font-size: 13px; color: var(--ink-2); font-weight: 500; }

.stepper { display: inline-flex; align-items: center; gap: 2px; height: 38px; padding: 3px; border-radius: 999px; background: var(--lav-4); box-shadow: inset 0 0 0 1px var(--line); }
.stepper button { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: var(--brand); transition: background .2s, transform .2s var(--ease-spring); }
.stepper button:hover { background: #fff; }
.stepper button:active { transform: scale(.88); }
.stepper button .i { width: 16px; height: 16px; }
.stepper output { min-width: 26px; text-align: center; font-family: 'Rubik', sans-serif; font-weight: 700; font-size: 15px; }
.stepper output.bump { animation: bump .35s var(--ease-spring); }
.stepper.has-value { background: var(--lav-3); box-shadow: inset 0 0 0 1.5px var(--lav); }

.builder {
  position: fixed; z-index: 70; left: 12px; right: 12px;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 10px);
  display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 18px;
  border-radius: 24px; color: #fff; background: rgba(18, 16, 42, .92);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 24px 50px -20px rgba(18, 16, 42, .8);
  transform: translateY(calc(100% + 120px)); opacity: 0;
  transition: transform .5s var(--ease-spring), opacity .3s;
}
.builder.is-on { transform: none; opacity: 1; }
@media (min-width: 900px) { .builder { left: 50%; right: auto; width: 640px; margin-left: -320px; bottom: 24px; } }
.builder__txt { flex: 1; min-width: 0; line-height: 1.25; }
.builder__txt b { display: block; font-size: 15px; }
.builder__txt span { font-size: 12px; color: rgba(255, 255, 255, .65); }
.builder .btn-ghost { background: transparent; color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .25); }

/* ── сессия решения ───────────────────────────────────────────────────── */
.session { max-width: 860px; margin: 0 auto; }
.session__head { display: flex; align-items: center; gap: 12px; }
.session__title { flex: 1; min-width: 0; }
.session__title b { display: block; font-size: 17px; line-height: 1.2; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.session__title small { display: block; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 900px) { .session__title b { font-size: 22px; } }
.session__meta { display: flex; align-items: center; gap: 8px; }
.meta-pill { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 999px; background: #fff; box-shadow: inset 0 0 0 1.5px var(--line); font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; }
.meta-pill .i { width: 16px; height: 16px; color: var(--muted); }
.meta-pill--streak { color: #C25B00; background: var(--warn-bg); box-shadow: none; }
.meta-pill--streak .i { color: var(--warn); fill: currentColor; stroke: none; }
.meta-pill--streak.bump { animation: bump .45s var(--ease-spring); }
@media (max-width: 480px) { .meta-pill--time { display: none; } }

.segbar { display: flex; gap: 5px; margin: 16px 0 18px; }
.segbar i { flex: 1; height: 8px; border-radius: 999px; background: var(--lav-3); position: relative; overflow: hidden; transition: background .3s; }
.segbar i.is-cur { background: var(--lav-2); }
.segbar i.is-cur::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(89, 65, 242, .55), transparent); background-size: 200% 100%; animation: shimmer 1.6s linear infinite; }
.segbar i.ok { background: var(--ok-2); animation: pop .45s var(--ease-spring); }
.segbar i.bad { background: var(--bad); animation: pop .45s var(--ease-spring); }
.segbar i.self { background: var(--warn); animation: pop .45s var(--ease-spring); }

.stage { position: relative; }
.task-card {
  position: relative; background: #fff; border-radius: var(--r-lg); box-shadow: var(--sh-card); padding: 20px;
  transition: box-shadow .4s;
}
@media (min-width: 900px) { .task-card { padding: 32px 36px; } }
.task-card.enter { animation: slideInR .55s var(--ease-out) both; }
.task-card.leave { animation: slideOutL .28s ease-in both; }
.task-card.is-ok  { box-shadow: 0 0 0 2px var(--ok-line), 0 30px 60px -30px rgba(18, 160, 108, .55); }
.task-card.is-bad { box-shadow: 0 0 0 2px var(--bad-line), 0 30px 60px -30px rgba(224, 52, 75, .45); }
.task-card__head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.task-card__head .proto { font-size: 13px; color: var(--muted); }
.task-card__head .icon-btn { margin-left: auto; width: 38px; height: 38px; }
.task-text { font-size: 17px; line-height: 1.62; }
@media (min-width: 900px) { .task-text { font-size: 19px; } }
.task-text .katex { font-size: 1.07em; }
.task-fig { margin: 18px auto 4px; display: flex; justify-content: center; }
.task-fig .fig { width: 100%; max-width: 340px; height: auto; max-height: 300px; }
.task-fig .fig--wide { max-width: 440px; }
.dist { margin: 18px 0 4px; overflow-x: auto; }
.dist table { border-collapse: separate; border-spacing: 0; margin: 0 auto; font-size: 17px; border-radius: 16px; overflow: hidden; box-shadow: inset 0 0 0 1.5px var(--line); }
.dist th, .dist td { padding: 10px 18px; text-align: center; border-right: 1.5px solid var(--line); }
.dist tr:first-child th, .dist tr:first-child td { border-bottom: 1.5px solid var(--line); }
.dist th { background: var(--lav-4); color: var(--brand); }
.dist td:last-child { border-right: 0; }
.dist--text th { text-align: left; font-size: 14px; font-weight: 500; line-height: 1.3; min-width: 120px; max-width: 200px; white-space: normal; }
.dist--text td { white-space: nowrap; padding: 10px 14px; }
.dist--grid table { font-size: 15px; }
.dist--grid th, .dist--grid td { padding: 8px 12px; line-height: 1.35; white-space: normal; border-bottom: 1.5px solid var(--line); }
.dist--grid tr:last-child th, .dist--grid tr:last-child td { border-bottom: 0; }
.dist--grid tr:first-child th { font-size: 13px; font-weight: 600; letter-spacing: .02em; }
.dist--grid tr:not(:first-child) th { background: none; color: var(--ink); font-weight: 500; }
.dist--grid .t { text-align: left; }
@media (max-width: 519px) { .dist--grid table { font-size: 14px; } .dist--grid th, .dist--grid td { padding: 7px 8px; } }
@media (max-width: 520px) { .dist--text table { font-size: 15px; } .dist--text th { font-size: 13px; min-width: 104px; padding: 8px 10px; } .dist--text td { padding: 8px 10px; } }

/* подпись источника под условием — неброско, как ссылка на сборник */
.task-src { margin-top: 14px; text-align: right; font-size: 12px; line-height: 1.3; color: var(--muted); letter-spacing: .01em; opacity: .85; }
.task-src__code { font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; letter-spacing: .04em; }
.sample .task-src, .report__task .task-src { margin-top: 8px; }

/* сложность: три точки */
.diff { display: inline-flex; align-items: center; gap: 3px; vertical-align: middle; }
.diff i { width: 6px; height: 6px; border-radius: 50%; background: var(--lav-2); }
.diff[data-d="1"] i:nth-child(-n+1), .diff[data-d="2"] i:nth-child(-n+2), .diff[data-d="3"] i:nth-child(-n+3) { background: var(--brand); }
.diff[data-d="3"] i:nth-child(-n+3) { background: #2200FF; }
.task-card__head .diff { height: 30px; padding: 0 10px; border-radius: 999px; background: var(--lav-4); }
.choice button .diff { margin-right: 2px; }
.choice button.is-on .diff i { background: var(--lav); }
.choice button.is-on .diff[data-d="1"] i:nth-child(-n+1), .choice button.is-on .diff[data-d="2"] i:nth-child(-n+2), .choice button.is-on .diff[data-d="3"] i:nth-child(-n+3) { background: var(--brand); }

/* фильтр каталога */
.filters { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 16px; }
.filter { display: flex; align-items: center; gap: 10px; min-width: 0; max-width: 100%; }
.filter__lbl { font-size: 12px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.choice--sm { gap: 6px; }
.choice--sm button { height: 34px; font-size: 13px; padding: 0 12px; white-space: nowrap; flex: none; }
@media (max-width: 640px) { .filter { flex-direction: column; align-items: flex-start; gap: 6px; width: 100%; } }
.num-row.is-off .num-badge { opacity: .55; }

/* банк задач в модерации */
.bank-top { display: flex; align-items: center; justify-content: space-between; gap: 14px 20px; flex-wrap: wrap; margin-bottom: 14px; }
.bank-top b { display: block; font-size: 17px; }
.bank-top span { display: block; margin-top: 4px; font-size: 14px; color: var(--muted); max-width: 640px; }
.gen-row__src { display: block; margin-top: 2px; font-size: 12px; color: var(--brand); }
.gen-row__text { display: block; margin-top: 4px; font-size: 13px; color: var(--ink-2); }
.gen-row__main b .diff { margin-left: 6px; }

/* редактор авторской задачи */
.editor { display: grid; gap: 14px; margin-top: 14px; }
.editor__row { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; }
@media (max-width: 520px) { .editor__row { grid-template-columns: minmax(0, 1fr); } }
.fld { display: grid; gap: 6px; min-width: 0; }
.fld > span { font-size: 12px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.fld input, .fld select { width: 100%; height: 44px; padding: 0 14px; border-radius: 14px; border: 0; outline: 0; background: var(--lav-4); box-shadow: inset 0 0 0 1.5px var(--line); font-size: 15px; transition: box-shadow .2s, background .2s; }
.fld input:focus, .fld select:focus { background: #fff; box-shadow: inset 0 0 0 2px var(--brand); }
.fld select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 19px, calc(100% - 13px) 19px; background-size: 5px 5px; background-repeat: no-repeat; }
.fld textarea { min-height: 90px; font-family: ui-monospace, Menlo, monospace; font-size: 14px; line-height: 1.5; }
.editor__preview { padding: 14px; border-radius: 18px; background: var(--lav-4); }
.editor__plbl { font-size: 12px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 10px; }
.editor__preview .sample { background: #fff; }

.answer { margin-top: 22px; }
.answer__label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.answer__row { display: flex; gap: 10px; }
.answer__field { position: relative; flex: 1; min-width: 0; }
.answer__field input {
  width: 100%; height: 56px; padding: 0 52px 0 20px; border-radius: 18px; border: 0; outline: 0;
  font-size: 22px; font-weight: 500; letter-spacing: .01em; background: var(--lav-4);
  box-shadow: inset 0 0 0 2px var(--line); transition: box-shadow .25s, background .25s;
}
.answer__field input::placeholder { color: #B5B1C9; font-weight: 400; font-size: 17px; }
.answer__field input:focus { background: #fff; box-shadow: inset 0 0 0 2px var(--brand), 0 0 0 5px rgba(89, 65, 242, .12); }
.answer__field.is-ok input { background: var(--ok-bg); box-shadow: inset 0 0 0 2px var(--ok-2); color: var(--ok); }
.answer__field.is-bad input { background: var(--bad-bg); box-shadow: inset 0 0 0 2px var(--bad); color: var(--bad); text-decoration: line-through; text-decoration-thickness: 2px; }
.answer__field.shake { animation: shake .5s cubic-bezier(.36, .07, .19, .97) both; }
.answer__mark { position: absolute; right: 14px; top: 50%; width: 28px; height: 28px; margin-top: -14px; }
.answer__mark path { fill: none; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .5s .1s var(--ease-out) forwards; }
.answer__hint { margin-top: 8px; font-size: 13px; color: var(--muted); }
.answer__row .btn { height: 56px; border-radius: 18px; padding: 0 24px; }
@media (max-width: 480px) { .answer__row { flex-direction: column; } .answer__row .btn { width: 100%; } }
.saved { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--ok); opacity: 0; transition: opacity .3s; }
.saved.is-on { opacity: 1; }
.saved .i { width: 15px; height: 15px; }

.fb { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-top: 16px; padding: 14px 16px; border-radius: 18px; font-size: 16px; animation: rise .45s var(--ease-out) both; }
.fb--ok { background: var(--ok-bg); color: #0B7A51; }
.fb--bad { background: var(--bad-bg); color: #A8172C; }
.fb--self { background: var(--warn-bg); color: #8A5200; }
.fb b { font-weight: 700; }
.fb .i { width: 22px; height: 22px; }
.fb__note { flex-basis: 100%; display: flex; align-items: center; gap: 8px; font-size: 13px; opacity: .85; }
.fb__note .i { width: 16px; height: 16px; }
.fb__streak { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; background: #fff; color: #C25B00; font-size: 13px; font-weight: 700; animation: pop .5s var(--ease-spring) .2s both; }

.next-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; }
.next-row .btn-primary { margin-left: auto; }
@media (max-width: 480px) { .next-row .btn { flex: 1; } }

.collapse { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .55s var(--ease-out), margin .35s; }
.collapse > div { overflow: hidden; min-height: 0; }
.collapse.is-open { grid-template-rows: 1fr; }
.solution { margin-top: 18px; padding: 18px 18px 6px; border-radius: 20px; background: var(--lav-4); box-shadow: inset 0 0 0 1px var(--line); }
.solution__title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--brand); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 12px; }
.steps { list-style: none; counter-reset: st; }
.steps li { position: relative; padding: 0 0 14px 38px; font-size: 16px; line-height: 1.6; counter-increment: st; }
.steps li::before { content: counter(st); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-family: 'Rubik', sans-serif; font-weight: 700; font-size: 13px; color: #fff; background: var(--grad); }
.steps li:not(:last-child)::after { content: ''; position: absolute; left: 12.5px; top: 30px; bottom: 4px; width: 1.5px; background: var(--lav-2); }
.collapse.is-open .steps li { animation: rise .45s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 90ms + 120ms); }
.criteria { margin: 4px 0 14px; display: grid; gap: 8px; }
.criteria div { display: grid; grid-template-columns: 34px 1fr; gap: 10px; font-size: 14px; line-height: 1.45; color: var(--ink-2); }
.criteria b { height: 26px; border-radius: 8px; display: grid; place-items: center; background: #fff; color: var(--brand); font-family: 'Rubik', sans-serif; box-shadow: inset 0 0 0 1px var(--line); }
.answer-key { margin: 2px 0 14px; padding: 12px 14px; border-radius: 14px; background: #fff; font-size: 16px; box-shadow: inset 0 0 0 1px var(--line); }
.answer-key__lbl { display: block; font-size: 12px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }

.task-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 20px; padding-top: 16px; border-top: 1px dashed var(--line); }

.selfcheck { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.selfcheck > span { font-size: 14px; color: var(--muted); margin-right: 4px; }
.pts { min-width: 44px; height: 40px; padding: 0 12px; border-radius: 12px; display: inline-grid; place-items: center; font-family: 'Rubik', sans-serif; font-weight: 700; background: #fff; color: var(--ink-2); box-shadow: inset 0 0 0 1.5px var(--line); transition: transform .25s var(--ease-spring), background .2s, color .2s, box-shadow .2s; }
.pts:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1.5px var(--lav); }
.pts.is-on { color: #fff; background: var(--grad); box-shadow: 0 10px 20px -10px rgba(34, 0, 255, .7); animation: bump .35s var(--ease-spring); }

.photo-drop { margin-top: 18px; display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 18px; border: 2px dashed var(--lav-2); background: var(--lav-4); color: var(--ink-2); font-size: 14px; line-height: 1.4; }
.photo-drop .i { width: 28px; height: 28px; color: var(--brand); }

/* итог сессии */
.summary { text-align: center; padding: 30px 20px; animation: rise .6s var(--ease-out) both; }
@media (min-width: 900px) { .summary { padding: 44px; } }
.summary .ring { margin: 0 auto; }
.summary h2 { margin-top: 18px; font-size: 26px; line-height: 1.15; font-weight: 700; }
.summary p { margin-top: 6px; color: var(--muted); }
.summary__stats { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin: 18px 0 24px; }
.summary__btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

/* ── экзамен ──────────────────────────────────────────────────────────── */
.exam-intro { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; overflow: hidden; }
@media (min-width: 900px) { .exam-intro { grid-template-columns: minmax(0, 1fr) 300px; align-items: center; padding: 44px 48px; } }
.exam-intro__art { position: relative; display: grid; place-items: center; order: -1; }
@media (min-width: 900px) { .exam-intro__art { order: 0; } }
.exam-intro__art img { width: 160px; animation: floaty 5s ease-in-out infinite; filter: drop-shadow(0 26px 22px rgba(43, 27, 158, .3)); }
@media (min-width: 900px) { .exam-intro__art img { width: 250px; } }
.exam-intro__art::before { content: ''; position: absolute; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, rgba(171, 160, 242, .55), transparent 68%); animation: breathe 4s ease-in-out infinite; }
.rules { list-style: none; display: grid; gap: 10px; margin: 20px 0 24px; }
@media (min-width: 640px) { .rules { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rules li { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 18px; background: var(--lav-4); font-size: 14px; line-height: 1.4; color: var(--ink-2); }
.rules li b { display: block; font-size: 15px; color: var(--ink); margin-bottom: 2px; }
.rules .i { width: 22px; height: 22px; color: var(--brand); margin-top: 1px; }
.resume { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; padding: 14px 16px; border-radius: 18px; background: var(--warn-bg); color: #8A5200; font-size: 14px; }
.resume b { color: #6B3F00; }

.exam { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
@media (min-width: 1000px) { .exam { grid-template-columns: 300px minmax(0, 1fr); gap: 24px; align-items: start; } }
.exam__side {
  position: sticky; top: calc(var(--topbar-h) + 8px); z-index: 20;
  padding: 12px; border-radius: var(--r-md); background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: var(--sh-card);
}
@media (min-width: 1000px) { .exam__side { padding: 22px; border-radius: var(--r-lg); top: calc(var(--topbar-h) + 18px); } }
.exam__timer { display: flex; align-items: center; gap: 12px; }
.exam__timer .ring { --size: 52px !important; }
@media (min-width: 1000px) { .exam__timer .ring { --size: 76px !important; } }
.exam__clock { font-family: 'Rubik', sans-serif; font-weight: 700; font-size: 22px; line-height: 1; font-variant-numeric: tabular-nums; }
@media (min-width: 1000px) { .exam__clock { font-size: 28px; } }
.exam__clock small { display: block; margin-top: 4px; font-family: 'Geologica', sans-serif; font-weight: 400; font-size: 12px; color: var(--muted); }
.exam__timer.is-low .exam__clock { color: var(--bad); animation: pulseText 1.2s ease-in-out infinite; }
.exam__timer .btn { margin-left: auto; }
@media (min-width: 1000px) { .exam__timer .btn { display: none; } }
.navgrid { display: flex; gap: 6px; margin-top: 12px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.navgrid::-webkit-scrollbar { display: none; }
@media (min-width: 1000px) { .navgrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 20px; overflow: visible; } }
.navgrid .part-sep { flex: none; margin: 0 4px; writing-mode: horizontal-tb; }
@media (max-width: 999px) { .navgrid .part-sep { display: none; } }
.nav-cell {
  position: relative; flex: none; width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center; font-family: 'Rubik', sans-serif; font-weight: 700; font-size: 15px;
  background: #fff; color: var(--ink-2); box-shadow: inset 0 0 0 1.5px var(--line);
  transition: transform .25s var(--ease-spring), background .25s, color .25s, box-shadow .25s;
}
@media (min-width: 1000px) { .nav-cell { width: auto; height: 46px; } }
.nav-cell:hover { transform: translateY(-2px); }
.nav-cell.is-long { box-shadow: inset 0 0 0 1.5px #F3D7A8; }
.nav-cell.is-done { background: var(--lav-3); color: var(--brand); box-shadow: none; animation: bump .4s var(--ease-spring); }
.nav-cell.is-cur { color: #fff; background: var(--grad); box-shadow: 0 10px 20px -10px rgba(34, 0, 255, .8); transform: scale(1.06); }
.nav-cell.is-flag::after { content: ''; position: absolute; top: -3px; right: -3px; width: 11px; height: 11px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 2px #fff; }
.exam__stats { display: none; margin-top: 18px; font-size: 14px; color: var(--muted); line-height: 1.6; }
@media (min-width: 1000px) { .exam__stats { display: block; } .exam__side .btn-block { margin-top: 16px; } }
.exam__side > .btn-block { display: none; }
@media (min-width: 1000px) { .exam__side > .btn-block { display: inline-flex; } }
.exam__pager { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.exam__pager .btn-primary { margin-left: auto; }
@media (max-width: 480px) { .exam__pager .btn { padding: 0 14px; } .hide-sm { display: none !important; } }

/* ── результат ────────────────────────────────────────────────────────── */
.result-hero {
  position: relative; overflow: hidden; isolation: isolate; color: #fff;
  border-radius: var(--r-xl); padding: 28px 22px; background: var(--grad); box-shadow: var(--sh-hero);
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; text-align: center;
}
@media (min-width: 900px) { .result-hero { grid-template-columns: auto 1fr; text-align: left; align-items: center; padding: 44px 52px; gap: 44px; } }
.result-hero .ring { margin: 0 auto; }
.result-hero__score { font-size: 96px; line-height: .9; }
@media (min-width: 900px) { .result-hero__score { font-size: 120px; } }
.result-hero__unit { margin-top: 6px; font-size: 16px; color: rgba(255, 255, 255, .85); }
.result-hero__msg { margin-top: 14px; font-size: 17px; line-height: 1.45; max-width: 560px; }
.result-hero__chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; justify-content: center; }
@media (min-width: 900px) { .result-hero__chips { justify-content: flex-start; } }

.res-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.res-row { border-radius: 18px; background: var(--lav-4); overflow: hidden; transition: background .25s; }
.res-row__head { width: 100%; display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 10px 14px 10px 10px; text-align: left; }
@media (min-width: 900px) { .res-row__head { grid-template-columns: 44px 1fr 150px 150px 36px; } }
.res-row__n { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-family: 'Rubik', sans-serif; font-weight: 700; color: #fff; }
.res-row.ok .res-row__n { background: linear-gradient(135deg, #1DC28A, #0E9A68); }
.res-row.bad .res-row__n { background: linear-gradient(135deg, #F45B70, #D42A42); }
.res-row.empty .res-row__n { background: #CFCBE0; }
.res-row__topic { font-size: 15px; font-weight: 500; line-height: 1.25; }
.res-row__topic small { display: block; font-size: 13px; font-weight: 400; color: var(--muted); }
.res-row__ans { font-size: 14px; color: var(--muted); }
.res-row__ans b { display: block; font-size: 16px; color: var(--ink); font-weight: 500; }
.res-row.bad .res-row__ans--mine b { color: var(--bad); text-decoration: line-through; }
@media (max-width: 899px) { .res-row__ans { display: none; } }
.res-row__chev { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); transition: transform .35s var(--ease-out); }
.res-row.is-open .res-row__chev { transform: rotate(180deg); }
.res-row .collapse > div > div { padding: 0 14px 14px; }
.res-row .solution { margin-top: 4px; background: #fff; }
.mobile-ans { display: flex; gap: 16px; font-size: 14px; margin-bottom: 4px; }
@media (min-width: 900px) { .mobile-ans { display: none; } }

.long-row { padding: 16px; border-radius: 18px; background: var(--lav-4); }
.long-row + .long-row { margin-top: 10px; }
.long-row__head { display: flex; align-items: center; gap: 12px; }
.long-row__head .res-row__n { background: linear-gradient(135deg, #FFB547, #F08C00); flex: none; }
.long-row__head .btn { margin-left: auto; }
.long-row .selfcheck { margin-top: 12px; }

.result-ctas { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.note { margin-top: 18px; font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: flex-start; }
.note .i { width: 16px; height: 16px; margin-top: 2px; }

/* ── статистика ───────────────────────────────────────────────────────── */
.stat-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 900px) { .stat-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; } }
.stat-tile { position: relative; overflow: hidden; padding: 18px; border-radius: var(--r-md); background: #fff; box-shadow: var(--sh-card); min-height: 132px; display: flex; flex-direction: column; justify-content: space-between; }
@media (min-width: 900px) { .stat-tile { padding: 22px; min-height: 150px; border-radius: var(--r-lg); } }
.stat-tile b { font-size: 34px; line-height: 1; }
@media (min-width: 900px) { .stat-tile b { font-size: 44px; } }
.stat-tile span { font-size: 13px; color: var(--muted); line-height: 1.3; }
.stat-tile img { position: absolute; right: -8px; top: -6px; width: 72px; opacity: .95; animation: floaty 6s ease-in-out infinite; animation-delay: calc(var(--i, 0) * -1.3s); }
@media (min-width: 900px) { .stat-tile img { width: 90px; } }
.stat-tile--accent { background: var(--grad); color: #fff; }
.stat-tile--accent span { color: rgba(255, 255, 255, .85); }
.trend { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: var(--ok); }
.stat-tile--accent .trend { color: #B7FFE0; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: 16px; }
@media (min-width: 900px) { .grid-2 { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 20px; margin-top: 20px; } }

.bars { display: flex; align-items: flex-end; gap: 8px; height: 180px; padding-top: 10px; }
.bars__col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.bars__bar { position: relative; width: 100%; max-width: 46px; border-radius: 12px 12px 6px 6px; background: var(--lav-2); transform-origin: bottom; animation: barGrow .9s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 70ms + 200ms); }
.bars__bar.is-cur { background: var(--grad); box-shadow: 0 12px 22px -12px rgba(34, 0, 255, .7); }
.bars__bar em { position: absolute; left: 50%; top: -22px; transform: translateX(-50%); font-style: normal; font-family: 'Rubik', sans-serif; font-weight: 700; font-size: 12px; color: var(--ink-2); opacity: 0; animation: fadeIn .4s ease forwards; animation-delay: calc(var(--i, 0) * 70ms + 800ms); }
.bars__col span { font-size: 11px; color: var(--muted); white-space: nowrap; }

.history { list-style: none; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.history li { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; background: var(--lav-4); transition: transform .25s var(--ease-out), background .2s; }
.history li:hover { transform: translateX(3px); background: var(--lav-3); }
.history__ico { width: 44px; height: 44px; flex: none; border-radius: 14px; display: grid; place-items: center; background: #fff; }
.history__ico img { width: 34px; height: 34px; }
.history__txt { flex: 1; min-width: 0; line-height: 1.3; }
.history__txt b { display: block; font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history__txt span { font-size: 13px; color: var(--muted); }
.score-pill { flex: none; padding: 6px 12px; border-radius: 999px; font-family: 'Rubik', sans-serif; font-weight: 700; font-size: 15px; background: #fff; color: var(--brand); box-shadow: inset 0 0 0 1.5px var(--lav-2); }
.score-pill--hi { color: #fff; background: var(--grad); box-shadow: none; }

.achievements { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 900px) { .achievements { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; } }
.ach { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 18px; background: var(--lav-4); }
.ach img { width: 48px; height: 48px; flex: none; transition: transform .4s var(--ease-spring); }
.ach:hover img { transform: rotate(-10deg) scale(1.1); }
.ach b { display: block; font-size: 14px; line-height: 1.25; }
.ach span { font-size: 12px; color: var(--muted); }
.ach.is-locked { opacity: .55; }
.ach.is-locked img { filter: grayscale(1); }

/* ── работы (ученик) ──────────────────────────────────────────────────── */
.hw-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.hw { display: grid; grid-template-columns: 56px 1fr; gap: 14px; align-items: center; padding: 16px; border-radius: var(--r-md); background: #fff; box-shadow: var(--sh-card); transition: transform .3s var(--ease-out), box-shadow .3s; }
.hw:hover { transform: translateY(-2px); box-shadow: var(--sh-lift); }
@media (min-width: 900px) { .hw { grid-template-columns: 64px 1fr 220px auto; padding: 18px 22px; gap: 20px; } }
.hw img { width: 56px; height: 56px; }
.hw__title { font-size: 17px; font-weight: 700; line-height: 1.2; }
.hw__meta { margin-top: 3px; font-size: 13px; color: var(--muted); }
.hw__prog { grid-column: 1 / -1; }
@media (min-width: 900px) { .hw__prog { grid-column: auto; } }
.hw__prog small { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); }
.hw .btn { grid-column: 1 / -1; }
@media (min-width: 900px) { .hw .btn { grid-column: auto; } }

/* ── преподаватель (демо) ─────────────────────────────────────────────── */
.teacher { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 1180px) { .teacher { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 20px; align-items: start; } .teacher .mini-nums { grid-template-columns: repeat(5, 1fr); } }
.step { padding: 16px 0; border-top: 1px dashed var(--line); }
.step:first-of-type { border-top: 0; padding-top: 4px; }
.step__label { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 15px; font-weight: 700; }
.step__label i { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-family: 'Rubik', sans-serif; font-size: 13px; color: #fff; background: var(--grad); }
.choice { display: flex; flex-wrap: wrap; gap: 8px; }
.choice button { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px 0 6px; border-radius: 999px; font-size: 14px; font-weight: 500; background: var(--lav-4); color: var(--ink-2); box-shadow: inset 0 0 0 1.5px var(--line); transition: transform .25s var(--ease-spring), background .2s, color .2s, box-shadow .2s; }
.choice button.no-av { padding-left: 14px; }
.choice button:hover { transform: translateY(-1px); }
.choice button.is-on { background: var(--lav-3); color: var(--brand); box-shadow: inset 0 0 0 2px var(--brand); }
.choice .av { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; background: var(--grad-soft); }
.mini-nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 520px) { .mini-nums { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (min-width: 640px) { .mini-nums { grid-template-columns: repeat(7, minmax(0, 1fr)); } }
.mini-num { display: grid; justify-items: center; gap: 6px; padding: 10px 4px; border-radius: 14px; background: var(--lav-4); box-shadow: inset 0 0 0 1.5px var(--line); transition: background .2s, box-shadow .2s; }
.mini-num b { font-family: 'Rubik', sans-serif; font-size: 16px; color: var(--ink-2); }
.mini-num .stepper { height: 30px; padding: 2px; background: #fff; }
.mini-num .stepper button { width: 24px; height: 24px; }
@media (max-width: 519px) { .mini-num .stepper button { width: 21px; height: 21px; } .mini-num .stepper output { min-width: 13px; } }
.mini-num .stepper output { min-width: 16px; font-size: 13px; }
.mini-num.has-value { background: var(--lav-3); box-shadow: inset 0 0 0 2px var(--lav); }
.toggles { display: grid; gap: 10px; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.toggle input { display: none; }
.toggle i { position: relative; width: 46px; height: 28px; border-radius: 999px; background: #DCD8EC; flex: none; transition: background .3s; }
.toggle i::after { content: ''; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.2); transition: transform .35s var(--ease-spring); }
.toggle input:checked + i { background: var(--brand); }
.toggle input:checked + i::after { transform: translateX(18px); }
.send-fly { animation: fly .9s var(--ease-out) both; }

.matrix-wrap { overflow-x: auto; margin: 0 -6px; padding: 0 6px; }
.matrix { width: 100%; border-collapse: separate; border-spacing: 0 6px; font-size: 14px; min-width: 520px; }
.matrix th { padding: 6px 4px; font-size: 12px; font-weight: 500; color: var(--muted); text-align: center; }
.matrix th:first-child { text-align: left; }
.matrix td { padding: 8px 4px; text-align: center; background: var(--lav-4); }
.matrix td:first-child { text-align: left; padding-left: 12px; border-radius: 14px 0 0 14px; }
.matrix td:last-child { border-radius: 0 14px 14px 0; padding-right: 12px; }
.matrix .who { display: flex; align-items: center; gap: 10px; font-weight: 500; white-space: nowrap; }
.mc { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; font-weight: 700; animation: tileIn .45s var(--ease-spring) both; animation-delay: calc(var(--i, 0) * 30ms + 200ms); }
.mc.ok { background: var(--ok-bg); color: var(--ok); }
.mc.bad { background: var(--bad-bg); color: var(--bad); }
.mc.none { background: #ECEAF4; color: #B5B1C9; }
.mc .i { width: 16px; height: 16px; stroke-width: 3; }
.insight { display: flex; gap: 12px; align-items: flex-start; margin-top: 14px; padding: 14px; border-radius: 16px; background: var(--warn-bg); color: #6B3F00; font-size: 14px; line-height: 1.45; }
.insight img { width: 40px; height: 40px; flex: none; }

.demo-link { display: flex; justify-content: center; margin-top: 26px; }

/* ── модалки и тосты ──────────────────────────────────────────────────── */
.modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: end center; padding: 12px; }
@media (min-width: 640px) { .modal { place-items: center; } }
.modal__overlay { position: absolute; inset: 0; background: rgba(18, 16, 42, .45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fadeIn .25s ease both; }
.modal__card { position: relative; width: 100%; max-width: 520px; max-height: calc(100vh - 24px); overflow-y: auto; padding: 26px 22px 22px; border-radius: 28px; background: #fff; box-shadow: 0 40px 80px -30px rgba(18, 16, 42, .6); animation: modalIn .45s var(--ease-spring) both; }
@media (min-width: 640px) { .modal__card { padding: 32px; } }
.modal.is-closing .modal__overlay { animation: fadeOut .2s ease both; }
.modal.is-closing .modal__card { animation: modalOut .2s ease-in both; }
.modal__x { position: absolute; top: 14px; right: 14px; width: 38px; height: 38px; }
.modal__title { padding-right: 40px; font-size: 21px; line-height: 1.2; font-weight: 700; }
.modal__body { margin-top: 12px; font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.modal__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; justify-content: flex-end; }
@media (max-width: 480px) { .modal__actions .btn { flex: 1; } }
.reasons { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.reasons button { height: 38px; padding: 0 14px; border-radius: 999px; font-size: 14px; background: var(--lav-4); box-shadow: inset 0 0 0 1.5px var(--line); transition: background .2s, color .2s, box-shadow .2s; }
.reasons button.is-on { background: var(--lav-3); color: var(--brand); box-shadow: inset 0 0 0 2px var(--brand); }
.modal textarea { width: 100%; min-height: 96px; padding: 12px 14px; border-radius: 16px; border: 0; outline: 0; resize: vertical; background: var(--lav-4); box-shadow: inset 0 0 0 1.5px var(--line); font-size: 15px; transition: box-shadow .2s, background .2s; }
.modal textarea:focus { background: #fff; box-shadow: inset 0 0 0 2px var(--brand); }
.menu-list { display: grid; gap: 6px; margin-top: 6px; }
.menu-list a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; font-weight: 500; background: var(--lav-4); transition: background .2s, transform .25s var(--ease-out); }
.menu-list a:hover { background: var(--lav-3); transform: translateX(3px); }
.menu-list .i { color: var(--brand); }

#toast-root { position: fixed; z-index: 300; left: 0; right: 0; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px); display: grid; justify-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
@media (min-width: 900px) { #toast-root { bottom: 28px; } }
body.is-focus #toast-root { bottom: 20px; }
.toast { display: inline-flex; align-items: center; gap: 10px; max-width: 520px; padding: 12px 18px; border-radius: 999px; color: #fff; background: rgba(18, 16, 42, .92); font-size: 14px; box-shadow: 0 18px 40px -16px rgba(18, 16, 42, .7); animation: toastIn .45s var(--ease-spring) both; }
.toast.ok { background: linear-gradient(135deg, #1DC28A, #0E9A68); }
.toast.is-out { animation: toastOut .3s ease-in both; }
.toast .i { width: 18px; height: 18px; }

.float-text { position: fixed; z-index: 400; pointer-events: none; font-family: 'Rubik', sans-serif; font-weight: 700; font-size: 22px; color: var(--ok-2); text-shadow: 0 6px 16px rgba(18, 160, 108, .35); animation: floatUp 1s var(--ease-out) forwards; }
#fx-canvas { position: fixed; inset: 0; z-index: 500; pointer-events: none; }

/* ── кнопка смены знака в поле ответа, размеры колец, шаг назад ───────── */
.ring svg { width: var(--size); height: var(--size); }
.pm {
  position: absolute; right: 9px; top: 50%; width: 38px; height: 38px; margin-top: -19px;
  border-radius: 12px; display: grid; place-items: center;
  font-family: 'Rubik', sans-serif; font-weight: 700; font-size: 18px; color: var(--brand);
  background: #fff; box-shadow: inset 0 0 0 1.5px var(--line);
  transition: transform .2s var(--ease-spring), box-shadow .2s;
}
.pm:hover { box-shadow: inset 0 0 0 1.5px var(--lav); }
.pm:active { transform: scale(.9); }
.answer__field.is-ok .pm, .answer__field.is-bad .pm { display: none; }
.task-card.enter-back { animation: slideInL .55s var(--ease-out) both; }
@keyframes slideInL { from { opacity: 0; transform: translateX(-56px) rotate(-.6deg); } to { opacity: 1; transform: none; } }

.ring__label .i { width: calc(var(--size) * .36); height: calc(var(--size) * .36); color: var(--brand); }
.exam__timer.is-low .ring__label .i { color: var(--bad); }
.btn:focus-visible, .icon-btn:focus-visible, .pill:focus-visible, .nav-cell:focus-visible, .pts:focus-visible { outline: 3px solid rgba(89, 65, 242, .35); outline-offset: 3px; }
a:focus-visible { outline: 3px solid rgba(89, 65, 242, .35); outline-offset: 3px; border-radius: 12px; }

/* ── живой режим: вход, демо-плашка, загрузка, модерация ───────────────── */
.staff-only { display: none !important; }
body.is-staff .topnav .staff-only { display: inline-flex !important; }
body.is-staff .tabbar .staff-only { display: flex !important; }
body.is-staff .tabbar { grid-template-columns: repeat(5, 1fr); }
body.is-staff .tabbar .student-tab { display: none; }

.demo-banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 14px; padding: 12px 14px 12px 16px; border-radius: 18px;
  background: #fff; box-shadow: var(--sh-card), inset 0 0 0 1.5px var(--lav-2); font-size: 14px; color: var(--ink-2);
}
.demo-banner > .i { width: 22px; height: 22px; color: var(--brand); }
.demo-banner > span { flex: 1; min-width: 200px; }
.demo-banner .btn { margin-left: auto; }

.num-row.is-off { opacity: .62; }
.num-row.is-off:hover { transform: none; box-shadow: var(--sh-card); }
.num-row.is-off:hover .num-badge { transform: none; background: var(--lav-3); color: var(--brand); }

.skeleton { display: grid; gap: 14px; }
.skeleton i { display: block; height: 18px; border-radius: 9px; background: linear-gradient(90deg, var(--lav-4), var(--lav-3), var(--lav-4)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.skeleton i:first-child { height: 30px; width: 40%; }
.skeleton i.w60 { width: 60%; }

.btn.is-loading { pointer-events: none; }
.btn.is-loading::after { content: ''; width: 16px; height: 16px; margin-left: 4px; border-radius: 50%; border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; animation: spin .7s linear infinite; }
.dontknow { margin-top: 10px; }
.dontknow:hover { color: var(--brand); }
.hint-warn { display: inline-flex; align-items: center; gap: 6px; color: #A86400; font-weight: 500; }
.hint-warn .i { width: 16px; height: 16px; }

.modal--wide .modal__card { max-width: 780px; }
.samples { display: grid; gap: 16px; margin-top: 14px; }
.sample { padding: 16px; border-radius: 20px; background: #fff; box-shadow: inset 0 0 0 1.5px var(--line); }
.sample__head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; font-size: 13px; }
.sample__head .chip--ok { margin-left: auto; }
.sample .task-text { font-size: 16px; }
.sample .solution { margin-top: 12px; }

.gen-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.gen-group .card__head { flex-wrap: wrap; }
.gen-group__meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gen-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 14px; border-radius: 18px; background: var(--lav-4); }
.gen-row + .gen-row { margin-top: 8px; }
@media (min-width: 760px) { .gen-row { grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; } }
.gen-row__main b { display: block; font-size: 15px; }
.gen-row__main code, .report__meta code { font-size: 12px; color: var(--muted); font-family: ui-monospace, Menlo, monospace; }
.gen-row__stats { display: block; margin-top: 4px; font-size: 13px; color: var(--muted); }
.gen-row__act { display: flex; gap: 8px; flex-wrap: wrap; }
.rep-link { color: var(--bad); font-weight: 500; }

.report__meta { font-size: 13px; color: var(--muted); margin: -8px 0 10px; }
.report .reasons { margin: 0 0 10px; }
.report__comment { margin: 0 0 12px; padding: 10px 14px; border-left: 3px solid var(--lav); border-radius: 0 12px 12px 0; background: var(--lav-4); font-size: 15px; }
.report__answers { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-bottom: 12px; font-size: 14px; color: var(--muted); }
.report__answers b { color: var(--ink); }
.report__task { padding: 14px; border-radius: 16px; box-shadow: inset 0 0 0 1.5px var(--line); }
.report__task .task-text { font-size: 16px; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ── анимации ─────────────────────────────────────────────────────────── */
@keyframes rise      { from { opacity: 0; transform: translateY(18px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes viewIn    { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes viewOut   { to { opacity: 0; transform: translateY(-8px); } }
@keyframes fadeIn    { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut   { to { opacity: 0; } }
@keyframes floaty    { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-8px) rotate(2.5deg); } }
@keyframes drift     { 0% { transform: translate3d(0, 0, 0) rotate(0); } 100% { transform: translate3d(-40px, 30px, 0) rotate(6deg); } }
@keyframes mathFloat { 0% { transform: translateY(0) rotate(-10deg); opacity: 0; } 12% { opacity: 1; } 85% { opacity: 1; } 100% { transform: translateY(-520px) rotate(14deg); opacity: 0; } }
@keyframes shake     { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-8px); } 40%, 60% { transform: translateX(8px); } }
@keyframes pop       { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); } }
@keyframes bump      { 0% { transform: scale(1); } 40% { transform: scale(1.22); } 100% { transform: scale(1); } }
@keyframes draw      { to { stroke-dashoffset: 0; } }
@keyframes shimmer   { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes pulseRed  { 0% { box-shadow: 0 0 0 0 rgba(224, 52, 75, .5); } 100% { box-shadow: 0 0 0 9px rgba(224, 52, 75, 0); } }
@keyframes pulseText { 50% { opacity: .55; } }
@keyframes flame     { 0%, 100% { transform: scale(1) rotate(-4deg); } 50% { transform: scale(1.15) rotate(4deg); } }
@keyframes barGrow   { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes tileIn    { from { opacity: 0; transform: translateY(10px) scale(.8); } to { opacity: 1; transform: none; } }
@keyframes slideInR  { from { opacity: 0; transform: translateX(56px) rotate(.6deg); } to { opacity: 1; transform: none; } }
@keyframes slideOutL { to { opacity: 0; transform: translateX(-56px) rotate(-.6deg); } }
@keyframes modalIn   { from { opacity: 0; transform: translateY(30px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes modalOut  { to { opacity: 0; transform: translateY(16px) scale(.97); } }
@keyframes toastIn   { from { opacity: 0; transform: translateY(20px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes toastOut  { to { opacity: 0; transform: translateY(12px) scale(.95); } }
@keyframes floatUp   { from { opacity: 1; transform: translate(-50%, 0) scale(.9); } to { opacity: 0; transform: translate(-50%, -54px) scale(1.15); } }
@keyframes breathe   { 0%, 100% { transform: scale(1); opacity: .9; } 50% { transform: scale(1.12); opacity: 1; } }
@keyframes fly       { 0% { transform: none; } 40% { transform: translate(-6px, 4px) rotate(-8deg); } 100% { transform: translate(260px, -160px) rotate(18deg); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .reveal, .heat__cell { opacity: 1; }
}

/* знакомство: карточка из трёх шагов и подсказки на месте */
.modal--onb .modal__card { max-width: 520px; }
.onb { display: grid; gap: 12px; margin-top: 6px; }
.onb__step { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 14px; align-items: center; padding: 12px 14px; border-radius: 18px;
  background: var(--lav-4); animation: rise .45s var(--ease-out) both; animation-delay: calc(var(--i) * 110ms + 120ms); }
.onb__step img { width: 56px; height: 56px; object-fit: contain; }
.onb__step b { display: block; font-size: 16px; }
.onb__step span { display: block; margin-top: 2px; font-size: 14px; line-height: 1.45; color: var(--ink-2); }
.onb__note { margin-top: 12px; font-size: 13px; }
.coach { position: absolute; z-index: 60; max-width: min(320px, calc(100vw - 24px)); padding: 12px 14px 12px; border-radius: 16px;
  background: var(--ink); color: #fff; font-size: 14px; line-height: 1.45; box-shadow: 0 18px 40px -16px rgba(18, 16, 42, .55);
  opacity: 0; transform: translateY(6px); transition: opacity .25s, transform .3s var(--ease-out); pointer-events: none; }
.coach.is-in { opacity: 1; transform: none; pointer-events: auto; }
.coach.is-out { opacity: 0; transform: translateY(6px); }
.coach b { color: #D9D3FF; }
.coach__arrow { position: absolute; top: -6px; width: 12px; height: 12px; background: var(--ink); transform: rotate(45deg); border-radius: 2px; }
.coach--above .coach__arrow { top: auto; bottom: -6px; }
.coach__ok { margin-top: 8px; height: 30px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--ink); background: #fff; }
.coach__ok:hover { background: var(--lav-2); }

/* ── этап 2: варианты, пробник, работы ───────────────────────────────── */
.resume--info { background: var(--lav-3); color: var(--ink-2); }
.resume--info b { color: var(--ink); }
.open-list { display: grid; gap: 8px; margin: 4px 0 18px; }
.open-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--lav-4); box-shadow: inset 0 0 0 1.5px var(--line); transition: transform .25s var(--ease-out), background .2s; }
.open-row:hover { transform: translateX(3px); background: var(--lav-3); }
.open-row > .i { width: 20px; height: 20px; color: var(--brand); flex: none; }
.open-row > span:not(.btn) { flex: 1; min-width: 0; line-height: 1.3; }
.open-row b { display: block; font-size: 15px; font-weight: 500; }
.open-row small { font-size: 13px; color: var(--muted); }
.vnum { display: inline-flex; gap: 8px; align-items: center; }
.vnum input { width: 150px; height: 52px; padding: 0 16px; border-radius: 16px; border: 0; outline: 0; background: var(--lav-4); box-shadow: inset 0 0 0 1.5px var(--line); font-family: 'Rubik', sans-serif; font-size: 17px; letter-spacing: .08em; transition: box-shadow .2s, background .2s; }
.vnum input:focus { background: #fff; box-shadow: inset 0 0 0 2px var(--brand); }
.vnum input::placeholder { letter-spacing: 0; font-family: inherit; font-size: 15px; color: var(--muted); }
@media (max-width: 519px) { .vnum { width: 100%; } .vnum input { flex: 1; width: auto; min-width: 0; } }
.history__link { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; color: inherit; }
.hw.is-done { background: var(--lav-4); box-shadow: none; }
.hw__note { margin-top: 6px; font-size: 13px; color: var(--ink-2); font-style: italic; }
.mini-num.is-off { opacity: .5; background: transparent; }
.mini-num.is-off small { font-size: 11px; color: var(--muted); line-height: 30px; }
.due-pick { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 10px 0 12px; border-radius: 999px; background: var(--lav-4); box-shadow: inset 0 0 0 1.5px var(--line); color: var(--ink-2); cursor: pointer; }
.due-pick .i { width: 18px; height: 18px; }
.due-pick input { border: 0; outline: 0; background: transparent; font: inherit; font-size: 14px; color: inherit; max-width: 140px; }
.due-pick.is-on { background: var(--lav-3); color: var(--brand); box-shadow: inset 0 0 0 2px var(--brand); }
.inp { width: 100%; padding: 12px 14px; border-radius: 14px; border: 0; outline: 0; background: var(--lav-4); box-shadow: inset 0 0 0 1.5px var(--line); font: inherit; font-size: 15px; color: var(--ink); transition: box-shadow .2s, background .2s; resize: vertical; }
.inp:focus { background: #fff; box-shadow: inset 0 0 0 2px var(--brand); }
.alist { display: grid; gap: 10px; }
.arow { border-radius: 18px; background: var(--lav-4); box-shadow: inset 0 0 0 1.5px var(--line); transition: background .2s, box-shadow .2s; }
.arow.is-open { background: #fff; box-shadow: inset 0 0 0 2px var(--lav), var(--sh-card); }
.arow__head { width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px 16px; text-align: left; }
.arow__title { flex: 1; min-width: 0; font-size: 15px; font-weight: 600; line-height: 1.3; }
.arow__title small { display: block; margin-top: 2px; font-size: 13px; font-weight: 400; color: var(--muted); }
.arow .res-row__chev { transition: transform .3s var(--ease-out); }
.arow.is-open .res-row__chev { transform: rotate(180deg); }
.arow__body { padding: 0 12px 14px; }
.arow__foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px 18px; margin-top: 10px; }
button.mc { border: 0; cursor: pointer; font-family: 'Rubik', sans-serif; font-size: 14px; }
.mc.filled { background: var(--lav-3); color: var(--brand); }
.mc.wait { background: var(--warn-bg); color: #A35F00; box-shadow: inset 0 0 0 1.5px #F2C46D; }
.mc.part { background: var(--warn-bg); color: #A35F00; }
.mc.pts:hover, .mc.wait:hover { transform: translateY(-1px); box-shadow: inset 0 0 0 2px var(--brand); }
.matrix th .th-n { display: block; font-size: 10px; color: var(--muted); opacity: .8; }
.ans-list { display: grid; gap: 8px; margin-top: 12px; }
.ans-row { border-radius: 14px; background: var(--lav-4); }
.ans-row summary { display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; list-style: none; }
.ans-row summary::-webkit-details-marker { display: none; }
.ans-row.ok summary { box-shadow: inset 3px 0 0 var(--ok); border-radius: 14px; }
.ans-row.bad summary { box-shadow: inset 3px 0 0 var(--bad); border-radius: 14px; }
.ans-row .res-row__n { background: #fff; color: var(--brand); box-shadow: inset 0 0 0 1.5px var(--line); }
.ans-row.ok .res-row__n { background: var(--ok-bg); color: var(--ok); box-shadow: none; }
.ans-row.bad .res-row__n { background: var(--bad-bg); color: var(--bad); box-shadow: none; }
.ans-row__given { flex: 1; min-width: 0; font-size: 14px; }
.ans-row__state { font-size: 13px; color: var(--muted); white-space: nowrap; }
.ans-row__body { padding: 4px 14px 14px; }

/* ── оформление решений: таблицы, окружность, метод интервалов ───────── */
.steps li .sol-table, .steps li .sfig { margin-left: -2px; }
/* на телефоне рисунок в решении шире — на всю ширину блока решения: так подписи меньше теснятся */
@media (max-width: 519px) { .solution .steps li .sfig { position: relative; z-index: 1; width: calc(100% + 60px); margin-left: -48px; background: var(--lav-4); border-radius: 12px; } }
.sol-table { margin: 10px 0 6px; overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line); background: #fff; }
.sol-table table { border-collapse: collapse; min-width: 100%; font-size: 14px; }
.sol-table th { padding: 9px 10px; font-size: 12px; font-weight: 600; line-height: 1.25; color: var(--ink-2); background: var(--lav-3); text-align: center; vertical-align: bottom; }
.sol-table td { padding: 8px 12px; text-align: center; border-top: 1px solid var(--line); white-space: nowrap; }
.sol-table td:first-child { font-weight: 600; color: var(--brand); }
.sol-table tr.is-sum td { background: var(--lav-3); font-weight: 600; border-top: 2px solid var(--lav-2); }
.sol-table .katex { font-size: 1.08em; }
.sfig { margin: 12px auto 6px; width: 100%; }
.sfig__box { position: relative; width: 100%; }
.sfig__box svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.sfig__l { position: absolute; transform: translate(-50%, -50%); padding: 2px 3px; border-radius: 6px; background: rgba(255, 255, 255, .88); font-size: 13.5px; line-height: 1; white-space: nowrap; color: var(--ink); pointer-events: none; }
.sfig__l.end { color: var(--brand); }
.sfig__l.root .katex { font-weight: 700; }
.sfig__l.var { font-size: 15px; }
.sfig__l.txt { font-size: 12px; font-weight: 600; color: var(--brand); letter-spacing: .02em; }
.sfig__l.txt.mute { color: var(--muted); font-weight: 500; }
.sfig__l.txt.ink { color: var(--ink); font-weight: 500; }
.sfig--circle { max-width: 300px; }
.sfig__l.tick { font-size: 12px; color: var(--ink-2); background: none; }
.sfig__l.lbl { font-size: 13px; color: var(--brand); }
.sfig__l.pt { font-size: 14px; background: none; }
.sfig--solid { max-width: 420px; }
@media (max-width: 519px) { .sfig__l { font-size: 12px; } }
.sfig figcaption { margin-top: 4px; font-size: 12.5px; line-height: 1.35; color: var(--muted); text-align: center; }
.sol-way { display: inline-block; margin: 4px 0 2px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--brand); background: var(--lav-3); }
.sol-note { display: block; margin-top: 6px; padding: 8px 12px; border-radius: 12px; font-size: 14px; line-height: 1.45; color: #6B3F00; background: var(--warn-bg); }
.sol-cases { display: grid; gap: 8px; margin-top: 8px; }
.sol-cases p { padding: 10px 12px; border-radius: 12px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); line-height: 1.5; }
.sol-cases .di { display: block; padding: 5px 0 0; }

/* Варианты ФИПИ «по годам» на экране «Вариант» */
.off-title { margin: 22px 0 10px; font: 600 17px/1.3 Rubik, sans-serif; color: var(--ink); }
.off-list { display: grid; gap: 10px; margin: 0 0 18px; }
.off-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 18px; background: var(--lav-4); box-shadow: inset 0 0 0 1.5px var(--line); }
.off-card__ico { width: 46px; height: 46px; flex: none; object-fit: contain; }
.off-card__txt { flex: 1; min-width: 0; line-height: 1.35; }
.off-card__txt b { display: block; font-size: 16px; font-weight: 500; color: var(--ink); }
.off-card__txt small { display: block; margin-top: 3px; font-size: 13px; color: var(--muted); }
.off-card__btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.off-card.is-locked { opacity: .75; }
@media (max-width: 640px) {
  .off-card { flex-wrap: wrap; }
  .off-card__btns { width: 100%; justify-content: flex-start; }
}
.task-src__note { font-weight: 500; color: var(--brand); }

/* Подсказки по шагам решения */
.answer__more { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; margin-top: 10px; }
.answer__more .link-btn small { color: var(--muted); font-weight: 400; }
[data-hint-btn] small { font-weight: 400; opacity: .75; }
.hint-box { margin-top: 16px; padding: 14px 16px 6px; border-radius: 18px; background: var(--warn-bg); box-shadow: inset 0 0 0 1.5px #F7DCA6; }
.hint-box__title { display: flex; align-items: center; gap: 8px; font-weight: 500; color: #6B3F00; font-size: 14px; }
.hint-box__title .i { width: 18px; height: 18px; color: var(--warn); }
.hint-box .steps { margin-top: 10px; }
.hint-box__note { margin: 4px 0 10px; font-size: 13px; color: #8A5200; }

.answer__more .dontknow { margin-top: 0; }

/* Шпаргалка по номеру */
.modal--theory .modal__body { margin-top: 6px; }
.theory__sec { margin-top: 14px; }
.theory__h { display: flex; align-items: center; gap: 8px; font: 600 15px/1.3 Rubik, sans-serif; color: var(--ink); }
.theory__h .i { width: 18px; height: 18px; color: var(--warn); }
.theory__list { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 7px; font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.theory__warn { margin-top: 18px; padding: 12px 16px 14px; border-radius: 18px; background: var(--warn-bg); }
.theory-btn .i { width: 18px; height: 18px; }


/* ── Прогноз балла: карточка в статистике и у преподавателя ── */
.trend--down { color: var(--bad); }
.trend--flat { color: var(--muted); font-weight: 600; }
.stat-tile--accent .trend--down { color: #FFC9D1; }
.stat-tile--accent .trend--flat { color: rgba(255, 255, 255, .8); }
.forecast__more { display: inline-flex; align-items: center; gap: 4px; margin-top: 10px; white-space: nowrap; font-size: 13px; font-weight: 600; color: #fff; text-decoration: none; opacity: .92; }
.forecast__more .i { width: 15px; height: 15px; transition: transform .25s var(--ease-out); }
.forecast__more:hover { opacity: 1; }
.forecast__more:hover .i { transform: translateX(3px); }
.fc { scroll-margin-top: calc(var(--topbar-h) + 16px); }
.fc .card__head { flex-wrap: wrap; }
.fc__wait { font-size: 15px; line-height: 1.5; color: var(--ink-2); margin: 0 0 14px; }
.fc__top { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: center; }
@media (min-width: 720px) { .fc__top { grid-template-columns: auto minmax(0, 1fr); gap: 28px; } }
.fc__score { display: flex; align-items: center; gap: 14px; }
.fc__score > b { font-size: 64px; line-height: .9; letter-spacing: -.03em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.fc__score span { display: block; font-size: 15px; font-weight: 600; color: var(--ink); }
.fc__score small { display: block; margin-top: 4px; font-size: 13px; color: var(--muted); }
.fc__facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.fc-fact { padding: 10px 12px; border-radius: 16px; background: var(--lav-4); }
.fc-fact b { display: block; font: 700 18px/1.2 Rubik, sans-serif; color: var(--ink); white-space: nowrap; }
.fc-fact b .trend { font-size: 18px; }
.fc-fact span { display: block; margin-top: 2px; font-size: 12px; line-height: 1.3; color: var(--muted); }
.fc-scale { position: relative; margin-top: 22px; padding-top: 22px; }
.fc-scale .bar { height: 12px; }
.fc-scale__mark { position: absolute; top: 18px; height: 20px; width: 0; border-left: 2px dashed #A8A4BE; font-style: normal; }
.fc-scale__mark span { position: absolute; top: -20px; left: 0; transform: translateX(-50%); font-size: 11px; line-height: 14px; color: var(--muted); white-space: nowrap; }
.fc-scale__mark.is-end span { transform: translateX(-100%); }
.fc-scale__mark.is-start span { transform: none; }
.fc-scale__mark--goal { border-left-color: var(--brand); }
.fc-scale__mark--goal span { color: var(--brand); font-weight: 700; }
.fc-scale__axis { display: flex; justify-content: space-between; margin-top: 6px; font-size: 11px; color: var(--muted); }
.fc-nums { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: 20px; }
@media (min-width: 720px) { .fc-nums { grid-template-columns: minmax(0, 13fr) minmax(0, 20fr); gap: 24px; } }
.fc-nums__h { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 8px; font-size: 12px; font-weight: 500; color: var(--muted); }
.fc-nums__h span:first-child { text-transform: uppercase; letter-spacing: .05em; }
.fc-nums__row { display: flex; align-items: stretch; gap: 4px; height: 112px; }
.fc-nums__col { flex: var(--w, 1) 1 0; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.fc-nums__bar { position: relative; flex: 1; border-radius: 8px; background: #F1F0F6; overflow: hidden; }
.fc-nums__bar i { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 8px 8px 0 0; background: var(--lav); transform-origin: bottom; animation: barGrow .9s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 45ms + 200ms); }
.fc-nums__col.is-good .fc-nums__bar i { background: var(--grad); }
.fc-nums__col.is-mid .fc-nums__bar i { background: #C9C1FF; }
.fc-nums__col.is-weak .fc-nums__bar i { background: var(--bad-line); }
.fc-nums__col > span { font: 600 11px/1 Rubik, sans-serif; text-align: center; color: var(--ink-2); }
.fc-nums__col.is-none > span { color: #A8A4BE; }
.fc-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.fc-legend i { display: inline-block; width: 12px; height: 12px; margin-right: 6px; border-radius: 4px; vertical-align: -2px; background: #F1F0F6; }
.fc-legend i.is-good { background: var(--grad); }
.fc-legend i.is-mid { background: #C9C1FF; }
.fc-legend i.is-weak { background: var(--bad-line); }
.fc__goal { margin: 18px 0 0; font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.fc__geo { display: flex; gap: 8px; align-items: flex-start; margin: 16px 0 0; padding: 10px 12px; border-radius: 14px; background: var(--lav-4); font-size: 14px; line-height: 1.45; color: var(--ink-2); }
.fc__geo svg { flex: none; margin-top: 2px; }
.fc-tips { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin-top: 12px; }
@media (min-width: 640px) { .fc-tips { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); } }
.fc-tip { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; background: var(--lav-4); box-shadow: inset 0 0 0 1.5px var(--line); color: inherit; text-decoration: none; transition: background .2s, box-shadow .2s, transform .2s var(--ease-out); }
a.fc-tip:hover { background: #fff; box-shadow: inset 0 0 0 2px var(--lav), var(--sh-card); transform: translateY(-1px); }
.fc-tip__n { display: grid; place-items: center; min-width: 46px; height: 46px; padding: 0 6px; border-radius: 14px; background: var(--grad); color: #fff; font: 700 15px/1 Rubik, sans-serif; }
.fc-tip__txt b { display: block; font-size: 14px; font-weight: 600; line-height: 1.25; }
.fc-tip__txt small { display: block; margin-top: 3px; font-size: 12px; line-height: 1.35; color: var(--muted); }
.fc-tip__go { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--brand); white-space: nowrap; }
.fc-tip__go .i { width: 16px; height: 16px; }
.fc-how { margin-top: 16px; font-size: 13px; color: var(--muted); }
.fc-how summary { cursor: pointer; font-weight: 500; color: var(--ink-2); }
.fc-how p { margin: 8px 0 0; line-height: 1.55; }
.modal .fc-how { margin-bottom: 4px; }

/* ── «Мои ученики» у преподавателя ── */
.sprog td { white-space: nowrap; }
.sprog td small { font-size: 12px; }
.sprog .num { font-size: 18px; }
.sprog .trend { margin-left: 4px; }
.sprog__n { height: 24px; padding: 0 8px; font-size: 12px; margin: 2px; }

/* ── Видеоразборы ── */
.modal--video .modal__card { max-width: 860px; }
.vplayer { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 18px; overflow: hidden; background: #0E0B26; }
.vplayer iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.vplayer.is-loading { background: linear-gradient(90deg, var(--lav-4), var(--lav-3), var(--lav-4)); background-size: 200% 100%; animation: shimmer 1.6s linear infinite; }
.vplayer--link { display: grid; place-items: center; text-align: center; background: var(--lav-4); box-shadow: inset 0 0 0 1.5px var(--line); }
.vplayer--link > div { display: grid; justify-items: center; gap: 10px; padding: 20px; }
.vplayer--link .i { width: 40px; height: 40px; color: var(--brand); }
.vplayer--link p { margin: 0; color: var(--ink-2); font-size: 15px; }
.vmeta { margin-top: 14px; }
.vmeta b { display: block; font-size: 17px; line-height: 1.3; }
.vmeta span { display: block; margin-top: 4px; font-size: 13px; color: var(--muted); }
.vmeta p { margin: 10px 0 0; font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.vmeta .link { display: inline-block; margin-top: 10px; font-size: 13px; }
.vlist { display: grid; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.vlist__item { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; border-radius: 16px; background: var(--lav-4); text-align: left; cursor: pointer; font: inherit; color: inherit; transition: background .2s, box-shadow .2s; }
.vlist__item .i { width: 30px; height: 30px; padding: 7px; border-radius: 50%; background: #fff; color: var(--brand); }
.vlist__item b { display: block; font-size: 14px; font-weight: 600; }
.vlist__item small { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.vlist__item:hover { background: var(--lav-3); }
.vlist__item.is-on { background: #fff; box-shadow: inset 0 0 0 2px var(--lav); }
.vlist__item.is-on .i { background: var(--grad); color: #fff; }
.vcount { margin-left: 2px; padding: 1px 7px; border-radius: 999px; background: var(--lav-3); color: var(--brand); font: 700 11px/1.5 Rubik, sans-serif; font-style: normal; }
.vtask { margin-top: 14px; }
.vform__row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
@media (min-width: 640px) { .vform__row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.vform__preview { padding: 12px; border-radius: 18px; background: var(--lav-4); }
.vform__preview .vplayer { max-width: 420px; }
.vform__plbl { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; font-size: 13px; color: var(--ok); font-weight: 500; }
.vform__plbl:last-child { margin-bottom: 0; }
.vform__plbl.is-bad { color: var(--bad); }
.vform__plbl .i { width: 16px; height: 16px; flex: none; }
.vrow__chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.vrow__chips .chip { height: 24px; font-size: 12px; }
.vrow__del .i { width: 16px; height: 16px; }

/* ── Очки, уровни, достижения, рейтинг недели ── */
.lvl { display: inline-grid; place-items: center; flex: none; min-width: 26px; height: 26px; padding: 0 6px; margin-left: 8px; border-radius: 9px; background: var(--grad); color: #fff; font: 700 13px/1 Rubik, sans-serif; box-shadow: 0 6px 12px -8px rgba(34, 0, 255, .8); vertical-align: middle; }
.lvl--xl { min-width: 76px; height: 76px; margin: 0; border-radius: 24px; font-size: 34px; box-shadow: var(--sh-btn); }
.medal { position: relative; display: inline-grid; place-items: center; flex: none; width: 58px; height: 58px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff 0, var(--m1) 55%, var(--m2) 100%); box-shadow: inset 0 0 0 3px var(--m2), 0 10px 18px -12px var(--m2); }
.medal img { width: 72%; height: 72%; object-fit: contain; filter: drop-shadow(0 3px 4px rgba(18, 16, 42, .25)); }
.medal--t1 { --m1: #F7D7BC; --m2: #C9814A; }
.medal--t2 { --m1: #EEF0F6; --m2: #9AA1B8; }
.medal--t3 { --m1: #FFF0B8; --m2: #E3A21A; }
.medal--t4 { --m1: #E4DEFF; --m2: #5941F2; }
.medal.is-locked { background: #F1F0F6; box-shadow: inset 0 0 0 3px #E2E0EC; }
.medal.is-locked img { filter: grayscale(1); opacity: .35; }
.medal--lg { width: 96px; height: 96px; }
.ach-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
@media (min-width: 640px) { .ach-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .ach-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.ach-grid--small { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)) !important; }
.ach-grid--small .medal { width: 44px; height: 44px; }
.ach-card { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 18px; background: var(--lav-4); }
.ach-card.is-on { background: #fff; box-shadow: inset 0 0 0 1.5px var(--line), var(--sh-card); }
.ach-card > div { min-width: 0; flex: 1; }
.ach-card b { display: block; font-size: 15px; line-height: 1.25; }
.ach-card span { display: block; margin-top: 2px; font-size: 12px; line-height: 1.35; color: var(--muted); }
.ach-card:not(.is-on) b { color: var(--ink-2); }
.ach-card .bar { height: 6px; margin-top: 8px; }
.ach-card small { display: block; margin-top: 4px; font-size: 11px; color: var(--muted); }
.ach-card__date { color: var(--ok) !important; font-weight: 500; }
.modal--ach .modal__card { max-width: 560px; text-align: center; }
.ach-new { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; margin-top: 8px; }
.ach-new__item { display: grid; justify-items: center; gap: 6px; width: 150px; animation: pop .6s var(--ease-spring) both; }
.ach-new__item:nth-child(2) { animation-delay: .12s; } .ach-new__item:nth-child(3) { animation-delay: .24s; }
.ach-new__item b { font-size: 15px; line-height: 1.25; }
.ach-new__item span { font-size: 12px; color: var(--muted); line-height: 1.35; }
.lvl-card { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: center; }
@media (min-width: 900px) { .lvl-card { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 28px; } }
.lvl-card__main { display: flex; align-items: center; gap: 18px; }
.lvl-card__main > div { flex: 1; min-width: 0; }
.lvl-card__t { font: 700 22px/1.2 Rubik, sans-serif; margin-bottom: 10px; }
.lvl-card__main small { display: block; margin-top: 8px; font-size: 13px; color: var(--muted); }
.lvl-card__facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.lb-head, .ach-head { flex-wrap: wrap; }
.lb-tabs { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; margin: -4px 0 14px; }
.lb { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.lb__row { display: grid; grid-template-columns: 40px auto minmax(0, 1fr) auto 64px; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 16px; background: var(--lav-4); }
.lb__row .lvl { margin-left: 0; }
.lb__row.is-me { background: #fff; box-shadow: inset 0 0 0 2px var(--lav), var(--sh-card); }
.lb__rank { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #fff; font: 700 14px/1 Rubik, sans-serif; color: var(--ink-2); }
.lb__rank.r1 { background: linear-gradient(135deg, #FFE7A0, #E3A21A); color: #6B4500; }
.lb__rank.r2 { background: linear-gradient(135deg, #F4F5F9, #9AA1B8); color: #2E3245; }
.lb__rank.r3 { background: linear-gradient(135deg, #F7D7BC, #C9814A); color: #5A2E0B; }
.lb__name { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb__name em { font-style: normal; font-size: 12px; font-weight: 500; color: var(--brand); margin-left: 4px; }
.lb__solved { font-size: 13px; color: var(--muted); white-space: nowrap; }
.lb__xp { text-align: right; font: 700 17px/1 Rubik, sans-serif; color: var(--brand); }
.lb__xp::after { content: ' оч.'; font-size: 11px; font-weight: 500; color: var(--muted); }
@media (max-width: 520px) { .lb__row { grid-template-columns: 34px auto minmax(0, 1fr) 58px; padding: 9px 10px; gap: 8px; } .lb__solved { display: none; } }
.lb__gap { text-align: center; color: var(--muted); letter-spacing: .3em; }
.lb__note { margin: 14px 0 0; font-size: 13px; line-height: 1.5; color: var(--muted); }
.lb__hide { margin-top: 12px; }
.rate-card { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: center; color: inherit; text-decoration: none; transition: transform .3s var(--ease-out), box-shadow .3s; }
.rate-card:hover { transform: translateY(-2px); box-shadow: var(--sh-lift); }
@media (min-width: 900px) { .rate-card { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) auto auto; gap: 24px; } }
.rate-card__lvl { display: flex; align-items: center; gap: 14px; }
.rate-card__lvl > div { flex: 1; min-width: 0; }
.rate-card__lvl .lvl { min-width: 48px; height: 48px; margin: 0; border-radius: 16px; font-size: 22px; }
.rate-card b { display: block; font-size: 16px; line-height: 1.25; }
.rate-card small { display: block; margin-top: 3px; font-size: 12px; color: var(--muted); }
.rate-card .bar { margin-top: 8px; height: 6px; }
.rate-card .btn { justify-self: start; }
.sprog-ach { margin-top: 4px; }
.who .lvl { margin-left: 2px; }

/* ── Печать варианта ── */
.print-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-bottom: 16px; padding: 14px 16px; border-radius: var(--r-md); background: #fff; box-shadow: var(--sh-card); }
.print-bar__txt { flex: 1; min-width: 200px; }
.print-bar__txt b { display: block; font-size: 16px; }
.print-bar__txt span { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); }
.print-bar__key { margin: 0; }
.pdoc { max-width: 820px; margin: 0 auto; padding: 36px 40px; background: #fff; border-radius: 6px; box-shadow: 0 20px 50px -30px rgba(18, 16, 42, .45); color: #111; font-size: 15px; line-height: 1.5; }
@media (max-width: 640px) { .pdoc { padding: 20px 16px; } }
.pdoc__head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 18px; align-items: center; padding-bottom: 14px; border-bottom: 2px solid #111; }
.pdoc__brand { display: flex; align-items: center; gap: 8px; font: 700 16px/1.1 Rubik, sans-serif; }
.pdoc__brand img { width: 30px; height: 30px; }
.pdoc__brand small { display: block; font: 500 11px/1.2 Rubik, sans-serif; color: #555; }
.pdoc__title b { display: block; font: 700 18px/1.25 Rubik, sans-serif; }
.pdoc__title span { display: block; font-size: 13px; color: #555; }
.pdoc__who { grid-column: 1 / -1; display: grid; grid-template-columns: auto minmax(0, 1fr) auto 110px; align-items: end; gap: 8px; font-size: 13px; color: #333; }
.pdoc__who i { display: block; height: 18px; border-bottom: 1px solid #111; }
.pdoc__about { margin: 10px 0 0; font-size: 13px; color: #444; }
.pdoc__part { margin: 22px 0 6px; font: 700 17px/1.2 Rubik, sans-serif; }
.pdoc__hint { margin: 0 0 10px; font-size: 13px; color: #444; font-style: italic; }
.pdoc__task { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; padding: 12px 0; border-top: 1px solid #ddd; }
.pdoc__n { display: grid; place-items: center; width: 30px; height: 30px; border: 1.5px solid #111; border-radius: 6px; font: 700 15px/1 Rubik, sans-serif; }
.pdoc__body .task-text { font-size: 15px; }
.pdoc__body .task-fig { margin: 10px 0 4px; max-width: 320px; }
.pdoc__body .task-fig svg { max-width: 100%; height: auto; }
.pdoc__body .task-src { margin-top: 6px; font-size: 11px; color: #666; }
.pdoc__ans { display: flex; align-items: end; gap: 8px; margin-top: 10px; font-weight: 600; font-size: 14px; }
.pdoc__ans span { display: block; width: 180px; height: 24px; border: 1.5px solid #111; border-radius: 4px; }
.pdoc__key { border-collapse: collapse; margin: 6px 0 4px; font-size: 14px; }
.pdoc__key td { padding: 6px 12px; border: 1px solid #bbb; }
.pdoc__key td:first-child { font-weight: 700; text-align: center; background: #f4f4f4; }
.pdoc__sol { padding: 10px 0; border-top: 1px solid #ddd; }
.pdoc__soln { font: 700 14px/1.2 Rubik, sans-serif; margin-bottom: 4px; }
.pdoc__foot { margin-top: 24px; padding-top: 8px; border-top: 1px solid #ddd; font-size: 11px; color: #777; text-align: right; }

@media print {
  @page { size: A4; margin: 14mm 13mm 15mm; }
  html, body { background: #fff !important; }
  body { padding: 0 !important; }
  .topbar, .tabbar, .bg-deco, .no-print, #toast-root, #modal-root, #fx-canvas, .demo-banner { display: none !important; }
  .view { padding: 0 !important; min-height: 0 !important; }
  .wrap { max-width: none !important; padding: 0 !important; }
  .reveal, .view-in, .view-in * { opacity: 1 !important; transform: none !important; animation: none !important; }
  .pdoc { max-width: none; padding: 0; box-shadow: none; border-radius: 0; font-size: 11.5pt; }
  .pdoc__task, .pdoc__sol, .pdoc__key tr { break-inside: avoid; page-break-inside: avoid; }
  .pdoc__part { break-after: avoid; page-break-after: avoid; }
  .pdoc__break { break-before: page; page-break-before: always; }
  .pdoc__sheet--np { break-before: page; page-break-before: always; }
  .pdoc__sheet--full { min-height: 262mm; }
  .pdoc__sheet { break-inside: avoid; page-break-inside: avoid; }
  .pdoc { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .pdoc--big { font-size: 13.5pt; }
  .pdoc .solution, .pdoc .sol { break-inside: auto; }
  a[href]::after { content: none !important; }
}

/* ── шторка «Типы задач» ──────────────────────────────────────────────── */
html.has-sheet, html.has-sheet body { overflow: hidden; }
.sheet { position: fixed; inset: 0; z-index: 210; display: grid; align-items: end; justify-items: center; pointer-events: none; }
.sheet__overlay { position: absolute; inset: 0; background: rgba(18, 16, 42, .45); opacity: 0; transition: opacity .2s; }
.sheet__card { position: relative; width: 100%; max-width: 720px; max-height: min(86vh, 760px); display: flex; flex-direction: column;
  background: #fff; border-radius: 28px 28px 0 0; box-shadow: 0 -30px 70px -30px rgba(18, 16, 42, .55);
  transform: translateY(105%); transition: transform .24s var(--ease-out); padding-bottom: env(safe-area-inset-bottom); }
.sheet.is-on { pointer-events: auto; }
.sheet.is-on .sheet__overlay { opacity: 1; }
.sheet.is-on .sheet__card { transform: none; }
.sheet__head { position: relative; display: flex; align-items: center; gap: 12px; padding: 22px 14px 10px 20px; touch-action: none; }
.sheet__grip { position: absolute; top: 8px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 4px; background: var(--lav-2); }
.sheet__title { flex: 1; min-width: 0; line-height: 1.25; }
.sheet__title b { display: block; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet__title span { font-size: 13px; color: var(--ink-3, #6b6890); }
.sheet__body { flex: 1; min-height: 80px; overflow-y: auto; overscroll-behavior: contain; padding: 4px 16px 8px; display: grid; gap: 8px; align-content: start; grid-template-columns: minmax(0, 1fr); }
.sheet__empty { padding: 28px 8px; text-align: center; color: var(--ink-2); }
.sheet__list { display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr); }
.sheet__all, .sheet__type { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 18px; background: var(--lav-4); box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; }
.sheet__all small { margin-left: auto; color: var(--ink-3, #6b6890); }
.sheet__tt { flex: 1; min-width: 0; display: grid; line-height: 1.3; }
.sheet__tt b { font-size: 15px; font-weight: 500; }
.sheet__tt small { font-size: 12px; color: var(--ink-3, #6b6890); }
.sheet input[type=checkbox] { position: absolute; opacity: 0; pointer-events: none; }
.sheet__chk { flex: none; width: 22px; height: 22px; border-radius: 7px; box-shadow: inset 0 0 0 2px var(--lav); background: #fff; display: grid; place-items: center; transition: background .15s; }
.sheet input:checked + .sheet__chk { background: var(--brand); box-shadow: none; }
.sheet input:checked + .sheet__chk::after { content: ''; width: 10px; height: 6px; border: solid #fff; border-width: 0 0 2.5px 2.5px; transform: rotate(-45deg) translate(1px, -1px); }
.sheet input:focus-visible + .sheet__chk { outline: 2px solid var(--brand); outline-offset: 2px; }
.sheet__foot { padding: 10px 16px 16px; display: grid; gap: 12px; border-top: 1px solid var(--line); }
.sheet__foot[hidden] { display: none; }
.sheet__count { display: flex; align-items: center; justify-content: space-between; font-weight: 500; }
.sheet__btns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.sheet__btns .btn[disabled] { opacity: .45; pointer-events: none; }
@media (min-width: 900px) { .sheet { align-items: center; } .sheet__card { border-radius: 28px; } }
@media (prefers-reduced-motion: reduce) { .sheet__card, .sheet__overlay { transition: none; } }

/* ── печать: настройки, листы части 2, клетка ─────────────────────────── */
.print-set { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-bottom: 16px; padding: 12px 16px; border-radius: var(--r-md); background: #fff; box-shadow: var(--sh-card); }
.pset { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.pset[hidden] { display: none; }
.pset select { height: 34px; padding: 0 10px; border: 0; border-radius: 10px; background: var(--lav-4); box-shadow: inset 0 0 0 1.5px var(--line); font-size: 14px; }
.pset--chk { cursor: pointer; }
.pset--chk input { width: 18px; height: 18px; accent-color: var(--brand); }
.pdoc { --pc: #5941F2; --pg: #aaa2ee; }
.pdoc--bw { --pc: #111; --pg: #aaa; }
.pdoc__part { color: var(--pc); }
.pdoc__n { border-color: var(--pc); color: var(--pc); }
.pdoc__head { border-bottom-color: var(--pc); }
.pdoc--big { font-size: 17px; }
.pdoc--big .pdoc__body .task-text { font-size: 17px; }
.pdoc__sheet { display: block; margin-top: 18px; }
.pdoc__sheet--full { display: flex; flex-direction: column; min-height: 262mm; }
.pdoc__sheet--full .pdoc__field { flex: 1; min-height: 60mm; }
.pdoc__shead { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 16px; align-items: center; padding-bottom: 10px; border-bottom: 1.5px solid var(--pc); margin-bottom: 8px; }
.pdoc__shead .pdoc__who { grid-column: auto; }
.pdoc__t2 { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; padding: 8px 0 12px; }
.pdoc__cont { padding: 6px 0 10px; font-size: 13px; color: #555; font-style: italic; }
.pdoc__field { position: relative; margin-top: 8px; border: 1.5px solid var(--pc); border-radius: 4px; overflow: hidden; }
.pdoc__field svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.pdoc__bl-h { margin: 18px 0 8px; font: 700 14px/1.2 Rubik, sans-serif; color: var(--pc); }
.pdoc__blank { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 24px; break-inside: avoid; }
.pdoc__bl-row { display: flex; align-items: center; gap: 8px; }
.pdoc__bl-row b { width: 26px; text-align: right; font: 700 14px/1 Rubik, sans-serif; }
.pdoc__cells { display: flex; }
.pdoc__cells i { width: 6.5mm; height: 7mm; border: 1px solid var(--pc); margin-left: -1px; }
@media print { .pdoc--big { font-size: 13.5pt; } .pdoc--big .pdoc__body .task-text { font-size: 13.5pt; } }

/* ── каталог: строка зовёт нажать, под ней выезжают типы ──────────────── */
.num-row:not(.is-off) { cursor: pointer; }
.num-row:not(.is-off):hover .num-title { color: var(--brand); }
.num-row:not(.is-off):hover [data-types] { background: var(--lav-3); color: var(--brand); box-shadow: inset 0 0 0 1.5px var(--brand); }
.num-row [data-types] .tchev { width: 16px; height: 16px; transition: transform .25s var(--ease-out); }
.num-row.is-open [data-types] { background: var(--brand); color: #fff; box-shadow: none; }
.num-row.is-open [data-types] .tchev { transform: rotate(180deg); }
.num-types { grid-column: 1 / -1; display: grid; grid-template-rows: 0fr; transition: grid-template-rows .26s var(--ease-out); cursor: default; }
.num-types.is-on { grid-template-rows: 1fr; }
.num-types__in { overflow: hidden; min-height: 0; }
.num-types__body { margin-top: 4px; padding: 14px; border-radius: 18px; background: var(--lav-4); box-shadow: inset 0 0 0 1px var(--line); display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
.num-types__top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font-weight: 500; font-size: 14px; }
.num-types__top span { flex: 1; min-width: 160px; }
.num-types__list { display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .num-types__list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.num-types__list--secs { display: block; column-gap: 12px; }
@media (min-width: 900px) { .num-types__list--secs { columns: 2; } }
.num-types__sec { display: grid; gap: 8px; break-inside: avoid; padding-bottom: 14px; }
.num-types__group { padding: 0 4px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.ttype { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .2s; }
.ttype.has-value { box-shadow: inset 0 0 0 2px var(--lav); }
.ttype__txt { flex: 1; min-width: 0; display: grid; line-height: 1.3; }
.ttype__txt b { font-size: 14px; font-weight: 500; }
.ttype__txt small { font-size: 12px; color: var(--muted); }
.ttype .stepper { background: var(--lav-4); }
.num-types__sum { margin: 0; font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.num-types__sum b { color: var(--ink); }
.num-types__btns { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.num-types__btns .btn[disabled] { opacity: .45; pointer-events: none; }
@media (max-width: 480px) { .num-types__btns .btn { flex: 1; } }
.sheet__empty { padding: 20px 8px; text-align: center; color: var(--ink-2); }

/* сложность: зелёный → янтарный → красный */
.diff[data-d="1"] i:nth-child(-n+1) { background: #12A06C; }
.diff[data-d="2"] i:nth-child(-n+2) { background: #E8A100; }
.diff[data-d="3"] i:nth-child(-n+3) { background: #E0344B; }
.choice button.lv1, .choice button.lv2, .choice button.lv3 { padding-left: 14px; }
.choice button.lv1 { background: #E8F8F1; color: #0B7A52; box-shadow: inset 0 0 0 1.5px #BFEAD7; }
.choice button.lv2 { background: #FFF6DE; color: #8A6100; box-shadow: inset 0 0 0 1.5px #F6E0A3; }
.choice button.lv3 { background: #FFE9EC; color: #B5203A; box-shadow: inset 0 0 0 1.5px #F7C4CC; }
.choice button.lv1:hover, .choice button.lv2:hover, .choice button.lv3:hover { transform: translateY(-2px); }
.choice button.lv1.is-on { background: #12A06C; color: #fff; box-shadow: 0 10px 20px -12px rgba(18, 160, 108, .9); }
.choice button.lv2.is-on { background: #E8A100; color: #fff; box-shadow: 0 10px 20px -12px rgba(232, 161, 0, .9); }
.choice button.lv3.is-on { background: #E0344B; color: #fff; box-shadow: 0 10px 20px -12px rgba(224, 52, 75, .9); }
.choice button.lv1.is-on .diff i, .choice button.lv2.is-on .diff i, .choice button.lv3.is-on .diff i { background: rgba(255, 255, 255, .45) !important; }
.choice button.lv1.is-on .diff[data-d="1"] i:nth-child(-n+1), .choice button.lv2.is-on .diff[data-d="2"] i:nth-child(-n+2), .choice button.lv3.is-on .diff[data-d="3"] i:nth-child(-n+3) { background: #fff !important; }
.choice--sm button[data-v="0"].is-on { background: var(--brand); color: #fff; box-shadow: 0 10px 20px -12px rgba(89, 65, 242, .9); }

/* ── Персик: шапка, домик, лента с миской (js/pet.js; рисует pet-art.js) ───── */
.hero__tiles--2 { grid-template-columns: repeat(2, 1fr); }

.pet-chip {
  display: inline-flex; align-items: center; gap: 2px; height: 42px; padding: 0 12px 0 4px; border-radius: 999px; flex: none;
  background: #fff; box-shadow: inset 0 0 0 1.5px var(--line); color: var(--ink); font-weight: 700; font-size: 15px;
  font-variant-numeric: tabular-nums; transition: transform .25s var(--ease-spring), box-shadow .2s;
}
.pet-chip[hidden] { display: none; }
.pet-chip:hover { transform: translateY(-1px); box-shadow: inset 0 0 0 1.5px var(--lav); }
.pet-chip:active { transform: scale(.96); }
.pet-chip.is-off b { color: var(--muted); }
.pet-chip__head {
  position: relative; width: 34px; height: 34px; border-radius: 50%; overflow: hidden; flex: none; margin-right: 4px;
  background: linear-gradient(135deg, #EEEBFF, #D9D3FF);
}
.pet-chip__head .pa { position: absolute; width: 190%; left: -45%; top: -6%; }
.pet-chip__head.is-box .pa, .pet-chip__head.is-rustle .pa, .pet-chip__head.is-tiny .pa { width: 128%; left: -14%; top: 4%; }
.pet-chip b { margin-left: 3px; min-width: 8px; text-align: left; }
@media (max-width: 400px) {
  .pet-chip { padding-right: 9px; }
  .topbar .wrap { gap: 8px; }
  .topbar__right { gap: 6px; }
  .brand-pill__tag { display: none; }
}

/* карточка «Домик Персика» */
.pet-home {
  display: grid; grid-template-columns: minmax(150px, 210px) 1fr; gap: 8px 26px; align-items: center;
  margin-top: 16px; padding: 18px 24px 20px 14px; border-radius: var(--r-lg);
  background: #fff; box-shadow: var(--sh-card);
  background-image: radial-gradient(120% 90% at 0% 0%, rgba(171, 160, 242, .22), transparent 55%);
}
.pet-home[hidden] { display: none; }
.pet-home__cat { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.pet-home__pic { width: 100%; cursor: pointer; -webkit-user-select: none; user-select: none; outline: none; }
.pet-home__pic .pa { width: 100%; }
.pet-home__say {
  position: relative; max-width: 210px; padding: 8px 12px; border-radius: 14px; background: var(--lav-4);
  font-size: 13px; line-height: 1.3; color: var(--ink-2); text-align: center;
}
.pet-home__say::before { content: ''; position: absolute; left: 50%; top: -5px; width: 10px; height: 10px; background: var(--lav-4); transform: translateX(-50%) rotate(45deg); border-radius: 2px; }
.pet-home__body { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.pet-home__head h2 { margin: 0 0 6px; font-size: 22px; line-height: 1.1; font-weight: 700; letter-spacing: -.01em; }
.pet-home__grow { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.pet-home__grow small { font-size: 13px; color: var(--muted); }
.pet-home__note { margin: -6px 0 0; font-size: 13px; color: var(--muted); }
.pet-home__cta:empty { display: none; }
.pet-home__cta .btn { width: 100%; }
.pet-home__sk { grid-column: 1 / -1; }
.pet-repair { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: var(--r-sm); background: var(--warn-bg); color: #8A5300; font-size: 13px; line-height: 1.35; }

.pet-plaid { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 10px; border-radius: 999px; background: #E6F3FF; color: #2872B8; font-weight: 700; font-size: 14px; }
.pet-plaid svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* миска нормы: по зёрнышку за каждый ответ */
.pet-bowl__top { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 7px; font-size: 13px; color: var(--muted); }
.pet-bowl__top b { font-size: 16px; color: var(--ink); font-variant-numeric: tabular-nums; }
.pet-bowl.is-met .pet-bowl__top b { color: var(--ok); }
.pet-bowl__dots { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 4px; }
.pet-bowl__dots i { height: 10px; border-radius: 999px; background: var(--lav-3); transition: background .35s; }
.pet-bowl__dots i.is-on { background: linear-gradient(90deg, #FFB13B, #FF8C4B); }
.pet-bowl.is-met .pet-bowl__dots i.is-on { background: var(--ok-2); }

/* неделя Пн–Вс */
.pet-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.pet-wd { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.pet-wd i { width: 100%; max-width: 40px; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; background: var(--lav-4); }
.pet-wd i svg { width: 58%; height: 58%; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.pet-wd small { font-size: 11px; color: var(--muted); }
.pet-wd.is-met i, .pet-wd.is-repair i { background: var(--brand); color: #fff; }
.pet-wd.is-repair i { background: var(--brand-2); }
.pet-wd.is-freeze i { background: #E6F3FF; color: #2872B8; }
.pet-wd.is-miss i { background: transparent; color: var(--lav); box-shadow: inset 0 0 0 1.5px var(--line); }
.pet-wd.is-today i { background: #fff; box-shadow: inset 0 0 0 2px var(--brand); }
.pet-wd.is-today small { color: var(--brand); font-weight: 700; }
.pet-wd.is-future i { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); opacity: .6; }

@media (max-width: 640px) {
  .pet-home { grid-template-columns: 1fr; padding: 16px 16px 18px; gap: 12px; }
  .pet-home__cat { flex-direction: row; align-items: center; gap: 12px; }
  .pet-home__pic { width: 132px; flex: none; }
  .pet-home__say { max-width: none; flex: 1; text-align: left; }
  .pet-home__say::before { left: -4px; top: 50%; transform: translateY(-50%) rotate(45deg); }
}
.modal--pet .modal__card { max-width: 560px; padding: 14px; }
.modal--pet .pet-home { margin-top: 24px; box-shadow: none; background-color: var(--lav-4); }

/* лента на экране решения */
.pet-strip { display: flex; align-items: center; gap: 10px; margin: -4px 0 14px; padding: 6px 8px 6px 6px; border-radius: var(--r-md); background: #fff; box-shadow: var(--sh-card); }
.pet-strip[hidden] { display: none; }
.pet-strip__cat { width: 64px; flex: none; }
.pet-strip__cat .pa { width: 100%; }
.pet-strip__body { flex: 1; min-width: 0; }
.pet-strip__body .pet-bowl__top { margin-bottom: 5px; }
.pet-strip__body small { display: block; margin-top: 5px; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pet-strip__open { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--brand); background: var(--lav-3); }
.pet-strip__open .i { width: 16px; height: 16px; }

/* «окно» Персика справа сверху на главной, едет за прокруткой. От 1200 px: прижато к правому краю, контент слева сужается ровно
   настолько, чтобы окно влезло (левый край по шапке сохраняется); от 1480 px — в свободном поле рядом с контентом.
   Уже 1200 px (планшет, телефон) окна нет: там голова питомца с числом дней в шапке. */
.view > .wrap { position: relative; }
.pet-dock { display: none; }
@media (min-width: 1200px) {
  .view > .wrap:has(> .pet-dock) { padding-right: max(var(--gutter), calc(172px - max(0px, (100vw - 1180px) / 2))); }
  .pet-dock { display: block; position: absolute; top: 0; bottom: 0; width: 144px; right: calc(16px - max(0px, (100vw - 1180px) / 2)); pointer-events: none; z-index: 5; }
  .pet-win {
    pointer-events: auto; position: sticky; top: calc(var(--topbar-h) + 18px); display: flex; flex-direction: column; align-items: stretch; gap: 8px; width: 100%;
    padding: 12px 12px 14px; border-radius: var(--r-lg); text-align: left; cursor: pointer; color: var(--ink);
    background: #fff radial-gradient(120% 80% at 0% 0%, rgba(240, 205, 150, .4), transparent 60%); box-shadow: var(--sh-card);
    transition: transform .25s var(--ease-spring), box-shadow .2s;
  }
  .pet-win[hidden] { display: none; }
  .pet-win:hover { transform: translateY(-2px); box-shadow: var(--sh-lift); }
  .pet-win:active { transform: scale(.98); }
}
@media (min-width: 1480px) { .pet-dock { right: auto; left: calc(100% - var(--gutter) + 12px); } }
.pet-win__ttl { font-size: 13px; font-weight: 500; color: var(--muted); }
.pet-win__cat { display: block; width: 100%; }
.pet-win__cat .pa { width: 100%; }
.pet-win__streak { display: flex; align-items: center; gap: 6px; }
.pet-win__streak b { font-size: 24px; line-height: 1; font-weight: 700; }
.pet-win__streak em { font-style: normal; font-size: 13px; line-height: 1.15; color: var(--ink-2); }
.pet-win__bar { display: block; height: 8px; border-radius: 999px; background: var(--lav-3); overflow: hidden; }
.pet-win__bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #FFB13B, #FF8C4B); transition: width .5s var(--ease-out); }
.pet-win.is-met .pet-win__bar i { background: var(--ok-2); }
.pet-win small { font-size: 12px; color: var(--muted); }

/* облачка из рисунка («мяу…», «бывает!») вылезают за кадр и ложатся на текст — в домике и окне есть своя подпись; в ленте решения оставляем */
.pet-home .pa .pa-bub, .pet-win .pa .pa-bub { display: none !important; }

/* Персик: экраны событий (день засчитан, онбординг, настройки, скучал) */
.pet-gear { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; margin: 8px auto 0; padding: 0 14px; border-radius: 999px; color: var(--muted); font-size: 13px; }
.pet-gear svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pet-gear:hover { color: var(--brand); background: var(--lav-3); }
.pet-home__cta { display: flex; flex-direction: column; align-items: stretch; }
.pet-home__cta .pet-gear { align-self: center; }
.pet-grow { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: var(--r-md); background: #fff; box-shadow: inset 0 0 0 1.5px var(--line); text-align: left; }
.pet-grow__top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); }
.pet-grow__top b { font-size: 16px; color: var(--ink); }
.pet-grow__bar { height: 10px; border-radius: 999px; background: var(--lav-3); overflow: hidden; }
.pet-grow__bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #8E7BFF, #5941F2); transition: width .5s var(--ease-out); }
.no-pet-dock .pet-dock { display: none !important; }
.no-pet-dock .view > .wrap:has(> .pet-dock) { padding-right: var(--gutter) !important; }
.pet-home { position: relative; }
.modal--pet .modal__card { text-align: center; }
.pet-day, .pet-miss, .pet-onb__pane { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 8px 8px 4px; }
.pet-day h3, .pet-miss h3, .pet-onb h3 { margin: 4px 0 0; font-size: 24px; line-height: 1.15; letter-spacing: -.01em; }
.pet-day p, .pet-miss p, .pet-onb p { margin: 0; font-size: 15px; line-height: 1.4; color: var(--ink-2); max-width: 380px; }
.pet-day .btn, .pet-miss .btn, .pet-onb .btn { width: 100%; max-width: 360px; margin-top: 6px; }
.pet-day__cat, .pet-miss__cat, .pet-onb__cat { width: 180px; margin: 0 auto; }
.pet-day__cat .pa, .pet-miss__cat .pa, .pet-onb__cat .pa { width: 100%; }
.pet-day__cat .pa-bub, .pet-miss__cat .pa-bub, .pet-onb__cat .pa-bub { display: none !important; }
@keyframes pet-pop { 0% { transform: scale(.7); } 55% { transform: scale(1.35); } 100% { transform: scale(1); } }
.pet-day__n { font-size: 15px; color: var(--ink-2); }
.pet-day__n b { font-size: 34px; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; vertical-align: -3px; }
.pet-day__gift { padding: 8px 12px; border-radius: 12px; background: #E6F3FF; color: #2872B8; font-size: 13px; font-weight: 500; }
.pet-day__week { width: 100%; max-width: 380px; margin-top: 4px; }
.pet-miss .pet-repair { text-align: left; }
.pet-miss .btn-ghost { margin-top: 0; }
.pet-goals { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: 100%; max-width: 380px; margin: 6px 0 4px; }
.pet-goal { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 4px 10px; border-radius: var(--r-md); background: var(--lav-4); box-shadow: inset 0 0 0 1.5px transparent; transition: box-shadow .2s, background .2s, transform .2s var(--ease-spring); }
.pet-goal b { font-size: 26px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.pet-goal small { font-size: 11px; color: var(--muted); line-height: 1.2; }
.pet-goal:hover { transform: translateY(-1px); }
.pet-goal.is-on { background: #fff; box-shadow: inset 0 0 0 2px var(--brand); }
.pet-goal.is-on b { color: var(--brand); }
.pet-set { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.pet-set__lbl { font-size: 14px; font-weight: 500; color: var(--ink-2); }
.pet-set__note { margin: 0; font-size: 13px; max-width: 380px; }
.pet-set__rem { width: 100%; max-width: 380px; margin-top: 8px; text-align: left; }
.modal--pet-set .modal__title { text-align: center; }
@media (max-width: 480px) { .pet-day__cat, .pet-miss__cat, .pet-onb__cat { width: 150px; } .pet-day h3, .pet-miss h3, .pet-onb h3 { font-size: 21px; } }

/* вместо огонька серии — мордашка питомца в кружке (js/pet.js: faceHtml). Размеры: --sm в строке и плитке, --lg на «Дне засчитан» */
.pet-face { display: inline-block; vertical-align: middle; margin: 0; width: 26px; height: 26px; box-shadow: 0 0 0 2px #fff; }
.pet-face--sm { width: 24px; height: 24px; }
.pet-face--lg { width: 48px; height: 48px; }
.pet-face-slot { display: inline-block; vertical-align: middle; margin-left: 2px; }
.pet-face-slot:empty { display: none; }
.tile { position: relative; }
.tile .pet-face-slot { position: absolute; top: 12px; right: 12px; margin: 0; }
@media (min-width: 900px) { .tile .pet-face-slot { top: 16px; right: 16px; } }
.tile .pet-face { width: 30px; height: 30px; }
.pet-repair .pet-face { flex: none; width: 30px; height: 30px; }
.sprog__streak { display: inline-flex; align-items: center; gap: 6px; }
.pet-day__n { display: flex; align-items: center; justify-content: center; gap: 10px; }
.pet-day__n.is-pop .pet-face { animation: pet-pop .7s var(--ease-spring); }
.pet-day__n.is-pop b { display: inline-block; animation: pet-pop .7s var(--ease-spring); }

/* шапка: чип с Персиком — тёплый, чтобы не терялся рядом с кнопками */
.pet-chip { background: linear-gradient(135deg, #FFF4DD, #FFE2B4); box-shadow: inset 0 0 0 1.5px #F2C57E; color: #7A3E0C; font-size: 17px; font-weight: 800; padding-right: 14px; }
.pet-chip:hover { box-shadow: inset 0 0 0 2px #E9A94F; }
.pet-chip .pet-chip__head { background: linear-gradient(135deg, #FFFBF1, #FFE9C7); box-shadow: 0 0 0 2px #fff; }
.pet-chip.is-off b { color: #7A3E0C; }
.pet-chip b { display: inline !important; }

/* выбор питомца при рождении: котик Персик или собака Амелька */
.pet-pick { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 8px 8px 4px; }
.pet-pick h3 { margin: 4px 0 0; font-size: 24px; line-height: 1.15; letter-spacing: -.01em; }
.pet-pick p { margin: 0; font-size: 15px; line-height: 1.4; color: var(--ink-2); max-width: 400px; }
.pet-pick__opts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; max-width: 420px; margin: 6px 0 2px; }
.pet-pick__opt { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 10px 14px; border-radius: var(--r-md); background: var(--lav-4); box-shadow: inset 0 0 0 1.5px transparent; transition: box-shadow .2s, background .2s, transform .2s var(--ease-spring); }
.pet-pick__opt:hover { transform: translateY(-2px); }
.pet-pick__opt.is-on { background: #fff; box-shadow: inset 0 0 0 2px var(--brand); }
.pet-pick__pic { display: block; width: 100%; max-width: 150px; }
.pet-pick__pic .pa { width: 100%; }
.pet-pick__opt b { margin-top: 4px; font-size: 19px; line-height: 1.2; }
.pet-pick__opt.is-on b { color: var(--brand); }
.pet-pick__opt small { font-size: 12px; line-height: 1.25; color: var(--muted); }
.pet-pick .btn { width: 100%; max-width: 360px; margin-top: 6px; }
@media (max-width: 480px) { .pet-pick h3 { font-size: 21px; } .pet-pick__opts { gap: 8px; } }

/* Витрина номера (#/proto) */
a.num-badge { text-decoration: none; cursor: pointer; }
.proto-list { display: grid; gap: 16px; max-width: 760px; margin-inline: auto; }
.page-head--proto { max-width: 760px; margin-inline: auto; }
.proto-card .answer__more { display: flex; align-items: center; justify-content: space-between; gap: 8px 14px; flex-wrap: wrap; }
.proto-card__k { margin-left: auto; font-size: 13px; }
.ttype__txt[data-open] { cursor: pointer; }
.ttype__txt[data-open]:hover b { color: var(--brand); }
.ttype__go { width: 14px; height: 14px; margin-left: 6px; vertical-align: -2px; opacity: .55; }

/* Группы заданий в навигации варианта: «Задание №N» и темы внутри */
.navgrid .grp-sep { grid-column: 1 / -1; flex: none; display: flex; align-items: center; gap: 8px; margin: 10px 4px 0; font-size: 13px; font-weight: 500; color: var(--brand); white-space: nowrap; }
.navgrid .grp-sep::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.navgrid .grp-sep--topic { margin-top: 6px; font-size: 12px; }
@media (max-width: 999px) { .navgrid .grp-sep { margin: 0 4px; align-self: center; font-size: 12px; } .navgrid .grp-sep::after { display: none; } }

/* Выбор числа задач в быстрой тренировке */
.quick-count { display: inline-flex; gap: 6px; }
.quick-count button { min-width: 38px; padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-weight: 600; font-size: 13px; cursor: pointer; }
.quick-count button.is-on { background: var(--grad); color: #fff; border-color: transparent; }
/* ── Дуэль (js/duel.js; экран решения — .session--duel) ───────────────── */
.duel-page { max-width: 640px; margin: 0 auto; }
.duel-page .card { display: flex; flex-direction: column; gap: 14px; }
.duel-hero { display: flex; gap: 14px; align-items: center; }
.duel-hero img { width: 72px; height: 72px; flex: none; filter: drop-shadow(0 10px 12px rgba(43, 27, 158, .2)); }
.duel-hero h1, .duel-invite h1, .duel-result h1 { font-size: 26px; line-height: 1.1; font-weight: 700; letter-spacing: -.02em; }
.duel-hero p { margin-top: 4px; color: var(--ink-2); font-size: 14px; }
.duel-field { display: flex; flex-direction: column; gap: 8px; }
.duel-lbl { font-size: 13px; font-weight: 500; color: var(--muted); }
.duel-seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 999px; background: var(--lav-3); }
.duel-seg button { height: 40px; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--ink-2); transition: background .2s, color .2s; }
.duel-seg button.is-on { background: #fff; color: var(--brand); box-shadow: var(--sh-card); }
.duel-seg button:disabled { opacity: .45; }
.duel-nums { display: flex; flex-wrap: wrap; gap: 8px; }
.duel-nums[hidden] { display: none; }
.duel-facts { display: flex; flex-wrap: wrap; gap: 8px; }
.duel-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.duel-actions .btn { flex: 1 1 180px; }
.duel-link { display: flex; gap: 8px; }
.duel-link input { flex: 1; min-width: 0; height: 46px; padding: 0 14px; border-radius: 14px; background: var(--lav-3); font-size: 14px; color: var(--ink-2); box-shadow: inset 0 0 0 1.5px var(--line); }
.duel-link .btn { flex: none; }
.duel-note, .duel-spec { font-size: 14px; color: var(--ink-2); }
.duel-reason, .duel-warn { display: flex; gap: 8px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; font-size: 14px; background: var(--lav-3); color: var(--ink-2); }
.duel-warn { background: var(--warn-bg); color: #6B3F00; }
.duel-reason .i, .duel-warn .i { flex: none; width: 18px; height: 18px; margin-top: 1px; }
.duel-vs { display: flex; align-items: center; justify-content: center; gap: 18px; padding: 8px 0 2px; }
.duel-vs em { font-style: normal; font-weight: 700; font-size: 15px; color: var(--muted); letter-spacing: .08em; }
.duel-who { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 96px; }
.duel-who .pet-face { width: 64px; height: 64px; }
.duel-who b { font-size: 14px; font-weight: 600; text-align: center; }
.duel-who i { font-style: normal; position: absolute; top: -6px; right: 6px; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 999px; display: grid; place-items: center; font-size: 14px; font-weight: 700; color: #fff; background: var(--brand); }
/* арена: свой питомец слева, соперник справа смотрит влево; на экране решения — дорожки по клетке на задачу */
.duel-arena { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: end; gap: 4px 10px; padding: 16px 14px 10px; border-radius: var(--r-md); background: radial-gradient(circle at 50% 30%, #fff 0%, var(--lav-3) 100%); }
.duel-arena__side { position: relative; justify-self: center; width: 100%; max-width: 150px; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; }
.duel-arena__side b { max-width: 100%; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.duel-arena__pet { width: 100%; aspect-ratio: 1; display: flex; align-items: flex-end; justify-content: center; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.duel-arena__n { font-style: normal; position: absolute; top: 0; right: -6px; min-width: 30px; height: 30px; padding: 0 8px; border-radius: 999px; display: grid; place-items: center; font-size: 16px; font-weight: 700; color: #fff; background: var(--brand); box-shadow: 0 0 0 3px #fff; }
.duel-arena__side--them .duel-arena__n { right: auto; left: -6px; background: var(--ink-2); }
.duel-arena__mid { align-self: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.duel-arena__mid em { font-style: normal; font-weight: 700; font-size: 15px; color: var(--muted); letter-spacing: .08em; }
.duel-arena__note { grid-column: 1 / -1; text-align: center; font-size: 13px; color: var(--ink-2); }
.duel-arena__note:empty { display: none; }
.duel-lane { display: flex; gap: 4px; }
.duel-lane--them { flex-direction: row-reverse; }      /* каждая дорожка заполняется от своего питомца */
.duel-lane i { width: 14px; height: 14px; border-radius: 5px; background: #fff; box-shadow: inset 0 0 0 1.5px var(--lav-2); }
.duel-lane--them i { box-shadow: inset 0 0 0 1.5px #BFE3FF; }
.duel-lane i.ok { background: var(--ok); box-shadow: none; }
.duel-lane i.bad { background: var(--bad); box-shadow: none; }
.duel-lane--them i.ok, .duel-lane--them i.bad { opacity: .6; }
.duel-lane i.is-pop { animation: pet-pop .7s var(--ease-spring); }
.duel-arena-slot { margin: -4px 0 14px; }
.duel-arena-slot:empty { display: none; }
.duel-arena--run { padding: 10px 12px 8px; background: #fff; box-shadow: var(--sh-card); }
.duel-arena--run .duel-arena__side { max-width: 84px; }
.duel-arena--run .duel-arena__side b { font-size: 12px; font-weight: 500; color: var(--muted); }
.duel-result { text-align: center; align-items: stretch; }
.duel-result > .muted { margin-top: -6px; }
.duel-result--win h1 { color: var(--ok); }
.duel-table { display: flex; flex-direction: column; border-radius: 16px; background: var(--lav-3); padding: 4px 12px; text-align: left; }
.duel-tr { display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: center; min-height: 44px; font-size: 14px; }
.duel-tr + .duel-tr { border-top: 1px solid var(--line); }
.duel-th { font-size: 12px; color: var(--muted); font-weight: 500; }
.duel-t { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.duel-t small { font-weight: 400; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.duel-t .i { width: 16px; height: 16px; }
.duel-t.ok { color: var(--ok); } .duel-t.bad { color: var(--bad); } .duel-t.none { color: var(--muted); }
.session--duel .meta-pill--time { display: inline-flex; font-weight: 700; color: var(--brand); }
.session--duel .meta-pill--time.is-urgent { color: var(--bad); background: var(--bad-bg); box-shadow: none; }
.session--duel .segbar i { cursor: pointer; }
.session--duel .segbar i.ok, .session--duel .segbar i.bad { cursor: default; }
@media (max-width: 480px) {
  .duel-hero h1, .duel-invite h1, .duel-result h1 { font-size: 22px; }
  .duel-link { flex-direction: column; }
  .duel-who { min-width: 80px; }
  .duel-arena { gap: 4px 6px; padding: 12px 8px 8px; }
  .duel-arena--run .duel-arena__side { max-width: 72px; }
  .duel-lane i { width: 12px; height: 12px; border-radius: 4px; }
}
.duel-table--solo .duel-tr { grid-template-columns: 1fr 1fr; }

/* ── Дуэли: «Мои дуэли», карточка «Тебя вызвали», бейдж ─────────────────── */
.topnav a[hidden], .topnav .badge[hidden] { display: none; }
.duel-incoming:empty { display: none; }
.duel-in { cursor: default; }
.duel-in__btns { display: flex; gap: 8px; flex: none; }
.duel-more { display: inline-flex; align-items: center; gap: 6px; margin: -6px 0 14px 6px; font-size: 14px; font-weight: 500; color: var(--brand); }
.duel-more .arrow { width: 16px; height: 16px; }
.duel-sec { margin-top: 20px; }
.duel-list { list-style: none; margin: 0; padding: 4px 16px; gap: 0; }
.duel-row { display: flex; align-items: center; gap: 10px; min-height: 64px; padding: 8px 0; }
.duel-row + .duel-row { border-top: 1px solid var(--line); }
.duel-row__link { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex: 1; min-width: 0; color: inherit; text-decoration: none; }
.duel-row__txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.duel-row__txt b { font-size: 15px; font-weight: 600; }
.duel-row__txt small { font-size: 13px; color: var(--muted); }
.duel-row__btns { display: flex; gap: 8px; flex: none; }
.duel-empty { text-align: center; padding: 28px 0; }
.duel-top .duel-actions .btn { flex: 0 1 auto; }
@media (max-width: 480px) {
  .duel-in { flex-wrap: wrap; }
  .duel-in__btns, .duel-in__btns .btn { width: 100%; }
  .duel-row--in { flex-wrap: wrap; }
  .duel-row--in .duel-row__btns { width: 100%; }
  .duel-row--in .duel-row__btns .btn { flex: 1; }
}

/* ── D5: друзья, «Найти соперника», пьедестал вызова преподавателя, дуэли в кабинете преподавателя ── */
.duel-ghost { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; padding-top: 14px; border-top: 1px solid var(--line); }
.duel-ghost .btn { flex: none; }
.duel-friendslink { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; color: var(--brand); }
.duel-friendslink .i { width: 16px; height: 16px; }
.fr-invite { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.fr-row__who { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.fr-row__who .pet-face { flex: none; }
.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 10px; padding: 18px 8px 0; border-radius: var(--r-md); background: radial-gradient(circle at 50% 30%, #fff 0%, var(--lav-3) 100%); }
.podium__col { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; text-align: center; }
.podium__col b { max-width: 100%; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.podium__col small { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.podium__pet .pet-face { width: 64px; height: 64px; }
.podium__col--1 .podium__pet .pet-face { width: 84px; height: 84px; }
.podium__step { width: 100%; display: grid; place-items: center; margin-top: 4px; border-radius: 14px 14px 0 0; font-size: 22px; font-weight: 700; color: #fff; background: var(--lav-2); }
.podium__col--1 .podium__step { height: 76px; background: linear-gradient(180deg, #FFC93C, #FF9F1C); }
.podium__col--2 .podium__step { height: 54px; background: linear-gradient(180deg, #B8C4D6, #8E9BB0); }
.podium__col--3 .podium__step { height: 38px; background: linear-gradient(180deg, #E6A66B, #C47B3E); }
.podium__col.is-me b { color: var(--brand); }
.podium-table .duel-tr { grid-template-columns: 34px 1fr auto; gap: 8px; }
.podium-table .podium-tr.is-me { font-weight: 600; color: var(--brand); }
.podium-table .podium-tr > span:last-child { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tduel { margin-top: 16px; }
.tduel .choice { margin-bottom: 4px; }
.tduel__row { display: flex; flex-wrap: wrap; gap: 14px 18px; align-items: flex-end; margin-top: 12px; }
.tduel__row .fld { display: flex; flex-direction: column; gap: 6px; min-width: 150px; }
.tduel__row .fld:first-child { flex: 1 1 260px; }
.tduel__list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.tduel__item { border-radius: 16px; background: var(--lav-3); padding: 12px 14px; }
.tduel__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.tduel__head small { display: block; color: var(--muted); font-size: 13px; }
.tduel__table { margin-top: 10px; display: flex; flex-direction: column; font-size: 14px; }
.tduel__table > div { display: grid; grid-template-columns: 34px 1fr auto; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); }
.tduel__table > div > span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; }
.sprog__duel { white-space: nowrap; font-size: 13px; }

/* ── Учётка для всех: согласие, ник, родитель (account.js) ── */
.acc-card { max-width: 640px; margin: 8px auto 0; padding: 26px 22px; }
.acc-card h2 { font-size: 24px; line-height: 1.2; font-weight: 700; }
.acc-card h3 { margin-top: 18px; font-size: 17px; font-weight: 700; }
.acc-card > p, .acc-card [data-a] > p { margin-top: 8px; }
.acc-age, .acc-btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.acc-text { margin-top: 12px; max-height: 260px; overflow: auto; padding: 14px 16px; border-radius: 14px; background: var(--lav-4); box-shadow: inset 0 0 0 1.5px var(--line); font-size: 14px; line-height: 1.5; }
.acc-more { margin-top: 12px; }
.acc-more summary { display: inline-block; font-size: 14px; color: var(--brand); text-decoration: underline; cursor: pointer; }
.acc-text p + p { margin-top: 8px; }
.acc-draft { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: #FFF6D6; color: #6B5300; font-size: 13px; }
.acc-draft .i { flex: none; width: 16px; height: 16px; margin-top: 2px; }
.acc-check { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; font-size: 14px; line-height: 1.4; cursor: pointer; }
.acc-check input { flex: none; width: 20px; height: 20px; margin-top: 1px; accent-color: var(--brand); }
.acc-link { margin-top: 14px; }
.acc-foot { margin-top: 18px; font-size: 14px; color: var(--muted); }
.linkish { padding: 0; border: 0; background: none; font: inherit; color: var(--brand); text-decoration: underline; cursor: pointer; }
.btn-danger { color: #fff; background: var(--bad); }
.menu-list a.danger { color: var(--bad); }
body.acc-lock .topnav, body.acc-lock .tabbar, body.is-public .to-cab { display: none; }

.acc-simple { margin-top: 10px; font-size: 15px; line-height: 1.5; }
.onb__lead { margin: 0 0 12px; font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.onb__exams, .onb__btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.onb__btns .btn-lg { flex: 1 1 220px; }
/* переключатель «Мой тренажёр» / «Модерация» в меню сотрудника */
.staff-mode { margin-top: 12px; }
.staff-mode button { flex: 1 1 0; justify-content: center; }
.staff-mode__hint { font-size: 13px; margin-top: 8px; }
