/* ИКТ за день — «конспект с маркером» */
:root {
  --paper: #f5f1e8;
  --surface: #fffdf7;
  --surface-2: #f9f5ec;
  --ink: #1b1a17;
  --ink-2: #3a372f;
  --muted: #6e685b;
  --line: #e3dccb;
  --line-strong: #cfc6b1;
  --accent: #2448b8;
  --accent-2: #1a3690;
  --accent-soft: #e4eafb;
  --on-accent: #ffffff;
  --marker: #ffe066;
  --marker-soft: rgba(255, 214, 10, 0.42);
  --good: #2b8a3e;
  --good-soft: #e3f4e6;
  --bad: #c92a2a;
  --bad-soft: #fde8e8;
  --warn: #c76a00;
  --warn-soft: #fff1db;
  --shadow-1: 0 1px 0 rgba(27, 26, 23, 0.04), 0 1px 3px rgba(27, 26, 23, 0.06);
  --shadow-2: 0 2px 0 rgba(27, 26, 23, 0.04), 0 12px 32px -12px rgba(27, 26, 23, 0.22);
  --radius-s: 8px;
  --radius-m: 14px;
  --radius-l: 22px;
  --font-display: "Unbounded", "Golos Text", system-ui, sans-serif;
  --font-body: "Golos Text", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", Consolas, "JetBrains Mono", monospace;
  --text-s: 0.875rem;
  --text-base: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  --text-l: 1.25rem;
  --text-xl: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
  --text-hero: clamp(2rem, 1.2rem + 3.6vw, 3.6rem);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --dur: 220ms;
  --side-w: 272px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --paper: #121419;
  --surface: #1a1d24;
  --surface-2: #20242c;
  --ink: #ede9df;
  --ink-2: #d6d1c4;
  --muted: #9b9588;
  --line: #2b3039;
  --line-strong: #3a404b;
  --accent: #86a6ff;
  --accent-2: #a9c0ff;
  --accent-soft: #1f2a48;
  --on-accent: #0d1426;
  --marker: #ffd43b;
  --marker-soft: rgba(255, 212, 59, 0.24);
  --good: #69db7c;
  --good-soft: rgba(105, 219, 124, 0.12);
  --bad: #ff8787;
  --bad-soft: rgba(255, 135, 135, 0.12);
  --warn: #ffc078;
  --warn-soft: rgba(255, 192, 120, 0.12);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-2: 0 18px 40px -16px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
body::before { /* лёгкая бумажная фактура */
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(120, 100, 60, 0.05) 1px, transparent 1px);
  background-size: 3px 3px;
  z-index: 0;
}
:root[data-theme="dark"] body::before { background-image: radial-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px); }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; margin: 0; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--muted); }
.mark { background: linear-gradient(transparent 52%, var(--marker-soft) 52%); padding: 0 2px; }

/* ---------- layout ---------- */
.app { position: relative; z-index: 1; display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 70%, var(--paper));
  padding: 22px 14px 28px;
  display: flex; flex-direction: column; gap: 18px;
  scrollbar-width: thin;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); padding: 0 8px; }
.brand-logo {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  background: var(--ink); color: var(--paper); font-family: var(--font-display); font-weight: 700; font-size: 0.8rem;
  box-shadow: 3px 3px 0 var(--marker);
}
.brand-title { font-family: var(--font-display); font-weight: 600; font-size: 1rem; line-height: 1.1; }
.brand-sub { font-size: 0.75rem; color: var(--muted); }
.search-btn {
  display: flex; align-items: center; gap: 10px; width: 100%;
  border: 1px solid var(--line); background: var(--surface); border-radius: 10px;
  padding: 9px 12px; color: var(--muted); cursor: pointer; text-align: left;
  transition: border-color var(--dur) var(--ease);
}
.search-btn:hover { border-color: var(--line-strong); }
.search-btn kbd { margin-left: auto; }
kbd {
  font-family: var(--font-mono); font-size: 0.72rem; padding: 1px 6px; border-radius: 5px;
  border: 1px solid var(--line-strong); border-bottom-width: 2px; background: var(--surface-2); color: var(--ink-2);
}
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); padding: 0 10px 4px; font-weight: 600; }
.nav-link {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 9px;
  color: var(--ink-2); text-decoration: none; font-size: 0.93rem; position: relative;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.nav-link:hover { background: var(--surface-2); color: var(--ink); }
.nav-link.active { background: var(--ink); color: var(--paper); }
.nav-link.active .nav-num { background: var(--marker); color: #1b1a17; }
.nav-ico { width: 18px; text-align: center; flex: none; opacity: 0.9; }
.nav-num {
  flex: none; width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center;
  font-size: 0.72rem; font-weight: 700; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line);
}
.nav-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-pct { font-size: 0.7rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.nav-link.active .nav-pct { color: color-mix(in srgb, var(--paper) 70%, transparent); }
.nav-link.done .nav-num { background: var(--good); color: #fff; border-color: transparent; }
.side-foot { margin-top: auto; display: flex; gap: 8px; padding: 0 6px; }

.main { min-width: 0; }
.topbar { display: none; }
.page { max-width: 1120px; margin: 0 auto; padding: 36px 40px 96px; animation: page-in 380ms var(--ease); }
.page.narrow { max-width: 860px; }
@keyframes page-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- buttons, chips ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  padding: 10px 16px; border-radius: 11px; cursor: pointer; text-decoration: none; font-weight: 500;
  font-size: 0.95rem; line-height: 1.2;
  transition: transform 120ms var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease), border-color var(--dur);
  box-shadow: 0 2px 0 var(--line-strong);
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 3px 0 var(--line-strong); }
.btn:active { transform: translateY(1px); box-shadow: 0 1px 0 var(--line-strong); }
.btn-primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent-2); box-shadow: 0 2px 0 var(--accent-2); }
.btn-primary:hover { box-shadow: 0 3px 0 var(--accent-2); }
.btn-ink { background: var(--ink); color: var(--paper); border-color: var(--ink); box-shadow: 3px 3px 0 var(--marker); }
.btn-ink:hover { box-shadow: 4px 4px 0 var(--marker); }
.btn-ghost { background: transparent; box-shadow: none; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); box-shadow: none; }
.btn-s { padding: 6px 11px; font-size: 0.85rem; border-radius: 9px; }
.btn-l { padding: 14px 22px; font-size: 1.02rem; border-radius: 13px; }
.btn[disabled] { opacity: 0.45; pointer-events: none; }
.icon-btn { width: 38px; height: 38px; padding: 0; border-radius: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface); font-size: 0.84rem; cursor: pointer;
  transition: all var(--dur) var(--ease); color: var(--ink-2);
}
.chip:hover { border-color: var(--ink-2); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.tag {
  display: inline-flex; align-items: center; gap: 5px; font-size: 0.74rem; font-weight: 600;
  padding: 2px 8px; border-radius: 6px; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line);
  white-space: nowrap;
}
.tag-good { background: var(--good-soft); color: var(--good); border-color: transparent; }
.tag-bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.tag-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.tag-accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }

/* ---------- surfaces ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m);
  padding: 20px; box-shadow: var(--shadow-1);
}
.card-link { text-decoration: none; color: inherit; display: block; transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur); }
.card-link:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: var(--line-strong); }
.eyebrow { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700; color: var(--muted); }
.page-head { margin-bottom: 28px; }
.page-head h1 { font-size: var(--text-xl); margin: 6px 0 8px; }
.page-head p { margin: 0; color: var(--muted); max-width: 64ch; }
.section-title { font-size: 1.15rem; margin: 40px 0 14px; display: flex; align-items: baseline; gap: 10px; }
.section-title small { font-family: var(--font-body); font-weight: 400; font-size: 0.86rem; color: var(--muted); }
.progress { height: 6px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width 600ms var(--ease); }
.progress.good > span { background: var(--good); }

/* ---------- home ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; margin-bottom: 20px;
}
.hero-main {
  position: relative; overflow: hidden; border-radius: var(--radius-l); padding: 34px;
  background: var(--ink); color: var(--paper); box-shadow: var(--shadow-2);
}
.hero-main::after {
  content: ""; position: absolute; right: -60px; bottom: -80px; width: 280px; height: 280px; border-radius: 50%;
  background: var(--marker); opacity: 0.16; filter: blur(2px);
}
.hero-main h1 { font-size: var(--text-hero); line-height: 1.02; margin: 10px 0 14px; }
.hero-main h1 .hl { color: #1b1a17; background: var(--marker); padding: 0 10px; border-radius: 6px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.hero-main p { color: color-mix(in srgb, var(--paper) 78%, transparent); max-width: 52ch; margin: 0 0 22px; }
.hero-main .eyebrow { color: color-mix(in srgb, var(--paper) 60%, transparent); }
.hero-main .btn { position: relative; z-index: 1; }
.hero-main .btn:not(.btn-marker) { background: transparent; color: var(--paper); border-color: color-mix(in srgb, var(--paper) 35%, transparent); box-shadow: none; }
.btn-marker { background: var(--marker); color: #1b1a17; border-color: #e0b800; box-shadow: 0 2px 0 #c9a400; }
.hero-side { display: grid; gap: 20px; grid-template-rows: auto 1fr; }
.ring-card { display: flex; gap: 18px; align-items: center; }
.ring { position: relative; width: 104px; height: 104px; flex: none; }
.ring svg { transform: rotate(-90deg); }
.ring-val { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; }
.ring-val small { display: block; font-family: var(--font-body); font-size: 0.68rem; font-weight: 500; color: var(--muted); margin-top: -6px; }
.stat-list { display: grid; gap: 6px; font-size: 0.9rem; }
.stat-list b { font-variant-numeric: tabular-nums; }
.exam-card h3 { font-size: 1rem; margin-bottom: 10px; }
.exam-parts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.exam-part { border: 1px dashed var(--line-strong); border-radius: 12px; padding: 12px; }
.exam-part b { font-family: var(--font-display); font-size: 1.4rem; display: block; }
.exam-part span { font-size: 0.82rem; color: var(--muted); }

.plan { position: relative; display: grid; gap: 12px; }
.plan-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.plan-head label { font-size: 0.88rem; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.plan-head input[type="time"] { font: inherit; padding: 5px 8px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); }
.block {
  display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 18px; padding: 18px 20px;
  border-radius: var(--radius-m); background: var(--surface); border: 1px solid var(--line); position: relative;
}
.block.is-done { background: color-mix(in srgb, var(--good-soft) 60%, var(--surface)); }
.block.is-current { border-color: var(--ink); box-shadow: 4px 4px 0 var(--marker); }
.block.is-break { background: transparent; border-style: dashed; padding: 10px 20px; }
.block-time { font-family: var(--font-display); font-weight: 600; font-size: 0.95rem; }
.block-time small { display: block; font-family: var(--font-body); font-weight: 400; font-size: 0.78rem; color: var(--muted); }
.block h3 { font-size: 1.02rem; margin-bottom: 4px; }
.block p { margin: 0 0 10px; color: var(--muted); font-size: 0.9rem; }
.todo { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.todo a { display: flex; gap: 10px; align-items: center; text-decoration: none; color: var(--ink-2); padding: 5px 8px; border-radius: 8px; font-size: 0.92rem; }
.todo a:hover { background: var(--surface-2); color: var(--ink); }
.todo .box { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--line-strong); flex: none; display: grid; place-items: center; font-size: 0.7rem; }
.todo .done .box { background: var(--good); border-color: var(--good); color: #fff; }
.todo .done { color: var(--muted); }
.todo .meta { margin-left: auto; font-size: 0.78rem; color: var(--muted); white-space: nowrap; }

.modules-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.module-card { padding: 18px; display: flex; flex-direction: column; gap: 10px; min-height: 170px; }
.module-card .num { font-family: var(--font-display); font-size: 2.2rem; line-height: 1; color: var(--mod, var(--accent)); font-weight: 700; }
.module-card h3 { font-size: 0.98rem; }
.module-card .sub { font-size: 0.8rem; color: var(--muted); }
.module-card .progress { margin-top: auto; }

/* ---------- module page ---------- */
.mod-hero { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 24px; align-items: center; margin-bottom: 26px; }
.mod-big { font-family: var(--font-display); font-weight: 700; font-size: clamp(4rem, 3rem + 4vw, 7rem); line-height: 0.85; color: var(--mod, var(--accent)); text-shadow: 4px 4px 0 var(--marker-soft); }
.mod-hero h1 { font-size: var(--text-xl); margin-bottom: 6px; }
.mod-hero .en { color: var(--muted); font-size: 0.95rem; margin-bottom: 10px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 22px; overflow-x: auto; scrollbar-width: none; }
.tab { border: 0; background: none; padding: 10px 14px; cursor: pointer; color: var(--muted); border-bottom: 2.5px solid transparent; margin-bottom: -1px; white-space: nowrap; font-weight: 500; }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.tab:hover { color: var(--ink); }
.lesson-list { display: grid; gap: 10px; }
.lesson-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 18px; }
.lesson-row .idx { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; background: var(--surface-2); border: 1px solid var(--line); font-size: 0.85rem; }
.lesson-row.done .idx { background: var(--good); color: #fff; border-color: transparent; }
.lesson-row h3 { font-family: var(--font-body); font-weight: 600; font-size: 1rem; }
.lesson-row .en { font-size: 0.82rem; color: var(--muted); }
.action-bar { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0 8px; }
.list-plain { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.list-plain li::marker { color: var(--muted); }
.trap { border-left: 3px solid var(--warn); padding: 10px 14px; background: var(--warn-soft); border-radius: 0 10px 10px 0; }

/* ---------- lesson reading ---------- */
.read-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 50; pointer-events: none; }
.read-progress span { display: block; height: 100%; width: 0; background: var(--marker); box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink) 25%, transparent); }
.lesson-layout { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 48px; align-items: start; }
.crumbs { font-size: 0.85rem; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.crumbs a { color: var(--muted); }
.lesson-title { font-size: var(--text-xl); margin: 4px 0 6px; }
.lesson-en { color: var(--muted); margin-bottom: 18px; }
.toc { position: sticky; top: 28px; font-size: 0.86rem; border-left: 2px solid var(--line); padding-left: 14px; display: grid; gap: 6px; }
.toc a { color: var(--muted); text-decoration: none; line-height: 1.35; }
.toc a:hover, .toc a.on { color: var(--ink); }
.toc a.on { font-weight: 600; }
.toc .eyebrow { margin-bottom: 4px; }
.sec { scroll-margin-top: 24px; margin-top: 34px; }
.sec > h2 { font-size: 1.28rem; margin-bottom: 12px; display: flex; gap: 12px; align-items: baseline; }
.sec > h2 .sn { font-size: 0.85rem; color: var(--muted); font-weight: 500; font-family: var(--font-body); }

.prose { color: var(--ink-2); line-height: 1.72; }
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 14px; }
.prose h3 { font-size: 1.05rem; margin: 26px 0 10px; color: var(--ink); }
.prose h4 { font-size: 0.96rem; margin: 20px 0 8px; color: var(--ink); font-family: var(--font-body); font-weight: 700; }
.prose strong { color: var(--ink); font-weight: 650; background: linear-gradient(transparent 58%, var(--marker-soft) 58%); padding: 0 1px; }
.prose ul, .prose ol { padding-left: 22px; margin: 0 0 14px; }
.prose li { margin: 4px 0; }
.prose li::marker { color: var(--muted); }
.prose code { font-family: var(--font-mono); font-size: 0.88em; background: var(--surface-2); border: 1px solid var(--line); padding: 1px 5px; border-radius: 5px; }
.prose pre { background: #17181c; color: #e9e6dc; padding: 16px 18px; border-radius: 12px; overflow-x: auto; font-size: 0.86rem; line-height: 1.55; margin: 0 0 16px; position: relative; }
.prose pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }
.prose pre[data-lang]::before { content: attr(data-lang); position: absolute; top: 6px; right: 10px; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; color: #8f8a7d; }
.prose .tw { overflow-x: auto; margin: 0 0 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.prose table { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
.prose th, .prose td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { background: var(--surface-2); font-weight: 650; color: var(--ink); white-space: nowrap; }
.prose tr:last-child td { border-bottom: 0; }
.prose blockquote { margin: 0 0 16px; padding: 10px 16px; border-left: 3px solid var(--line-strong); color: var(--muted); }
.callout { margin: 0 0 16px; padding: 14px 16px 4px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); position: relative; }
.callout-title { font-size: 0.76rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 6px; display: flex; gap: 8px; align-items: center; }
.callout-exam { background: color-mix(in srgb, var(--marker) 22%, var(--surface)); border-color: color-mix(in srgb, var(--marker) 70%, var(--line)); }
.callout-exam .callout-title { color: #8a6d00; }
:root[data-theme="dark"] .callout-exam .callout-title { color: var(--marker); }
.callout-formula { background: var(--accent-soft); border-color: transparent; }
.callout-formula .callout-title { color: var(--accent); }
.callout-formula p { font-family: var(--font-mono); font-size: 0.95rem; }
.callout-example { background: var(--surface-2); }
.callout-tip { background: var(--good-soft); border-color: transparent; }
.callout-tip .callout-title { color: var(--good); }
.callout-warn { background: var(--warn-soft); border-color: transparent; }
.callout-warn .callout-title { color: var(--warn); }
.lesson-end { margin-top: 48px; padding-top: 26px; border-top: 1px solid var(--line); }

/* ---------- quiz ---------- */
.quiz-wrap { max-width: 760px; margin: 0 auto; }
.quiz-top { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.quiz-top .progress { flex: 1; }
.quiz-count { font-variant-numeric: tabular-nums; font-size: 0.88rem; color: var(--muted); white-space: nowrap; }
.q-card { padding: 28px; border-radius: var(--radius-l); }
.q-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.q-text { font-size: 1.22rem; font-weight: 600; line-height: 1.4; margin: 0 0 20px; color: var(--ink); }
.opts { display: grid; gap: 10px; }
.opt {
  display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; align-items: center; text-align: left;
  border: 1.5px solid var(--line); background: var(--surface); border-radius: 13px; padding: 12px 14px; cursor: pointer;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease), transform 120ms var(--ease);
  font-size: 1rem; line-height: 1.4;
}
.opt:hover:not([disabled]) { border-color: var(--ink-2); transform: translateX(2px); }
.opt .k { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-weight: 700; background: var(--surface-2); border: 1px solid var(--line); font-size: 0.85rem; }
.opt[disabled] { cursor: default; }
.opt.correct { border-color: var(--good); background: var(--good-soft); }
.opt.correct .k { background: var(--good); color: #fff; border-color: transparent; }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); animation: shake 300ms; }
.opt.wrong .k { background: var(--bad); color: #fff; border-color: transparent; }
.opt.chosen { border-color: var(--ink); background: var(--surface-2); }
.opt.chosen .k { background: var(--ink); color: var(--paper); }
.opt.faded { opacity: 0.55; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.explain { margin-top: 18px; padding: 14px 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); animation: page-in 300ms var(--ease); }
.explain .verdict { font-weight: 700; margin-bottom: 4px; }
.explain .verdict.ok { color: var(--good); }
.explain .verdict.no { color: var(--bad); }
.quiz-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.hint-keys { font-size: 0.8rem; color: var(--muted); }
.setup-grid { display: grid; gap: 18px; }
.setup-grid fieldset { border: 0; padding: 0; margin: 0; }
.setup-grid legend { font-weight: 600; margin-bottom: 8px; padding: 0; }
.result-hero { text-align: center; padding: 36px 24px; }
.result-score { font-family: var(--font-display); font-size: clamp(3rem, 2rem + 4vw, 5rem); font-weight: 700; line-height: 1; }
.review-item { padding: 16px 18px; }
.review-item .q { font-weight: 600; margin-bottom: 6px; }

/* ---------- flashcards ---------- */
.fc-stage { perspective: 1400px; max-width: 640px; margin: 0 auto; }
.fc {
  position: relative; height: 340px; cursor: pointer; transform-style: preserve-3d;
  transition: transform 520ms var(--ease);
}
.fc.flipped { transform: rotateY(180deg); }
.fc-face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border-radius: var(--radius-l); padding: 28px; display: flex; flex-direction: column; justify-content: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-2); overflow-y: auto;
}
.fc-front { background-image: repeating-linear-gradient(transparent 0 31px, color-mix(in srgb, var(--accent) 12%, transparent) 31px 32px); }
.fc-front .fc-text { font-family: var(--font-display); font-size: clamp(1.15rem, 1rem + 1vw, 1.6rem); font-weight: 600; line-height: 1.3; text-align: center; }
.fc-back { transform: rotateY(180deg); }
.fc-back .fc-text { font-size: 1.04rem; line-height: 1.6; }
.fc-corner { position: absolute; top: 14px; left: 18px; right: 18px; display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--muted); }
.fc-actions { display: flex; justify-content: center; gap: 12px; margin-top: 22px; flex-wrap: wrap; }
.btn-know { background: var(--good); color: #fff; border-color: var(--good); box-shadow: 0 2px 0 color-mix(in srgb, var(--good) 70%, #000); }
.btn-again { background: var(--bad); color: #fff; border-color: var(--bad); box-shadow: 0 2px 0 color-mix(in srgb, var(--bad) 70%, #000); }
.boxes { display: flex; gap: 6px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.boxes span { font-size: 0.76rem; padding: 3px 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); }

/* ---------- problems ---------- */
.trainers { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.trainer-card { padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.trainer-card .ico { font-size: 1.6rem; }
.trainer-card h3 { font-size: 1rem; }
.trainer-card p { margin: 0; font-size: 0.88rem; color: var(--muted); }
.trainer-card .tag { align-self: flex-start; }
.task { padding: 26px; border-radius: var(--radius-l); }
.task-statement { font-size: 1.02rem; margin-bottom: 16px; }
.data-table { border-collapse: collapse; margin: 6px 0 16px; font-size: 0.92rem; background: var(--surface); }
.data-table th, .data-table td { border: 1px solid var(--line-strong); padding: 6px 12px; text-align: center; font-variant-numeric: tabular-nums; }
.data-table th { background: var(--surface-2); }
.tw-scroll { overflow-x: auto; }
.answers { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin: 10px 0 16px; }
.field { display: grid; gap: 5px; }
.field label { font-size: 0.85rem; color: var(--ink-2); font-weight: 500; }
.field input, .field select, .input {
  font: inherit; padding: 9px 12px; border-radius: 10px; border: 1.5px solid var(--line-strong);
  background: var(--surface); color: var(--ink); width: 100%; font-variant-numeric: tabular-nums;
}
.field input:focus, .input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field.ok input { border-color: var(--good); background: var(--good-soft); }
.field.no input { border-color: var(--bad); background: var(--bad-soft); }
.field .fb { font-size: 0.8rem; min-height: 1em; }
.field.ok .fb { color: var(--good); }
.field.no .fb { color: var(--bad); }
.steps { counter-reset: st; list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.steps li { counter-increment: st; position: relative; padding: 12px 14px 12px 50px; background: var(--surface-2); border-radius: 12px; border: 1px solid var(--line); }
.steps li::before { content: counter(st); position: absolute; left: 14px; top: 12px; width: 24px; height: 24px; border-radius: 7px; background: var(--ink); color: var(--paper); font-size: 0.78rem; font-weight: 700; display: grid; place-items: center; }
.steps .calc { font-family: var(--font-mono); font-size: 0.9rem; color: var(--ink); display: block; margin-top: 4px; overflow-x: auto; }
.formula-box { font-family: var(--font-mono); background: var(--accent-soft); color: var(--ink); padding: 10px 14px; border-radius: 10px; font-size: 0.9rem; margin: 0 0 14px; display: grid; gap: 4px; }
details.worked { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); padding: 0; }
details.worked > summary { cursor: pointer; padding: 14px 18px; font-weight: 600; list-style: none; display: flex; gap: 10px; align-items: center; }
details.worked > summary::-webkit-details-marker { display: none; }
details.worked > summary::before { content: "＋"; color: var(--muted); }
details.worked[open] > summary::before { content: "－"; }
details.worked > .inner { padding: 0 18px 18px; }

/* ---------- mock exam ---------- */
.mock-bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 12px 16px; margin: 0 -16px 18px; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.timer { font-family: var(--font-display); font-weight: 600; font-variant-numeric: tabular-nums; font-size: 1.1rem; }
.timer.low { color: var(--bad); }
.qnav { display: flex; flex-wrap: wrap; gap: 6px; }
.qnav a { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; font-size: 0.8rem; text-decoration: none; color: var(--ink-2); border: 1px solid var(--line); background: var(--surface); }
.qnav a.answered { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.qnav a.right { background: var(--good); color: #fff; border-color: transparent; }
.qnav a.miss { background: var(--bad); color: #fff; border-color: transparent; }
.mock-q { padding: 20px 22px; margin-bottom: 12px; scroll-margin-top: 80px; }
.mock-q .q-text { font-size: 1.04rem; margin-bottom: 12px; }
.mock-q .opts { grid-template-columns: 1fr 1fr; gap: 8px; }
.mock-q .opt { padding: 9px 12px; font-size: 0.95rem; grid-template-columns: 28px minmax(0, 1fr); }
.mock-q .opt .k { width: 28px; height: 28px; font-size: 0.8rem; }
.attempts { display: grid; gap: 6px; }

/* ---------- glossary / cheat ---------- */
.gloss-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.gloss-tools .input { max-width: 360px; }
.gloss { display: grid; gap: 8px; }
.gloss-item { display: grid; grid-template-columns: minmax(160px, 260px) minmax(0, 1fr); gap: 18px; padding: 14px 18px; }
.gloss-item .t { font-weight: 700; color: var(--ink); }
.gloss-item .r { font-size: 0.85rem; color: var(--muted); }
.gloss-item .d { font-size: 0.95rem; }
.cheat-mod { break-inside: avoid; margin-bottom: 22px; }
.cheat-mod h2 { font-size: 1.05rem; margin-bottom: 10px; display: flex; gap: 10px; align-items: center; }
.cheat-mod h2 .nav-num { width: 28px; height: 28px; }
.cheat-cols { columns: 2 380px; column-gap: 28px; }
.cheat-list { margin: 0; padding-left: 18px; display: grid; gap: 5px; font-size: 0.93rem; }

/* ---------- search ---------- */
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(15, 14, 12, 0.45); backdrop-filter: blur(3px); display: flex; justify-content: center; align-items: flex-start; padding: 10vh 16px 16px; animation: fade 160ms ease; }
@keyframes fade { from { opacity: 0; } }
.search-box { width: min(680px, 100%); background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-2); border: 1px solid var(--line); overflow: hidden; display: flex; flex-direction: column; max-height: 76vh; }
.search-box input { border: 0; border-bottom: 1px solid var(--line); padding: 18px 20px; font: inherit; font-size: 1.1rem; background: transparent; color: var(--ink); outline: none; }
.search-res { overflow-y: auto; padding: 8px; }
.search-res a { display: block; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--ink); }
.search-res a:hover, .search-res a.sel { background: var(--surface-2); }
.search-res .k { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.search-res .s { font-size: 0.86rem; color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-res mark { background: var(--marker-soft); color: inherit; border-radius: 3px; }
.empty { text-align: center; padding: 28px; color: var(--muted); }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 10px 18px; border-radius: 12px; z-index: 200; box-shadow: var(--shadow-2); animation: page-in 260ms var(--ease); font-size: 0.92rem; }

/* ---------- responsive ---------- */
@media (max-width: 1280px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-side { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: none; }
}
@media (max-width: 1100px) {
  .lesson-layout { grid-template-columns: minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 1000px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); z-index: 90; transform: translateX(-102%);
    transition: transform 280ms var(--ease); box-shadow: var(--shadow-2); background: var(--surface);
  }
  .app.menu-open .sidebar { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.35); z-index: 80; }
  .topbar {
    display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 30; padding: 10px 16px;
    background: color-mix(in srgb, var(--paper) 90%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
  }
  .topbar .brand { flex: 1; padding: 0; }
  .page { padding: 22px 16px 80px; }
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-main { padding: 26px 22px; }
  .mock-bar { margin: 0 -16px 16px; top: 59px; }
}
@media (max-width: 900px) {
  .hero-side { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .block { grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 16px; }
  .mod-hero { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .gloss-item { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .mock-q .opts { grid-template-columns: minmax(0, 1fr); }
  .q-card { padding: 20px 16px; }
  .q-text { font-size: 1.08rem; }
  .fc { height: 380px; }
  .exam-parts { grid-template-columns: minmax(0, 1fr); }
  .lesson-row { grid-template-columns: 30px minmax(0, 1fr); }
  .lesson-row > :last-child { grid-column: 2; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
}
@media print {
  .sidebar, .topbar, .no-print, .read-progress { display: none !important; }
  .app { display: block; }
  body { background: #fff; }
  body::before { display: none; }
  .page { padding: 0; max-width: none; }
  .card { box-shadow: none; }
}
