/* ==========================================================================
   Основы SEO — дизайн-система курса
   Аудитория 40+, без технического бэкграунда.
   Принципы: крупный кегль, высокий контраст, узкая колонка, книжная подача.
   ========================================================================== */

:root {
  --paper:        #FAF7F2;
  --paper-raised: #FFFFFF;
  --paper-sunk:   #F1ECE3;
  --ink:          #1A1815;
  --ink-soft:     #4A443B;
  --ink-faint:    #7A7267;
  --rule:         #DFD7C9;
  --rule-soft:    #EBE4D8;

  --accent:       #0F5F57;
  --accent-deep:  #0A423C;
  --accent-wash:  #E4F0EC;
  --accent-ink:   #FFFFFF;

  --amber:        #A85A22;
  --amber-wash:   #FBEEE0;

  --danger:       #9C2F2F;
  --danger-wash:  #FBE9E7;

  --ok:           #226B3E;
  --ok-wash:      #E6F2E8;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", "Helvetica Neue", Arial, sans-serif;
  --serif: Georgia, "Iowan Old Style", "Times New Roman", "PT Serif", serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --measure: 40rem;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(26, 24, 21, .05), 0 6px 20px rgba(26, 24, 21, .06);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:        #15171A;
    --paper-raised: #1E2126;
    --paper-sunk:   #101215;
    --ink:          #E9E5DD;
    --ink-soft:     #B4ADA1;
    --ink-faint:    #8A8377;
    --rule:         #333941;
    --rule-soft:    #262B31;

    --accent:       #58C4AE;
    --accent-deep:  #8BDCC9;
    --accent-wash:  #16302D;
    --accent-ink:   #0B1A18;

    --amber:        #E09A5F;
    --amber-wash:   #2E2317;

    --danger:       #E58B84;
    --danger-wash:  #2E1A19;

    --ok:           #7FC894;
    --ok-wash:      #17281D;

    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.35);
  }
}

:root[data-theme="dark"] {
  --paper:        #15171A;
  --paper-raised: #1E2126;
  --paper-sunk:   #101215;
  --ink:          #E9E5DD;
  --ink-soft:     #B4ADA1;
  --ink-faint:    #8A8377;
  --rule:         #333941;
  --rule-soft:    #262B31;
  --accent:       #58C4AE;
  --accent-deep:  #8BDCC9;
  --accent-wash:  #16302D;
  --accent-ink:   #0B1A18;
  --amber:        #E09A5F;
  --amber-wash:   #2E2317;
  --danger:       #E58B84;
  --danger-wash:  #2E1A19;
  --ok:           #7FC894;
  --ok-wash:      #17281D;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.35);
}

/* --- Базовая типографика ------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 19px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

@media (max-width: 600px) { body { font-size: 18px; } }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 .5em;
  text-wrap: balance;
}

h1 { font-size: clamp(2rem, 5.2vw, 2.85rem); }
h2 { font-size: clamp(1.5rem, 3.6vw, 1.95rem); margin-top: 2.4em; }
h3 { font-size: clamp(1.2rem, 2.6vw, 1.35rem); margin-top: 1.9em; }

p { margin: 0 0 1.15em; }
p:last-child { margin-bottom: 0; }

strong { font-weight: 700; color: var(--ink); }
em { font-style: italic; }

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover { color: var(--accent-deep); }

ul, ol { margin: 0 0 1.15em; padding-left: 1.35em; }
li { margin-bottom: .5em; }
li::marker { color: var(--accent); }

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 2.6em 0;
}

code {
  font-family: var(--mono);
  font-size: .87em;
  background: var(--paper-sunk);
  border: 1px solid var(--rule-soft);
  border-radius: 4px;
  padding: .1em .38em;
  word-break: break-word;
}

/* --- Каркас -------------------------------------------------------------- */

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.wrap-wide { max-width: 56rem; margin: 0 auto; padding: 0 1.25rem; }

main { padding-bottom: 5rem; }

/* --- Верхняя панель ------------------------------------------------------ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(12px);
  -webkit-backdrop-filter: saturate(1.6) blur(12px);
  border-bottom: 1px solid var(--rule-soft);
}

.topbar__inner {
  max-width: 56rem;
  margin: 0 auto;
  padding: .7rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.topbar__home {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.topbar__home:hover { color: var(--accent); }
.topbar__home span { color: var(--accent); }

.topbar__spacer { flex: 1; }

.topbar__meta {
  font-size: .85rem;
  color: var(--ink-faint);
  white-space: nowrap;
}

.theme-toggle {
  appearance: none;
  border: 1px solid var(--rule);
  background: var(--paper-raised);
  color: var(--ink-soft);
  border-radius: 999px;
  width: 2.2rem;
  height: 2.2rem;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex: none;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }

/* Полоса прогресса чтения */
.readbar {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  background: var(--accent);
  width: 0;
  z-index: 60;
  transition: width .1s linear;
}

/* --- Шапка урока --------------------------------------------------------- */

.lesson-head {
  padding: 3rem 0 0;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
}

.lesson-kicker {
  display: flex;
  align-items: baseline;
  gap: .7rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.lesson-num {
  font-family: var(--serif);
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
}

.lesson-time {
  font-size: .88rem;
  color: var(--ink-faint);
}

.lesson-lede {
  font-size: 1.18rem;
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 1.1rem 0 0;
  font-family: var(--serif);
}

/* --- Врезки -------------------------------------------------------------- */

.box {
  margin: 2rem 0;
  padding: 1.3rem 1.4rem;
  border-radius: var(--radius);
  border: 1px solid var(--rule);
  background: var(--paper-raised);
}

.box__label {
  display: block;
  font-family: var(--sans);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  margin-bottom: .6rem;
}

/* Определение термина */
.def {
  background: var(--accent-wash);
  border: 1px solid transparent;
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.def .box__label { color: var(--accent); }
.def dfn {
  font-style: normal;
  font-weight: 700;
  font-family: var(--serif);
  font-size: 1.1em;
}

/* Цитата первоисточника */
.source {
  background: var(--paper-sunk);
  border-left: 4px solid var(--ink-faint);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.source .box__label { color: var(--ink-faint); }
.source blockquote {
  margin: 0 0 .7rem;
  font-family: var(--serif);
  font-size: 1.04em;
  line-height: 1.6;
}
.source cite {
  display: block;
  font-style: normal;
  font-size: .88rem;
  color: var(--ink-faint);
}

/* Миф */
.myth { background: var(--danger-wash); border-left: 4px solid var(--danger); border-radius: 0 var(--radius) var(--radius) 0; }
.myth .box__label { color: var(--danger); }

/* Правда / вывод */
.truth { background: var(--ok-wash); border-left: 4px solid var(--ok); border-radius: 0 var(--radius) var(--radius) 0; }
.truth .box__label { color: var(--ok); }

/* Предупреждение */
.warn { background: var(--amber-wash); border-left: 4px solid var(--amber); border-radius: 0 var(--radius) var(--radius) 0; }
.warn .box__label { color: var(--amber); }

/* --- Практика ------------------------------------------------------------ */

.practice {
  margin: 2.6rem 0;
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper-raised);
}

.practice__head {
  background: var(--accent);
  color: var(--accent-ink);
  padding: .75rem 1.4rem;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.practice__body { padding: 1.4rem; }
.practice__body > :first-child { margin-top: 0; }

.steps { list-style: none; padding: 0; margin: 0; counter-reset: step; }
.steps li {
  position: relative;
  padding-left: 2.6rem;
  margin-bottom: 1rem;
  counter-increment: step;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0; top: .12em;
  width: 1.75rem; height: 1.75rem;
  border-radius: 50%;
  background: var(--accent-wash);
  color: var(--accent);
  font-family: var(--serif);
  font-weight: 700;
  font-size: .95rem;
  display: grid; place-items: center;
}

/* Чекбоксы задания */
.task {
  display: flex;
  gap: .8rem;
  align-items: flex-start;
  padding: .85rem 1rem;
  border: 1px solid var(--rule);
  border-radius: 8px;
  margin-bottom: .6rem;
  background: var(--paper);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.task:hover { border-color: var(--accent); }
.task input { margin: .32em 0 0; width: 1.15rem; height: 1.15rem; accent-color: var(--accent); flex: none; cursor: pointer; }
.task span { flex: 1; }
.task.is-done { background: var(--ok-wash); border-color: var(--ok); }
.task.is-done span { color: var(--ink-soft); text-decoration: line-through; text-decoration-color: var(--ok); }

/* --- Квиз ---------------------------------------------------------------- */

.quiz {
  margin: 2.6rem 0;
  padding: 1.5rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper-raised);
  box-shadow: var(--shadow);
}

.quiz__label {
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--amber);
  display: block;
  margin-bottom: .7rem;
}

.quiz__q {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 0 0 1.1rem;
}

.quiz__opts { list-style: none; margin: 0; padding: 0; }

.quiz__opt {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--rule);
  border-radius: 8px;
  padding: .8rem 1rem;
  margin-bottom: .55rem;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.quiz__opt:hover:not([disabled]) { border-color: var(--accent); background: var(--accent-wash); }
.quiz__opt[disabled] { cursor: default; }

.quiz__opt.is-right { border-color: var(--ok); background: var(--ok-wash); }
.quiz__opt.is-wrong { border-color: var(--danger); background: var(--danger-wash); }

.quiz__mark { font-weight: 700; margin-right: .45rem; }
.quiz__opt.is-right .quiz__mark { color: var(--ok); }
.quiz__opt.is-wrong .quiz__mark { color: var(--danger); }

.quiz__why {
  display: none;
  margin-top: .55rem;
  padding-top: .55rem;
  border-top: 1px dashed var(--rule);
  font-size: .93rem;
  line-height: 1.55;
  color: var(--ink-soft);
}
.quiz__opt.is-revealed .quiz__why { display: block; }

/* --- Схемы --------------------------------------------------------------- */

.figure {
  margin: 2.4rem 0;
  padding: 1.4rem;
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow-x: auto;
}
.figure svg { display: block; max-width: 100%; height: auto; margin: 0 auto; }
.figure figcaption {
  margin-top: 1rem;
  font-size: .88rem;
  color: var(--ink-faint);
  text-align: center;
  line-height: 1.5;
}

.svg-ink   { fill: var(--ink); }
.svg-soft  { fill: var(--ink-soft); }
.svg-faint { fill: var(--ink-faint); }
.svg-accent{ fill: var(--accent); }
.svg-amber { fill: var(--amber); }
.svg-line  { stroke: var(--rule); fill: none; }
.svg-line-accent { stroke: var(--accent); fill: none; }
.svg-box   { fill: var(--paper); stroke: var(--rule); }
.svg-box-accent { fill: var(--accent-wash); stroke: var(--accent); }

/* --- Таблицы ------------------------------------------------------------- */

.table-scroll { overflow-x: auto; margin: 2rem 0; -webkit-overflow-scrolling: touch; }

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 30rem;
  font-size: .95rem;
}
th, td {
  text-align: left;
  padding: .7rem .8rem;
  border-bottom: 1px solid var(--rule-soft);
  vertical-align: top;
}
th {
  font-family: var(--sans);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--ink-faint);
  border-bottom: 2px solid var(--rule);
}
tbody tr:last-child td { border-bottom: 0; }

/* --- Оглавление курса (главная) ------------------------------------------ */

.hero {
  padding: 4.5rem 0 3rem;
  text-align: left;
}
.hero h1 { margin-bottom: .4em; }
.hero__sub {
  font-family: var(--serif);
  font-size: clamp(1.1rem, 2.6vw, 1.32rem);
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 34rem;
}
.hero__facts {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}
.fact__n {
  font-family: var(--serif);
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  display: block;
}
.fact__l { font-size: .85rem; color: var(--ink-faint); }

.progress {
  margin: 2.5rem 0;
  padding: 1.2rem 1.4rem;
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
.progress__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: .7rem;
}
.progress__title { font-weight: 700; font-size: .95rem; }
.progress__count { font-size: .9rem; color: var(--ink-faint); }
.progress__track {
  height: 8px;
  background: var(--paper-sunk);
  border-radius: 99px;
  overflow: hidden;
}
.progress__fill {
  height: 100%;
  background: var(--accent);
  width: 0;
  border-radius: 99px;
  transition: width .4s cubic-bezier(.4,0,.2,1);
}
.progress__reset {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  margin-top: .8rem;
  font: inherit;
  font-size: .82rem;
  color: var(--ink-faint);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.progress__reset:hover { color: var(--danger); }

.toc { list-style: none; margin: 0; padding: 0; }

.toc__item { margin-bottom: .7rem; }

.toc__link {
  display: flex;
  gap: 1.1rem;
  align-items: flex-start;
  padding: 1.15rem 1.3rem;
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.toc__link:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
  color: inherit;
}

.toc__n {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--rule);
  line-height: 1.1;
  flex: none;
  width: 1.7rem;
  text-align: right;
  transition: color .15s;
}
.toc__link:hover .toc__n { color: var(--accent); }
.toc__item.is-done .toc__n { color: var(--ok); }

.toc__body { flex: 1; min-width: 0; }
.toc__t {
  display: block;
  font-family: var(--serif);
  font-size: 1.14rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: .25rem;
}
.toc__d { display: block; font-size: .93rem; color: var(--ink-soft); line-height: 1.5; }
.toc__meta { display: block; font-size: .8rem; color: var(--ink-faint); margin-top: .4rem; }

.toc__check {
  flex: none;
  width: 1.4rem; height: 1.4rem;
  border-radius: 50%;
  border: 2px solid var(--rule);
  display: grid; place-items: center;
  font-size: .8rem;
  color: transparent;
  margin-top: .15rem;
}
.toc__item.is-done .toc__check {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
}

/* --- Кнопки и навигация -------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font: inherit;
  font-weight: 700;
  font-size: .97rem;
  padding: .8rem 1.4rem;
  border-radius: 8px;
  border: 1.5px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  text-decoration: none;
  cursor: pointer;
  transition: opacity .15s, background .15s;
}
.btn:hover { opacity: .88; color: var(--accent-ink); }

.btn--ghost { background: transparent; color: var(--accent); }
.btn--ghost:hover { background: var(--accent-wash); color: var(--accent); }

.btn--done { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn--done:hover { color: #fff; }

.lesson-foot {
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
}

.mark-done { margin-bottom: 2rem; text-align: center; }
.mark-done__hint { font-size: .87rem; color: var(--ink-faint); margin-top: .7rem; }

.pager {
  display: flex;
  gap: .8rem;
  flex-wrap: wrap;
}
.pager a {
  flex: 1 1 12rem;
  padding: 1rem 1.2rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  background: var(--paper-raised);
  transition: border-color .15s;
}
.pager a:hover { border-color: var(--accent); color: inherit; }
.pager__dir { display: block; font-size: .76rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: .25rem; }
.pager__t { font-family: var(--serif); font-weight: 700; font-size: 1.02rem; line-height: 1.3; }
.pager a.next { text-align: right; }

/* --- Блок «спросите учителя» --------------------------------------------- */

.ask {
  margin: 3rem 0 0;
  padding: 1.3rem 1.4rem;
  background: var(--paper-sunk);
  border-radius: var(--radius);
  font-size: .95rem;
  color: var(--ink-soft);
  line-height: 1.6;
}
.ask strong { color: var(--ink); }

/* --- Ссылки на источники ------------------------------------------------- */

.refs { margin-top: 2.5rem; font-size: .9rem; }
.refs h3 { font-size: .78rem; letter-spacing: .13em; text-transform: uppercase; font-family: var(--sans); color: var(--ink-faint); margin-bottom: .7rem; }
.refs ol { padding-left: 1.3rem; }
.refs li { margin-bottom: .45rem; color: var(--ink-soft); }

/* --- Подвал -------------------------------------------------------------- */

.foot {
  border-top: 1px solid var(--rule);
  padding: 2.5rem 0 3.5rem;
  font-size: .88rem;
  color: var(--ink-faint);
  line-height: 1.6;
}
.foot a { color: var(--ink-soft); }

/* --- Справочники (reference) --------------------------------------------- */

.ref-page .wrap { max-width: 46rem; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: .9rem;
  margin: 1.5rem 0 2.5rem;
}
.card {
  padding: 1.1rem 1.2rem;
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  display: block;
  transition: border-color .15s;
}
.card:hover { border-color: var(--accent); color: inherit; }
.card__t { display: block; font-family: var(--serif); font-weight: 700; font-size: 1.05rem; margin-bottom: .3rem; }
.card__d { display: block; font-size: .9rem; color: var(--ink-soft); line-height: 1.5; }

.glossary { margin: 0; }
.glossary__group { margin-bottom: 2.5rem; }
.glossary dt {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.1rem;
  margin-top: 1.5rem;
  color: var(--ink);
  scroll-margin-top: 5rem;
}
.glossary dd {
  margin: .35rem 0 0;
  color: var(--ink-soft);
  line-height: 1.6;
}
.glossary .alias {
  display: block;
  font-size: .85rem;
  color: var(--ink-faint);
  margin-top: .3rem;
}
.glossary .alias b { font-weight: 700; color: var(--ink-faint); }

.jump {
  display: flex; flex-wrap: wrap; gap: .4rem;
  margin: 1.5rem 0 2.5rem;
  padding: 1rem;
  background: var(--paper-sunk);
  border-radius: var(--radius);
}
.jump a {
  font-size: .88rem;
  padding: .25rem .6rem;
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: 6px;
  text-decoration: none;
}

.checklist { list-style: none; padding: 0; margin: 0 0 2rem; }
.checklist li {
  display: flex; gap: .75rem; align-items: flex-start;
  padding: .7rem .2rem;
  border-bottom: 1px solid var(--rule-soft);
}
.checklist li::before {
  content: "☐";
  color: var(--accent);
  font-size: 1.2rem;
  line-height: 1.35;
  flex: none;
}
.checklist b { display: block; }
.checklist small { color: var(--ink-faint); font-size: .87rem; line-height: 1.5; display: block; margin-top: .15rem; }

.tool-meta {
  font-size: .88rem;
  color: var(--ink-faint);
  margin-top: -.55rem;
  margin-bottom: 2rem;
}
.tool-meta a { color: var(--accent); }

.answer {
  border-left: 3px solid var(--accent);
  background: var(--accent-wash);
  padding: .65rem .95rem;
  margin: .9rem 0 2.2rem;
  font-size: .95rem;
  border-radius: 0 8px 8px 0;
}
.answer b { color: var(--accent-deep); }

.print-hint {
  font-size: .85rem;
  color: var(--ink-faint);
  padding: .8rem 1rem;
  background: var(--paper-sunk);
  border-radius: 8px;
  margin-bottom: 2rem;
}

/* --- Печать -------------------------------------------------------------- */

@media print {
  :root {
    --paper: #fff; --paper-raised: #fff; --paper-sunk: #f6f6f6;
    --ink: #000; --ink-soft: #333; --ink-faint: #666;
    --rule: #bbb; --rule-soft: #ddd;
    --accent: #0A423C; --accent-wash: #f0f4f3;
  }
  body { font-size: 11.5pt; line-height: 1.5; background: #fff; }
  .topbar, .readbar, .ask, .pager, .mark-done, .progress, .theme-toggle,
  .print-hint, .jump, .quiz { display: none !important; }
  main { padding-bottom: 0; }
  .wrap, .wrap-wide { max-width: 100%; padding: 0; }
  a { color: #000; text-decoration: none; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 8pt; color: #666; word-break: break-all; }
  h2, h3 { break-after: avoid; page-break-after: avoid; }
  .box, .figure, .practice, table, .checklist li { break-inside: avoid; page-break-inside: avoid; }
  .glossary dt { break-after: avoid; }
}

/* --- Доступность --------------------------------------------------------- */

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-ink);
  padding: .7rem 1.2rem;
  z-index: 100;
  border-radius: 0 0 8px 0;
}
.skip:focus { left: 0; color: var(--accent-ink); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
