/* ============================================================
   «Чай по-русски» — тема ООР по РКИ
   Единственный CSS-файл проекта. Без внешних ресурсов.
   Палитра: кремовый, терракота, тёмно-зелёный, золото.
   ============================================================ */

/* ---------- 1. Переменные ---------- */
:root {
  --bg: #faf6ef;
  --surface: #fffdf8;
  --surface-2: #f4ecdf;
  --surface-3: #efe3d2;
  --text: #2b2119;
  --muted: #6f5f4f;
  --muted-2: #8a7a68;
  --terracotta: #b8512a;
  --terracotta-600: #9c4222;
  --terracotta-700: #853619;
  --terracotta-100: #f7e7de;
  --terracotta-050: #fcf1ea;
  --green: #2f4a3c;
  --green-600: #243b2f;
  --green-500: #3f6b4d;
  --green-100: #e9f0e8;
  --gold: #d9a441;
  --gold-600: #b8862c;
  --gold-100: #f8efd8;
  --line: #e6dccd;
  --line-strong: #d6c8b3;
  --danger: #a83f2f;
  --danger-100: #f8e4df;
  --ok: #3f6b4d;
  --ok-100: #edf4ec;

  --serif: "PT Serif", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --container: 1140px;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 20px;

  --shadow-sm: 0 1px 2px rgba(43, 33, 25, 0.05);
  --shadow: 0 1px 2px rgba(43, 33, 25, 0.04), 0 16px 36px -24px rgba(43, 33, 25, 0.38);
  --shadow-lg: 0 2px 8px rgba(43, 33, 25, 0.06), 0 28px 64px -32px rgba(43, 33, 25, 0.45);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --header-h: 72px;
}

/* ---------- 2. Сброс и база ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  font-size: clamp(0.975rem, 0.94rem + 0.18vw, 1.05rem);
  line-height: 1.65;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(58rem 40rem at 8% -12%, rgba(217, 164, 65, 0.16), transparent 62%),
    radial-gradient(48rem 34rem at 108% 0%, rgba(184, 81, 42, 0.1), transparent 62%);
  background-repeat: no-repeat;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.01em;
  color: var(--text);
}

p {
  margin: 0;
}

img,
svg,
iframe,
video {
  max-width: 100%;
}

img {
  height: auto;
}

a {
  color: var(--terracotta-600);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--terracotta-700);
}

strong,
b {
  font-weight: 700;
}

::selection {
  background: rgba(217, 164, 65, 0.35);
  color: var(--text);
}

/* длинные русские слова не должны вылезать из блоков */
p,
li,
td,
th,
dd,
dt,
figcaption,
summary,
.brand__title,
.card__title,
.section__title,
.ex__title,
.step__title,
.opt__text,
.match-item,
.token,
.btn,
.chip,
.q__text,
.tf-item__text,
.note,
.answers {
  overflow-wrap: break-word;
}

.opt__text,
.match-item,
.token,
.btn,
.chip,
.gap {
  overflow-wrap: anywhere;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- 3. Доступность ---------- */
.skip-link {
  position: absolute;
  top: -4rem;
  left: 1rem;
  z-index: 200;
  display: inline-block;
  padding: 0.7rem 1.1rem;
  border-radius: 999px;
  background: var(--green-600);
  color: #fff8ef;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: top 0.25s var(--ease);
}

.skip-link:focus {
  top: 1rem;
  color: #fff8ef;
}

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  border-radius: 6px;
}

.btn:focus-visible,
.tf-btn:focus-visible,
.match-item:focus-visible,
.token:focus-visible,
.nav-toggle:focus-visible,
.brand:focus-visible,
.answers > summary:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

/* ---------- 4. Сетка и контейнер ---------- */
.container {
  width: min(100% - 2.5rem, var(--container));
  margin-inline: auto;
}

.grid {
  display: grid;
  gap: clamp(1rem, 0.8rem + 1vw, 1.5rem);
  align-items: start;
}

.grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stack > * + * {
  margin-top: 1.25rem;
}

/* ---------- 5. Шапка ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(250, 246, 239, 0.92);
  border-bottom: 1px solid transparent;
  transition: background-color 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

@supports (backdrop-filter: blur(10px)) {
  .site-header {
    background: rgba(250, 246, 239, 0.78);
    -webkit-backdrop-filter: blur(14px) saturate(1.25);
    backdrop-filter: blur(14px) saturate(1.25);
  }

  .site-header.is-stuck {
    background: rgba(250, 246, 239, 0.94);
  }
}

.site-header.is-stuck {
  border-bottom-color: var(--line);
  box-shadow: 0 14px 32px -26px rgba(43, 33, 25, 0.55);
}

.site-header__inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: var(--header-h);
  padding-block: 0.55rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  margin-right: auto;
  color: var(--text);
  text-decoration: none;
  border-radius: var(--radius-sm);
}

.brand:hover {
  color: var(--text);
}

.brand__mark {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.16;
  min-width: 0;
}

.brand__title {
  font-family: var(--serif);
  font-size: 1.13rem;
  font-weight: 700;
  letter-spacing: 0.005em;
}

.brand__sub {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.8rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.nav-toggle:hover {
  border-color: var(--terracotta);
  color: var(--terracotta-600);
}

.nav-toggle__bars {
  position: relative;
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: background-color 0.2s ease, transform 0.25s var(--ease);
}

.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.25s var(--ease), top 0.25s var(--ease);
}

.nav-toggle__bars::before {
  top: -6px;
}

.nav-toggle__bars::after {
  top: 6px;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars {
  background: transparent;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before {
  top: 0;
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after {
  top: 0;
  transform: rotate(-45deg);
}

.site-nav__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav__link {
  display: inline-block;
  padding: 0.38rem 0.55rem;
  border-radius: 999px;
  color: #4a3b2d;
  font-size: 0.84rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.site-nav__link:hover {
  background: var(--surface-2);
  color: var(--terracotta-600);
}

.site-nav__link.is-active {
  background: var(--terracotta-100);
  color: var(--terracotta-700);
  font-weight: 700;
}

/* ---------- 6. Первый экран ---------- */
.page-hero {
  position: relative;
  padding: clamp(2.4rem, 1.4rem + 3vw, 4.4rem) 0 clamp(0.7rem, 0.4rem + 0.9vw, 1.4rem);
}

.page-hero::before {
  content: "";
  position: absolute;
  inset: -6rem 0 auto;
  height: 26rem;
  background: radial-gradient(36rem 18rem at 18% 30%, rgba(217, 164, 65, 0.13), transparent 70%);
  pointer-events: none;
}

.page-hero__inner {
  position: relative;
}

/* сплит-герой главной: текст слева, декоративный арт справа */
.page-hero__inner--split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(1.2rem, 1rem + 1.6vw, 2.4rem);
}

.page-hero__content {
  min-width: 0;
}

.page-hero__art {
  display: block;
  width: 100%;
  height: auto;
  max-height: 320px;
  margin: 0;
  object-fit: contain;
  border-radius: var(--radius-lg);
}

@media (min-width: 1100px) {
  .page-hero__inner--split {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: clamp(2rem, 1rem + 2.6vw, 3.2rem);
    align-items: center;
  }

  .page-hero__art {
    max-height: none;
  }
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0 0 0.95rem;
  color: var(--terracotta-600);
  font-family: var(--sans);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  flex: none;
  width: 2.1rem;
  height: 1.5px;
  background: var(--terracotta);
  opacity: 0.55;
}

.page-hero__title {
  max-width: 22ch;
  margin: 0 0 1rem;
  font-size: clamp(2.1rem, 1.4rem + 2.9vw, 3.5rem);
  line-height: 1.07;
  letter-spacing: -0.018em;
  text-wrap: balance;
}

.page-hero__lead {
  max-width: 62ch;
  color: var(--muted);
  font-size: clamp(1.02rem, 0.98rem + 0.25vw, 1.18rem);
  line-height: 1.65;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.34rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.72);
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.015em;
  box-shadow: var(--shadow-sm);
}

.chip::before {
  content: "";
  flex: none;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
}

/* декоративная обложка (cover.svg) */
.page-hero__cover,
.cover {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 2rem;
  border-radius: var(--radius-lg);
}

.cover-showcase {
  margin: 2.4rem 0 0;
  padding: clamp(0.7rem, 2vw, 1.4rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--surface), #f7efe2);
  box-shadow: var(--shadow);
}

.cover-showcase img {
  display: block;
  width: 100%;
  height: auto;
}

/* ---------- 7. Секции ---------- */
.section {
  padding: clamp(2.2rem, 1.5rem + 2vw, 3.5rem) 0;
}

.section--tint {
  background: linear-gradient(180deg, rgba(244, 236, 223, 0.5), rgba(244, 236, 223, 0.15));
  border-block: 1px solid rgba(230, 220, 205, 0.7);
}

.section__head {
  max-width: 70ch;
  margin-bottom: clamp(1.3rem, 1rem + 1vw, 2.1rem);
}

.section__kicker {
  margin: 0 0 0.5rem;
  color: var(--gold-600);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.section__title {
  margin: 0 0 0.6rem;
  font-size: clamp(1.6rem, 1.25rem + 1.4vw, 2.3rem);
  line-height: 1.14;
  text-wrap: balance;
}

.section__lead {
  max-width: 68ch;
  margin: 0;
  color: var(--muted);
}

.section__head--center {
  margin-inline: auto;
  text-align: center;
}

.section__head--center .section__lead {
  margin-inline: auto;
}

/* ---------- 8. Карточки ---------- */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  height: 100%;
  padding: clamp(1.1rem, 1rem + 0.5vw, 1.5rem);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s ease;
}

.card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

.card__title {
  margin: 0;
  font-size: 1.18rem;
  line-height: 1.25;
}

.card__text {
  margin: 0;
  color: var(--muted);
  font-size: 0.97rem;
}

.card__meta {
  margin: 0;
  color: var(--gold-600);
  font-family: var(--serif);
  font-size: 0.86rem;
  font-style: italic;
}

.card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: auto;
  padding-top: 0.8rem;
}

.card--accent {
  border-color: transparent;
  background: linear-gradient(150deg, #c05a31, var(--terracotta) 55%, #a8471f);
  color: #fdf6ec;
  box-shadow: 0 22px 44px -28px rgba(184, 81, 42, 0.9);
}

.card--accent::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(120% 80% at 100% 0%, rgba(217, 164, 65, 0.4), transparent 58%);
  pointer-events: none;
}

.card--accent > * {
  position: relative;
  z-index: 1;
}

.card--accent .card__title {
  color: #fff8ef;
}

.card--accent .card__text {
  color: rgba(253, 246, 236, 0.85);
}

.card--accent .card__meta {
  color: rgba(255, 248, 232, 0.78);
}

.card--accent .btn--ghost {
  border-color: rgba(253, 246, 236, 0.5);
  background: transparent;
  color: #fdf6ec;
}

.card--accent .btn--ghost:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(253, 246, 236, 0.85);
  color: #fff;
}

/* ---------- 9. Врезки ---------- */
.note {
  position: relative;
  padding: 1rem 1.2rem 1rem 1.35rem;
  border: 1px solid transparent;
  border-left: 3px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface-2);
}

.note p {
  margin: 0;
  font-size: 0.96rem;
}

.note p + p {
  margin-top: 0.5rem;
}

.note strong {
  color: var(--text);
}

.note--info {
  border-color: rgba(47, 74, 60, 0.18);
  border-left-color: var(--green);
  background: var(--green-100);
}

.note--tip {
  border-color: rgba(217, 164, 65, 0.32);
  border-left-color: var(--gold);
  background: var(--gold-100);
}

.note--warn {
  border-color: rgba(184, 81, 42, 0.24);
  border-left-color: var(--terracotta);
  background: var(--terracotta-050);
}

/* ---------- 10. Таблица ---------- */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.table__caption {
  padding: 1rem 1.25rem 0.4rem;
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.04rem;
  font-weight: 700;
  text-align: left;
  caption-side: top;
}

.table th {
  padding: 0.68rem 1.1rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.table td {
  padding: 0.68rem 1.1rem;
  border-bottom: 1px solid rgba(230, 220, 205, 0.72);
  vertical-align: top;
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.table tbody tr:hover td {
  background: rgba(217, 164, 65, 0.07);
}

.table td:first-child {
  color: var(--text);
  font-family: var(--serif);
  font-weight: 600;
}

/* ---------- 11. Учебный текст, диалог, ответы ---------- */
.text-body {
  max-width: 68ch;
  font-size: clamp(1.02rem, 0.99rem + 0.2vw, 1.1rem);
  line-height: 1.8;
}

.text-body > p + p,
.text-body > * + * {
  margin-top: 1rem;
}

.text-body__lead {
  font-size: 1.14em;
  line-height: 1.62;
  color: var(--text);
}

.text-body strong {
  color: var(--green-600);
  font-weight: 700;
}

.text-body em {
  font-family: var(--serif);
}

.text-body a {
  text-decoration-thickness: 1.5px;
}

.dialog {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-width: 72ch;
  padding: clamp(1rem, 1rem + 1vw, 1.5rem);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.dialog__line {
  font-size: 1rem;
  line-height: 1.6;
}

.dialog__speaker {
  margin-right: 0.2rem;
  color: var(--terracotta-600);
  font-weight: 700;
}

.answers {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.answers > summary {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.9rem 1.1rem;
  border-radius: 16px;
  color: var(--terracotta-600);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.answers > summary::-webkit-details-marker {
  display: none;
}

.answers > summary::before {
  content: "+";
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 1.4rem;
  height: 1.4rem;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  color: var(--terracotta);
  font-family: var(--sans);
  font-size: 1.05rem;
  line-height: 1;
  transition: transform 0.25s var(--ease), background-color 0.25s ease;
}

.answers[open] > summary::before {
  transform: rotate(45deg);
  background: var(--terracotta-100);
}

.answers > ol,
.answers > ul {
  margin: 0 1.1rem 1.1rem 2.4rem;
  padding: 0;
}

.answers > p {
  padding: 0 1.1rem 1.1rem;
}

.answers li + li {
  margin-top: 0.35rem;
}

/* ---------- 12. Кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 2.6rem;
  padding: 0.6rem 1.15rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-size: 0.91rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.22s ease, color 0.22s ease, border-color 0.22s ease,
    transform 0.18s ease, box-shadow 0.22s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn--primary {
  background: var(--terracotta);
  color: #fff8ef;
  box-shadow: 0 12px 24px -16px rgba(184, 81, 42, 0.95);
}

.btn--primary:hover {
  background: var(--terracotta-600);
  color: #fff8ef;
}

.btn--ghost {
  border-color: var(--line-strong);
  background: transparent;
  color: var(--terracotta-600);
}

.btn--ghost:hover {
  border-color: var(--terracotta);
  background: var(--surface-2);
  color: var(--terracotta-700);
}

.btn--link {
  min-height: auto;
  padding: 0.2rem 0.3rem;
  border: 0;
  background: none;
  color: var(--terracotta-600);
  font-size: 0.89rem;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.btn--link:hover {
  background: none;
  color: var(--terracotta-700);
}

/* ---------- 13. Упражнения ---------- */
.ex {
  position: relative;
  margin: 0 0 clamp(1.4rem, 1.1rem + 1vw, 2.2rem);
  padding: clamp(1.15rem, 1rem + 1.2vw, 2rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  scroll-margin-top: calc(var(--header-h) + 1.5rem);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.ex:last-child {
  margin-bottom: 0;
}

.ex.is-done {
  border-color: rgba(47, 74, 60, 0.34);
  box-shadow: 0 1px 2px rgba(43, 33, 25, 0.04), 0 18px 40px -30px rgba(47, 74, 60, 0.55);
}

.ex__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 0.55rem;
}

.ex__num {
  display: grid;
  flex: none;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: var(--terracotta-100);
  color: var(--terracotta-600);
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 700;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.ex.is-done .ex__num {
  background: var(--green);
  color: #f6f1e6;
}

.ex__title {
  flex: 1 1 12ch;
  min-width: 0;
  margin: 0;
  font-size: clamp(1.14rem, 1.05rem + 0.4vw, 1.4rem);
  line-height: 1.25;
}

.ex__badge {
  flex: none;
  padding: 0.2rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  white-space: nowrap;
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.ex.is-done .ex__badge {
  border-color: rgba(47, 74, 60, 0.28);
  background: var(--green-100);
  color: var(--green-600);
}

.ex__task {
  margin: 0 0 1.1rem;
  color: var(--muted);
  font-size: 0.94rem;
}

.ex__body > .q:first-child,
.ex__body > .tf-list:first-child,
.ex__body > .gaps:first-child,
.ex__body > .match:first-child,
.ex__body > .order:first-child {
  margin-top: 0;
}

.ex__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--line);
}

.ex__score {
  margin-left: auto;
  color: var(--green-600);
  font-size: 0.88rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.ex__score:empty {
  display: none;
}

.ex__feedback {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  min-height: 1.4em;
  margin: 0.7rem 0 0;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.5;
}

.ex__feedback:empty {
  display: none;
}

.ex__feedback::before {
  content: "";
  flex: none;
  width: 0.52rem;
  height: 0.52rem;
  margin-top: 0.46em;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.75;
}

.ex__feedback.is-ok {
  color: var(--green-600);
}

.ex__feedback.is-partial {
  color: #8a6515;
}

.ex__feedback.is-bad {
  color: var(--terracotta-700);
}

.ex__feedback.is-empty {
  color: var(--muted);
}

/* вопрос */
.q + .q {
  margin-top: 1.2rem;
  padding-top: 1.2rem;
  border-top: 1px dashed rgba(230, 220, 205, 0.85);
}

.q__text {
  margin: 0 0 0.62rem;
  font-weight: 500;
  line-height: 1.55;
}

/* варианты */
.opts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: 0.5rem;
}

.opt {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.58rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.opt:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.opt input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.opt__mark {
  display: grid;
  flex: none;
  place-items: center;
  width: 1.16rem;
  height: 1.16rem;
  margin-top: 0.11rem;
  border: 2px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.opt input[type="checkbox"] + .opt__mark {
  border-radius: 6px;
}

.opt input:checked + .opt__mark {
  border-color: var(--terracotta);
  background: var(--terracotta);
}

.opt input[type="radio"]:checked + .opt__mark::after {
  content: "";
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: var(--surface);
}

.opt input[type="checkbox"]:checked + .opt__mark::after {
  content: "✓";
  color: var(--surface);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
}

.opt input:focus-visible + .opt__mark {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

.opt:has(input:focus-visible) {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

.opt:has(input:checked) {
  border-color: rgba(184, 81, 42, 0.55);
  background: var(--terracotta-050);
}

.opt__text {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.96rem;
  line-height: 1.5;
}

.opt.is-correct {
  border-color: rgba(63, 107, 77, 0.6);
  background: var(--ok-100);
}

.opt.is-correct .opt__mark {
  border-color: var(--ok);
  background: var(--ok);
}

.opt.is-correct .opt__mark::after {
  content: "✓";
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
}

.opt.is-wrong {
  border-color: rgba(168, 63, 47, 0.55);
  background: var(--danger-100);
}

.opt.is-wrong .opt__mark {
  border-color: var(--danger);
  background: var(--danger);
}

.opt.is-wrong .opt__mark::after {
  content: "×";
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1;
}

.opt.is-missing {
  border-color: var(--gold);
  border-style: dashed;
  background: var(--gold-100);
}

.opt.is-missing .opt__mark {
  border-color: var(--gold-600);
}

/* верно / неверно */
.tf-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tf-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.72rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  transition: border-color 0.25s ease, background-color 0.25s ease;
}

.tf-item__text {
  flex: 1 1 14rem;
  min-width: 0;
  margin: 0;
  font-size: 0.97rem;
}

.tf-item__controls {
  display: flex;
  flex: none;
  gap: 0.4rem;
}

.tf-btn {
  min-height: 2.2rem;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.tf-btn:hover {
  border-color: var(--terracotta);
  background: var(--terracotta-100);
  color: var(--terracotta-700);
}

.tf-btn[aria-pressed="true"] {
  border-color: var(--terracotta);
  background: var(--terracotta);
  color: #fff8ef;
}

.tf-item.is-correct {
  border-color: rgba(63, 107, 77, 0.6);
  background: var(--ok-100);
}

.tf-item.is-correct .tf-btn[aria-pressed="true"] {
  border-color: var(--ok);
  background: var(--ok);
  color: #fff;
}

.tf-item.is-wrong {
  border-color: rgba(168, 63, 47, 0.55);
  background: var(--danger-100);
}

.tf-item.is-wrong .tf-btn[aria-pressed="true"] {
  border-color: var(--danger);
  background: var(--danger);
  color: #fff;
}

.tf-item.is-missing {
  border-color: var(--gold);
  border-style: dashed;
  background: var(--gold-100);
}

.tf-btn.is-correct {
  border-color: var(--ok);
  background: var(--ok-100);
  color: var(--green-600);
}

.tf-btn.is-correct::after {
  content: " ✓";
  color: var(--ok);
}

/* пропуски */
.gaps {
  max-width: 68ch;
}

.gaps__text {
  margin: 0;
  font-size: 1.04rem;
  line-height: 2.5;
}

.gap {
  display: inline-block;
  min-width: 6.5ch;
  max-width: 100%;
  margin: 0 0.14rem;
  padding: 0.1rem 0.42rem 0.16rem;
  border: 0;
  border-bottom: 2px dashed var(--line-strong);
  border-radius: 7px 7px 0 0;
  background: rgba(217, 164, 65, 0.08);
  color: var(--text);
  font: inherit;
  font-size: 0.98em;
  text-align: center;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.gap:focus {
  border-bottom-color: var(--terracotta);
  background: var(--surface);
}

.gap:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

.gap::placeholder {
  color: var(--muted-2);
  font-size: 0.9em;
}

.gap.is-correct {
  border-bottom-color: var(--ok);
  background: var(--ok-100);
  color: var(--green-600);
}

.gap.is-wrong {
  border-bottom-color: var(--danger);
  background: var(--danger-100);
  color: var(--danger);
}

.gap.is-missing {
  border-bottom-color: var(--gold);
  background: var(--gold-100);
}

@supports (field-sizing: content) {
  .gap {
    field-sizing: content;
  }
}

/* соответствия */
.match {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(0.7rem, 1vw, 1.4rem);
  align-items: start;
}

.match__col {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
}

.match-item {
  position: relative;
  display: block;
  width: 100%;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.18s ease;
}

.match-item:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.match-item.is-selected {
  border-color: var(--terracotta);
  background: var(--terracotta-100);
  box-shadow: inset 0 0 0 1px var(--terracotta);
}

.match-item.is-matched {
  padding-right: 2.2rem;
  border-color: rgba(63, 107, 77, 0.55);
  background: var(--ok-100);
  color: var(--green-600);
  cursor: default;
}

.match-item.is-matched:hover {
  border-color: rgba(63, 107, 77, 0.55);
  background: var(--ok-100);
}

.match-item.is-matched:disabled {
  opacity: 1;
}

.match-item.is-matched::after {
  content: "✓";
  position: absolute;
  top: 50%;
  right: 0.75rem;
  transform: translateY(-50%);
  color: var(--ok);
  font-weight: 700;
}

.match-item.is-wrong {
  border-color: var(--danger);
  background: var(--danger-100);
  animation: oer-shake 0.4s var(--ease);
}

.match-item.is-revealed {
  border-style: dashed;
}

.match-item.is-missing {
  border-color: var(--gold);
  border-style: dashed;
  background: var(--gold-100);
}

@keyframes oer-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-5px);
  }
  40% {
    transform: translateX(5px);
  }
  60% {
    transform: translateX(-4px);
  }
  80% {
    transform: translateX(3px);
  }
}

/* порядок слов */
.order {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.order + .order {
  margin-top: 1.2rem;
  padding-top: 1.2rem;
  border-top: 1px dashed var(--line);
}

.order__line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  min-height: 4rem;
  padding: 0.55rem 0.7rem;
  border: 2px dashed var(--line-strong);
  border-radius: 14px;
  background: rgba(255, 253, 248, 0.65);
  transition: border-color 0.25s ease, background-color 0.25s ease;
}

.order__line:empty::before {
  content: "Перетащите слова сюда…";
  color: var(--muted-2);
  font-size: 0.84rem;
  font-style: italic;
}

.order__pool {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  min-height: 2.5rem;
}

@supports (display: flex) {
  .order__line:empty::before {
    content: "Нажимайте на слова по порядку…";
  }
}

.token {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease,
    transform 0.18s ease, box-shadow 0.2s ease;
}

.token:hover {
  border-color: var(--terracotta);
  color: var(--terracotta-600);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.order__line .token {
  border-color: #d8c6a9;
  background: #f2e8d7;
}

.order__line .token:hover {
  border-color: var(--terracotta);
}

.order.is-missing .order__line {
  border-color: var(--gold);
  background: var(--gold-100);
}

.order.is-correct .order__line {
  border-color: rgba(63, 107, 77, 0.6);
  background: var(--ok-100);
}

.order.is-wrong .order__line {
  border-color: var(--danger);
  background: var(--danger-100);
}

/* открытый ответ */
.q__answer {
  display: block;
  width: 100%;
  max-width: 62ch;
  min-height: 6.5rem;
  margin-top: 0.5rem;
  padding: 0.8rem 0.95rem;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.98rem;
  line-height: 1.6;
  resize: vertical;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.q__answer:focus {
  border-color: var(--terracotta);
  outline: none;
  box-shadow: 0 0 0 3px rgba(217, 164, 65, 0.22);
}

.q__answer::placeholder {
  color: var(--muted-2);
}

/* ---------- 14. Прогресс ---------- */
.progress {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin: 0 0 clamp(1.4rem, 1.2rem + 1vw, 2rem);
  padding: 0.85rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 253, 248, 0.9);
  box-shadow: var(--shadow-sm);
}

.progress__track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-2);
  box-shadow: inset 0 1px 2px rgba(43, 33, 25, 0.09);
}

.progress__bar {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--terracotta), var(--gold));
  transition: width 0.55s var(--ease);
}

.progress__bar.is-complete {
  background: linear-gradient(90deg, var(--green), var(--gold));
}

.progress__label {
  margin: 0;
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* ---------- 15. Шаги (план разработки) ---------- */
.steps {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.steps::before {
  content: "";
  position: absolute;
  top: 1.5rem;
  bottom: 1.5rem;
  left: 1.35rem;
  width: 2px;
  background: linear-gradient(var(--line-strong), rgba(230, 220, 205, 0));
}

.step {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.step__num {
  position: relative;
  z-index: 1;
  display: grid;
  flex: none;
  place-items: center;
  width: 2.7rem;
  height: 2.7rem;
  border: 1.5px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--terracotta-600);
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

.step__body {
  flex: 1 1 auto;
  min-width: 0;
  padding: clamp(1rem, 1rem + 0.6vw, 1.4rem);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.step__body > * + * {
  margin-top: 0.5rem;
}

.step__title {
  margin: 0;
  font-size: 1.15rem;
}

.step__body p {
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
}

.step__body strong {
  color: var(--text);
}

/* ---------- 16. Видео ---------- */
.video-figure {
  max-width: 920px;
  margin: 0;
}

.video-figure__frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: #1e1712;
  box-shadow: var(--shadow);
}

.video-figure__iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-figure__caption {
  margin: 0.85rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

/* ---------- 17. Подвал ---------- */
.site-footer {
  margin-top: clamp(2.4rem, 2rem + 3vw, 4rem);
  padding-top: clamp(2rem, 1.6rem + 2vw, 3rem);
  border-top: 3px solid var(--gold);
  background: var(--green-600);
  color: rgba(250, 246, 239, 0.8);
  font-size: 0.92rem;
}

.site-footer__inner {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: clamp(1.5rem, 1rem + 2vw, 2.5rem);
  padding-bottom: clamp(1.6rem, 1.2rem + 2vw, 2.6rem);
}

.site-footer__brand {
  margin: 0 0 0.5rem;
  color: #fdf6ec;
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 700;
}

.site-footer__text {
  max-width: 46ch;
  margin: 0 0 0.6rem;
  line-height: 1.65;
}

.site-footer__note {
  margin: 0;
  color: rgba(250, 246, 239, 0.55);
  font-size: 0.8rem;
}

.site-footer__title {
  margin: 0 0 0.65rem;
  color: var(--gold);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.site-footer__list {
  display: grid;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer a {
  color: #f3e9d7;
  text-decoration-color: rgba(217, 164, 65, 0.55);
  text-underline-offset: 3px;
}

.site-footer a:hover {
  color: var(--gold);
}

.site-footer__author p {
  margin: 0 0 0.2rem;
}

.site-footer__bottom {
  border-top: 1px solid rgba(250, 246, 239, 0.14);
  padding: 1rem 0;
}

.site-footer__bottom p {
  margin: 0;
  color: rgba(250, 246, 239, 0.55);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

/* ---------- 18. Анимации появления ---------- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.65s var(--ease), transform 0.65s var(--ease);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
  will-change: auto;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------- 19. Адаптив ---------- */
@media (max-width: 1120px) {
  .brand__sub {
    display: none;
  }

  .site-nav__link {
    padding-inline: 0.45rem;
    font-size: 0.82rem;
  }
}

@media (max-width: 980px) {
  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    position: absolute;
    top: calc(100% + 0.55rem);
    right: 0;
    left: 0;
    z-index: 80;
    padding: 0.6rem;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 0.22s ease, transform 0.25s var(--ease), visibility 0.22s;
  }

  .site-nav.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
  }

  .site-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
  }

  .site-nav__link {
    display: block;
    padding: 0.62rem 0.85rem;
    border-radius: 12px;
    font-size: 0.92rem;
    white-space: normal;
  }

  .grid--4,
  .grid--3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .site-footer__inner {
    grid-template-columns: 1fr 1fr;
  }

  .site-footer__brand-col {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .grid--2,
  .grid--3,
  .grid--4 {
    grid-template-columns: minmax(0, 1fr);
  }

  .opts {
    grid-template-columns: minmax(0, 1fr);
  }

  .ex {
    padding: 1.1rem;
    border-radius: 16px;
  }

  .ex__actions {
    gap: 0.5rem;
  }

  .ex__score {
    flex-basis: 100%;
    margin-left: 0;
  }

  .match {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
  }

  .match-item {
    padding: 0.55rem 0.7rem;
    font-size: 0.9rem;
  }

  .match-item.is-matched {
    padding-right: 1.8rem;
  }

  .tf-item {
    align-items: flex-start;
  }

  .site-footer__inner {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 1.9rem 0;
  }

  .page-hero {
    padding-top: 1.8rem;
  }

  .steps::before {
    left: 1.2rem;
  }

  .step {
    gap: 0.7rem;
  }

  .step__num {
    width: 2.4rem;
    height: 2.4rem;
    font-size: 1rem;
  }
}

@media (max-width: 520px) {
  :root {
    --header-h: 64px;
  }

  .container {
    width: calc(100% - 1.75rem);
  }

  .brand__mark {
    width: 30px;
    height: 30px;
  }

  .brand__title {
    font-size: 1.02rem;
  }

  .nav-toggle__label {
    display: none;
  }

  .nav-toggle {
    padding: 0.5rem 0.7rem;
  }

  .page-hero__title {
    font-size: clamp(1.85rem, 1.3rem + 4.5vw, 2.5rem);
  }

  .chip {
    font-size: 0.76rem;
  }

  .card {
    border-radius: 16px;
  }

  .ex__head {
    gap: 0.6rem;
  }

  .ex__num {
    width: 2.1rem;
    height: 2.1rem;
    font-size: 0.98rem;
  }

  .ex__badge {
    font-size: 0.68rem;
  }

  .btn {
    min-height: 2.5rem;
    padding: 0.58rem 1rem;
    font-size: 0.87rem;
  }

  .gaps__text {
    line-height: 2.65;
  }

  .gap {
    min-width: 5.5ch;
    margin-inline: 0.1rem;
  }

  .match {
    gap: 0.45rem;
  }

  .match-item {
    padding: 0.5rem 0.6rem;
    font-size: 0.85rem;
    line-height: 1.4;
  }

  .match-item.is-matched {
    padding-right: 1.5rem;
  }

  .match-item.is-matched::after {
    right: 0.5rem;
  }

  .tf-item {
    padding: 0.65rem 0.7rem;
  }

  .tf-item__controls {
    gap: 0.3rem;
  }

  .tf-btn {
    padding: 0.36rem 0.65rem;
    font-size: 0.78rem;
  }

  .token {
    padding: 0.36rem 0.65rem;
    font-size: 0.9rem;
  }

  .order__line {
    min-height: 3.4rem;
  }

  .ex__actions .btn {
    flex: 1 1 auto;
  }

  .ex__actions .btn--link {
    flex-basis: 100%;
    justify-content: flex-start;
  }

  .video-figure__frame {
    border-radius: 14px;
  }
}

/* очень узкие экраны — минимальные поля */
@media (max-width: 380px) {
  .match {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.35rem;
  }

  .match__col[data-side="left"] {
    gap: 0.35rem;
  }
}

/* ---------- 20. Печать ---------- */
@media print {
  :root {
    --text: #000;
    --muted: #333;
    --line: #c9c9c9;
    --line-strong: #999;
    --surface: #fff;
    --surface-2: #fff;
    --bg: #fff;
  }

  html,
  body {
    background: #fff !important;
    background-image: none !important;
    color: #000 !important;
    font-size: 11pt;
  }

  .skip-link,
  .site-header,
  .site-footer,
  .nav-toggle,
  .site-nav,
  .ex__actions,
  .progress,
  .reveal {
    display: none !important;
  }

  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }

  main {
    padding: 0;
  }

  .container {
    width: 100%;
    max-width: none;
  }

  .page-hero {
    padding: 0 0 1rem;
  }

  .page-hero::before {
    display: none;
  }

  .section {
    padding: 1rem 0;
    break-inside: auto;
  }

  .section__head,
  .text-body,
  .dialog,
  .note,
  .card,
  .step__body,
  .table-wrap,
  .ex,
  .video-figure {
    max-width: none;
    box-shadow: none !important;
    break-inside: avoid;
  }

  .ex {
    border-color: #bbb;
    padding: 0.8rem 0;
    margin-bottom: 1rem;
  }

  .ex,
  .card,
  .note,
  .answers,
  .dialog,
  .step__body,
  .table-wrap {
    background: #fff !important;
    border-color: #ccc !important;
  }

  .grid {
    display: block;
  }

  .grid > * + * {
    margin-top: 0.8rem;
  }

  .card {
    padding: 0.6rem 0;
    border: 0;
  }

  .card:hover {
    transform: none;
    box-shadow: none;
  }

  .card--accent {
    background: #fff !important;
    color: #000 !important;
  }

  .card--accent .card__title,
  .card--accent .card__text,
  .card--accent .card__meta {
    color: #000 !important;
  }

  details > summary {
    display: none;
  }

  details > *:not(summary) {
    display: block !important;
  }

  .answers {
    padding-left: 0;
  }

  .answers > ol,
  .answers > ul {
    margin-left: 1.4rem;
  }

  a {
    color: #000;
    text-decoration: underline;
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 8.5pt;
    color: #444;
    word-break: break-all;
  }

  .site-nav__link.is-active {
    background: none;
    color: #000;
  }

  .opt,
  .tf-item,
  .match-item,
  .token,
  .gap {
    border-color: #999 !important;
    background: #fff !important;
    color: #000 !important;
  }

  .opt.is-correct,
  .tf-item.is-correct,
  .match-item.is-matched,
  .gap.is-correct,
  .order.is-correct .order__line {
    outline: 1.5px solid #000;
  }
}
