/* «Учёба» — внешний вид. Цвета заданы переменными: светлая тема по умолчанию,
   тёмная — по настройке системы или вручную (атрибут data-theme на <html>). */
@font-face { font-family: "Literata"; src: url("../fonts/literata-cyrillic-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Literata"; src: url("../fonts/literata-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Literata"; src: url("../fonts/literata-cyrillic-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Literata"; src: url("../fonts/literata-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
/* Onest — основной шрифт интерфейса (переменная толщина 100–900), лежит локально, чтобы работать без сети */
@font-face { font-family: "Onest"; src: url("../fonts/onest-cyrillic-wght-normal.woff2") format("woff2-variations"), url("../fonts/onest-cyrillic-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; src: url("../fonts/onest-latin-wght-normal.woff2") format("woff2-variations"), url("../fonts/onest-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2215, U+FEFF, U+FFFD; }
/* знак минус (U+2212) у Onest короткий и похож на дефис — берём его из системного шрифта */

:root {
  --bg: #f3f3f1;
  --surface: #ffffff;
  --surface2: #ececea;
  --chip: #ececea;
  --line: #e0e0db;
  --line-strong: #cfcfca;
  --ring: #8e9096;
  --ink: #18191b;
  --ink2: #3b3d42;
  --muted: #66686e;
  --graphite: #232427;
  --graphite-ink: #ffffff;
  --plate: #232427;
  --plate-ink: #ffffff;
  --plate-label: #b9bbc0;
  --check: #c02d26;
  --check-ink: #b32a24;
  --check-soft: #fbeceb;
  --check-on: #ffffff;
  --check-on2: #ffeae7;
  --check-track: rgba(255,255,255,.32);
  --memo: #ffd93b;
  --memo-bar: #f0bf00;
  --memo-on: #18191b;
  --solve: #1f5bd6;
  --solve-ink: #1a50c0;
  --solve-soft: #ebf1fd;
  --done: #1b7f45;
  --done-ink: #17703c;
  --done-soft: #e7f3eb;
  --done-on: #ffffff;
  --paper: #fbfaf5;
  --paper-ink: #1a50c0;
  --paper-line: #d9d6cc;
  --focus: #232427;
  --shadow: 0 1px 2px rgba(24,25,27,.05), 0 8px 24px -16px rgba(24,25,27,.22);
  --accent: #232427;
  --accent-ink: #ffffff;
  --accent-soft: rgba(35,36,39,.08);
  --good: var(--done);
  --good-soft: var(--done-soft);
  --bad: var(--check-ink);
  --bad-soft: var(--check-soft);
  --blue: var(--solve-ink);
  --amber: var(--muted);
  --amber-soft: var(--surface2);
  --hl: var(--memo);
  --hl-edge: var(--memo-bar);
  --hl-ink: var(--memo-on);
  --card-line: transparent;
  --signal-bg: #232427;
  --signal-red: #ffaaa3;
  --signal-yellow: #ffe074;
  --signal-green: #85e4ad;
  --section-today: #245fbd;
  --section-homework: #a34d08;
  --section-subjects: #08766e;
  --section-cards: #7844bd;
  --r: 16px; --r-s: 11px; --ease: cubic-bezier(.22, 1, .36, 1); --spring: cubic-bezier(.34, 1.45, .64, 1);
  --fs: 16px; --nav-h: 64px; --side-w: 244px; color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  --bg: #16181d;
  --surface: #21242c;
  --surface2: #2a2e38;
  --chip: #2a2e38;
  --line: #373d48;
  --line-strong: #4a5261;
  --ring: #6e7076;
  --ink: #efefec;
  --ink2: #c9cac6;
  --muted: #9c9ea4;
  --graphite: #ececea;
  --graphite-ink: #18191b;
  --plate: #2c2d31;
  --plate-ink: #efefec;
  --plate-label: #9c9ea4;
  --check: #b3302a;
  --check-ink: #ff7b72;
  --check-soft: #3a282a;
  --check-on: #ffffff;
  --check-on2: #ffeae7;
  --check-track: rgba(255,255,255,.28);
  --memo: #f5cf3a;
  --memo-bar: #e0b820;
  --memo-on: #18191b;
  --solve: #2f63d4;
  --solve-ink: #80a8ff;
  --solve-soft: #282f3e;
  --done: #1d8047;
  --done-ink: #55cf8b;
  --done-soft: #22342d;
  --done-on: #ffffff;
  --paper: #1f1f1c;
  --paper-ink: #a9c0ff;
  --paper-line: #45413a;
  --focus: #ececea;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 28px -18px rgba(0,0,0,.8);
  --accent: #ececea;
  --accent-ink: #18191b;
  --accent-soft: rgba(236,236,234,.10);
  --good: var(--done);
  --good-soft: var(--done-soft);
  --bad: var(--check-ink);
  --bad-soft: var(--check-soft);
  --blue: var(--solve-ink);
  --amber: var(--muted);
  --amber-soft: var(--surface2);
  --hl: var(--memo);
  --hl-edge: var(--memo-bar);
  --hl-ink: var(--memo-on);
  --card-line: rgba(255,255,255,.07);
  --signal-bg: #f5f4ef;
  --signal-red: #a82020;
  --signal-yellow: #765600;
  --signal-green: #126837;
  --section-today: #90b5ff;
  --section-homework: #ffb46b;
  --section-subjects: #63d6c8;
  --section-cards: #c6a1ff;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #16181d;
  --surface: #21242c;
  --surface2: #2a2e38;
  --chip: #2a2e38;
  --line: #373d48;
  --line-strong: #4a5261;
  --ring: #6e7076;
  --ink: #efefec;
  --ink2: #c9cac6;
  --muted: #9c9ea4;
  --graphite: #ececea;
  --graphite-ink: #18191b;
  --plate: #2c2d31;
  --plate-ink: #efefec;
  --plate-label: #9c9ea4;
  --check: #b3302a;
  --check-ink: #ff7b72;
  --check-soft: #3a282a;
  --check-on: #ffffff;
  --check-on2: #ffeae7;
  --check-track: rgba(255,255,255,.28);
  --memo: #f5cf3a;
  --memo-bar: #e0b820;
  --memo-on: #18191b;
  --solve: #2f63d4;
  --solve-ink: #80a8ff;
  --solve-soft: #282f3e;
  --done: #1d8047;
  --done-ink: #55cf8b;
  --done-soft: #22342d;
  --done-on: #ffffff;
  --paper: #1f1f1c;
  --paper-ink: #a9c0ff;
  --paper-line: #45413a;
  --focus: #ececea;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 28px -18px rgba(0,0,0,.8);
  --accent: #ececea;
  --accent-ink: #18191b;
  --accent-soft: rgba(236,236,234,.10);
  --good: var(--done);
  --good-soft: var(--done-soft);
  --bad: var(--check-ink);
  --bad-soft: var(--check-soft);
  --blue: var(--solve-ink);
  --amber: var(--muted);
  --amber-soft: var(--surface2);
  --hl: var(--memo);
  --hl-edge: var(--memo-bar);
  --hl-ink: var(--memo-on);
  --card-line: rgba(255,255,255,.07);
  --signal-bg: #f5f4ef;
  --signal-red: #a82020;
  --signal-yellow: #765600;
  --signal-green: #126837;
  --section-today: #90b5ff;
  --section-homework: #ffb46b;
  --section-subjects: #63d6c8;
  --section-cards: #c6a1ff;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: var(--fs); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem; line-height: 1.55; -webkit-font-smoothing: antialiased; 
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
}
a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { margin: 0; line-height: 1.15; font-weight: 750; letter-spacing: -.02em; }
h1 { font-size: 1.65rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1.02rem; }
sup { font-size: .7em; line-height: 0; } sub { font-size: .7em; line-height: 0; }
/* Синяя ручка — главная мысль; жёлтый маркер — только то, что учим наизусть. */
mark { background: none; color: inherit; font-weight: 700; padding: 0; margin: 0; text-decoration: underline 2px var(--solve-ink); text-underline-offset: .2em; text-decoration-skip-ink: none; }
.memo-f { background: var(--memo); color: var(--memo-on); font-weight: 700; padding: .06em .3em; border-radius: .38em .26em .42em .3em; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.memo-f mark { background: none; color: inherit; text-decoration: none; padding: 0; }
.memo-f b, .memo-f strong, .memo-f a { color: inherit; }
.memo-f .math-line { display: inline-block; vertical-align: middle; max-width: 100%; }
b, strong { font-weight: 700; }
.prose b, .why b, .rule b, .gist b, .steps b, .traps b, .task .q b, .pr .q b, .fb.info b { color: var(--ink); }
.card, .rule, .task, .pr, .stat, .subj, .test-card, .pager a, .tabs, .toc button, .top .back, .top .act { border: 1px solid var(--card-line); }
pre, code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .92em; }
pre { background: var(--surface2); padding: 10px 12px; border-radius: var(--r-s); overflow-x: auto; margin: 8px 0; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; margin: 8px 0; }
td, th { border: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
th { background: var(--surface2); font-weight: 600; }
ul, ol { padding-left: 1.3em; margin: 6px 0; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- каркас ---------- */
.app { max-width: 820px; margin: 0 auto; padding: 14px 16px 30px; }
.top { display: flex; align-items: center; gap: 10px; min-height: 44px; margin: 2px 0 12px; }
.top .back { width: 40px; height: 40px; border-radius: 12px; border: 0; background: var(--surface); box-shadow: var(--shadow); display: grid; place-items: center; flex: none; }
.top .ttl { flex: 1; min-width: 0; }
.top .ttl small { display: block; color: var(--muted); font-size: .82rem; }
.top .ttl h1 { font-size: 1.35rem; overflow-wrap: anywhere; }
.top .act { width: 40px; height: 40px; border-radius: 12px; border: 0; background: var(--surface); box-shadow: var(--shadow); display: grid; place-items: center; flex: none; color: var(--muted); }
.top .act.on { color: var(--amber); }
.ico { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ico.s { width: 18px; height: 18px; }

.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); background: var(--surface);
   border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
}
.nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 0; color: var(--muted); font-size: clamp(.6rem, 2.85vw, .72rem); font-weight: 600; position: relative; }
.nav a .ico { width: 54px; height: 30px; padding: 4px 16px; border-radius: 99px; transition: background .25s var(--ease), transform .25s var(--spring); }
.nav a.on { color: var(--accent); }
.nav a.on .ico { background: var(--accent-soft); }
.nav a:active .ico { transform: scale(.9); }
.nav a .dot { position: absolute; top: 9px; left: calc(50% + 8px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--bad); color: var(--graphite-ink); font-size: .65rem; display: grid; place-items: center; }
.side { display: none; }

@media (min-width: 900px) {
  body { padding-bottom: 0; }
  .nav { display: none; }
  .side {
    display: flex; flex-direction: column; gap: 4px; position: fixed; top: 0; bottom: 0; left: 0; width: var(--side-w);
    padding: 22px 14px; background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto;
  }
  .side .brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; padding: 4px 10px 16px; }
  .side .brand i { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); display: grid; place-items: center; color: var(--graphite-ink); font-style: normal; }
  .side a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--ink); font-weight: 600; font-size: .95rem; }
  .side a:hover { background: var(--surface2); }
  .side a.on { background: var(--accent-soft); color: var(--accent); }
  .side a .cnt { margin-left: auto; font-size: .75rem; color: var(--muted); }
  .side .sep { height: 1px; background: var(--line); margin: 10px 8px; }
  .app { margin-left: calc(var(--side-w) + max(0px, (100vw - var(--side-w) - 900px) / 2)); max-width: 900px; padding: 26px 32px 60px; }
}

/* ---------- карточки и блоки ---------- */
.card { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; margin: 0 0 12px; }
.card.flat { box-shadow: none; border: 1px solid var(--line); }
.sec { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 24px 2px 10px; scroll-margin-top: 64px; }
.sec h2 { font-size: 1.12rem; display: flex; align-items: center; gap: 10px; }
.sec h2 .si { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--surface2); color: var(--ink); flex: none; }
.sec > span { white-space: nowrap; }
.sec a, .sec button.link { font-size: .88rem; font-weight: 600; background: none; border: 0; color: var(--accent); padding: 0; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 8px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.hs { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 2px 2px 8px; margin: 0 -2px; scrollbar-width: none; }
.hs::-webkit-scrollbar { display: none; }
.hs > * { scroll-snap-align: start; flex: none; }
.empty { text-align: center; color: var(--muted); padding: 26px 10px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 16px;
  border-radius: 12px; border: 0; background: var(--accent); color: var(--accent-ink); font-weight: 650;
  transition: transform .18s var(--spring), opacity .2s, background .2s;
}
.btn:active { transform: scale(.97); }
.btn.sec2 { background: var(--surface2); color: var(--ink); }
.btn.ghost { background: transparent; color: var(--accent); padding: 8px 10px; min-height: 40px; }
.btn.good { background: var(--done); color: var(--done-on); } .btn.bad { background: var(--check); color: var(--check-on); }
.btn.sm { min-height: 38px; padding: 7px 12px; font-size: .9rem; border-radius: 10px; }
.btn.block { width: 100%; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: .78rem; font-weight: 650; background: var(--surface2); color: var(--muted); white-space: nowrap; }
.chip.s { background: var(--c-bg); color: var(--c-ink); }
.chip.kr { background: var(--bad-soft); color: var(--bad); }
.chip.ok { background: var(--good-soft); color: var(--done-ink); }
.chip.warn { background: var(--amber-soft); color: var(--amber); }
.chip.acc { background: var(--accent-soft); color: var(--accent); }
.sdot { display: inline-block; width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--c-ink); margin-right: 6px; }
.chip .sdot { margin-right: 0; }
.link-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-size: .86rem; font-weight: 600; border: 0; margin: 0 6px 6px 0; }

/* ---------- главный экран ---------- */
.hello { margin: 4px 2px 14px; }
.hello small { color: var(--muted); font-size: .9rem; }
.hello h1 { font-size: 1.7rem; margin-top: 2px; }
.now { border-radius: 24px; padding: 20px; color: var(--plate-ink); margin-bottom: 12px; background: var(--plate); }
.now > * { position: relative; }
.now small { opacity: .85; font-size: .78rem; font-weight: 700; letter-spacing: .06em; }
.hello h1 { font-weight: 800; letter-spacing: -.03em; }
.now .big { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-top: 6px; }
.now .big b { font-size: 1.5rem; line-height: 1.15; }
.now .room { text-align: right; flex: none; }
.now .room b { font-size: 2.2rem; line-height: 1; display: block; }
.now .room span { font-size: .75rem; opacity: .85; }
.now .sub { opacity: .9; font-size: .9rem; margin-top: 6px; }
.now .bar { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .25); margin-top: 12px; overflow: hidden; }
.now .bar i { display: block; height: 100%; background: #fff; border-radius: 99px; width: 100%; transform-origin: left; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 12px; }
.stats.n1 { grid-template-columns: 1fr; } .stats.n2 { grid-template-columns: 1fr 1fr; }
.stats.n1 .stat { display: flex; align-items: center; gap: 12px; }
.stats.n1 .stat i { margin: 0; }
.stats.n1 .stat b { font-size: 1.3rem; }
.stats.n1 .stat span { margin: 0; font-size: .88rem; }
.stat { --c: var(--accent); background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 12px; text-align: left; border: 0; color: var(--ink); position: relative; overflow: hidden; transition: transform .2s var(--spring); }
.stat:active { transform: scale(.97); }
.stat.c-bad { --c: var(--ink); } .stat.c-amb { --c: var(--amber); }
.stat i { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 14%, transparent); color: var(--c); margin-bottom: 8px; }
.stat b { display: block; font-size: 1.5rem; line-height: 1; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat span { display: block; font-size: .74rem; color: var(--muted); font-weight: 600; line-height: 1.25; margin-top: 4px; }

.lesson { display: grid; grid-template-columns: 54px 1fr; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.lesson:first-child { border-top: 0; padding-top: 2px; }
.lesson .tm { font-weight: 700; font-size: .95rem; font-variant-numeric: tabular-nums; }
.lesson .tm small { display: block; color: var(--muted); font-weight: 500; font-size: .75rem; }
.lesson .nm { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 650; }
.lesson .nm .rm { margin-left: auto; font-weight: 750; color: var(--ink); background: var(--surface2); padding: 1px 9px; border-radius: 8px; font-variant-numeric: tabular-nums; font-size: .92rem; }
.lesson.other .nm .rm { color: var(--muted); background: var(--surface2); }
.lesson .tp { color: var(--muted); font-size: .88rem; margin-top: 2px; }
.lesson .hw { margin-top: 8px; padding: 10px 12px; border-radius: 12px; background: var(--surface2); font-size: .93rem; display: flex; gap: 10px; align-items: flex-start; color: var(--ink2); }
.lesson .hw .txt { flex: 1; min-width: 0; }
.lesson .hw.done .txt { opacity: .6; }
.hwfoot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-top: 6px; }
.hwfoot .files { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: .8rem; }
.hwfoot .files .ico { width: 15px; height: 15px; }
.hwlink { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; color: var(--ink); font-weight: 700; font-size: .92rem; }
.hwlink .ico { width: 17px; height: 17px; }
.hwlink .ico:last-child { width: 15px; height: 15px; margin-left: -2px; }
/* главная кнопка «Разобрать домашку» */
.cta { display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 12px; margin: 0 0 12px; border-radius: 18px; background: var(--accent); color: var(--graphite-ink); box-shadow: var(--shadow); transition: transform .2s var(--spring); }
.cta:active { transform: scale(.98); }
.cta .cta-ic { width: 42px; height: 42px; border-radius: 13px; background: rgba(255, 255, 255, .18); display: grid; place-items: center; flex: none; }
.cta b { display: block; font-size: 1.05rem; }
.cta small { display: block; opacity: .88; font-size: .82rem; line-height: 1.3; }
.cta-dots { display: flex; gap: 4px; }
.lesson.now-l { background: var(--accent-soft); border-radius: 14px; padding: 10px; margin: 4px -10px; border-top-color: transparent; }
.lesson.past { opacity: .55; }
.lesson.other .nm { color: var(--muted); font-weight: 600; }
.check { width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--muted); background: transparent; flex: none; display: grid; place-items: center; transition: background .2s, border-color .2s; }
.check.on { background: var(--good); border-color: var(--done-ink); }
.check.on::after { content: ""; width: 12px; height: 7px; border: 2.5px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }

.test-card { width: 260px; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 14px; display: block; color: var(--ink); }
.test-card .when { display: flex; justify-content: space-between; align-items: center; }
.test-card h3 { margin: 8px 0 10px; font-size: .98rem; line-height: 1.3; min-height: 2.6em; }
.ring { --p: 0; width: 46px; height: 46px; border-radius: 50%; position: relative; background: none; display: grid; place-items: center; flex: none; }
.ring::before { content: attr(data-t); width: 36px; height: 36px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-size: .72rem; font-weight: 800; }
.meter { height: 8px; border-radius: 99px; background: var(--surface2); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--done); border-radius: 99px; transform-origin: left; transition: transform .6s var(--ease); }

.bring { display: flex; flex-wrap: wrap; gap: 8px; }
.bring span { padding: 8px 12px; border-radius: 12px; background: var(--surface2); font-size: .9rem; }

/* ---------- предметы ---------- */
.subj { display: flex; align-items: center; gap: 13px; padding: 14px; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); color: var(--ink); transition: transform .2s var(--spring), box-shadow .25s; }
.subj:active { transform: scale(.98); }
@media (hover: hover) { .subj:hover { transform: translateY(-2px); box-shadow: 0 1px 2px rgba(20, 21, 28, .05), 0 16px 30px -18px var(--surface2); } }
/* плитка предмета */
.mono { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; flex: none; color: var(--graphite-ink); font-weight: 800; font-size: 1rem; background: var(--surface2); box-shadow: inset 0 0 0 1px var(--surface2); }
.mono.lg { width: 56px; height: 56px; border-radius: 17px; font-size: 1.25rem; }
.mono svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.mono.lg svg { width: 30px; height: 30px; }
.subj b { display: block; }
.subj small { color: var(--muted); font-size: .8rem; }
.tabs { display: flex; gap: 6px; overflow-x: auto; margin: 0 0 12px; scrollbar-width: none; background: var(--surface); padding: 5px; border-radius: 14px; box-shadow: var(--shadow); }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: 1; border: 0; background: transparent; padding: 9px 12px; border-radius: 10px; font-weight: 650; font-size: .9rem; color: var(--muted); white-space: nowrap; }
.tabs button.on { background: var(--graphite); color: var(--graphite-ink); box-shadow: 0 4px 12px -6px var(--surface2); }
.tlist a { display: flex; align-items: center; gap: 12px; padding: 13px 4px; border-top: 1px solid var(--line); color: var(--ink); }
.tlist a:first-child { border-top: 0; }
.tlist a b { display: block; font-weight: 650; }
.tlist a small { display: block; color: var(--muted); font-size: .84rem; line-height: 1.4; }
.lvl { width: 38px; height: 6px; border-radius: 99px; background: var(--surface2); overflow: hidden; flex: none; }
.lvl i { display: block; height: 100%; border-radius: 99px; background: var(--good); }
.grp { font-size: .76rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 16px 4px 4px; }

/* ---------- тема ---------- */
.lead { font-size: 1.08rem; font-weight: 600; margin: 0 0 12px; }
.top.slim { margin-bottom: 8px; }

/* Шапки темы, предмета и домашки получают цвет через .tint. */
.hero {
  position: relative; overflow: hidden; isolation: isolate; border-radius: 24px; padding: 18px 18px 16px; margin: 0 0 14px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.hero::before, .hero::after { content: none; }
.hero .crumbs { display: flex; align-items: center; gap: 12px; }
.hero .crumbs a { color: var(--ink); font-weight: 700; font-size: .92rem; }
.hero .crumbs small { display: block; color: var(--muted); font-size: .82rem; line-height: 1.3; }
.hero h1 { font-size: 1.72rem; font-weight: 800; letter-spacing: -.025em; margin: 14px 0 12px; overflow-wrap: anywhere; text-wrap: balance; }
.hero .crumbs h1 { font-size: 1.5rem; }
.gist { display: block; background: color-mix(in srgb, var(--surface) 78%, transparent); border-radius: 16px; padding: 12px 14px; font-size: 1.02rem; line-height: 1.55; color: var(--ink); box-shadow: 0 1px 0 var(--line); }
.gist .lbl { display: flex; align-items: center; gap: 6px; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink); margin-bottom: 4px; }
.gist .lbl .ico { width: 15px; height: 15px; }
.gist.long { font-size: .95rem; line-height: 1.55; }
.gist .files { display: block; color: var(--muted); font-size: .82rem; margin-top: 6px; }
.gist.kr { margin-top: 12px; color: var(--ink); }
.gist.kr .lbl { color: var(--bad); }
.hero .meta { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.hero .meta b { display: block; font-size: .95rem; }
.hero .meta small { display: block; color: var(--muted); font-size: .8rem; line-height: 1.3; }
.hero .meta .btn { background: var(--graphite); }
.hero .ring::before { background: var(--surface); }
.ring0 { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 2px var(--surface2); }
/* отсчёт до контрольной — крупно и красным */
.count { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; padding: 6px 12px 6px 10px; border-radius: 12px; background: var(--bad-soft); color: var(--bad); font-weight: 800; font-size: 1.15rem; letter-spacing: -.01em; }
.count .ico { width: 19px; height: 19px; }
.count.past { background: var(--surface2); color: var(--muted); }
.hero .count + h1 { margin-top: 10px; }
.hero-btns { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 12px; }
.hero-btns .btn:only-child { grid-column: 1 / -1; }
.hero-btns .btn.sec2 { background: var(--surface); }
.dayarr { display: flex; gap: 6px; }
a.act { color: var(--ink) !important; }
/* вкладки можно листать — край затухает */
.tabs { -webkit-mask-image: none; mask-image: none; }
@media (min-width: 520px) { .tabs { -webkit-mask-image: none; mask-image: none; } }
mark.nw { white-space: nowrap; }
/* ---------- раздел «Домашка» ---------- */
.hello { display: flex; align-items: flex-start; gap: 10px; }
.hello .act, .top .act { width: 44px; height: 44px; border-radius: 13px; border: 1px solid var(--card-line); background: var(--surface); box-shadow: var(--shadow); display: grid; place-items: center; flex: none; color: var(--ink); }
.seg.wide { display: grid; grid-template-columns: 1fr 1fr; width: 100%; margin: 0 0 6px; }
.seg.wide button { min-height: 40px; }
.small.ok { color: var(--done-ink); font-weight: 650; }
.mono.sm { width: 38px; height: 38px; border-radius: 12px; }
.mono.sm svg { width: 21px; height: 21px; }
.hwi { position: relative; background: var(--surface); border: 1px solid var(--card-line); border-radius: 18px; box-shadow: var(--shadow); padding: 13px 14px 14px; margin: 0 0 10px; transition: opacity .25s; }
.hwi-top { display: flex; align-items: center; gap: 11px; }
.hwi-top b { display: block; font-size: 1.02rem; }
.hwi-top small { display: block; color: var(--muted); font-size: .8rem; }
.hwi .tdone { position: static; flex: none; }
.hwi-ask { margin-top: 10px; color: var(--ink2); line-height: 1.55; }
.hwi-files { display: flex; align-items: center; gap: 6px; margin-top: 6px; color: var(--muted); font-size: .8rem; }
.hwi-files .ico { width: 15px; height: 15px; }
.hwi-kr { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 9px 11px; border-radius: 12px; background: var(--bad-soft); color: var(--bad); font-weight: 700; font-size: .9rem; }
.hwi-kr span { flex: 1; min-width: 0; }
.hwi-kr .ico { width: 17px; height: 17px; flex: none; }
.hwi-go { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: var(--graphite); color: var(--graphite-ink); min-height: 52px; }
.hwi-go b { display: block; font-size: .98rem; }
.hwi-go small { display: block; opacity: .85; font-size: .78rem; }
.hwi-go:active { transform: scale(.985); }
.hwi-none { margin-top: 10px; font-size: .84rem; color: var(--muted); padding: 9px 11px; border-radius: 12px; background: var(--surface2); }
.hwi.done { opacity: 1; }
.hwi.done .hwi-go { background: var(--surface2); color: var(--ink); }
.hwday { margin-top: 20px; }
/* «Выучить к контрольной» — список того, что надо помнить наизусть */
.memgrp { background: var(--surface); border: 1px solid var(--card-line); border-radius: 18px; box-shadow: var(--shadow); padding: 6px 14px 8px; margin: 0 0 10px; }
.memt { display: flex; align-items: center; gap: 6px; padding: 8px 0 6px; font-weight: 750; color: var(--ink); font-size: .95rem; }
.memt .ico { width: 16px; height: 16px; color: var(--muted); }
.memi { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.memi small { display: block; font-size: .72rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.memi .f { font-size: .98rem; line-height: 1.5; color: var(--ink); }
.memk { flex: none; display: inline-flex; align-items: center; gap: 5px; min-height: 40px; padding: 6px 12px; border-radius: 99px; border: 1.5px solid var(--line); background: transparent; color: var(--muted); font-weight: 700; font-size: .82rem; }
.memk .ico { width: 15px; height: 15px; }
.memk.on { background: var(--done); border-color: var(--done); color: var(--done-on); }
.memi.on .f { color: var(--muted); }
/* плашки-переключатели: предметы в повторении и в поиске */
.pills { margin: 0 -16px 4px; padding: 2px 16px 8px; gap: 8px; scroll-padding-inline: 16px; }
.pill { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 7px 14px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); font-weight: 650; font-size: .88rem; white-space: nowrap; }
.pill.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.pill.on { background: var(--graphite); border-color: var(--graphite); color: var(--graphite-ink); }
.spills { display: flex; flex-wrap: wrap; gap: 8px; }
.spills .pill { padding-left: 6px; }
.spills button.pill { padding-left: 14px; }
.mono.xs { width: 28px; height: 28px; border-radius: 9px; }
.mono.xs svg { width: 17px; height: 17px; }

/* оглавление темы — липкая полоса с разделами */
.toc { position: sticky; top: 0; z-index: 20; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 2px; padding: 8px 16px; background: var(--bg);  }
.toc::-webkit-scrollbar { display: none; }
.toc button { flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 7px 14px; font-weight: 650; font-size: .86rem; color: var(--ink2); min-height: 36px; transition: background .2s, color .2s, border-color .2s; }
.toc button:active { background: var(--graphite); color: var(--graphite-ink); border-color: var(--graphite); }
@media (min-width: 960px) { .toc { margin: 0 -32px 2px; padding: 10px 32px; } }

/* карточки правил: номер, подпись, формула */
.rules { display: grid; gap: 10px; counter-reset: rl; }
@media (min-width: 700px) { .rules { grid-template-columns: 1fr 1fr; } }
.rule { counter-increment: rl; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); padding: 13px 15px 14px; position: relative; }
.rule small { display: flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 800; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; line-height: 1.3; }
.rule small::before { content: counter(rl); flex: none; width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; background: var(--surface2); color: var(--ink); font-size: .75rem; letter-spacing: 0; }
.rule .f { font-size: 1.06rem; margin-top: 7px; line-height: 1.5; color: var(--ink2); }
.rule .nt { color: var(--muted); font-size: .85rem; margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line); }
.prose { color: var(--ink2); line-height: 1.68; }
.prose p { margin: 0 0 12px; }
.prose p:last-child { margin-bottom: 0; }
.prose ul li, .prose ol li { margin: 4px 0; }
.prose table, .rule table { font-size: .9rem; }
.card > table, .prose table { display: block; overflow-x: auto; }
.steps { counter-reset: st; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: st; position: relative; padding: 5px 0 14px 42px; color: var(--ink2); }
.steps li:last-child { padding-bottom: 2px; }
.steps li::before { content: counter(st); position: absolute; left: 0; top: 3px; width: 28px; height: 28px; border-radius: 50%; background: transparent; color: var(--graphite-ink); display: grid; place-items: center; font-weight: 800; font-size: .82rem; box-shadow: 0 4px 10px -5px var(--surface2); }
.steps li:not(:last-child)::after { content: ""; position: absolute; left: 13px; top: 34px; bottom: 2px; width: 2px; border-radius: 2px; background: var(--surface2); }
.traps { padding-left: 0; list-style: none; margin: 0; }
.traps li { padding: 10px 12px 10px 42px; border-radius: 12px; background: var(--surface2); position: relative; margin: 8px 0 0; color: var(--ink2); }
.traps li:first-child { margin-top: 0; }
.traps li::before { content: "!"; position: absolute; left: 12px; top: 10px; width: 20px; height: 20px; border-radius: 50%; background: transparent; border: 1.5px solid var(--ink); color: var(--ink); font-weight: 800; font-size: .75rem; display: grid; place-items: center; }

/* листалка «предыдущая / следующая тема» */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }
.pager a { display: block; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); padding: 12px 14px; color: var(--ink); min-width: 0; }
.pager a.nx { text-align: right; grid-column: 2; }
.pager small { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: .78rem; font-weight: 650; }
.pager a.nx small { justify-content: flex-end; }
.pager b { display: block; font-size: .92rem; line-height: 1.3; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.fig { width: 100%; height: auto; display: block; margin: 10px auto; max-width: 560px; }
.fig text { font-family: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.fig .tone-accent rect { fill: var(--surface2); stroke: var(--ink); stroke-width: 1.4; }
.fig .tone-blue rect { fill: var(--solve-soft); stroke: var(--solve-ink); stroke-width: 1.4; }
.fig .tone-green rect { fill: var(--good-soft); stroke: var(--good); stroke-width: 1.4; }
.fig .tone-amber rect { fill: var(--amber-soft); stroke: var(--amber); stroke-width: 1.4; }
.fig .tone-red rect { fill: var(--bad-soft); stroke: var(--bad); stroke-width: 1.4; }
.fig .tone-gray rect { fill: var(--surface2); stroke: var(--muted); stroke-width: 1.2; }
.fig .t1 { font-size: 15px; font-weight: 650; fill: var(--ink); }
.fig .t2 { font-size: 13px; fill: var(--muted); }
.task-figure, .nb-figure { max-width: 358px; margin: 16px auto; }
/* Задание в оригинале (вырезка листа) и короткое решение — 2026-10-05 */
.task-photo { margin: 12px 0 4px; }
.task-photo .page-crop { display: block; margin-top: 6px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: #fff; }
.task-photo .page-crop + .page-crop { margin-top: 8px; }
.task-photo svg { display: block; width: 100%; height: auto; }
.task-brief { margin: 14px 0 0; padding: 10px 14px 12px; border-radius: 12px; background: var(--surface2); border-left: 4px solid var(--solve-ink); }
.task-brief p { margin: 6px 0 0; line-height: 1.5; color: var(--ink); }
/* Своя подготовка — 2026-10-09 */
.prep-sec h2 { margin: 0 0 8px; font-size: 1.05rem; }
.prep-short { border-left: 4px solid var(--solve-ink); }
.prep-rep { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.prep-rep small { color: var(--muted); }
.nb-modes { display: inline-flex; gap: 4px; padding: 4px; margin: 2px 0 10px; border-radius: 999px; background: var(--surface2); }
.nb-mode { min-height: 40px; padding: 6px 16px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font: inherit; font-size: .9rem; cursor: pointer; }
.nb-mode[aria-pressed="true"] { background: var(--surface); color: var(--ink); font-weight: 650; box-shadow: 0 1px 3px rgba(0, 0, 0, .14); }
.hw-fig { max-width: 358px; }
.hw-fig path, .hw-fig line, .hw-fig rect, .hw-fig circle, .hw-fig ellipse { vector-effect: non-scaling-stroke; }
.nb-figure { --solve-ink: var(--ink); --solve-soft: var(--surface2); break-inside: avoid; }
.nb-figure > span { display: block; color: var(--muted); margin-bottom: 8px; }
.nb-figure .hw-fig text { font-size: 14px; }
.hw-cave-art { width: 100%; height: 100%; background: var(--ink); mask: url('../icons/hw-cave.png') center / contain no-repeat; -webkit-mask: url('../icons/hw-cave.png') center / contain no-repeat; }
.figbox { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 8px 10px; margin: 0 0 12px; overflow-x: auto; }

/* ---------- тетрадный блок ---------- */
.nb {
  position: relative; background: var(--paper); color: var(--paper-ink); border-radius: 12px; padding: 14px 14px 14px 38px;
  font-family: "Literata", Georgia, "Times New Roman", serif; font-size: 1rem; line-height: 1.75; white-space: pre-wrap;
  overflow-wrap: anywhere; border: 1px solid color-mix(in srgb, var(--paper-line) 30%, transparent); margin: 10px 0 0;
}
.nb::before { content: ""; position: absolute; left: 24px; top: 0; bottom: 0; width: 1.5px; background: var(--paper-line); }
.nb .nbh { display: block; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; font-size: .74rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; white-space: normal; }
.nb-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 6px; }
.why { margin-top: 10px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); font-size: .95rem; }
.why .nbh { display: block; font-size: .74rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--solve-ink); margin-bottom: 4px; }

/* ---------- задачи и проверка ---------- */
.task { position: relative; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); padding: 15px 15px 14px; margin: 0 0 12px; transition: opacity .3s; }
.task .n { display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding: 0 6px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: .85rem; margin-right: 8px; }
.task .q { font-size: 1rem; padding-right: 46px; }
.task .q p { margin: 0 0 6px; }
/* круглая отметка «переписал» в углу задачи */
.tdone { position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); color: transparent; display: grid; place-items: center; transition: background .2s, border-color .2s, color .2s, transform .2s var(--spring); }
.tdone::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; }
.tdone:not(.on):hover { border-color: var(--ink2); color: var(--ink2); }
.tdone:active { transform: scale(.9); }
.tdone.on { background: var(--done); border-color: var(--done); color: var(--done-on); }
.tdone .ico { width: 20px; height: 20px; stroke-width: 2.6; }
.task.is-done .q { opacity: .72; }
.task .toggles { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 12px; }
.task .toggles .tog:only-child { grid-column: 1 / -1; }
.tog { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1.5px solid var(--line); background: transparent; border-radius: 13px; padding: 9px 14px; font-weight: 650; font-size: .92rem; min-height: 44px; color: var(--ink); }
.tog.main { background: var(--graphite); border-color: var(--graphite); color: var(--graphite-ink); }
.tog.main.on { background: var(--ink); border-color: var(--ink); }
.tog:not(.main).on { background: var(--surface2); border-color: var(--graphite); color: var(--ink); }
.tog.done { border-color: var(--done-ink); color: var(--done-ink); }
.task .links { margin-top: 10px; }
/* ссылки на темы под задачей — строкой, а не плашкой */
.tlinks { margin-top: 10px; display: grid; gap: 2px; }
.tlinks a { display: flex; align-items: center; gap: 8px; padding: 7px 2px; color: var(--ink); font-size: .9rem; font-weight: 600; min-height: 36px; }
.tlinks a span { flex: 1; min-width: 0; }
.tlinks a .ico { width: 17px; height: 17px; opacity: .8; }
.pr { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 14px; margin: 0 0 12px; }
.pr .head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.pr .st { margin-left: auto; }
.opts { display: grid; gap: 8px; margin: 10px 0 4px; }
.opt { text-align: left; border: 1.5px solid var(--line); background: var(--surface); border-radius: 12px; padding: 11px 14px; min-height: 46px; transition: border-color .2s, background .2s, transform .15s var(--spring); }
.opt:hover:not([disabled]) { border-color: var(--accent); }
.opt:active:not([disabled]) { transform: scale(.985); }
.opt.right { border-color: var(--done-ink); background: var(--good-soft); }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
.opt[disabled] { cursor: default; }
.inp { display: flex; gap: 8px; margin: 10px 0 4px; flex-wrap: wrap; }
.inp input, .inp textarea, .field { flex: 1; min-width: 150px; min-height: 46px; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); }
.inp textarea { min-height: 96px; width: 100%; resize: vertical; }
.inp input:focus, .inp textarea:focus, .field:focus { outline: none; border-color: var(--accent); }
.inp input.right { border-color: var(--done-ink); background: var(--good-soft); }
.inp input.wrong { border-color: var(--bad); background: var(--bad-soft); }
.fb { margin-top: 8px; padding: 10px 12px; border-radius: 12px; font-size: .93rem; animation: pop .3s var(--ease); }
.fb.good { background: var(--good-soft); color: var(--done-ink); }
.fb.bad { background: var(--bad-soft); color: var(--bad); }
.fb.info { background: var(--surface2); color: var(--ink); }
.hint { margin-top: 8px; padding: 10px 12px; border-radius: 12px; background: var(--amber-soft); font-size: .93rem; }
.practice-help { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 12px; min-width: 0; }
.hint-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.hint-count { font-variant-numeric: tabular-nums; }
.hint-list { list-style: none; padding: 0; margin: 0; }
.hint-list .hint { background: var(--solve-soft); color: var(--ink); line-height: 1.6; overflow-wrap: anywhere; }
.hint-list .hint > b { display: block; color: var(--solve-ink); margin-bottom: 4px; font-size: .8rem; }
.practice-help .btn { min-height: 44px; }
.practice-solution { margin-top: 12px; min-width: 0; }
.solution-notes { padding-left: 22px; line-height: 1.6; overflow-wrap: anywhere; }
.solution-notes li + li { margin-top: 8px; }
.pr .head { flex-wrap: wrap; }
.pr .figwrap, .practice-solution .figwrap { max-width: 100%; overflow-x: auto; }
.checklist { list-style: none; padding: 0; margin: 8px 0 0; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; }
.checklist li .check { width: 22px; height: 22px; border-radius: 7px; margin-top: 1px; }
.order-pool, .order-line { display: flex; flex-wrap: wrap; gap: 8px; min-height: 48px; padding: 6px 0; }
.order-line { border: 1.5px dashed var(--line); border-radius: 12px; padding: 8px; }
.order-line.right { border-color: var(--done-ink); background: var(--good-soft); }
.order-line.wrong { border-color: var(--bad); background: var(--bad-soft); }
.ochip { border: 1.5px solid var(--accent); background: var(--surface); color: var(--accent); border-radius: 99px; padding: 7px 13px; font-weight: 600; font-size: .9rem; }
.order-line .ochip { background: var(--accent); color: var(--graphite-ink); }

/* ---------- карточки повторения ---------- */
.fc-wrap { perspective: 1200px; margin: 12px 0 14px; }
#csbtns > .btn { min-height: 54px; font-size: 1.02rem; }
.fc .tap { position: absolute; left: 0; right: 0; bottom: 18px; display: flex; justify-content: center; align-items: center; gap: 6px; color: var(--muted); font-size: .85rem; font-weight: 600; }
.fc { position: relative; min-height: max(300px, 52vh); transform-style: preserve-3d; transition: transform .5s var(--ease); cursor: pointer; }
.fc.flip { transform: rotateY(180deg); }
.fc .side2, .fc .side1 { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 20px; padding: 22px; display: flex; flex-direction: column; justify-content: center; box-shadow: var(--shadow); }
.fc .side1 { background: var(--surface); box-shadow: var(--shadow); }
.fc .side2 { background: var(--surface); transform: rotateY(180deg); border: 1.5px solid var(--line); }
.fc .lbl { position: absolute; top: 20px; left: 22px; right: 22px; font-size: .74rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ink); line-height: 1.3; }
.fc .txt { font-size: 1.55rem; font-weight: 700; text-align: center; line-height: 1.3; letter-spacing: -.015em; text-wrap: balance; }
.fc .side2 .txt { font-size: 1.15rem; font-weight: 500; line-height: 1.5; color: var(--ink); }
.fc-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.fc-btns .btn { flex-direction: column; gap: 0; font-size: .95rem; min-height: 56px; }
.fc-btns .btn small { font-weight: 500; opacity: .85; font-size: .72rem; }

/* ---------- пробник, таймер ---------- */
.timer { font-size: 3.2rem; font-weight: 800; font-variant-numeric: tabular-nums; text-align: center; letter-spacing: -.02em; }
.grade { font-size: 4rem; font-weight: 900; text-align: center; line-height: 1; }

/* ---------- всплывающее окно ---------- */
.sheet-bg { position: fixed; inset: 0; background: rgba(8, 9, 14, .45); z-index: 60; opacity: 0; transition: opacity .25s; }
.sheet-bg.on { opacity: 1; }
.peek-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 61; max-height: 82vh; overflow-y: auto; background: var(--bg);
  border-radius: 22px 22px 0 0; padding: 10px 16px calc(20px + env(safe-area-inset-bottom)); transform: translateY(100%); transition: transform .32s var(--ease);
}
.peek-sheet.on { transform: none; }
.peek-sheet .grip { width: 42px; height: 5px; border-radius: 99px; background: var(--chip); margin: 2px auto 12px; }
@media (min-width: 960px) { .peek-sheet { left: 50%; right: auto; width: 620px; margin-left: -310px; bottom: 40px; border-radius: 22px; max-height: 80vh; } }

.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); opacity: 0; z-index: 70; background: var(--ink); color: var(--bg); padding: 11px 16px; border-radius: 14px; font-weight: 600; font-size: .92rem; box-shadow: var(--shadow); transition: opacity .25s, transform .3s var(--ease); display: flex; gap: 12px; align-items: center; width: max-content; max-width: calc(100vw - 32px); pointer-events: none; }
.toast.on { pointer-events: auto; }
.toast.on { opacity: 1; transform: translateX(-50%); }
.toast button { background: var(--accent); color: var(--graphite-ink); border: 0; border-radius: 10px; padding: 6px 10px; font-weight: 700; }
@media (min-width: 960px) { .toast { bottom: 26px; left: calc(50% + var(--side-w) / 2); } }

.search-box { position: relative; margin-bottom: 12px; }
.search-box input { width: 100%; min-height: 50px; padding: 12px 14px 12px 44px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--surface); font-size: 1.02rem; box-shadow: var(--shadow); }
.search-box input:focus { outline: none; border-color: var(--accent); }
.search-box .ico { position: absolute; left: 14px; top: 14px; color: var(--muted); }
.res a { display: block; padding: 12px 4px; border-top: 1px solid var(--line); color: var(--ink); }
.res a:first-child { border-top: 0; }
.res a b { display: block; }
.res a small { color: var(--muted); display: block; font-size: .84rem; }
.hl { background: var(--amber-soft); border-radius: 3px; }

.set-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.set-row:first-child { border-top: 0; }
.set-row { flex-wrap: wrap; }
.set-row > .grow { min-width: 150px; font-weight: 600; }
.seg { display: inline-flex; background: var(--surface2); border-radius: 12px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 7px 12px; border-radius: 9px; font-weight: 650; font-size: .88rem; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* Нейтральные элементы внутри страниц предмета. */
.chip.acc, .task .n { background: var(--surface2); color: var(--ink); }
.link-chip { background: var(--surface2); color: var(--ink); }
.btn:not(.sec2):not(.ghost):not(.good):not(.bad) { background: var(--graphite); }
.btn.ghost { color: var(--ink); }
.why .nbh { color: var(--solve-ink); }
.opt:hover:not([disabled]) { border-color: var(--ink); }
.task .q, .pr .q { color: var(--ink); line-height: 1.6; }
.why { color: var(--ink2); line-height: 1.62; }

/* появление экрана: блоки выезжают по очереди */
.view > * { animation: rise .42s var(--ease) both; }
.view > :nth-child(2) { animation-delay: .03s; } .view > :nth-child(3) { animation-delay: .06s; } .view > :nth-child(4) { animation-delay: .09s; }
.view > :nth-child(5) { animation-delay: .12s; } .view > :nth-child(6) { animation-delay: .15s; } .view > :nth-child(n+7) { animation-delay: .18s; }
.view > .toc, .still .view > * { animation: none; }
.home > .hmain, .home > .hside { animation: none; }
.hmain > *, .hside > * { animation: rise .42s var(--ease) both; }
.hmain > :nth-child(2) { animation-delay: .04s; } .hmain > :nth-child(3) { animation-delay: .08s; } .hmain > :nth-child(n+4) { animation-delay: .12s; }
.hside > * { animation-delay: .1s; }
.still .hmain > *, .still .hside > * { animation: none; }
/* ноутбук: главная в две колонки — слева день, справа контрольные и разборы */
@media (min-width: 1280px) {
  .app:has(.home) { max-width: 1160px; margin-left: calc(var(--side-w) + max(0px, (100vw - var(--side-w) - 1160px) / 2)); }
  .home { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
  .hside { position: sticky; top: 20px; padding-top: 58px; }
  .hside .hs { flex-direction: column; overflow: visible; }
  .hside .test-card { width: auto; }
  .hside .sec:first-child { margin-top: 0; }
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fadein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media print { .nav, .side, .top .act, .toggles, .btns { display: none !important; } body { background: #fff; } .card, .task, .pr { box-shadow: none; border: 1px solid #ddd; } }

/* Четыре раздела: срочные темы, общие отметки правил и проверка с вариантами. */
.hello { gap: 8px; }
.hello .act { border-radius: 50%; }
.week-link { display: flex; align-items: center; min-height: 44px; margin-top: 14px; }
.prow { display: flex; align-items: center; gap: 12px; padding: 16px 0; color: var(--ink); min-width: 0; }
.prow + .prow { border-top: 1px solid var(--line); }
.prow .grow > b, .prow small { display: block; }
.prow small { color: var(--muted); margin: 3px 0; }
.prow .meter { margin-top: 10px; }
.prow .ring { width: 42px; height: 42px; font-size: .7rem; flex: none; }
.prow > .ico { flex: none; }
.prow .why, .sheet .why, .sheet-first .why { display: flex; flex-wrap: wrap; gap: 5px; padding: 0; margin: 7px 0 0; border: 0; background: none; }
.why .w { padding: 3px 7px; border-radius: 7px; font-size: .72rem; line-height: 1.4; font-weight: 600; }
.w-kr { color: var(--bad); background: var(--bad-soft); }
.w-hw { color: var(--accent); background: var(--accent-soft); }
.w-new { color: var(--muted); background: var(--surface2); }
.w-done { color: var(--done-ink); background: var(--good-soft); }
.w-mem { color: var(--amber); background: var(--amber-soft); }
.path { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 16px 0; }
.path button { display: flex; align-items: flex-start; text-align: left; gap: 8px; padding: 12px; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; min-height: 44px; }
.path b { display: block; font-size: .84rem; line-height: 1.35; }
.path small { display: block; color: var(--muted); font-size: .72rem; margin-top: 4px; }
.path-num, .sh-num { display: grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 50%; background: var(--surface2); color: var(--ink); }
.path .done .path-num { background: var(--good-soft); color: var(--done-ink); }
.sheet-tools { display: flex; justify-content: space-between; align-items: center; margin: 16px 0 10px; }
.sheet-tools .act { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; }
.sheet-first { border: 1px solid var(--line); padding: 12px; background: var(--surface); border-radius: 12px; }
.sheet-first > b { display: block; margin-bottom: 6px; }
.sheet-first button { display: block; width: 100%; min-height: 44px; text-align: left; padding: 10px 0; border: 0; background: none; }
.sheet { padding: 20px; margin-bottom: 16px; border: 1px solid var(--card-line); border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); scroll-margin-top: 18px; }
.sheet > header { display: flex; gap: 10px; align-items: flex-start; }
.sheet h3 { line-height: 1.4; }
.sheet h3 a { color: var(--ink); }
.sh-gist { font-size: 1.12rem; line-height: 1.55; margin: 16px 0; }
.sheet-more { display: flex; align-items: center; min-height: 44px; margin-top: 10px; font-size: .88rem; }
.rule-mem { position: relative; padding-top: 56px; }
.rule .memk { position: absolute; top: 8px; right: 8px; min-height: 44px; }
.rule.on { background: var(--surface2); }
.rule.on .f { color: var(--muted); }
.memk { min-height: 44px; }
.error-banner { display: flex; gap: 10px; align-items: center; padding: 14px; margin-bottom: 14px; border-radius: 12px; background: var(--surface2); color: var(--ink); }
.level-pills { margin-top: 12px; gap: 6px; }
.level-pills .pill { min-height: 44px; flex: none; }
.level-hint { margin: 8px 0 18px; }
.lvl-lesson { color: var(--done-ink); background: var(--good-soft); }
.lvl-base { color: var(--blue); background: color-mix(in srgb, var(--blue) 12%, var(--surface)); }
.lvl-ege { color: var(--accent); background: var(--accent-soft); }
.lvl-ege2 { color: var(--amber); background: var(--amber-soft); }
.lvl-olymp { color: var(--bad); background: var(--bad-soft); }
.mc-question { font-size: 1.25rem; line-height: 1.55; margin: 20px 0; }
.mcq { display: grid; gap: 10px; }
.mcq button { display: flex; gap: 10px; align-items: center; min-height: 56px; width: 100%; padding: 12px; text-align: left; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); line-height: 1.5; }
.mcq button > span:nth-child(2) { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.mcq button:disabled { opacity: 1; cursor: default; }
.mc-num { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: var(--surface2); color: var(--muted); font-size: .8rem; }
.mcq .right { border-color: var(--done-ink); background: var(--good-soft); }
.mcq .wrong { border-color: var(--bad); background: var(--bad-soft); }
.mc-answer { padding: 16px 0; line-height: 1.6; }
.mc-answer > b { display: block; margin-bottom: 6px; }
.mc-card .row { flex-wrap: wrap; }

/* Запись и схемы: длинная формула прокручивается внутри своего блока. */
[hidden] { display: none !important; }
.katex-display { text-align: left; margin: .65em 0; overflow-x: auto; overflow-y: hidden; padding: 4px 0; }
.katex-display > .katex { text-align: left; }
.math-line { display: block; min-width: 0; max-width: 100%; overflow-x: auto; overflow-y: hidden; padding: 4px 0; }
.math-line .katex-display { margin: 0; padding: 0; overflow: visible; white-space: nowrap; }
.math-line .katex-display > .katex { display: block; width: max-content; max-width: none; white-space: nowrap; overflow-wrap: normal; }
.q > .katex, .ln > .katex, .plan-know > span > .katex, .sh-gist > .katex, .rule .f > .katex { display: inline-block; max-width: 100%; overflow-x: auto; overflow-y: hidden; padding: 3px 0; vertical-align: middle; }
.q, .ln, .rule .f, .sh-gist, .plan-know > span, .lx, .why { min-width: 0; overflow-wrap: anywhere; }
.nb-block, .task-walk, .walk-step, .task, .sheet { min-width: 0; max-width: 100%; }
.nb { padding: 14px; white-space: normal; }
.nb::before { display: none; }
.nb .ln { padding: 6px 0; }
.nb .nb-code-indent { white-space: pre-wrap; }
.nb-line + .nb-line { border-top: 1px solid color-mix(in srgb, var(--paper-ink) 7%, transparent); }
.nb .lx { margin: 4px -14px 8px; padding: 10px 14px; font: .86rem/1.6 "Onest", sans-serif; background: var(--surface2); color: var(--ink2); border: 1px solid var(--line); }
.nb-actions { align-items: center; justify-content: flex-start; flex-wrap: wrap; gap: 6px; }
.nb-actions .btn { min-height: 44px; }
.nb-count { margin-right: auto; }
.nb-diagram { overflow-x: auto; max-width: 100%; padding: 10px 0; }
.nb-diagram table { border-collapse: collapse; width: auto; font-variant-numeric: tabular-nums; }
.nb-diagram caption, .diagram-title { text-align: left; font: .72rem/1.5 "Onest", sans-serif; color: var(--muted); margin-bottom: 8px; }
.horner td, .horner th { text-align: center; padding: 7px 13px; min-width: 42px; border: 0; background: none; font-weight: 400; white-space: nowrap; }
.horner th { border-right: 1.5px solid currentColor; }
.horner tr + tr { border-top: 1.5px solid currentColor; }
.remainder { display: inline-flex; align-items: center; justify-content: center; border: 1.5px solid var(--ink); border-radius: 50%; min-width: 28px; height: 28px; }
.division-scroll { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
.division { display: flex; width: max-content; align-items: flex-start; padding-left: 12px; font: inherit; overflow-wrap: normal; }
.division table { flex: none; margin: 0; font: inherit; }
.division table td { position: relative; padding: 5px 6px; text-align: right; white-space: nowrap; min-width: 26px; border: 0; background: none; font-weight: 400; }
.division td.sub-term { border-bottom: 1px solid currentColor; }
.division .sub-start::before { content: '−'; position: absolute; left: -10px; }
.division-corner { flex: none; margin-left: 14px; border-left: 1.5px solid currentColor; white-space: nowrap; }
.division-corner > div { padding: 5px 8px; }
.division-corner > div:first-child { border-bottom: 1.5px solid currentColor; }
/* на телефоне длинное деление уголком ужимается, чтобы делитель и частное не уезжали за край */
@media (max-width: 480px) {
  .division { font-size: .8em; padding-left: 9px; }
  .division table td { padding: 3px 2px; min-width: 0; }
  .division .sub-start::before { left: -8px; }
  .division-corner { margin-left: 6px; }
  .division-corner > div { padding: 3px 5px; }
}
.axis { min-width: 270px; padding: 36px 14px 44px 3px; }
.axis-track { position: relative; height: 2px; background: var(--paper-ink); }
.axis-track::after { content: ''; position: absolute; right: -6px; top: -4px; border-left: 9px solid var(--paper-ink); border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
.axis-interval { position: absolute; bottom: 2px; height: 18px; }
.axis-interval b { position: absolute; left: 45%; bottom: 17px; line-height: 1; font-size: 1.25rem; }
.axis-interval.hatch::before { content: ''; position: absolute; inset: 0; background: var(--done-ink); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='18'%3E%3Cpath d='M-6 18L4 0M4 18L14 0' fill='none' stroke='black'/%3E%3C/svg%3E"); mask-size: 10px 18px; }
.axis-point { position: absolute; top: -4px; }
.axis-point > i { display: block; position: relative; left: -5px; width: 10px; height: 10px; border: 1.5px solid var(--paper-ink); border-radius: 50%; background: var(--paper); }
.axis-point.filled > i { background: var(--paper-ink); }
.axis-point > span { position: absolute; top: 17px; transform: translateX(-50%); white-space: nowrap; font-size: .9rem; }
.axis-x { position: absolute; right: -12px; top: 10px; font-style: italic; }
.dano { display: flex; gap: 16px; width: max-content; max-width: 100%; padding-right: 12px; border-right: 1.5px solid currentColor; }
.dano b { display: block; }
.dano-find { border-top: 1.5px solid currentColor; padding-top: 8px; margin-top: 8px; }
.dano-si { border-left: 1px solid currentColor; padding-left: 12px; }
.nb-table th, .nb-table td { border: 1px solid var(--muted); padding: 7px 9px; text-align: left; min-width: 64px; }
.nb-table th, .nb-table td { white-space: normal; overflow-wrap: normal; word-break: normal; }
.nb-table { font-size: .9em; }
.nb-table th, .nb-table td { padding: 6px; }
/* Школьная запись: орфограммы, морфемы, схемы и программный код. */
.nb u { text-decoration-thickness: 2px; text-underline-offset: .2em; }
.morpheme { position: relative; display: inline-block; margin-top: .5em; line-height: 1.4; }
.morpheme::before { content: ''; position: absolute; inset: -.35em 0 auto; height: .25em; border-top: 1.5px solid currentColor; }
.morph-root::before { border-radius: 50% 50% 0 0; height: .4em; }
.morph-prefix::before { border-right: 1.5px solid currentColor; }
.morph-suffix::before { border: 0; background: currentColor; height: .4em; clip-path: polygon(0 100%, 50% 0, 100% 100%, 90% 100%, 50% 24%, 10% 100%); }
.morph-ending { outline: 1.5px solid currentColor; outline-offset: 1px; margin: 0 2px; }
.morph-ending::before { display: none; }
.sentence-scheme { width: max-content; max-width: none; font-weight: 600; letter-spacing: .03em; }
.nb-code pre { margin: 0; padding: 10px 0; width: max-content; min-width: 100%; background: transparent; color: inherit; }
.nb-code code { display: block; font: .84rem/1.7 Consolas, "Courier New", monospace; white-space: pre; overflow-wrap: normal; }
.code-line { display: block; min-height: 1.7em; }
.code-number { display: inline-block; width: 2.5em; padding-right: .8em; text-align: right; color: var(--muted); user-select: none; }
.nb-code .code-line { white-space: pre; }
.nb-dano { border-bottom: 1.5px solid currentColor; }
[data-nb-kind="rus"] .nb-line + .nb-line, [data-nb-kind="lit"] .nb-line + .nb-line,
[data-nb-kind="eng"] .nb-line + .nb-line { border-top: 0; }
.task-plan { padding: 16px; margin: 12px 0; background: var(--surface2); border-radius: 12px; }
.task-plan h3 { margin-bottom: 16px; }
.task-plan > b { display: block; font-size: .8rem; color: var(--ink); }
.task-plan p { margin: 5px 0 16px; line-height: 1.65; }
.plan-know { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.plan-know > span { max-width: 100%; background: var(--surface); padding: 8px 10px; border-radius: 8px; font-size: .86rem; }
.walk-step { margin-top: 18px; scroll-margin-top: 16px; }
.step-counter { display: block; color: var(--ink); margin-bottom: 6px; }
.walk-step h3 { line-height: 1.4; }
.walk-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.walk-actions .btn:last-child, .walk-actions [data-act="walknext"] { flex: 1; }
.walk-actions .btn { white-space: normal; min-height: 48px; }
.walk-dots { display: flex; gap: 6px; margin-top: 18px; }
.walk-dots i { height: 5px; flex: 1; background: var(--line); border-radius: 4px; }
.walk-dots .on { background: var(--ink); }
.walk-done { margin-top: 12px; }
.hw-subjects { margin: 16px 0; gap: 8px; }
.hw-subjects .pill { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; flex: none; }
.hw-subjects .mono { width: 28px; height: 28px; }
.toggles { flex-wrap: wrap; }
.toggles .tog { min-height: 44px; }
@media (max-width: 600px) {
  .path { grid-template-columns: 1fr; }
  .path button { align-items: center; }
  .path small { margin-top: 2px; }
  .sheet { padding: 16px; }
  .nb { font-size: .94rem; }
  .task-plan { padding: 12px; }
}
@media print {
  .sheet-tools, .sheet-first, .memk, .sheet-more, .nb-actions { display: none !important; }
  .sheet { box-shadow: none; break-inside: avoid; border: 1px solid #ddd; }
}


/* «Пенал»: цвет означает действие. */
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.top .back, .top .act, .hello .act { width: 48px; height: 48px; }
.btn.sm, .btn.ghost, .pill, .tabs button, .toc button, .seg button, .hwlink, .tlinks a, .link-chip { min-height: 44px; }
.nav a.on { color: var(--ink); font-weight: 750; }
.nav a .dot, .side a .cnt:not(:empty) { background: var(--graphite); color: var(--graphite-ink); font-style: normal; border-radius: 99px; min-width: 18px; padding: 0 5px; }
.nav a[href="#/cards"] .dot, .side a[href="#/cards"] .cnt:not(:empty) { background: var(--memo); color: var(--memo-on); }
.side a.on .cnt:not(:empty) { outline: 2px solid var(--surface); }
.mono, .mono.sm, .mono.lg, .mono.xs { background: var(--c); color: #fff; box-shadow: none; border-radius: 10px; }
.mono { width: 38px; height: 38px; font-size: 15px; }
.mono.sm { width: 32px; height: 32px; }
.mono.lg { width: 48px; height: 48px; }
.lesson .nm .rm, .lesson.other .nm .rm { background: none; color: var(--ink2); padding: 0; font-weight: 700; }
.lesson .hw { background: var(--surface2); }
.lesson.past { opacity: 1; }
.now small, .now .sub, .now .room span { color: var(--plate-label); opacity: 1; }
.now .bar i { background: var(--plate-ink); }
.hero { background: var(--surface); border-color: var(--line); }
.gist { background: none; box-shadow: none; padding: 0; color: var(--ink2); }
.hero .gist { margin-top: 12px; }
.tl, .tlinks a, .sheet-more, .link-chip { color: var(--ink); text-decoration: underline 1px var(--line-strong); text-underline-offset: .2em; font-weight: 600; }
.link-chip { color: var(--ink); }
.sec.sem-mem .si { background: var(--memo); color: var(--memo-on); }
.sec.sem-und .si { background: var(--solve-soft); color: var(--solve-ink); }
.sec.sem-prep .si { background: var(--check-soft); color: var(--check-ink); }
.sec.sem-warn .si { background: var(--surface2); color: var(--ink); }
.sec.sem-done .si { background: var(--done-soft); color: var(--done-ink); }
.w-hw { background: var(--solve-soft); color: var(--solve-ink); }
.w-mem { background: var(--memo); color: var(--memo-on); }
.why .w { display: inline-flex; align-items: center; gap: 4px; }
.why .w .ico { width: 13px; height: 13px; }
.lvl-lesson, .lvl-base, .lvl-ege, .lvl-ege2 { background: var(--surface2); color: var(--muted); }
.lvl-base { color: var(--ink2); } .lvl-ege { color: var(--ink); } .lvl-ege2 { background: var(--line-strong); color: var(--ink); }
.lvl-olymp { background: var(--graphite); color: var(--graphite-ink); }
.check, .checklist li .check, .tdone { width: 44px; height: 44px; border-radius: 50%; border-color: var(--ring); }
.check.on, .tdone.on { border-color: var(--done); }
.memk { min-height: 44px; border-color: var(--ring); }
.memk.on { border-color: var(--done); }
.hwi.done { opacity: 1; } .hwi.done .hwi-ask { color: var(--muted); }
.hwi-go { background: var(--graphite); color: var(--graphite-ink); border: 0; }
.hwi.done .hwi-go { background: var(--surface); color: var(--ink); border: 1.5px solid var(--line-strong); }
.hwi-go small { opacity: .78; }
.hwi.done .hwi-go small { opacity: 1; color: var(--muted); }
.hwi.tap { cursor: pointer; }
.hwi.tap:active { transform: scale(.995); }
.donebtn { display: inline-flex; align-items: center; gap: 6px; flex: none; min-height: 40px; padding: 0 13px; border-radius: 999px; border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--muted); font-size: .86rem; font-weight: 650; transition: background .2s, border-color .2s, color .2s; }
.donebtn .ico { width: 17px; height: 17px; stroke-width: 2.6; }
.donebtn:hover { border-color: var(--ink2); color: var(--ink2); }
.donebtn.on { background: var(--done); border-color: var(--done); color: var(--done-on); }
.donebtn:active { transform: scale(.94); }
.hwi-kr { background: none; padding: 0; min-height: 44px; }
.hwi-kr.past { color: var(--muted); }
.hwi { border-radius: 20px; padding: 16px; }
.hwi-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 8px; font-size: .82rem; font-weight: 650; background: var(--surface2); color: var(--ink2); }
.tag.solve { background: var(--solve-soft); color: var(--solve-ink); }
.tag.memo { background: var(--memo); color: var(--memo-on); border-radius: .38em .26em .42em .3em; }
.tag.test { background: var(--check-soft); color: var(--check-ink); }
.tag.done { background: var(--done-soft); color: var(--done-ink); }
.tag .ico { width: 16px; height: 16px; }
.day-progress { display: flex; gap: 4px; margin: 10px 0 14px; }
.day-progress i { height: 6px; flex: 1; border-radius: 6px; background: var(--line); }
.day-progress i.on { background: var(--done); }
.day-checks { display: flex; align-items: flex-start; gap: 8px; font-size: .92rem; font-weight: 650; color: var(--check-ink); margin: 10px 0 14px; }
.day-checks a { color: inherit; }
.hwday { flex-wrap: wrap; align-items: baseline; }
.hwday h2 { font-size: 1.2rem; }
.count.urgent { display: flex; background: var(--check); color: var(--check-on); padding: 16px; border-radius: 16px; }
.ring { color: var(--ink); }
.ring::before { display: none; }
.ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 4; }
.ring .track { stroke: var(--line); }
.ring .value { stroke: var(--progress, var(--done)); }
.ring span { position: relative; font-size: .72rem; font-weight: 800; }
.steps li::before { border: 2px solid var(--solve-ink); color: var(--solve-ink); box-shadow: none; }
.steps li:not(:last-child)::after { background: var(--line); }
.step-counter { color: var(--solve-ink); font-weight: 700; }
.walk-dots .on { background: var(--solve-ink); }
.task-plan { background: var(--surface2); }
.task-plan > b { color: var(--solve-ink); }
.task-plan .need-memo { margin-top: 16px; }
.plan-know > span { background: none; padding: 4px 0; font-size: 1rem; }
.plan-know { display: block; } .plan-know > span { display: block; }
.answer-plate { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 16px; margin: 14px 0; padding: 16px 20px; background: var(--plate); color: var(--plate-ink); border-radius: 16px; }
.answer-plate small { color: var(--plate-label); font-size: .8rem; font-weight: 750; letter-spacing: .04em; }
.answer-plate strong { font-size: 1.5rem; line-height: 1.35; min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.answer-plate mark, .answer-plate b { color: inherit; background: none; text-decoration: none; }
.answer-plate .math-line { margin: 0; }
.nb { border-color: var(--line); padding-left: 28px; font-size: 1.0625rem; line-height: 1.6; }
.nb::before { display: block; left: 12px; width: 3px; }
.nb .lx { margin-left: 0; }
.remainder { border-color: var(--done-ink); color: var(--done-ink); }
.fig .tone-accent rect, .fig .tone-blue rect { fill: var(--solve-soft); stroke: var(--solve-ink); }
.fig .tone-red rect, .fig .tone-amber rect { fill: var(--surface2); stroke: var(--muted); }
.memo-block { padding: 0 16px 16px; border-top: 6px solid var(--memo-bar); border-radius: 20px; margin: 20px 0 14px; background: var(--surface); box-shadow: var(--shadow); }
.memo-block > .sec { margin-top: 16px; flex-wrap: wrap; }
.memo-block .rules { grid-template-columns: 1fr; gap: 0; }
.memo-block .rule { box-shadow: none; border: 0; border-radius: 0; padding: 20px 58px 14px 0; background: none; }
.memo-block .rule + .rule { border-top: 1px solid var(--line); }
.memo-block .rule small { padding-right: 0; color: var(--muted); }
.memo-block .rule small::before { content: none; }
.memo-block .rule .memk { top: 12px; right: 0; }
.memo-block .memk { width: 44px; height: 44px; padding: 0; justify-content: center; border-radius: 50%; font-size: 0; }
.memo-block .memk span { display: none; }
.memo-block .memk .ico { width: 18px; height: 18px; }
.memo-block .memk:not(.on) .ico { visibility: hidden; }
.memo-block .rule .f { font-size: 1.2rem; padding-top: 8px; }
.memo-f b, .memo-f strong, .memo-f a { color: inherit; }
.test-deadline { display: flex; align-items: center; gap: 5px; color: var(--check-ink) !important; }
.tag.test { white-space: normal; }
.memo-block .rule .nt { border: 0; }
.memo-block .btn { margin-top: 10px; min-height: 52px; }
.toc button[data-to="s-main"]::before, .toc button[data-to="k-mem"]::before { content: ''; display: inline-block; width: 10px; height: 10px; background: var(--memo); border-radius: 2px; margin-right: 6px; }
.memgrp .f { line-height: 1.7; }
.alarm { padding: 20px; border-radius: 24px; background: var(--check); color: var(--check-on); margin-bottom: 14px; }
.alarm-head { display: flex; gap: 6px; align-items: center; font-size: .85rem; font-weight: 800; letter-spacing: .04em; }
.alarm-row { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 10px; padding: 16px 0; color: var(--check-on); }
.alarm-row + .alarm-row { border-top: 1px solid var(--check-track); }
.alarm-time { font-size: 1.55rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.2; }
.alarm-row b { display: block; font-size: 1.25rem; line-height: 1.2; }
.alarm-row small { display: block; color: var(--check-on2); font-size: .92rem; margin-top: 6px; line-height: 1.4; letter-spacing: 0; font-weight: 500; opacity: 1; }
.alarm-progress { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; font-size: .82rem; font-weight: 650; }
.alarm-progress .meter { flex: 1; min-width: 70px; height: 6px; background: var(--check-track); }
.alarm-progress .meter i { background: var(--check-on); }
.alarm .btn { background: var(--check-on); color: var(--check); width: 100%; min-height: 52px; }
.memo-preview { padding: 16px; }
.memo-preview ul { list-style: none; padding: 0; }
.memo-preview li { margin-top: 16px; line-height: 1.65; }
.memo-preview small { display: block; color: var(--muted); font-size: .82rem; }
.home-hw-row { display: flex; gap: 12px; align-items: center; min-height: 64px; padding: 14px 0; }
.home-hw-row + .home-hw-row { border-top: 1px solid var(--line); }
.home-hw-row > a { display: flex; gap: 12px; align-items: center; flex: 1; min-width: 0; color: var(--ink); }
.home-hw-row b { font-size: 1rem; font-weight: 600; }
.home-hw-row.done b { color: var(--muted); text-decoration: line-through; }
.home-hw-row .tdone { position: static; flex: none; }
.future-check { display: grid; grid-template-columns: 38px minmax(0,1fr); gap: 12px; padding: 14px 0; color: var(--ink); min-height: 72px; }
.future-check + .future-check { border-top: 1px solid var(--line); }
.future-date { text-align: center; font-size: 1.5rem; line-height: 1.15; font-weight: 800; }
.future-check small { display: block; font-size: .82rem; color: var(--muted); font-weight: 500; margin-top: 4px; }
.future-check .deadline { color: var(--check-ink); display: flex; gap: 5px; align-items: center; font-size: .86rem; font-weight: 650; margin-top: 6px; }
.legend-hint { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: .8rem; color: var(--muted); }
.legend-hint a { flex: 1; color: var(--ink2); text-decoration: underline; text-underline-offset: 3px; }
.legend-hint button { width: 44px; height: 44px; flex: none; background: none; border: 0; display: grid; place-items: center; }
.color-legend h2 { margin-bottom: 16px; }
.color-legend ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 16px; }
.color-legend li { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: start; }
.legend-swatch { width: 44px; height: 28px; border-radius: 7px; display: grid; place-items: center; font-weight: 700; }
.legend-swatch.test { background: var(--check); color: var(--check-on); }
.legend-swatch.memo { background: var(--memo); color: var(--memo-on); border-radius: .38em .26em .42em .3em; }
.legend-swatch.solve { color: var(--solve-ink); text-decoration: underline 2px; }
.legend-swatch.done { background: var(--done); color: var(--done-on); width: 28px; border-radius: 50%; margin-left: 8px; }
.legend-swatch.info { background: var(--surface2); color: var(--ink); }
@media (min-width: 960px) { .nb { max-width: 560px; } }
@media (max-width: 420px) { .task .toggles { grid-template-columns: 1fr; } .sec > span { white-space: normal; } }

/* Разделы с общей шапкой и самостоятельными каталогами. */
.top { align-items: flex-start; margin-bottom: 18px; }
.top .ttl { padding-top: 4px; }
.top .ttl small { margin-top: 5px; line-height: 1.45; }
.top-actions { display: flex; gap: 6px; flex: none; }
.top .back, .top .act { width: 44px; height: 44px; }
.page-heading { font-size: 1.15rem; line-height: 1.45; margin: 20px 0 14px; overflow-wrap: anywhere; }
.hero h2 { font-size: 1.5rem; line-height: 1.3; overflow-wrap: anywhere; }
.section-tabs { display: flex; gap: 4px; padding: 4px; margin-bottom: 18px; background: var(--surface2); border-radius: 12px; }
.section-tabs a { flex: 1; min-width: 0; display: grid; place-items: center; min-height: 44px; padding: 8px; color: var(--muted); text-align: center; font-size: .86rem; font-weight: 650; border-radius: 9px; overflow-wrap: anywhere; }
.section-tabs a[aria-current] { color: var(--ink); background: var(--surface); box-shadow: var(--shadow); }
.section-tabs a:active { transform: scale(.98); }
.subject-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.subjects .grp { font-size: .82rem; font-weight: 650; color: var(--muted); margin: 24px 2px 10px; }
.subject-grid .subj { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; box-shadow: none; overflow-wrap: anywhere; }
.subject-grid .subj > b { line-height: 1.4; font-size: .98rem; }
.subject-grid .subj > small { line-height: 1.6; }
.subject-grid .mono { width: 44px; height: 44px; }
.subject-grid .mono svg { width: 30px; height: 30px; }
.subject-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; max-width: 100%; }
.subject-tags:empty { display: none; }
.subject-tags .tag { white-space: normal; font-size: .72rem; line-height: 1.45; }
.subject-tags .tag .ico { flex: none; }
.topic-list .prow:first-child { padding-top: 2px; }
.topic-list .prow:last-child { padding-bottom: 2px; }
.topic-list b, .study-now b { overflow-wrap: anywhere; }
.glossary > div + div { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.glossary dt { font-weight: 700; margin-bottom: 6px; }
.glossary dd { margin: 0; overflow-wrap: anywhere; }
.glossary dd > a { display: block; margin-top: 8px; font-size: .85rem; }
.path { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.home > .top, .home > .section-tabs { grid-column: 1 / -1; }
.home .hmain, .home .hside { min-width: 0; }
.nearest-test { display: block; color: var(--ink); background: var(--surface); border: 1px solid var(--line); }
.nearest-test > small { display: flex; align-items: center; gap: 6px; color: var(--check-ink); }
.nearest-test > b { display: block; font-size: 1.16rem; line-height: 1.45; margin: 10px 0; }
.nearest-test > span { display: block; color: var(--muted); font-size: .86rem; }
.bring-line { color: var(--muted); font-size: .85rem; line-height: 1.7; }
.bring-line b { color: var(--ink); }
a.home-hw-row { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 10px 0; color: var(--ink); }
.card-filter { display: flex; align-items: center; gap: 12px; margin: 16px 0; color: var(--muted); font-size: .88rem; }
.card-filter select { min-width: 0; flex: 1; min-height: 44px; max-width: 100%; padding: 10px 12px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; font: inherit; }
.test-date { display: block; color: var(--muted); margin-top: 8px; }
.view, .card, .hero { min-width: 0; }
.rules { grid-template-columns: minmax(0, 1fr); }
.rule { min-width: 0; }
.rule pre { max-width: 100%; overflow-x: auto; }
@media (min-width: 700px) { .rules { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 600px) { .subject-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 960px) { .subject-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1280px) {
  .home { column-gap: 28px; row-gap: 0; }
  .home .hside { padding-top: 0; }
}

/* Палитра предметов: UI.hs сохраняет hue и насыщенность, выравнивая яркость. */
[data-subject], .tint {
  --c: var(--subject-color);
  --c-bg: var(--subject-light);
  --c-ink: var(--subject-ink-light);
  --c-line: color-mix(in srgb, var(--c) 32%, var(--c-bg));
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) :is([data-subject], .tint) {
    --c-bg: var(--subject-dark);
    --c-ink: var(--subject-ink-dark);
  }
}
:root[data-theme="dark"] :is([data-subject], .tint) {
  --c-bg: var(--subject-dark);
  --c-ink: var(--subject-ink-dark);
}
.tint { --muted: var(--c-ink); background: var(--c-bg); border-color: var(--c-line); }
.subject-grid .subj.tint { border-color: var(--c-line); }
.subj.tint > b, .hero.tint h2, .hero.tint .crumbs a { color: var(--c-ink); }
.subject-grid .meter { width: 100%; height: 5px; }
[data-subject] .meter { background: var(--c-bg); box-shadow: inset 0 0 0 1px var(--c-line); }
.tint .meter { background: color-mix(in srgb, var(--c) 18%, var(--c-bg)); }
.mc-card[data-subject], .fc-wrap[data-subject] .side1, .fc-wrap[data-subject] .side2 {
  border: 1px solid var(--c-line); border-top: 5px solid var(--c);
}
.mc-card[data-subject] > .row { background: var(--c-bg); padding: 10px; border-radius: 8px; }
.mc-card[data-subject] > .row > .muted { color: var(--c-ink); }
.fc-wrap[data-subject] .lbl { color: var(--c-ink); }
.res .chip.s { margin-bottom: 7px; }

/* Непрозрачные метки читаются на подложке любого предмета. */
.tag.test, .chip.kr, .w-kr, .count:not(.past), .hwi-kr:not(.past), .tag.error {
  background: var(--signal-bg); color: var(--signal-red); border-radius: 6px;
}
.tag.memo, .w-mem {
  background: var(--signal-bg); color: var(--signal-yellow); border-radius: .38em .26em .42em .3em;
}
.tag.done, .chip.ok, .w-done { background: var(--signal-bg); color: var(--signal-green); border-radius: 99px; }
.tag.error { border-inline-start: 3px solid currentColor; }
.hwi-kr:not(.past) { padding: 9px 11px; }

/* Цвет раздела живёт в шапке и меню; карточки используют палитру предметов. */
body[data-section="today"] .top, :is(.nav, .side) a[href="#/"] { --section: var(--section-today); }
body[data-section="homework"] .top, :is(.nav, .side) a[href="#/homework"] { --section: var(--section-homework); }
body[data-section="subjects"] .top, :is(.nav, .side) a[href="#/subjects"] { --section: var(--section-subjects); }
body[data-section="cards"] .top, :is(.nav, .side) a[href="#/cards"] { --section: var(--section-cards); }
body[data-section="tests"] .top, :is(.nav, .side) a[href="#/tests"] { --section: var(--check-ink); }
body[data-section="terms"] .top, :is(.nav, .side) a[href="#/terms"] { --section: var(--solve-ink); }
body[data-section="errors"] .top, :is(.nav, .side) a[href="#/errors"] { --section: var(--section-cards); }
.section-icon { display: inline-grid; place-items: center; width: 30px; height: 30px; margin-right: 7px; vertical-align: middle; border-radius: 9px; color: var(--section); background: color-mix(in srgb, var(--section) 13%, var(--surface)); }

/* Словарь: синий означает «понять». Рисунки без анимации и градиентов. */
.term-link { display: inline; padding: 1px 0; margin: 0; border: 0; border-bottom: 1px dashed currentColor; border-radius: 0; background: none; color: inherit; font: inherit; line-height: inherit; text-align: inherit; cursor: pointer; white-space: normal; }
.term-link:focus-visible, .term-panel summary:focus-visible { outline: 2px solid var(--solve-ink); outline-offset: 3px; }
.term-link:active { color: var(--solve-ink); }
.term-panel { margin: 12px 0 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); }
.term-panel summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; min-height: 44px; font-size: 13px; cursor: pointer; list-style: none; }
.term-panel summary::-webkit-details-marker { display: none; }
.term-fold { color: var(--muted); font-size: 12px; }
.term-panel-body { padding: 0 4px 12px; }
.term-fig { display: block; width: 100%; max-width: 358px; height: auto; margin: 0 auto; overflow: visible; font-family: inherit; }
.term-description, .term-panel-body > .term-link { margin: 4px 10px 0; font-size: 14px; line-height: 1.5; }
.term-description b { font-weight: 600; }
.term-search { display: grid; gap: 7px; font-size: 14px; margin: 18px 0; }
.term-search input { width: 100%; min-height: 46px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); padding: 10px 12px; font: inherit; }
.term-card { padding: 16px 10px; margin: 12px 0; }
.term-card h3 { margin: 0 6px 12px; font-size: 18px; line-height: 1.3; }
.term-card p { margin: 6px; line-height: 1.5; }
.term-related { display: flex; gap: 8px 16px; flex-wrap: wrap; margin: 12px 6px 0; font-size: 13px; }
.term-dialog { padding: 8px 0 18px; }
.term-dialog > .btn { display: block; margin-left: auto; }
.term-dialog h2 { margin: 14px 0; font-size: 22px; }
.term-dialog p { line-height: 1.5; }
.term-card[hidden], .term-empty[hidden] { display: none; }
.nav a.on, .side a.on { color: var(--section, var(--accent)); }
.nav a.on .ico, .side a.on { background: color-mix(in srgb, var(--section, var(--accent)) 13%, var(--surface)); }

/* Самостоятельные разделы и домашка выбранного дня. */
.section-link { display: flex; align-items: center; gap: 14px; min-height: 88px; padding: 18px; margin-bottom: 20px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.section-link > .ico:first-child { color: var(--solve-ink); }
.section-link b, .section-link small { display: block; }
.section-link small { margin-top: 5px; color: var(--muted); font-size: .82rem; line-height: 1.5; }
.section-link:active { transform: scale(.99); }
.homework-days { display: flex; gap: 8px; overflow-x: auto; padding: 3px 2px 10px; scrollbar-width: thin; position: relative; }
.homework-day { flex: 0 0 100px; display: grid; justify-items: center; gap: 7px; padding: 12px 7px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: var(--surface); font-variant-numeric: tabular-nums; }
.homework-day > small { font-size: .72rem; color: var(--muted); white-space: nowrap; }
.homework-day > b { font-size: 1.18rem; }
.homework-day.is-today { border-color: var(--section-homework); }
.homework-day.is-today > small { color: var(--section-homework); font-weight: 750; }
.homework-day[aria-current] { background: var(--graphite); border-color: var(--graphite); color: var(--graphite-ink); }
.homework-day[aria-current] > small { color: inherit; }
.homework-day-count { display: flex; align-items: center; gap: 6px; font-size: .76rem; }
.homework-day-count i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .45; }
.homework-day-count.complete i { background: var(--done); opacity: 1; }
.homework-day:active { transform: scale(.97); }
.homework-day-key { margin: 4px 2px 22px; }
.homework-heading { margin: 0 2px 12px; }
.homework-heading h2 { font-size: 1.4rem; line-height: 1.35; text-wrap: balance; }
.homework-heading p { margin: 8px 0 0; font-size: .9rem; }
.homework-list .hwi { border-inline-start: 4px solid var(--c); }
.hwi-test-link { display: block; margin-top: 10px; padding: 10px 0 0; border-top: 1px solid var(--c-line); color: var(--c-ink); font-size: .82rem; line-height: 1.5; }
.test-entry > .row { align-items: flex-start; }
.test-entry .btns { gap: 8px; }
.test-topics { line-height: 1.6; overflow-wrap: anywhere; }
.test-result { padding-top: 12px; border-top: 1px solid var(--line); }
.term-filters { display: grid; gap: 0 20px; }
.term-filters .card-filter { margin: 0; flex-direction: column; align-items: stretch; gap: 7px; }
.term-filters .term-search { margin: 14px 0 0; }
.term-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.term-list .term-card { min-width: 0; margin: 0; }
@media (min-width: 700px) {
  .term-filters { grid-template-columns: 1fr 1fr; align-items: end; }
  .term-filters .term-search { margin: 0; }
  .term-list { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}

/* ===== Карточка задания: условие + рисунок, три одинаковые кнопки, одна открытая панель ===== */
.task .task-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.task .tact { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; min-height: 60px; padding: 8px 4px; border: 1.5px solid var(--line-strong); border-radius: 14px; background: var(--surface2); color: var(--ink); font-size: .86rem; font-weight: 650; line-height: 1.15; text-align: center; }
.task .tact .ico { width: 21px; height: 21px; stroke-width: 2; }
.task .tact:hover { border-color: var(--ink2); }
.task .tact.on { background: var(--graphite); border-color: var(--graphite); color: var(--graphite-ink); }
.task .tact:active { transform: scale(.97); }
.task > .pane { margin-top: 12px; }

/* «Коротко о задании» — один нейтральный блок */
.task-plan { padding: 14px 16px; margin: 0 0 14px; background: var(--surface2); border-radius: 14px; }
.task-plan .brief-row + .brief-row { margin-top: 12px; }
.task-plan p { margin: 3px 0 0; line-height: 1.6; color: var(--ink); }
.brief-k { display: block; font-size: .72rem; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }

/* шаги */
.walk-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 0 2px; }
.linkbtn { background: none; border: 0; padding: 6px 0; color: var(--muted); font-size: .84rem; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.walk-step { margin-top: 10px; }
.walk-step .step-counter { color: var(--muted); font-weight: 700; }

/* «Что нужно знать» — справка одним блоком внизу, без цветных плашек */
.task-cheat { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.cheat-list { margin: 8px 0 0; padding-left: 18px; }
.cheat-list li { margin: 0 0 6px; line-height: 1.55; color: var(--ink2); }
.task-cheat .tlinks { margin-top: 8px; }
.task-explain .nb-actions { display: none; }
