/* Клетка v2. Тетрадный лист в клетку, красная линия полей, ответы в клетках бланка ЕГЭ.
   Светлая тема — бумага и синяя гелевая ручка; тёмная — школьная доска и мел.
   Раскладка: широкая колонка 1200px, карточки-листы с тенью «лежит на столе». */
:root {
  --paper: #f3f4ee;
  --paper-2: #eceee5;
  --sheet: #fefefb;
  --sheet-2: #f2f4ec;
  --grid: rgba(58, 104, 168, 0.10);
  --grid-strong: rgba(58, 104, 168, 0.24);
  --ink: #2140b0;
  --ink-2: #1a3290;
  --ink-soft: #e4e9f9;
  --red: #d0342c;
  --red-soft: #fce7e3;
  --text: #171a22;
  --muted: #5d6272;
  --line: #dcdfd4;
  --ok: #17824a;
  --ok-soft: #dcf2e5;
  --warn: #a8690f;
  --warn-soft: #f9edd6;
  --hl: #ffe98a;
  --shadow-sm: 0 1px 2px rgba(23, 26, 34, 0.06);
  --shadow: 0 1px 0 rgba(23, 26, 34, 0.04), 0 10px 30px -14px rgba(23, 26, 34, 0.22);
  --shadow-lg: 0 2px 0 rgba(23, 26, 34, 0.04), 0 26px 60px -28px rgba(23, 26, 34, 0.38);
  --glass: rgba(243, 244, 238, 0.82);

  --s-math: #2140b0; --s-russian: #c0332c; --s-physics: #6d3fb0; --s-chemistry: #0b7e6d;
  --s-biology: #3a7d1c; --s-history: #9a5f0c; --s-social: #aa3372; --s-informatics: #16709f;
  --s-english: #c1561a; --s-geography: #5f6d0c;

  --f-display: "Unbounded", "Golos Text", system-ui, sans-serif;
  --f-body: "Golos Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --f-hand: "Caveat", "Segoe Print", "Comic Sans MS", cursive;

  --cell: 24px;
  --r: 14px;
  --r-sm: 9px;
  --wrap: 1200px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #141c19; --paper-2: #18221e; --sheet: #1c2622; --sheet-2: #222e29;
    --grid: rgba(214, 232, 220, 0.05); --grid-strong: rgba(214, 232, 220, 0.12);
    --ink: #a7bcff; --ink-2: #c3d1ff; --ink-soft: rgba(167, 188, 255, 0.14);
    --red: #ff8f7f; --red-soft: rgba(255, 143, 127, 0.14);
    --text: #e8eee9; --muted: #9daba3; --line: #2f3d36;
    --ok: #74d9a2; --ok-soft: rgba(116, 217, 162, 0.14);
    --warn: #f2c46c; --warn-soft: rgba(242, 196, 108, 0.14);
    --hl: rgba(242, 196, 108, 0.35);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow: 0 1px 0 rgba(0, 0, 0, 0.25), 0 12px 32px -14px rgba(0, 0, 0, 0.7);
    --shadow-lg: 0 2px 0 rgba(0, 0, 0, 0.25), 0 30px 70px -28px rgba(0, 0, 0, 0.85);
    --glass: rgba(20, 28, 25, 0.82);
    --s-math: #a3b7ff; --s-russian: #ff9d8f; --s-physics: #caa8ff; --s-chemistry: #5fd8c3;
    --s-biology: #9cdc7b; --s-history: #e8b66a; --s-social: #f39dc9; --s-informatics: #7cc7f2;
    --s-english: #ffb27d; --s-geography: #d0da6c;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #141c19; --paper-2: #18221e; --sheet: #1c2622; --sheet-2: #222e29;
  --grid: rgba(214, 232, 220, 0.05); --grid-strong: rgba(214, 232, 220, 0.12);
  --ink: #a7bcff; --ink-2: #c3d1ff; --ink-soft: rgba(167, 188, 255, 0.14);
  --red: #ff8f7f; --red-soft: rgba(255, 143, 127, 0.14);
  --text: #e8eee9; --muted: #9daba3; --line: #2f3d36;
  --ok: #74d9a2; --ok-soft: rgba(116, 217, 162, 0.14);
  --warn: #f2c46c; --warn-soft: rgba(242, 196, 108, 0.14);
  --hl: rgba(242, 196, 108, 0.35);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.25), 0 12px 32px -14px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 2px 0 rgba(0, 0, 0, 0.25), 0 30px 70px -28px rgba(0, 0, 0, 0.85);
  --glass: rgba(20, 28, 25, 0.82);
  --s-math: #a3b7ff; --s-russian: #ff9d8f; --s-physics: #caa8ff; --s-chemistry: #5fd8c3;
  --s-biology: #9cdc7b; --s-history: #e8b66a; --s-social: #f39dc9; --s-informatics: #7cc7f2;
  --s-english: #ffb27d; --s-geography: #d0da6c;
  color-scheme: dark;
}

/* ================= База ================= */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 90px; }
body {
  margin: 0;
  background-color: var(--paper);
  background-image:
    radial-gradient(1200px 520px at 78% -8%, color-mix(in srgb, var(--ink) 9%, transparent), transparent 70%),
    radial-gradient(900px 480px at -10% 30%, color-mix(in srgb, var(--red) 6%, transparent), transparent 70%),
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: auto, auto, var(--cell) var(--cell), var(--cell) var(--cell);
  background-attachment: fixed;
  color: var(--text);
  font: 400 16px/1.6 var(--f-body);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }
a { color: var(--ink); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2.5px solid var(--ink); outline-offset: 2px; border-radius: 6px; }
main:focus { outline: none; }
h1, h2, h3 { text-wrap: balance; line-height: 1.15; margin: 0; }
p { margin: 0; }
img { max-width: 100%; }
::selection { background: color-mix(in srgb, var(--ink) 22%, transparent); }
[hidden] { display: none !important; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sr:focus { position: fixed !important; left: 16px; top: 16px; width: auto; height: auto; clip: auto; z-index: 100; background: var(--sheet); padding: 8px 12px; border-radius: 8px; box-shadow: var(--shadow); }
.muted { color: var(--muted); }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.hand { font-family: var(--f-hand); font-weight: 600; }
kbd { font: 500 11px var(--f-mono); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 1px 5px; background: var(--sheet); color: var(--muted); }

/* ================= Шапка ================= */
.top {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30;
  padding: 10px 16px 0;
}
.top-in {
  max-width: var(--wrap); margin: 0 auto; padding: 8px 8px 8px 14px;
  display: flex; align-items: center; gap: 12px;
  background: var(--glass); border: 1px solid var(--line); border-radius: 16px;
  backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3);
  box-shadow: var(--shadow); position: relative;
}
.logo {
  display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text);
  font-family: var(--f-display); font-weight: 700; font-size: 19px; letter-spacing: -0.02em; flex-shrink: 0;
}
.logo:hover .logo-mark i:nth-child(4) { transform: scale(1.15); }
.logo-mark {
  width: 30px; height: 30px; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr;
  border: 2px solid var(--ink); border-radius: 6px; overflow: hidden; background: var(--sheet);
}
.logo-mark i { border-right: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); transition: transform .2s; }
.logo-mark i:nth-child(2n) { border-right: 0; }
.logo-mark i:nth-child(n+3) { border-bottom: 0; }
.logo-mark i:nth-child(4) { background: var(--red); }
.nav { display: flex; gap: 2px; margin-left: 6px; }
.nav a {
  text-decoration: none; color: var(--muted); padding: 8px 12px; border-radius: 10px; font-weight: 550; font-size: 15px;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; position: relative; transition: color .15s, background .15s;
}
.nav a:hover { color: var(--text); background: var(--sheet-2); }
.nav a.on { color: var(--ink); background: var(--ink-soft); }
.badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--red); color: #fff;
  font: 700 11.5px/20px var(--f-mono); text-align: center;
}
.top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.seg { display: inline-flex; background: var(--sheet-2); border: 1px solid var(--line); border-radius: 11px; padding: 3px; gap: 2px; }
.seg button {
  border: 0; background: transparent; padding: 5px 12px; border-radius: 8px; font-weight: 650; font-size: 14px; color: var(--muted);
  transition: background .15s, color .15s;
}
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--sheet); color: var(--ink); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }
.icon-btn {
  min-width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--line); background: var(--sheet);
  display: inline-grid; place-items: center; color: var(--muted); transition: color .15s, border-color .15s;
}
.icon-btn:hover { color: var(--text); border-color: var(--grid-strong); }
.icon-btn svg { width: 18px; height: 18px; }
.search-btn { padding: 0 8px 0 11px; gap: 8px; display: inline-flex; align-items: center; font-size: 14px; }
.search-btn span { min-width: 60px; text-align: left; }
.menu-btn { display: none; }

/* ================= Каркас ================= */
main { max-width: var(--wrap); margin: 0 auto; padding: 34px 16px 90px; display: block; }
.page-enter > * { animation: rise .45s cubic-bezier(.2, .8, .2, 1) both; }
.page-enter > *:nth-child(2) { animation-delay: .04s; }
.page-enter > *:nth-child(3) { animation-delay: .08s; }
.page-enter > *:nth-child(4) { animation-delay: .12s; }
.page-enter > *:nth-child(n+5) { animation-delay: .16s; }
@keyframes rise { from { opacity: .35; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; color: var(--muted); margin-bottom: 18px; align-items: center; }
.crumbs a { color: var(--muted); text-decoration: none; padding: 2px 8px; border-radius: 6px; background: var(--sheet-2); border: 1px solid var(--line); }
.crumbs a:hover { color: var(--ink); border-color: var(--ink); }
.crumbs > span:last-child { color: var(--text); font-weight: 550; }
.eyebrow { font: 600 11.5px/1.3 var(--f-mono); letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.h-display { font-family: var(--f-display); font-weight: 700; letter-spacing: -0.02em; }
.section { margin-top: 56px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.section-head h2 {
  font-family: var(--f-display); font-size: clamp(21px, 2.4vw, 26px); font-weight: 650; letter-spacing: -0.02em;
  position: relative; padding-bottom: 10px;
}
.section-head h2::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 64px; height: 8px; background: var(--red);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 8'%3E%3Cpath d='M2 5c9-3 17-3 26 0s18 2 34-2' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 8'%3E%3Cpath d='M2 5c9-3 17-3 26 0s18 2 34-2' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
}
.section-head > .muted, .section-head > a { font-size: 14.5px; }

.sheet { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); background: var(--sheet); color: var(--text);
  padding: 10px 17px; border-radius: 11px; font-weight: 650; font-size: 15px; text-decoration: none; white-space: nowrap; line-height: 1.2;
  box-shadow: var(--shadow-sm);
  transition: background .15s, border-color .15s, transform .1s, box-shadow .15s, filter .15s;
}
.btn:hover { border-color: var(--grid-strong); background: var(--sheet-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: var(--ink); border-color: var(--ink); color: var(--sheet);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .15) inset, 0 3px 0 var(--ink-2), 0 8px 18px -8px var(--ink);
}
.btn.primary:hover { filter: brightness(1.07); background: var(--ink); }
.btn.primary:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink-2); }
.btn.red { background: var(--red); border-color: var(--red); color: #fff; box-shadow: 0 3px 0 color-mix(in srgb, var(--red) 70%, #000), 0 8px 18px -8px var(--red); }
.btn.red:hover { filter: brightness(1.06); background: var(--red); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); box-shadow: none; }
.btn.ghost:hover { color: var(--text); background: var(--sheet-2); }
.btn.sm { padding: 6px 12px; font-size: 14px; border-radius: 9px; }
.btn.primary.sm { box-shadow: 0 2px 0 var(--ink-2); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 650;
  background: var(--sheet-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; text-decoration: none; line-height: 1.4;
}
a.chip:hover, button.chip:hover { border-color: var(--ink); color: var(--ink); }
button.chip { cursor: pointer; font-family: inherit; }
.chip.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.chip.ink { background: var(--ink-soft); color: var(--ink); border-color: color-mix(in srgb, var(--ink) 25%, transparent); }
.chip.red { background: var(--red-soft); color: var(--red); border-color: transparent; }
.chip.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.dots { display: inline-flex; gap: 3px; vertical-align: middle; }
.dots i { width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid currentColor; opacity: .75; }
.dots i.on { background: currentColor; opacity: 1; }
.bar { height: 7px; background: color-mix(in srgb, var(--line) 70%, var(--sheet-2)); border-radius: 4px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--c, var(--ink)); border-radius: 4px; transition: width .6s cubic-bezier(.2, .8, .2, 1); min-width: 0; }
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ================= Главная: герой ================= */
.hero { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.hero-left { display: flex; flex-direction: column; gap: 24px; min-width: 0; padding-top: 10px; }
.hero-left > .eyebrow {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 8px; border-radius: 999px;
  background: var(--sheet); border: 1px solid var(--line); box-shadow: var(--shadow-sm); color: var(--text);
}
.hero-left > .eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); }
.hero h1 {
  font-family: var(--f-display); font-size: clamp(36px, 5.4vw, 64px); font-weight: 700; letter-spacing: -0.045em; line-height: 1.02;
}
.hero h1 em { font-style: normal; color: var(--red); position: relative; display: inline-block; white-space: nowrap; margin: 0 .14em 0 .06em; }
.hero h1 em::after {
  content: ""; position: absolute; left: -8%; right: -8%; top: -14%; bottom: -18%; background: var(--red); pointer-events: none;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 100' preserveAspectRatio='none'%3E%3Cpath d='M150 6C70 4 10 22 8 50s62 44 150 44 138-16 136-46S220 2 118 10' fill='none' stroke='black' stroke-width='4' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 100' preserveAspectRatio='none'%3E%3Cpath d='M150 6C70 4 10 22 8 50s62 44 150 44 138-16 136-46S220 2 118 10' fill='none' stroke='black' stroke-width='4' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
  opacity: .8;
}
.hero-lead { font-size: clamp(16.5px, 1.6vw, 19px); color: var(--muted); max-width: 33em; line-height: 1.55; }
.hero-lead b { color: var(--text); }
.countdown {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 16px 18px; background: var(--sheet);
  border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.countdown::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--red); }
.count-cells { display: flex; }
.count-cells span {
  width: 50px; height: 64px; display: grid; place-items: center; font: 700 38px var(--f-mono); color: var(--red);
  border: 1.5px solid var(--grid-strong); margin-left: -1.5px; background: var(--sheet);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px); background-size: 100% 16px;
}
.count-cells span:first-child { margin-left: 0; border-radius: 8px 0 0 8px; }
.count-cells span:last-child { border-radius: 0 8px 8px 0; }
.count-label { font-size: 15px; line-height: 1.4; min-width: 0; flex: 1; }
.count-label b { display: block; font-size: 18px; font-family: var(--f-display); font-weight: 650; letter-spacing: -0.01em; margin-bottom: 2px; }
.count-label > button { border: 0; background: none; color: var(--ink); padding: 0; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; font-weight: 550; }
.date-edit { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.date-edit input { border: 1.5px solid var(--grid-strong); border-radius: 8px; padding: 5px 8px; background: var(--sheet); font-family: var(--f-mono); font-size: 14px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.stat {
  padding: 14px 14px 12px; background: var(--sheet); border: 1px solid var(--line); border-radius: 12px; min-width: 0;
  box-shadow: var(--shadow-sm); position: relative;
}
.stat b { display: block; font: 700 26px/1.1 var(--f-mono); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.stat span { font-size: 13px; color: var(--muted); }
.stat:nth-child(1) b { color: var(--ink); }
.stat:nth-child(2) b { color: var(--red); }
.stat:nth-child(3) b { color: var(--ok); }

/* Задача дня — лист, приколотый к столу */
.daily {
  padding: 22px 22px 20px; display: flex; flex-direction: column; gap: 12px; min-width: 0; position: relative;
  box-shadow: var(--shadow-lg); transform: rotate(0.6deg); margin-top: 8px;
  background-image: linear-gradient(90deg, transparent 38px, color-mix(in srgb, var(--red) 45%, transparent) 38px, color-mix(in srgb, var(--red) 45%, transparent) 39.5px, transparent 39.5px);
  padding-left: 56px;
}
.daily::before {
  content: ""; position: absolute; inset: 10px -10px -10px 10px; z-index: -1; border-radius: var(--r);
  background: var(--sheet-2); border: 1px solid var(--line); transform: rotate(-2.2deg);
}
.daily::after {
  content: ""; position: absolute; top: -14px; left: 50%; width: 92px; height: 26px; transform: translateX(-50%) rotate(-3deg);
  background: color-mix(in srgb, var(--warn) 22%, transparent); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent);
  border-radius: 3px; backdrop-filter: blur(2px);
}
.daily-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.daily-head .hand { font-size: 32px; color: var(--red); line-height: 1; }
.daily > p { font-size: 14px; }
.task.flat { padding: 0; border: 0; box-shadow: none; background: transparent; }
.task.flat .mark { right: 0; top: -6px; }

/* Продолжить / ошибки */
.continue-list { display: grid; gap: 12px; margin-top: 36px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.continue { display: flex; align-items: center; gap: 14px; padding: 14px 16px; flex-wrap: wrap; }
.continue > div { flex: 1; min-width: 180px; }
.continue b { font-size: 16px; }

/* План подготовки */
.plan { padding: 0; overflow: hidden; display: grid; grid-template-columns: 300px minmax(0, 1fr); }
.plan-pick { padding: 20px; background: var(--sheet-2); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.plan-pick .filter-row { gap: 6px; }
.pick-chip { padding: 5px 11px; font-size: 13px; }
.pick-chip.ink::before { content: "✓"; font-weight: 800; }
.plan-body { padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.plan-body > p.muted:only-child { padding: 18px 0; font-size: 15.5px; }
.plan-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.plan-stats div { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--sheet); min-width: 0; }
.plan-stats b { display: block; font: 700 24px/1.15 var(--f-mono); color: var(--ink); }
.plan-stats span { font-size: 13px; color: var(--muted); }
.plan-bar { height: 9px; }
.plan-note { font-size: 13.5px; }
.plan-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; }
.plan-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px;
  text-decoration: none; color: var(--text); background: var(--sheet); transition: border-color .15s, transform .15s;
}
.plan-item:hover { border-color: var(--c); transform: translateY(-1px); }
.plan-item .glyph { width: 36px; height: 36px; border-radius: 9px; }
.plan-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.plan-main b { font-size: 15px; line-height: 1.3; }
.plan-main small { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Предметы — обложки тетрадей */
.subjects { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.subj {
  --c: var(--ink);
  display: flex; flex-direction: column; gap: 12px; padding: 18px 18px 16px; text-decoration: none; color: var(--text);
  background: var(--sheet); border: 1px solid var(--line); border-radius: var(--r); position: relative; overflow: hidden;
  box-shadow: var(--shadow-sm); isolation: isolate;
  transition: transform .2s cubic-bezier(.2, .8, .2, 1), box-shadow .2s, border-color .2s;
}
.subj::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 5px; background: var(--c);
}
.subj::after {
  content: attr(data-glyph); position: absolute; right: -6px; bottom: -22px; z-index: -1;
  font: 800 108px/1 var(--f-display); color: var(--c); opacity: .07; letter-spacing: -0.06em; pointer-events: none;
  transition: transform .3s, opacity .3s;
}
.subj:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg), 0 0 0 1px color-mix(in srgb, var(--c) 40%, transparent); border-color: color-mix(in srgb, var(--c) 45%, var(--line)); text-decoration: none; }
.subj:hover::after { transform: translate(-6px, -6px) rotate(-4deg); opacity: .13; }
.subj-top { display: flex; gap: 12px; align-items: center; }
.glyph {
  --c2: var(--c, var(--ink));
  width: 48px; height: 48px; flex-shrink: 0; border-radius: 12px; display: grid; place-items: center;
  font: 700 18px var(--f-display); color: var(--c2); background: color-mix(in srgb, var(--c2) 12%, var(--sheet));
  border: 1.5px solid color-mix(in srgb, var(--c2) 30%, transparent); letter-spacing: -0.03em; line-height: 1;
  box-shadow: 0 1px 0 color-mix(in srgb, var(--c2) 20%, transparent);
}
.subj h3 { font-size: 17.5px; font-weight: 700; letter-spacing: -0.01em; }
.subj p { font-size: 14px; color: var(--muted); line-height: 1.45; }
.subj-foot { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); margin-top: auto; }
.subj-foot .bar { flex: 1; }
.subj-go { margin-left: auto; font-weight: 700; color: var(--c); opacity: 0; transform: translateX(-6px); transition: opacity .2s, transform .2s; }
.subj:hover .subj-go { opacity: 1; transform: none; }
.subj-ring {
  --p: 0;
  width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0; margin-left: auto; display: grid; place-items: center;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), color-mix(in srgb, var(--line) 80%, transparent) 0);
  font: 700 11px var(--f-mono); color: var(--text); position: relative;
}
.subj-ring::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--sheet); }
.subj-ring span { position: relative; }

/* Быстрый переход по предметам под героем */
.quick-subjects { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 30px; }
.quick-subjects a {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px; border-radius: 999px; text-decoration: none;
  background: var(--sheet); border: 1px solid var(--line); color: var(--text); font-size: 14px; font-weight: 550; box-shadow: var(--shadow-sm);
  transition: border-color .15s, transform .15s;
}
.quick-subjects a:hover { border-color: var(--c); transform: translateY(-1px); }
.quick-subjects .glyph { width: 28px; height: 28px; border-radius: 50%; font-size: 11px !important; border-width: 1px; }

/* Возможности */
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.feature { padding: 18px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.feature .f-ico {
  width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; background: var(--ink-soft); color: var(--ink);
  font: 700 16px var(--f-mono);
}
.feature:nth-child(2) .f-ico { background: var(--red-soft); color: var(--red); }
.feature:nth-child(3) .f-ico { background: var(--ok-soft); color: var(--ok); }
.feature:nth-child(4) .f-ico { background: var(--warn-soft); color: var(--warn); }
.feature b { font-size: 16px; }
.feature p { font-size: 14px; color: var(--muted); line-height: 1.5; }

/* Лаборатория — карточки */
.labs-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.lab-card {
  display: flex; flex-direction: column; gap: 8px; padding: 16px; background: var(--sheet); border: 1px solid var(--line);
  border-radius: var(--r); text-decoration: none; color: var(--text); transition: border-color .2s, transform .2s, box-shadow .2s;
  box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.lab-card:hover { border-color: var(--ink); transform: translateY(-3px); box-shadow: var(--shadow); text-decoration: none; }
.lab-card b { font-size: 16px; }
.lab-card > span:not(.lab-ico):not(.chip) { font-size: 13.5px; color: var(--muted); line-height: 1.45; }
.lab-card .lab-ico {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font: 700 15px var(--f-mono); color: var(--ink);
  background: var(--ink-soft); border: 1.5px dashed color-mix(in srgb, var(--ink) 40%, transparent); margin-bottom: 4px;
}
.lab-card::after { content: "→"; position: absolute; right: 16px; top: 18px; font-weight: 700; color: var(--ink); opacity: 0; transform: translateX(-6px); transition: .2s; }
.lab-card:hover::after { opacity: 1; transform: none; }

/* ================= Предмет ================= */
.subj-hero { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 28px; align-items: start; }
.subj-hero > div:first-child {
  background: var(--sheet); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow);
  padding: 28px; position: relative; overflow: hidden; isolation: isolate;
}
.subj-hero > div:first-child::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 6px; background: var(--c); }
.subj-hero > div:first-child::after {
  content: ""; position: absolute; right: -80px; top: -80px; width: 280px; height: 280px; border-radius: 50%; z-index: -1;
  background: radial-gradient(circle, color-mix(in srgb, var(--c) 16%, transparent), transparent 70%);
}
.subj-hero .glyph { width: 72px; height: 72px; font-size: 26px; border-radius: 16px; }
.subj-title { display: flex; gap: 18px; align-items: center; }
.subj-title h1 { font-family: var(--f-display); font-size: clamp(30px, 4.2vw, 46px); font-weight: 700; letter-spacing: -0.035em; }
.subj-progress { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-top: 24px; font-size: 14px; }
.subj-progress .mono { padding: 3px 9px; border-radius: 7px; background: var(--sheet-2); border: 1px solid var(--line); }
.subj-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.exam-card { padding: 20px; display: flex; flex-direction: column; gap: 12px; position: sticky; top: calc(env(safe-area-inset-top, 0px) + 86px); }
.exam-facts { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.exam-facts div { padding: 10px 11px; border-left: 1px solid var(--line); min-width: 0; }
.exam-facts div:first-child { border-left: 0; }
.exam-facts b { display: block; font: 700 18px/1.2 var(--f-mono); }
.exam-facts span { font-size: 12px; color: var(--muted); }
.exam-card p { font-size: 14.5px; line-height: 1.55; }

/* Оглавление тетради */
.toc-list { list-style: none; margin: 0; padding: 0; background: var(--sheet); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow-sm); }
.toc-list > li + li, .toc-list > a + a, .toc-list > .weak-row + .weak-row { border-top: 1px solid var(--line); }
.toc-row {
  display: grid; grid-template-columns: 60px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 16px 18px 16px 0;
  text-decoration: none; color: var(--text); position: relative; transition: background .15s;
}
.toc-row:hover { background: color-mix(in srgb, var(--c, var(--ink)) 5%, var(--sheet)); text-decoration: none; }
.toc-row:hover .toc-main b { color: var(--c, var(--ink)); }
.toc-num {
  font: 700 15px var(--f-mono); color: var(--red); text-align: right; padding-right: 14px; border-right: 1.5px solid color-mix(in srgb, var(--red) 55%, transparent);
  align-self: stretch; display: flex; align-items: center; justify-content: flex-end; margin: -16px 0;
}
.toc-main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.toc-main b { font-size: 17px; transition: color .15s; }
.toc-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; font-size: 13.5px; color: var(--muted); }
.toc-meta .mono { color: var(--ink); font-weight: 600; font-size: 12.5px; }
.toc-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; min-width: 120px; }
.toc-side .bar { width: 110px; }
.toc-row.dim { opacity: .5; }
.toc-row.dim:hover { opacity: .85; }
.result-topics .toc-row, .me-subj-row { grid-template-columns: auto minmax(0, 1fr) auto; padding: 12px 18px; }
.result-topics .toc-row { grid-template-columns: minmax(0, 1fr) auto; }
.weak-list { list-style: none; }
.weak-row { display: grid; grid-template-columns: auto minmax(0, 1fr) 150px auto; gap: 14px; align-items: center; padding: 12px 18px; }
.weak-row .glyph { width: 36px; height: 36px; border-radius: 9px; }
.weak-acc { display: flex; flex-direction: column; gap: 5px; }
.weak-acc .mono { font-weight: 700; }

/* ================= Тема ================= */
.topic-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 36px; align-items: start; }
.side-toc { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 92px); display: flex; flex-direction: column; gap: 1px; font-size: 14px; max-height: calc(100vh - 110px); overflow-y: auto; padding-bottom: 8px; }
.side-toc .eyebrow { margin-bottom: 10px; }
.side-toc a { text-decoration: none; color: var(--muted); padding: 6px 12px; border-left: 2px solid var(--line); line-height: 1.35; transition: color .15s, border-color .15s, background .15s; border-radius: 0 8px 8px 0; }
.side-toc a:hover { color: var(--text); background: var(--sheet-2); }
.side-toc a.on { color: var(--c, var(--ink)); border-left-color: var(--c, var(--ink)); font-weight: 650; background: color-mix(in srgb, var(--c, var(--ink)) 8%, transparent); }
.side-toc .side-prog { margin-top: 18px; padding: 14px; background: var(--sheet); border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow-sm); }
.topic-head { display: flex; flex-direction: column; gap: 12px; margin-bottom: 28px; }
.topic-head h1 { font-family: var(--f-display); font-size: clamp(28px, 4vw, 44px); font-weight: 700; letter-spacing: -0.035em; }
.topic-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.topic-summary { font-size: clamp(16.5px, 1.6vw, 19px); color: var(--muted); max-width: 42em; line-height: 1.55; }

/* Лист с полями */
.page {
  background: var(--sheet); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow);
  padding: 32px 36px 36px 80px; position: relative; min-width: 0;
  background-image: repeating-linear-gradient(transparent 0 27px, color-mix(in srgb, var(--grid) 60%, transparent) 27px 28px);
  background-position: 0 30px;
}
.page::before { content: ""; position: absolute; top: 0; bottom: 0; left: 56px; width: 1.5px; background: var(--red); opacity: .5; }
.page + .page { margin-top: 22px; }
.cheat { display: flex; flex-direction: column; gap: 12px; background-image: none; background-color: color-mix(in srgb, var(--hl) 18%, var(--sheet)); }
.cheat-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cheat-title .hand { font-size: 34px; color: var(--red); line-height: 1; }
.cheat-print { margin-left: auto; }
.cheat ol { margin: 0; padding-left: 24px; display: grid; gap: 8px; font-size: 16px; }
.cheat li { padding-left: 4px; }
.cheat li::marker { font-family: var(--f-mono); color: var(--red); font-weight: 700; }
.read-row { margin-top: 32px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; padding-top: 20px; border-top: 1.5px dashed var(--line); }
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 44px; flex-wrap: wrap; }
.pager .btn { white-space: normal; text-align: left; max-width: 48%; padding: 14px 18px; }

.prose { max-width: 72ch; font-size: 17px; line-height: 1.72; }
.prose > * + * { margin-top: 16px; }
.prose h2 { font-family: var(--f-display); font-size: 23px; font-weight: 650; margin-top: 12px; letter-spacing: -0.02em; position: relative; }
.prose h2:not(:first-child) { margin-top: 40px; }
.prose h2 .sec-n { position: absolute; left: -52px; top: 3px; font: 700 14px var(--f-mono); color: var(--red); width: 36px; text-align: right; }
.prose h3 { font-size: 18px; font-weight: 700; margin-top: 22px; }
.prose ul, .prose ol { padding-left: 24px; margin-bottom: 0; }
.prose li + li { margin-top: 5px; }
.prose ul li::marker { color: var(--red); }
.prose b, .prose strong { font-weight: 650; }
.prose code { font-family: var(--f-mono); font-size: .88em; background: var(--sheet-2); padding: 1px 6px; border-radius: 5px; border: 1px solid var(--line); }
.prose pre { background: var(--paper-2); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; overflow-x: auto; font-size: 14px; line-height: 1.55; }
.prose pre code { background: none; padding: 0; border: 0; }
.hl, .prose .hl { background: linear-gradient(transparent 52%, var(--hl) 52%, var(--hl) 92%, transparent 92%); padding: 0 2px; }
.prose details { border: 1.5px dashed var(--grid-strong); border-radius: 10px; padding: 12px 16px; background: var(--sheet); }
.prose summary { cursor: pointer; font-weight: 650; color: var(--ink); }
.prose details[open] summary { margin-bottom: 10px; }
.tbl-wrap { overflow-x: auto; max-width: 100%; border-radius: 10px; border: 1px solid var(--line); }
.tbl-wrap > table { border: 0; }
.tbl, .prose table { border-collapse: collapse; font-size: 15px; width: 100%; background: var(--sheet); }
.tbl th, .tbl td, .prose table th, .prose table td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 9px 12px; text-align: left; vertical-align: top; }
.tbl tr > :last-child, .prose table tr > :last-child { border-right: 0; }
.tbl tr:last-child > td, .prose table tr:last-child > td { border-bottom: 0; }
.tbl th, .prose table th { background: var(--sheet-2); font-weight: 700; font-size: 14px; }
.tbl tbody tr:hover, .prose table tr:hover td { background: color-mix(in srgb, var(--ink) 3%, transparent); }

.rule, .tip, .trap, .example { border-radius: 12px; padding: 16px 18px 16px 18px; position: relative; }
.rule > * + *, .tip > * + *, .trap > * + *, .example > * + * { margin-top: 8px; }
.rule::before, .tip::before, .trap::before, .example::before {
  display: inline-flex; align-items: center; gap: 6px; font: 700 11px var(--f-mono); letter-spacing: .09em; text-transform: uppercase;
  margin-bottom: 8px; padding: 3px 8px; border-radius: 6px;
}
.rule { border: 2px solid var(--ink); background: var(--ink-soft); box-shadow: 4px 4px 0 color-mix(in srgb, var(--ink) 22%, transparent); }
.rule::before { content: "§ Правило"; color: var(--sheet); background: var(--ink); }
.tip { background: var(--ok-soft); border: 1px solid color-mix(in srgb, var(--ok) 30%, transparent); }
.tip::before { content: "✦ Лайфхак"; color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.trap { background: var(--red-soft); border: 1.5px dashed var(--red); }
.trap::before { content: "⚠ Ловушка экзамена"; color: var(--red); background: color-mix(in srgb, var(--red) 12%, transparent); }
.example { border: 1px solid var(--line); background: var(--sheet-2); border-left: 4px solid var(--muted); }
.example::before { content: "Пример"; color: var(--muted); background: color-mix(in srgb, var(--muted) 12%, transparent); }
.quick {
  border: 1.5px solid var(--ink); border-radius: 12px; padding: 14px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px;
  background: color-mix(in srgb, var(--ink) 4%, var(--sheet)); box-shadow: 0 3px 0 color-mix(in srgb, var(--ink) 18%, transparent);
}
.quick-q { flex: 1 1 260px; font-weight: 550; }
.quick-q::before { content: "Проверь себя"; display: block; font: 700 11px var(--f-mono); color: var(--ink); letter-spacing: .09em; text-transform: uppercase; margin-bottom: 4px; }
.quick .blank { width: 200px; }
.quick-res { font: 700 24px var(--f-hand); min-width: 60px; }
math { font-family: "Latin Modern Math", "STIX Two Math", "Cambria Math", math; font-size: 1.1em; }
math[display="block"] { margin: 12px 0; }
.katex-block, .katex-display { display: block; overflow-x: auto; overflow-y: hidden; max-width: 100%; padding: 4px 0; }
.katex-wide { display: inline-block; max-width: 100%; overflow-x: auto; overflow-y: hidden; vertical-align: middle; }

/* ================= Бланк: поле в клетки ================= */
.blank {
  --cw: 26px;
  height: 42px; border: 1.5px solid var(--grid-strong); border-radius: 6px; background-color: var(--sheet);
  background-image: linear-gradient(90deg, transparent calc(var(--cw) - 1px), var(--grid-strong) calc(var(--cw) - 1px));
  background-size: var(--cw) 100%;
  font: 600 18px var(--f-mono); letter-spacing: calc(var(--cw) - 0.6em); padding: 0 0 0 calc((var(--cw) - 0.6em) / 2);
  color: var(--ink); width: calc(var(--cw) * 12 + 3px); max-width: 100%; text-transform: uppercase;
  transition: border-color .15s, box-shadow .15s;
}
.blank.lower { text-transform: none; }
.blank:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px var(--ink-soft); }
.blank.ok { border-color: var(--ok); color: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); }
.blank.bad { border-color: var(--red); color: var(--red); box-shadow: 0 0 0 4px var(--red-soft); animation: shake .35s; }
.blank::placeholder { color: var(--muted); opacity: .5; letter-spacing: normal; font-weight: 400; font-size: 14px; font-family: var(--f-body); text-transform: none; }
@keyframes shake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }

/* ================= Задание ================= */
.practice-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.practice-head h2 { font-family: var(--f-display); font-size: clamp(22px, 2.6vw, 28px); font-weight: 650; letter-spacing: -0.02em; margin-top: 4px; }
.tasks { display: flex; flex-direction: column; gap: 18px; }
.task { padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; position: relative; min-width: 0; transition: box-shadow .2s, border-color .2s; }
.task.sheet:focus-within { border-color: color-mix(in srgb, var(--ink) 40%, var(--line)); }
.task-head { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); padding-right: 90px; }
.task-head > a { font-size: 13px; }
.task-num {
  width: 36px; height: 36px; border: 1.5px solid var(--grid-strong); border-radius: 7px; display: grid; place-items: center;
  font: 700 15px var(--f-mono); color: var(--text); background: var(--sheet);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px); background-size: 100% 12px;
}
.task-q { font-size: 17px; line-height: 1.62; min-width: 0; }
.task-q > * + * { margin-top: 10px; }
.task-q table { border-collapse: collapse; font-size: 15px; }
.task-q table td, .task-q table th { border: 1px solid var(--line); padding: 6px 10px; }
.task-q pre { background: var(--paper-2); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; overflow-x: auto; font: 14px/1.55 var(--f-mono); }
.task-note { font-size: 14px; margin-bottom: 8px; }
.opts { display: flex; flex-direction: column; gap: 7px; }
.opt {
  display: flex; align-items: flex-start; gap: 12px; text-align: left; width: 100%;
  padding: 10px 14px 10px 10px; border: 1.5px solid var(--line); background: var(--sheet); border-radius: 11px; font-size: 16px; line-height: 1.45;
  transition: border-color .12s, background .12s, transform .12s;
}
.opt:hover { border-color: var(--grid-strong); background: var(--sheet-2); }
.opt:active { transform: scale(.995); }
.opt .box {
  flex-shrink: 0; width: 28px; height: 28px; border: 1.5px solid var(--grid-strong); border-radius: 6px; display: grid; place-items: center;
  font: 700 14px var(--f-mono); color: var(--muted); background: var(--sheet); transition: .12s;
}
.opt.sel { border-color: var(--ink); background: var(--ink-soft); }
.opt.sel .box { border-color: var(--ink); color: var(--sheet); background: var(--ink); }
.opt.right { border-color: var(--ok); background: var(--ok-soft); }
.opt.right .box { border-color: var(--ok); background: var(--ok); color: var(--sheet); }
.opt.wrong { border-color: var(--red); background: var(--red-soft); }
.opt.wrong .box { border-color: var(--red); background: var(--red); color: var(--sheet); }
.opt > span:last-child { min-width: 0; padding-top: 2px; }
.task.locked .opt { pointer-events: none; }
.input-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.unit { font-weight: 650; color: var(--muted); font-family: var(--f-mono); }
.order-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 7px; }
.order-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1.5px solid var(--line); border-radius: 11px; background: var(--sheet);
  font-size: 15.5px; line-height: 1.4; cursor: grab; user-select: none; transition: border-color .12s, box-shadow .12s;
}
.order-item:hover { border-color: var(--grid-strong); }
.order-item.dragging { border-color: var(--ink); cursor: grabbing; box-shadow: var(--shadow-lg); background: var(--ink-soft); }
.grip { color: var(--muted); display: grid; place-items: center; touch-action: none; cursor: grab; padding: 4px 0; }
.order-item .box { flex-shrink: 0; width: 28px; height: 28px; border: 1.5px solid var(--grid-strong); border-radius: 6px; display: grid; place-items: center; font: 700 14px var(--f-mono); }
.order-text { flex: 1; min-width: 0; }
.order-item .mv { display: flex; gap: 3px; }
.order-item .mv button { width: 30px; height: 30px; border: 1px solid var(--line); background: var(--sheet-2); border-radius: 8px; display: grid; place-items: center; color: var(--muted); }
.order-item .mv button:hover:not([disabled]) { color: var(--ink); border-color: var(--ink); }
.order-item .mv button[disabled] { opacity: .35; cursor: default; }
.order-item.right { border-color: var(--ok); background: var(--ok-soft); }
.order-item.wrong { border-color: var(--red); background: var(--red-soft); }
.match-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.match-col { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 12px 14px; border-radius: 11px; background: var(--sheet-2); border: 1px solid var(--line); }
.match-col .eyebrow { margin-bottom: 4px; }
.match-item { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; line-height: 1.45; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.match-item:last-child { border-bottom: 0; }
.match-item b { font-family: var(--f-mono); color: var(--ink); flex-shrink: 0; min-width: 20px; }
.match-item > span { min-width: 0; }
.match-answer { margin-top: 4px; display: flex; flex-direction: column; gap: 6px; }
.match-note { font-size: 13.5px; min-height: 1em; }
.answer-table { border-collapse: collapse; }
.answer-table th { font: 700 14px var(--f-mono); color: var(--muted); padding: 2px 0 5px; width: 42px; text-align: center; }
.answer-table td { padding: 0; }
.answer-table input {
  width: 42px; height: 46px; border: 1.5px solid var(--grid-strong); margin-left: -1.5px; text-align: center; background: var(--sheet);
  font: 700 20px var(--f-mono); color: var(--ink); border-radius: 0;
}
.answer-table td:first-child input { margin-left: 0; border-radius: 7px 0 0 7px; }
.answer-table td:last-child input { border-radius: 0 7px 7px 0; }
.answer-table input:focus { outline: none; border-color: var(--ink); position: relative; z-index: 1; box-shadow: 0 0 0 4px var(--ink-soft); }
.answer-table input.ok { border-color: var(--ok); color: var(--ok); position: relative; background: var(--ok-soft); }
.answer-table input.bad { border-color: var(--red); color: var(--red); position: relative; background: var(--red-soft); }
.task-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.task-extra { display: flex; flex-direction: column; gap: 12px; }
.task-extra:empty { display: none; }
.task-reveal { border-top: 1.5px dashed var(--line); padding-top: 14px; font-size: 16px; line-height: 1.62; display: flex; flex-direction: column; gap: 12px; }
.task-reveal .eyebrow { display: block; margin-bottom: 4px; }
.hint-box { background: var(--warn-soft); border-radius: 11px; padding: 12px 14px; font-size: 15.5px; border: 1px solid color-mix(in srgb, var(--warn) 25%, transparent); }
.hint-box::before { content: "Подсказка · "; font-weight: 700; color: var(--warn); }
.review-note { font-size: 14px; padding: 8px 12px; border-radius: 9px; background: var(--sheet-2); }
.mark {
  position: absolute; right: 20px; top: 12px; font: 700 36px/1 var(--f-hand); transform: rotate(-8deg); pointer-events: none;
  animation: stamp .4s cubic-bezier(.2, 1.6, .4, 1) both; padding: 2px 12px; border: 2.5px solid currentColor; border-radius: 12px 16px 10px 14px;
}
.mark.ok { color: var(--ok); }
.mark.bad { color: var(--red); }
@keyframes stamp { from { transform: rotate(-8deg) scale(1.8); opacity: 0; } to { transform: rotate(-8deg) scale(1); opacity: 1; } }
.correct-answer { font-size: 15.5px; }
.correct-answer b { color: var(--ok); font-family: var(--f-mono); }
.ai-box { border: 1.5px solid var(--ink); border-radius: 12px; padding: 14px 16px; background: var(--ink-soft); font-size: 15.5px; line-height: 1.6; }
.ai-box .eyebrow { color: var(--ink); display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.ai-text { white-space: pre-wrap; display: block; }
.ai-only { display: none !important; }
.has-ai .ai-only:not([hidden]) { display: inline-flex !important; }
.has-ai div.ai-only:not([hidden]), .has-ai section.ai-only:not([hidden]) { display: block !important; }

/* Тьютор */
.tutor { padding: 22px; display: flex; flex-direction: column; gap: 14px; background-image: radial-gradient(500px 200px at 100% 0, color-mix(in srgb, var(--ink) 8%, transparent), transparent); }
.tutor-log { display: flex; flex-direction: column; gap: 10px; max-height: 440px; overflow-y: auto; }
.tutor-log:empty { display: none; }
.msg { padding: 10px 14px; border-radius: 14px; font-size: 15px; line-height: 1.55; white-space: pre-wrap; max-width: 86%; }
.msg.me { align-self: flex-end; background: var(--ink); color: var(--sheet); border-bottom-right-radius: 4px; }
.msg.ai { align-self: flex-start; background: var(--sheet-2); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.tutor-form { display: flex; gap: 8px; align-items: flex-end; }
.tutor-form textarea { flex: 1; min-width: 0; resize: vertical; min-height: 46px; border: 1.5px solid var(--grid-strong); border-radius: 11px; padding: 10px 12px; background: var(--sheet); }
.tutor-form textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px var(--ink-soft); }
.suggests { display: flex; flex-wrap: wrap; gap: 6px; }
.suggests button { border: 1px dashed var(--grid-strong); background: var(--sheet); border-radius: 999px; padding: 5px 12px; font-size: 13.5px; color: var(--muted); }
.suggests button:hover { color: var(--ink); border-color: var(--ink); border-style: solid; }

/* ================= Пробник ================= */
.exam-setup { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.pick {
  --c: var(--ink);
  display: flex; gap: 12px; align-items: center; padding: 12px; border: 1.5px solid var(--line); border-radius: 13px; background: var(--sheet); text-align: left;
  transition: border-color .15s, box-shadow .15s, transform .15s; box-shadow: var(--shadow-sm);
}
.pick:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--c) 45%, var(--line)); }
.pick[aria-disabled="true"] { opacity: .5; }
.pick .glyph { width: 42px; height: 42px; font-size: 15px; }
.pick.on { border-color: var(--c); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 16%, transparent); }
.pick b { display: block; font-size: 15px; }
.pick span { font-size: 13px; color: var(--muted); }
.setup-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-top: 20px; padding: 14px 16px; background: var(--sheet); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-sm); }
.setup-row #ex-start { margin-left: auto; }
.check-label { display: inline-flex; gap: 8px; align-items: center; font-size: 15px; cursor: pointer; }
.check-label input { width: 18px; height: 18px; accent-color: var(--ink); }
.resume { padding: 16px 18px; display: flex; gap: 14px 20px; align-items: center; flex-wrap: wrap; margin-bottom: 22px; border-color: var(--ink); background: var(--ink-soft); }
.resume > div:first-child { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 220px; }
.resume-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.resume-confirm { flex-basis: 100%; font-size: 14.5px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.last-result { margin-bottom: 18px; }
.exam-run { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; align-items: start; }
.exam-panel { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 92px); padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.timer { font: 700 40px var(--f-mono); color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: -0.03em; line-height: 1.1; margin-top: 4px; }
.timer.low { color: var(--red); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.num-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; }
.num-grid button {
  aspect-ratio: 1; border: 1.5px solid var(--grid-strong); margin: 0 0 -1.5px -1.5px; background: var(--sheet); font: 600 14px var(--f-mono); color: var(--muted); padding: 0;
}
.num-grid button:hover { color: var(--text); background: var(--sheet-2); }
.num-grid button.done { background: var(--ink-soft); color: var(--ink); }
.num-grid button.cur { border-color: var(--ink); position: relative; z-index: 1; color: var(--text); box-shadow: inset 0 0 0 1.5px var(--ink); }
.num-grid button.ok { background: var(--ok-soft); color: var(--ok); }
.num-grid button.bad { background: var(--red-soft); color: var(--red); }
.ex-nav { display: grid; grid-template-columns: auto 1fr; gap: 8px; }
.ex-confirm { font-size: 14px; padding: 12px; border-radius: 10px; background: var(--red-soft); }
.exam-pill {
  position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 40; display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 999px; background: var(--text); color: var(--paper); text-decoration: none; font-weight: 650; box-shadow: var(--shadow-lg);
}
.exam-pill:hover { text-decoration: none; transform: translateY(-1px); }
.exam-pill-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--red); animation: pulse 1.2s infinite; }
.result-hero { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 32px; align-items: center; padding: 28px 32px; position: relative; overflow: hidden; }
.result-hero::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 6px; background: var(--c, var(--ink)); }
.score-big { font: 700 84px/1 var(--f-display); color: var(--red); letter-spacing: -0.05em; padding: 14px 22px; border: 3px solid currentColor; border-radius: 18px 26px 16px 22px; transform: rotate(-3deg); }
.score-big small { font-size: 24px; color: var(--muted); letter-spacing: 0; }
.review-item { padding: 14px 18px; }
.review-item summary { cursor: pointer; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; list-style: none; }
.review-item summary::-webkit-details-marker { display: none; }
.review-item summary::after { content: "▾"; margin-left: auto; color: var(--muted); transition: transform .2s; }
.review-item[open] summary::after { transform: rotate(180deg); }

/* ================= Карточки ================= */
.flash-wrap { max-width: 660px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; align-items: stretch; }
.flash { perspective: 1400px; height: 320px; cursor: pointer; border-radius: 18px; }
.flash-in { position: relative; width: 100%; height: 100%; transition: transform .6s cubic-bezier(.3, .7, .3, 1); transform-style: preserve-3d; }
.flash.flipped .flash-in { transform: rotateY(180deg); }
.flash-face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 18px; border: 1px solid var(--line);
  background-color: var(--sheet); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 36px 32px 28px; text-align: center; font-size: 23px; line-height: 1.4; overflow: auto;
  background-image: repeating-linear-gradient(transparent 0 31px, var(--grid) 31px 32px);
}
.flash-front { border-top: 6px solid var(--c, var(--ink)); }
.flash-face .eyebrow { position: absolute; top: 16px; left: 20px; }
.flash-back { transform: rotateY(180deg); color: var(--ink); font-weight: 650; border-top: 6px solid var(--ok); }
.flash-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.score-row { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.score-row b { color: var(--text); font-family: var(--f-mono); }

/* ================= Прогресс ================= */
.heat-sec { padding: 20px; }
.heat-scroll { overflow-x: auto; }
.heat-scroll canvas { width: 100%; min-width: 520px; display: block; }
.data-box { padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.data-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.imp-confirm { padding: 12px 14px; border-radius: 10px; background: var(--warn-soft); display: flex; flex-direction: column; gap: 10px; }

/* ================= Лаборатория ================= */
.lab-embed, .lab { margin: 20px 0; }
.lab-frame { border: 1.5px solid color-mix(in srgb, var(--ink) 55%, var(--line)); border-radius: 14px; background: var(--sheet); overflow: hidden; max-width: 100%; box-shadow: var(--shadow); }
.lab-bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--ink-soft); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.lab-bar b { font-size: 15px; color: var(--ink); }
.lab-bar .lab-tag { font: 700 10.5px var(--f-mono); letter-spacing: .09em; text-transform: uppercase; color: var(--sheet); background: var(--ink); padding: 3px 7px; border-radius: 5px; }
.lab-bar .grow { flex: 1; }
.lab-body { padding: 16px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.lab-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.lab-body label { font-size: 14px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.lab-body label.inline { flex-direction: row; align-items: center; gap: 8px; }
.lab-body input[type="range"] { accent-color: var(--ink); width: 170px; max-width: 100%; }
.lab-body input[type="text"], .lab-body input[type="number"], .lab-body select {
  border: 1.5px solid var(--grid-strong); border-radius: 8px; padding: 8px 10px; background: var(--sheet); font-family: var(--f-mono); font-size: 15px; min-width: 0;
}
.lab-body input:focus, .lab-body select:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px var(--ink-soft); }
.lab-body canvas { width: 100%; display: block; border-radius: 10px; background: var(--sheet); border: 1px solid var(--line); touch-action: none; }
.readout { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.readout div { padding: 10px 12px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 0 -1px -1px 0; }
.readout b { display: block; font: 700 18px var(--f-mono); font-variant-numeric: tabular-nums; }
.readout span { font-size: 12px; color: var(--muted); }
.lab-note { font-size: 14px; color: var(--muted); line-height: 1.5; }

/* Таблица Менделеева */
.pt-scroll { overflow-x: auto; padding-bottom: 4px; }
.pt { display: grid; grid-template-columns: repeat(18, minmax(36px, 1fr)); gap: 2px; min-width: 700px; }
.pt-el {
  --pc: var(--muted);
  aspect-ratio: 1 / 1.08; border: 1px solid color-mix(in srgb, var(--pc) 45%, transparent); border-radius: 4px; padding: 2px 3px;
  background: color-mix(in srgb, var(--pc) 14%, var(--sheet)); display: flex; flex-direction: column; justify-content: space-between;
  font-family: var(--f-mono); color: var(--text); cursor: pointer; text-align: left; min-width: 0; transition: transform .1s;
}
.pt-el:hover { transform: scale(1.14); z-index: 2; position: relative; box-shadow: var(--shadow); }
.pt-el.sel { outline: 2.5px solid var(--ink); outline-offset: 1px; }
.pt-el.dim { opacity: .25; }
.pt-el .z { font-size: 9px; color: var(--muted); line-height: 1; }
.pt-el .sym { font-size: 15px; font-weight: 700; line-height: 1; }
.pt-el .nm { font-size: 7px; line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-family: var(--f-body); }
.pt-gap { aspect-ratio: 1 / 1.08; }
.pt-label { font: 600 10px var(--f-mono); color: var(--muted); text-align: center; align-self: end; padding-bottom: 2px; }
.pt-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12.5px; color: var(--muted); }
.pt-legend span { display: inline-flex; align-items: center; gap: 5px; }
.pt-legend i { width: 11px; height: 11px; border-radius: 3px; }
.pt-info { display: grid; grid-template-columns: 110px 1fr; gap: 16px; align-items: start; }
.pt-big { aspect-ratio: 1; border: 2px solid var(--ink); border-radius: 10px; display: flex; flex-direction: column; justify-content: space-between; padding: 8px; font-family: var(--f-mono); background: var(--ink-soft); }
.pt-big .sym { font: 700 38px var(--f-display); color: var(--ink); line-height: 1; }
.pt-props { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 16px; font-size: 14px; min-width: 0; }
.pt-props div span { display: block; font-size: 12px; color: var(--muted); }
.pt-props div b { font-family: var(--f-mono); font-weight: 600; word-break: break-word; }

/* Игры */
.game-word { font: 700 clamp(30px, 6vw, 48px) var(--f-body); letter-spacing: .02em; display: flex; justify-content: center; flex-wrap: wrap; gap: 1px; padding: 16px 0; }
.game-word button { border: 0; background: none; padding: 2px 3px; font: inherit; color: var(--text); border-radius: 8px; border-bottom: 3px solid transparent; }
.game-word button.v { color: var(--ink); border-bottom-color: var(--ink-soft); }
.game-word button.v:hover { background: var(--ink-soft); }
.game-word button.ok { color: var(--ok); border-bottom-color: var(--ok); }
.game-word button.bad { color: var(--red); border-bottom-color: var(--red); }
.game-word span { padding: 2px 1px; }
.punnett { border-collapse: collapse; font-family: var(--f-mono); }
.punnett th, .punnett td { border: 1.5px solid var(--grid-strong); width: 58px; height: 42px; text-align: center; font-size: 15px; }
.punnett th { background: var(--sheet-2); color: var(--ink); }
.ratio-list { display: flex; flex-wrap: wrap; gap: 6px; }

/* ================= Поиск ================= */
.overlay { position: fixed; inset: 0; background: rgba(8, 12, 10, 0.5); backdrop-filter: blur(3px); z-index: 60; display: flex; justify-content: center; padding: 10vh 16px 16px; animation: fade .15s ease both; }
@keyframes fade { from { opacity: 0; } }
.palette { width: 100%; max-width: 660px; max-height: 72vh; display: flex; flex-direction: column; overflow: hidden; align-self: flex-start; box-shadow: var(--shadow-lg); animation: rise .2s ease both; }
.palette input { border: 0; border-bottom: 1px solid var(--line); padding: 18px 20px; font-size: 18px; background: transparent; outline: none; }
.palette-list { overflow-y: auto; padding: 6px; }
.palette-item { display: flex; gap: 12px; align-items: center; padding: 9px 12px; border-radius: 10px; text-decoration: none; color: var(--text); }
.palette-item.act, .palette-item:hover { background: var(--ink-soft); text-decoration: none; }
.palette-item .glyph { width: 34px; height: 34px; font-size: 12px; border-radius: 9px; }
.palette-item small { display: block; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.palette-item > div { min-width: 0; }
.palette-foot { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); background: var(--sheet-2); }
.palette-foot kbd { margin-right: 3px; }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 70;
  background: var(--text); color: var(--paper); padding: 11px 18px; border-radius: 12px; font-weight: 650; font-size: 15px; box-shadow: var(--shadow-lg);
  animation: toast .3s cubic-bezier(.2, 1.3, .4, 1) both; max-width: calc(100vw - 32px);
}
@keyframes toast { from { opacity: 0; transform: translate(-50%, 12px); } }
.xp-pop { position: fixed; z-index: 80; font: 700 24px var(--f-hand); color: var(--ok); pointer-events: none; animation: xp 1s ease forwards; }
@keyframes xp { from { opacity: 1; transform: translateY(0) scale(1); } to { opacity: 0; transform: translateY(-46px) scale(1.2); } }

.empty { padding: 40px 24px; text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.empty .hand { font-size: 34px; color: var(--red); line-height: 1.1; }

/* ================= Подвал ================= */
.foot {
  max-width: var(--wrap); margin: 0 auto 28px; padding: 22px 24px; color: var(--muted); font-size: 13.5px;
  display: flex; gap: 12px 24px; flex-wrap: wrap; justify-content: space-between; align-items: center;
  background: var(--sheet); border: 1px solid var(--line); border-radius: var(--r); width: calc(100% - 32px);
}
.foot::before { content: "Клетка"; font: 700 16px var(--f-display); color: var(--text); letter-spacing: -0.02em; flex-basis: 100%; }

/* ================= Печать шпаргалки ================= */
@media print {
  body { background: #fff; }
  .top, .foot, .no-print, .exam-pill, .toast { display: none !important; }
  body.print-cheat main > *:not(.topic-layout) { display: none !important; }
  body.print-cheat .topic-layout { display: block; }
  body.print-cheat .side-toc, body.print-cheat .topic-layout > div > *:not(#sec-cheat):not(.topic-head) { display: none !important; }
  .page, .sheet { box-shadow: none; }
}

/* ================= Адаптив ================= */
@media (max-width: 1100px) {
  .features { grid-template-columns: repeat(2, 1fr); }
  .plan { grid-template-columns: 1fr; }
  .plan-pick { border-right: 0; border-bottom: 1px solid var(--line); }
}
@media (max-width: 980px) {
  .hero, .subj-hero { grid-template-columns: 1fr; }
  .daily { transform: none; margin-top: 18px; }
  .exam-card { position: static; }
  .topic-layout { grid-template-columns: 1fr; }
  .side-toc { display: none; }
  .exam-run { grid-template-columns: 1fr; }
  .exam-panel { position: static; order: -1; }
  .nav { display: none; }
  .nav.open {
    display: flex; flex-direction: column; position: absolute; top: calc(100% + 8px); left: 0; right: 0; background: var(--sheet);
    border: 1px solid var(--line); border-radius: 14px; padding: 8px; margin: 0; box-shadow: var(--shadow-lg);
  }
  .nav.open a { padding: 11px 12px; }
  .menu-btn { display: inline-grid; }
  .weak-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .weak-acc { grid-column: 2; }
}
@media (max-width: 640px) {
  .top { padding: 8px 10px 0; }
  .top-in { gap: 6px; padding: 6px 6px 6px 10px; }
  main { padding-top: 22px; }
  .hero h1 { font-size: clamp(32px, 10vw, 44px); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .features { grid-template-columns: 1fr; }
  .daily { padding: 18px 16px 16px 40px; background-image: linear-gradient(90deg, transparent 24px, color-mix(in srgb, var(--red) 45%, transparent) 24px, color-mix(in srgb, var(--red) 45%, transparent) 25.5px, transparent 25.5px); }
  .daily::before { display: none; }
  .page { padding: 22px 16px 24px 36px; background-image: none; }
  .page::before { left: 22px; }
  .prose { font-size: 16.5px; }
  .prose h2 .sec-n { display: none; }
  .task { padding: 16px 14px; }
  .task-head { padding-right: 0; }
  .mark { top: auto; bottom: 14px; right: 14px; font-size: 30px; }
  .match-cols { grid-template-columns: 1fr; }
  .toc-row { grid-template-columns: 40px minmax(0, 1fr); padding-right: 14px; }
  .toc-side { grid-column: 2; align-items: center; flex-direction: row; min-width: 0; }
  .me-subj-row, .result-topics .toc-row { grid-template-columns: auto minmax(0, 1fr); }
  .search-btn span, .search-btn kbd { display: none; }
  .search-btn { padding: 0; }
  .result-hero { grid-template-columns: 1fr; padding: 22px; }
  .score-big { justify-self: start; font-size: 64px; }
  .pt-info { grid-template-columns: 1fr; }
  .pt-big { width: 110px; }
  .flash { height: 270px; }
  .flash-face { font-size: 19px; padding: 34px 20px 20px; }
  .logo-text { display: none; }
  .seg button { padding: 5px 9px; }
  .plan-stats { grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
  .plan-stats b { font-size: 19px; }
  .pager .btn { max-width: 100%; flex: 1 1 100%; }
  .subj-hero > div:first-child { padding: 22px 18px; }
  .subj-hero .glyph { width: 56px; height: 56px; font-size: 20px; }
  .setup-row #ex-start { margin-left: 0; width: 100%; }
  .count-cells span { width: 42px; height: 54px; font-size: 32px; }
  .weak-row { grid-template-columns: auto minmax(0, 1fr); }
  .weak-row > .btn { grid-column: 2; justify-self: start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ================= Иллюстрации (js/viz.js) ================= */
.viz { margin: 24px 0; padding: 18px 16px 14px; background: var(--sheet); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-sm); text-align: center; overflow-x: auto; }
.viz svg { width: 100%; max-width: 580px; min-width: 300px; height: auto; display: block; margin: 0 auto; overflow: visible; }
.viz figcaption { font-size: 14px; color: var(--muted); margin-top: 10px; line-height: 1.45; text-align: left; max-width: 580px; margin-inline: auto; }
.viz figcaption b { color: var(--red); font-family: var(--f-mono); font-weight: 700; }
.viz .gr { stroke: var(--grid-strong); stroke-width: 1; }
.viz .ax { stroke: var(--muted); stroke-width: 1.5; fill: none; }
.viz .c1, .viz .c2, .viz .c3, .viz .c4, .viz .c5 { stroke-width: 2.6; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.viz .c1 { stroke: var(--ink); } .viz .c2 { stroke: var(--red); } .viz .c3 { stroke: var(--ok); } .viz .c4 { stroke: var(--warn); } .viz .c5 { stroke: var(--text); }
.viz .thin { stroke-width: 1.5; } .viz .wide { stroke-width: 4; } .viz .d { stroke-dasharray: 6 5; }
.viz .k0 { stroke: none; } .viz .k2 { stroke: var(--red); stroke-width: 1; }
.viz .fn { fill: none; } .viz .fs { fill: var(--sheet); }
.viz .f1 { fill: var(--ink-soft); } .viz .f2 { fill: var(--red-soft); } .viz .f3 { fill: var(--ok-soft); } .viz .f4 { fill: var(--warn-soft); }
.viz .h1, .viz .p1 { fill: var(--ink); } .viz .h2, .viz .p2 { fill: var(--red); } .viz .h3, .viz .p3 { fill: var(--ok); } .viz .h4 { fill: var(--warn); } .viz .h5, .viz .p5 { fill: var(--muted); }
.viz text { font-family: var(--f-body); }
.viz .t { fill: var(--text); font-size: 14px; }
.viz .ts { fill: var(--muted); font-size: 12.5px; }
.viz .tn { fill: var(--muted); font-size: 11px; font-family: var(--f-mono); }
.viz .tb { font-weight: 700; } .viz .ti { fill: var(--ink); } .viz .tr { fill: var(--red); } .viz .tg { fill: var(--ok); } .viz .tm { fill: var(--muted); }
.viz .mono { font-family: var(--f-mono); } .viz .big { font: 700 30px var(--f-mono); }
