/* ==========================================================================
   «Имя России» — шаблон DLE
   Основные стили: дизайн-токены, сетка, компоненты, страницы.
   ========================================================================== */

/* ---------- 1. Токены ---------- */
:root {
  --paper: #f5f1e8;
  --paper-2: #efe9da;
  --paper-3: #e8e1cf;
  --card: #fffdf6;
  --line: #e0d8c4;
  --line-2: #e6dfcd;
  --line-3: #d5cbb2;
  --line-4: #c8bda1;
  --ink: #2b2620;
  --ink-2: #57503f;
  --muted: #706754;      /* WCAG 1.4.3: ≥ 4,5:1 на светлом фоне (было #8a7f68 – 3,5:1) */
  --muted-2: #b0a88f;
  --muted-3: #a59e8b;    /* WCAG 1.4.3: ≥ 4,5:1 на тёмной полосе (было #8f866e – 4,1:1) */
  --accent: #7a1f1f;
  --accent-2: #5c1414;
  --gold: #d8b98a;
  --gold-2: #f0dcb8;
  --dark: #2b2620;
  --dark-2: #3a342b;
  --dark-3: #181410;
  --dark-line: #4a4335;
  --dark-line-2: #3f382e;
  --dark-text: #cfc7ae;
  --rose: #e8cfc4;

  --serif: 'Prata', Georgia, 'Times New Roman', serif;
  --sans: 'Golos Text', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;

  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 18px;
  --radius-xl: 22px;
  --shadow-sm: 0 10px 20px rgba(43, 38, 32, .08);
  --shadow: 0 14px 28px rgba(43, 38, 32, .12);
  --shadow-lg: 0 26px 52px rgba(43, 38, 32, .16);

  --container: 1200px;
  --gutter: 32px;
  --header-offset: 140px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- 2. База ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-offset);
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.6 var(--sans);
  letter-spacing: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg, video, canvas, iframe { max-width: 100%; }
img { height: auto; border: 0; vertical-align: middle; }
svg { vertical-align: middle; }

a { color: var(--accent); text-decoration: none; transition: color .2s, background-color .2s, border-color .2s; }
a:hover { color: var(--accent-2); }

p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.4em; }
b, strong { font-weight: 700; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
table { border-collapse: collapse; border-spacing: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 .6em;
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.2;
  color: inherit;
  letter-spacing: 0;
}
h1 { font-size: clamp(34px, 4.6vw, 52px); line-height: 1.1; }
h2 { font-size: clamp(28px, 3.4vw, 38px); }
h3 { font-size: 22px; }
h4 { font-size: 19px; }
h5 { font-size: 17px; }
h6 { font-size: 15px; }

::selection { background: var(--accent); color: var(--paper); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.section--dark :focus-visible, .hero-slider :focus-visible, .site-footer :focus-visible, .topbar :focus-visible { outline-color: var(--gold); }

.i { width: 1.2em; height: 1.2em; flex: none; display: inline-block; vertical-align: -.2em; }

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 200;
  padding: 10px 18px; border-radius: 999px;
  background: var(--accent); color: var(--paper); font-weight: 600;
  transition: top .2s;
}
.skip-link:focus { top: 12px; color: var(--paper); }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Разделы сайта: средняя / начальная школа */
body:not(.section-primary) .only-primary { display: none !important; }
body.section-primary .only-middle { display: none !important; }

/* ---------- 3. Сетка и секции ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}
.container--narrow { max-width: 880px; }

.site-main { display: block; min-height: 40vh; }
.site-main:focus { outline: none; }

.section { padding: 72px 0; }
.section--tight { padding: 56px 0; }
.section--alt { background: var(--paper-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section--dark { background: var(--dark); color: var(--paper); }
.section--accent { background: var(--accent); color: var(--paper); }

.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px 24px; margin-bottom: 36px; flex-wrap: wrap;
}
.section-head--stack { display: block; }
.section-head--stack .section-title { margin-bottom: 12px; }
.section-head--stack .section-lead { margin: 0; }
.section-head .section-title { margin: 0; }
.section-title { font-family: var(--serif); font-size: clamp(28px, 3.4vw, 38px); font-weight: 400; line-height: 1.2; margin: 0 0 12px; }
.section-lead { margin: 0 0 36px; max-width: 640px; font-size: 16px; color: var(--ink-2); text-wrap: pretty; }
.section-head + .section-lead { margin-top: -24px; }
.section--dark .section-lead { color: var(--muted-2); }
.section-link { font-weight: 600; font-size: 15px; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.section-link .i { transition: transform .2s; }
.section-link:hover .i { transform: translateX(3px); }
.section--dark .section-link { color: var(--gold); }
.section--dark .section-link:hover { color: var(--gold-2); }

.eyebrow {
  margin: 0 0 16px;
  font-size: 13px; line-height: 1.4;
  letter-spacing: .18em; text-transform: uppercase;
  font-weight: 700; color: var(--accent);
}
.eyebrow--line { display: flex; align-items: center; gap: 12px; }
.eyebrow--muted { color: var(--muted); font-weight: 600; }
.eyebrow--gold { color: var(--gold); }

.grid { display: grid; gap: 20px; }
.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)); }

/* ---------- 4. Кнопки, чипы, карточки ---------- */
.btn, .bbcodes {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: auto; min-height: 46px;
  padding: 12px 26px;
  border: 1.5px solid transparent; border-radius: 999px;
  background: var(--accent); background-image: none;
  color: var(--paper) !important;
  font: 600 15px/1.25 var(--sans);
  letter-spacing: 0; text-transform: none; text-decoration: none !important;
  box-shadow: none; cursor: pointer; white-space: nowrap;
  transition: background-color .25s, border-color .25s, color .25s, box-shadow .25s, transform .25s;
}
.btn:hover, .bbcodes:hover { background: var(--accent-2); background-image: none; color: var(--paper) !important; box-shadow: 0 10px 26px rgba(122, 31, 31, .3); }
.btn:active, .bbcodes:active { transform: translateY(1px); background: var(--accent-2); box-shadow: none; }
.btn b { font-weight: inherit; }
.btn .i { width: 18px; height: 18px; }
.btn--sm { min-height: 40px; padding: 9px 20px; font-size: 14.5px; }
.btn--lg { min-height: 54px; padding: 15px 32px; font-size: 16px; }
.btn--outline { background: transparent; border-color: var(--line-4); color: var(--ink) !important; }
.btn--outline:hover { background: transparent; border-color: var(--accent); color: var(--accent) !important; box-shadow: none; }
.btn--light { background: var(--paper); color: var(--accent) !important; }
.btn--light:hover { background: #fff; color: var(--accent-2) !important; box-shadow: 0 10px 26px rgba(0, 0, 0, .18); }
.btn--ghost-light { background: transparent; border-color: rgba(245, 241, 232, .45); color: var(--paper) !important; }
.btn--ghost-light:hover { background: rgba(245, 241, 232, .1); border-color: var(--paper); color: var(--paper) !important; box-shadow: none; }
.btn--gold { background: var(--gold); color: var(--dark) !important; }
.btn--gold:hover { background: var(--gold-2); color: var(--dark) !important; box-shadow: 0 10px 26px rgba(0, 0, 0, .2); }
.btn[disabled], .btn.disabled { opacity: .55; pointer-events: none; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0;
  border: 1.5px solid var(--line-3); border-radius: 50%;
  background: transparent; color: var(--ink);
  transition: border-color .2s, color .2s, background-color .2s;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.icon-btn .i { width: 20px; height: 20px; }

.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 18px; border-radius: 999px;
  border: 1.5px solid var(--line-3); background: transparent;
  color: var(--ink-2); font: 600 14px/1.3 var(--sans);
  transition: all .2s; cursor: pointer; text-decoration: none;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.is-active, .chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.chip__count { font-size: 12px; opacity: .7; font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; list-style: none; }

.card {
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: 28px;
}
.card--hover { transition: border-color .2s, box-shadow .2s, transform .2s; }
.card--hover:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); transform: translateY(-3px); }
.card__kicker { margin: 0 0 12px; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.card__title { margin: 0 0 10px; font-family: var(--serif); font-size: 22px; line-height: 1.3; }
.card__text { margin: 0; font-size: 16px; line-height: 1.6; color: var(--ink-2); text-wrap: pretty; }

.admin-edit, .edit-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--muted);
  border: 1px dashed var(--line-4); border-radius: 999px; padding: 4px 12px;
}
.admin-edit:hover, a:hover > .admin-edit { color: var(--accent); border-color: var(--accent); }

/* ---------- 5. Шапка ---------- */
.site-header { position: sticky; top: 0; z-index: 60; }

.topbar { background: var(--dark); color: var(--muted-2); font-size: 12.5px; letter-spacing: .08em; }
.topbar__in { display: flex; align-items: center; gap: 12px 28px; min-height: 36px; padding-top: 6px; padding-bottom: 6px; }
.section-switch { display: flex; align-items: center; gap: 24px; }
.section-switch__link {
  color: var(--muted-3); font-weight: 700; text-transform: uppercase;
  padding: 2px 0; border-bottom: 2px solid transparent; line-height: 1.3;
}
.section-switch__link:hover { color: var(--paper); }
.section-middle .section-switch__link[data-section-link="middle"],
.section-primary .section-switch__link[data-section-link="primary"] { color: var(--paper); border-bottom-color: var(--gold); }
.topbar__mail { margin-left: auto; color: var(--muted-2); display: inline-flex; align-items: center; gap: 8px; }
.topbar__mail:hover { color: var(--paper); }
.topbar__label { color: var(--muted-3); }
.topbar__label b { color: var(--gold); font-weight: 600; }
.topbar__social { display: inline-flex; color: var(--muted-2); }
.topbar__social:hover { color: var(--paper); }
.topbar__social .i { width: 18px; height: 18px; }

.mainbar {
  position: relative;
  background: rgba(245, 241, 232, .94);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .3s;
}
.is-scrolled .mainbar { box-shadow: 0 8px 24px rgba(43, 38, 32, .08); }
.mainbar__in { display: flex; align-items: center; gap: 16px 32px; padding-top: 10px; padding-bottom: 10px; min-width: 0; }

.logo { display: flex; align-items: center; flex-shrink: 0; padding: 6px 10px; border-radius: 9px;}
.logo img { display: block; height: 64px; width: auto; transition: height .3s var(--ease); }
.is-scrolled .logo img { height: 52px; }

.main-nav { display: flex; align-items: center; gap: 12px 22px; margin-left: auto; font-size: 14.5px; font-weight: 500; flex-wrap: wrap; justify-content: flex-end; }
.main-nav a { color: var(--ink); padding: 6px 0; position: relative; }
.main-nav a:hover, .main-nav a.is-active { color: var(--accent); }
.main-nav a.is-active::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--accent); border-radius: 2px; }
.main-nav a.btn { padding: 9px 20px; color: var(--paper) !important; }
.main-nav a.btn::after { display: none; }
.main-nav a.btn.is-active { background: var(--accent-2); }
.mainbar__tools { display: flex; align-items: center; gap: 10px; }

.burger { display: none; position: relative; }
.burger span, .burger span::before, .burger span::after {
  content: ""; position: absolute; left: 50%; width: 18px; height: 1.8px; margin-left: -9px;
  background: currentColor; border-radius: 2px; transition: transform .3s, opacity .3s;
}
.burger span { top: 50%; margin-top: -1px; }
.burger span::before { top: -6px; left: 0; margin-left: 0; }
.burger span::after { top: 6px; left: 0; margin-left: 0; }
.menu-open .burger span { background: transparent; }
.menu-open .burger span::before { transform: translateY(6px) rotate(45deg); }
.menu-open .burger span::after { transform: translateY(-6px) rotate(-45deg); }

.site-search { border-top: 1px solid var(--line); background: var(--paper); }
.site-search__form { display: flex; gap: 12px; padding-top: 14px; padding-bottom: 14px; }
.site-search__form input[type="search"] {
  flex: 1; height: 50px; padding: 0 22px; border-radius: 999px;
  border: 1.5px solid var(--line-3); background: var(--card); box-shadow: none;
  -webkit-appearance: none; appearance: none; box-sizing: border-box; font-size: 16px;
}
.site-search__form input[type="search"]:focus { border-color: var(--accent); outline: none; }

/* Мобильное меню */
.mobile-menu { position: fixed; inset: 0; z-index: 90; }
.mobile-menu__backdrop { position: absolute; inset: 0; background: rgba(24, 20, 16, .55); opacity: 0; transition: opacity .3s; }
.mobile-menu__panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(380px, 88vw);
  display: flex; flex-direction: column; gap: 24px;
  padding: 22px 26px 32px; overflow-y: auto;
  background: var(--paper); box-shadow: -20px 0 60px rgba(0, 0, 0, .25);
  transform: translateX(104%); transition: transform .35s var(--ease);
}
.menu-open .mobile-menu__backdrop { opacity: 1; }
.menu-open .mobile-menu__panel { transform: none; }
.mobile-menu__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mobile-menu__top a:first-child { display: inline-flex; padding: 6px 8px; border-radius: 8px; background: var(--dark); }
.mobile-menu__top img { height: 44px; width: auto; }
.mobile-menu__switch { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 5px; border-radius: 999px; background: var(--paper-2); border: 1px solid var(--line); }
.mobile-menu__switch a { text-align: center; padding: 9px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.section-middle .mobile-menu__switch a[data-section-link="middle"],
.section-primary .mobile-menu__switch a[data-section-link="primary"] { background: var(--dark); color: var(--paper); }
.mobile-menu__nav { display: flex; flex-direction: column; }
.mobile-menu__nav a { padding: 14px 0; border-bottom: 1px solid var(--line); color: var(--ink); font-family: var(--serif); font-size: 21px; display: flex; justify-content: space-between; align-items: center; }
.mobile-menu__nav a .i { color: var(--muted); }
.mobile-menu__nav a.is-active { color: var(--accent); }
.mobile-menu__contacts { display: flex; flex-direction: column; gap: 10px; font-size: 15px; color: var(--ink-2); margin-top: auto; }
.mobile-menu__contacts a { color: var(--ink-2); display: inline-flex; align-items: center; gap: 10px; }
.menu-open { overflow: hidden; }

/* ---------- 6. Слайдер (герой главной) ---------- */
.hero-slider {
  position: relative; isolation: isolate; overflow: hidden;
  background: var(--dark-3); color: var(--paper);
  --slide-duration: 8000ms;
}
.hero-slider__track { display: grid; }
.slide {
  grid-area: 1 / 1;
  position: relative; z-index: 0;
  display: flex; align-items: flex-end;
  min-height: clamp(560px, calc(100vh - 128px), 780px);
  opacity: 0; visibility: hidden;
  transition: opacity 1s var(--ease), visibility 0s linear 1s;
}
.slide.is-active { opacity: 1; visibility: visible; z-index: 1; transition: opacity 1s var(--ease), visibility 0s; }
.slide__bg { position: absolute; inset: 0; z-index: -2; overflow: hidden; background: var(--dark-2); }
.slide__bg img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 55%; transform: scale(1.02); will-change: transform; }
.slide.is-active .slide__bg img { animation: kenburns 16s ease-out both; }
.slide__bg--mirror img { object-position: center 70%; }
.slide::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, rgba(24, 20, 16, .86) 0%, rgba(24, 20, 16, .64) 48%, rgba(24, 20, 16, .38) 100%),
    linear-gradient(0deg, rgba(24, 20, 16, .88) 0%, rgba(24, 20, 16, .2) 55%, rgba(24, 20, 16, .35) 100%);
}
.slide__content { position: relative; width: 100%; padding-top: 88px; padding-bottom: 150px; }
.slide__eyebrow {
  display: flex; align-items: center; gap: 12px; margin: 0 0 22px;
  font-size: 13px; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); font-weight: 700;
}
.slide__title {
  margin: 0 0 32px;
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(34px, 4.9vw, 62px); line-height: 1.08;
  max-width: none;
  color: var(--paper);
}
.slide__row { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 28px 72px; align-items: end; }
.slide__lead { margin: 0 0 30px; font-size: 18px; line-height: 1.65; color: #e6dfcd; max-width: 700px; text-wrap: pretty; }
.slide__actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* Логотип программы справа в слайдере – общий для всех слайдов, на светлой плашке */
.hero-slider { --brand-w: clamp(230px, 20vw, 300px); --brand-gap: clamp(40px, 4.5vw, 72px); --slide-pt: 64px; --slide-pb: 128px; }
.hero-slider__brand {
  position: absolute; left: 0; right: 0; top: var(--slide-pt); bottom: var(--slide-pb); z-index: 2;
  display: flex; align-items: center;
  pointer-events: none;
}
.hero-slider__brand-in { display: flex; justify-content: flex-end; }
.hero-slider__brand picture {
  display: block; width: var(--brand-w); padding: 18px;
  background: linear-gradient(180deg, #fbf8f0 0%, #f2ebdb 100%);
  border: 1px solid rgba(216, 185, 138, .9); border-radius: 26px;
  box-shadow: 0 0 0 7px rgba(245, 241, 232, .12), 0 30px 70px rgba(0, 0, 0, .5);
}
.hero-slider__brand img { display: block; width: 100%; height: auto; }

@media (min-width: 961px) {
  /* текст – одной колонкой слева, справа место под плашку с логотипом */
  .hero-slider .slide__content {
    padding-top: var(--slide-pt); padding-bottom: var(--slide-pb);
    padding-right: calc(var(--gutter) + var(--brand-w) + var(--brand-gap));
  }
  .hero-slider .slide__title { font-size: clamp(34px, 3.3vw, 48px); line-height: 1.1; margin-bottom: 24px; }
  .hero-slider .slide__row { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .hero-slider .slide__lead { margin-bottom: 26px; max-width: 760px; font-size: 17px; }
  .hero-slider .slide__facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 28px; border-top: 1px solid rgba(216, 185, 138, .35); }
  .hero-slider .slide__facts li { border-bottom: 0; padding: 16px 0 0; font-size: 14px; line-height: 1.45; align-items: flex-start; }
  .hero-slider .slide__facts li b { font-size: 24px; min-width: 0; }
  .hero-slider .slide__facts li .i { transform: translateY(3px); }
  .hero-slider .slide__quote { max-width: 620px; font-size: 19px; }
}
.slide__facts { list-style: none; margin: 0; padding: 0; border-top: 1px solid rgba(216, 185, 138, .35); }
.slide__facts li { padding: 14px 0; border-bottom: 1px solid rgba(216, 185, 138, .22); font-size: 15px; line-height: 1.5; color: var(--dark-text); display: flex; gap: 14px; align-items: baseline; }
.slide__facts li b { font-family: var(--serif); font-weight: 400; font-size: 26px; line-height: 1; color: var(--gold); min-width: 46px; white-space: nowrap; flex: none; }
.slide__facts li .i { color: var(--gold); width: 16px; height: 16px; flex: none; transform: translateY(2px); }
.slide__names { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.slide__names li { padding: 7px 14px; border-radius: 999px; border: 1px solid rgba(216, 185, 138, .4); font-size: 14px; color: var(--gold-2); }
.slide__quote { margin: 0; padding-left: 22px; border-left: 3px solid var(--gold); font-family: var(--serif); font-size: 20px; line-height: 1.55; color: var(--paper); }
.slide__quote cite { display: block; margin-top: 10px; font: 500 13px/1.4 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--gold); font-style: normal; }

.slide.is-active .slide__eyebrow,
.slide.is-active .slide__title,
.slide.is-active .slide__row { animation: fadeUp .9s var(--ease) both; }
.slide.is-active .slide__title { animation-delay: .12s; }
.slide.is-active .slide__row { animation-delay: .26s; }

.hero-slider__controls { position: absolute; left: 0; right: 0; bottom: 34px; z-index: 5; }
.hero-slider__controls-in { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.slider-tabs { display: flex; gap: 22px; flex: 1; max-width: 760px; }
.slider-tab {
  flex: 1; min-width: 0; padding: 0; border: 0; background: none; text-align: left;
  color: rgba(245, 241, 232, .6); font: 600 13px/1.3 var(--sans); letter-spacing: .06em;
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; row-gap: 10px;
  transition: color .2s;
}
.slider-tab:hover, .slider-tab.is-active { color: var(--paper); }
.slider-tab__num { font-family: var(--serif); font-weight: 400; font-size: 15px; color: var(--gold); letter-spacing: 0; }
.slider-tab__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-transform: uppercase; }
.slider-tab__bar { grid-column: 1 / -1; height: 2px; border-radius: 2px; background: rgba(245, 241, 232, .22); overflow: hidden; }
.slider-tab__bar i { display: block; height: 100%; width: 0; background: var(--gold); border-radius: 2px; }
.slider-tab.is-active .slider-tab__bar i { width: 100%; }
.hero-slider.is-autoplay .slider-tab.is-active .slider-tab__bar i { width: 0; animation: sliderProgress var(--slide-duration) linear forwards; }
.hero-slider.is-paused .slider-tab.is-active .slider-tab__bar i { animation-play-state: paused; }
.slider-arrows { display: flex; gap: 10px; }
.slider-arrow {
  width: 50px; height: 50px; border-radius: 50%; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid rgba(245, 241, 232, .4); background: rgba(24, 20, 16, .25); color: var(--paper);
  transition: all .2s;
}
.slider-arrow:hover { border-color: var(--gold); color: var(--gold); background: rgba(24, 20, 16, .5); }
.slider-arrow .i { width: 20px; height: 20px; }
html:not(.js) .hero-slider__controls { display: none; }
.hero-slider--single .hero-slider__controls { display: none; }
.hero-slider--single .slide__content { padding-bottom: 88px; }

/* ---------- 7. Главная: секции ---------- */
.stats-section { padding: 64px 0 8px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.stat { background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 28px; }
.stat__num { margin: 0; font-family: var(--serif); font-size: 44px; line-height: 1.15; color: var(--accent); }
.stat__label { margin: 6px 0 0; font-size: 15px; line-height: 1.5; color: var(--ink-2); }

.feature { display: flex; flex-direction: column; gap: 12px; }
.feature .card__kicker { margin: 0; }

.offer { border-top: 3px solid var(--accent); padding-top: 24px; display: flex; flex-direction: column; gap: 12px; }
.offer__title { margin: 0; font-family: var(--serif); font-size: 22px; font-weight: 400; }
.offer__text { margin: 0; font-size: 16px; line-height: 1.6; color: var(--ink-2); text-wrap: pretty; }

/* Внеурочная деятельность и целевая аудитория (главная средней школы) */
.extra-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 32px 56px; align-items: start; }
.extra-main p { margin: 0 0 16px; font-size: 17px; line-height: 1.7; color: var(--dark-text); text-wrap: pretty; }
.extra-main p:last-child { margin-bottom: 0; }
.extra-main .extra-main__lead { font-family: var(--serif); font-size: 23px; line-height: 1.45; color: var(--paper); }
.extra-aside {
  padding: 30px 30px 28px; border: 1px solid var(--dark-line); border-top: 3px solid var(--gold);
  border-radius: var(--radius); background: var(--dark-2);
}
.extra-aside p { margin: 0 0 14px; font-size: 16px; line-height: 1.65; color: var(--dark-text); }
.extra-aside p:last-child { margin-bottom: 0; }
.extra-aside__title { margin: 0 0 14px; font-family: var(--serif); font-size: 24px; font-weight: 400; color: var(--paper); }
.extra-aside .extra-aside__num { margin-bottom: 12px; font-family: var(--serif); font-size: 46px; line-height: 1; color: var(--gold); }
.extra-aside__num span { font-family: var(--sans); font-size: 15px; letter-spacing: .06em; text-transform: uppercase; color: var(--gold-2); margin-left: 6px; }
.extra-aside .extra-aside__accent { font-weight: 600; color: var(--paper); }

.step { background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 26px; display: flex; flex-direction: column; gap: 10px; }
.step__num { margin: 0; font-family: var(--serif); font-size: 30px; line-height: 1.1; color: #988659; }
.step__title { margin: 0; font: 700 17px/1.35 var(--sans); }
.step__text { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--ink-2); }
a.step { color: var(--ink); transition: border-color .2s, box-shadow .2s, transform .2s; }
a.step:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); transform: translateY(-3px); color: var(--ink); }
a.step:hover .step__num { color: var(--accent); }

.tool { display: flex; flex-direction: column; gap: 8px; color: var(--ink); background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 26px; transition: border-color .2s, box-shadow .2s, transform .2s; }
.tool:hover { color: var(--ink); border-color: var(--accent); box-shadow: var(--shadow-sm); transform: translateY(-3px); }
.tool__icon { width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: var(--paper-2); color: var(--accent); margin-bottom: 6px; }
.tool__icon .i { width: 22px; height: 22px; }
.tool__title { font-size: 17px; font-weight: 700; }
.tool__text { font-size: 14.5px; line-height: 1.5; color: var(--ink-2); }

/* Лента героев (горизонтальная прокрутка) */
.rail { position: relative; }
.rail__track {
  display: grid; grid-auto-flow: column;
  grid-auto-columns: calc((100% - 3 * 18px) / 4);
  gap: 18px; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-behavior: smooth;
  scrollbar-width: none; -ms-overflow-style: none;
  padding-bottom: 4px;
}
.rail__track::-webkit-scrollbar { display: none; }
.rail__track > * { scroll-snap-align: start; }
.rail__nav { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }
.rail.is-static .rail__nav { display: none; }
.rail__btn { width: 46px; height: 46px; border-radius: 50%; padding: 0; display: inline-flex; align-items: center; justify-content: center; border: 1.5px solid var(--line-3); background: transparent; color: var(--ink); transition: all .2s; }
.rail__btn:hover { border-color: var(--accent); color: var(--accent); }
.rail__btn[disabled] { opacity: .35; pointer-events: none; }
.rail__btn .i { width: 20px; height: 20px; }
.section--dark .rail__btn { border-color: var(--dark-line); color: var(--paper); }
.section--dark .rail__btn:hover { border-color: var(--gold); color: var(--gold); }
.rail__track:empty { display: none; }
.rail__track:empty ~ .rail__nav { display: none; }
.rail-empty { display: none; padding: 34px; border: 1px dashed var(--line-4); border-radius: var(--radius); color: var(--ink-2); }
.rail__track:empty ~ .rail-empty { display: block; }
.section--dark .rail-empty { border-color: var(--dark-line); color: var(--muted-2); }
.rail-empty p:last-child { margin-bottom: 0; }

/* CTA */
.cta { background: var(--accent); color: var(--paper); }
.cta__in { display: flex; align-items: center; justify-content: space-between; gap: 40px; flex-wrap: wrap; padding-top: 64px; padding-bottom: 64px; }
.cta__text { max-width: 620px; }
.cta__title { margin: 0 0 12px; font-family: var(--serif); font-size: clamp(26px, 3vw, 34px); font-weight: 400; line-height: 1.25; }
.cta__lead { margin: 0; font-size: 16px; line-height: 1.6; color: var(--rose); }
.cta__actions { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.cta__phone { font-size: 15px; color: var(--rose); }
.cta__phone:hover { color: #fff; }
.cta--form .cta__in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: start; gap: 48px; }
.cta--form .cta__actions { margin-top: 28px; }
.cta__form { background: var(--card); color: var(--ink); border-radius: var(--radius-lg); padding: 30px; box-shadow: 0 26px 52px rgba(24, 20, 16, .28); }
.cta__form-title { margin: 0 0 18px; font-family: var(--serif); font-size: 22px; color: var(--ink); }

/* Партнёры */
.partners { padding: 56px 0; }
.partners__grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 20px; align-items: stretch; }
.partner {
  display: flex; align-items: center; justify-content: center; min-height: 96px; padding: 16px;
  background: var(--card); border: 1px solid var(--line-2); border-radius: 12px;
  transition: border-color .25s, transform .25s, box-shadow .25s;
}
.partner:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: var(--shadow-sm); }
.partner img { max-width: 100%; max-height: 66px; object-fit: contain; }

/* ---------- 8. Внутренние страницы: шапка страницы ---------- */
.page-head { padding: 64px 0 28px; }
.page-head--line { border-bottom: 1px solid var(--line); padding-bottom: 40px; }
.page-title { margin: 0 0 18px; font-family: var(--serif); font-size: clamp(34px, 4.6vw, 52px); line-height: 1.1; font-weight: 400; max-width: 900px; animation: fadeUp .7s var(--ease) both; }
.page-lead { margin: 0; max-width: 680px; font-size: 18px; line-height: 1.6; color: var(--ink-2); text-wrap: pretty; }
.page-head__tools { margin-top: 20px; display: flex; gap: 10px; flex-wrap: wrap; }
.toc { display: flex; flex-wrap: wrap; gap: 10px 12px; margin-top: 30px; }
.toc a { border: 1.5px solid var(--line-3); border-radius: 999px; padding: 9px 18px; color: var(--ink-2); font-size: 14.5px; font-weight: 600; }
.toc a:hover { border-color: var(--accent); color: var(--accent); }

.back-link { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.back-link .i { width: 16px; height: 16px; transition: transform .2s; }
.back-link:hover .i { transform: translateX(-3px); }

/* Хлебные крошки DLE ({speedbar}) */
.speedbar { margin: 28px 0 0; font-size: 13.5px; color: var(--muted); }
.speedbar .over { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.speedbar a { color: var(--muted); }
.speedbar a:hover { color: var(--accent); }
.speedbar span[itemprop], .speedbar span { display: inline; }
.page-head .speedbar { margin: 0 0 22px; }

/* Сообщения DLE ({info}) */
.page-info:empty { display: none; }
.page-info { max-width: var(--container); margin: 28px auto 0; padding: 0 var(--gutter); }
.page-landing .page-info { display: none; }
.alert, .info-box {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 20px 24px; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--line-2); border-left: 4px solid var(--accent);
  color: var(--ink-2); font-size: 15.5px; line-height: 1.6;
}
.alert b, .alert__title { display: block; margin-bottom: 4px; color: var(--ink); font-size: 16px; }
.alert .i { color: var(--accent); width: 22px; height: 22px; margin-top: 2px; }
.block + .block { margin-top: 20px; }

/* ---------- 9. Карточки героев и таймлайн ---------- */
.hero-card { position: relative; }
.hero-card__link { display: flex; flex-direction: column; height: 100%; color: var(--ink); background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; transition: border-color .18s, transform .18s, box-shadow .18s; }
.hero-card__link:hover { color: var(--ink); border-color: var(--accent); transform: translateY(-3px); box-shadow: var(--shadow); }
.hero-card__media { display: block; position: relative; height: 170px; background: var(--paper-3); overflow: hidden; }
.hero-card__media img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 25%; transition: transform .5s var(--ease); }
.hero-card__link:hover .hero-card__media img { transform: scale(1.04); }
.hero-card__body { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px 20px; }
.hero-card__dates { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); font-weight: 700; min-height: 1em; }
.hero-card__dates:empty { display: none; }
.hero-card__name { font-family: var(--serif); font-size: 19px; line-height: 1.3; }
.hero-card__role { font-size: 13.5px; color: var(--muted); }
.hero-card__role:empty { display: none; }
.hero-card__excerpt { font-size: 14.5px; color: var(--ink-2); line-height: 1.55; }
.hero-card__more { margin-top: auto; padding-top: 6px; font-size: 14px; font-weight: 600; color: var(--accent); display: inline-flex; align-items: center; gap: 6px; }
.hero-card .edit-link, .hero-card > a[onclick] { position: absolute; top: 10px; right: 10px; z-index: 3; background: var(--card); padding: 3px 10px; border-radius: 999px; font-size: 12px; border: 1px solid var(--line-3); color: var(--muted); }
.hero-card.is-noimg .hero-card__media img { opacity: .9; }

/* Вариант «плитка» — в тёмной ленте на главной */
.heroes-rail .hero-card__link { position: relative; height: 300px; border: 0; background: var(--dark-2); color: var(--paper); }
.heroes-rail .hero-card__link:hover { color: var(--paper); transform: translateY(-4px); box-shadow: 0 20px 40px rgba(0, 0, 0, .35); }
.heroes-rail .hero-card__media { position: absolute; inset: 0; height: auto; background: var(--dark-2); }
.heroes-rail .hero-card__body {
  position: absolute; inset: 0; justify-content: flex-end; gap: 4px; padding: 20px;
  background: linear-gradient(180deg, transparent 38%, rgba(24, 20, 16, .92) 100%);
}
.heroes-rail .hero-card__dates { color: var(--gold); font-weight: 600; }
.heroes-rail .hero-card__name { font-size: 21px; color: var(--paper); }
.heroes-rail .hero-card__role { color: var(--muted-2); }
.heroes-rail .hero-card__excerpt, .heroes-rail .hero-card__more { display: none; }

/* Фильтры таймлайна */
.heroes-filters { display: flex; flex-direction: column; gap: 14px; padding-bottom: 24px; }
.filter-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filter-row__label { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-right: 6px; min-width: 64px; }

/* Список без JS: простая сетка */
.heroes-list #dle-content { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.heroes-list #dle-content > .navigation, .heroes-list #dle-content > .alert, .heroes-list #dle-content > .block { grid-column: 1 / -1; }
.heroes-list.is-ready #dle-content { display: block; }
.heroes-section { padding: 0 0 80px; }
.heroes-section--plain .heroes-list #dle-content { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.timeline-group { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 32px; padding: 40px 0; border-top: 1px solid var(--line); }
.timeline-group__aside { position: relative; padding-left: 26px; }
.timeline-group__aside::before { content: ""; position: absolute; left: 0; top: 7px; width: 13px; height: 13px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--paper); }
.timeline-group__aside::after { content: ""; position: absolute; left: 6px; top: 27px; bottom: -46px; width: 1.5px; background: var(--line-3); }
.timeline-group:last-child .timeline-group__aside::after { display: none; }
.timeline-group__title { position: sticky; top: calc(var(--header-offset) - 10px); margin: 0; font-family: var(--serif); font-size: 25px; font-weight: 400; line-height: 1.25; }
.timeline-group__range { display: block; margin-top: 6px; font: 500 14px/1.4 var(--sans); color: var(--muted); letter-spacing: .08em; }
.timeline-group__count { display: block; margin-top: 10px; font: 500 13px/1.4 var(--sans); color: var(--muted); }
.hero-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.timeline-empty { padding: 48px 0; font-size: 17px; color: var(--muted); border-top: 1px solid var(--line); }
.empty-state { max-width: 720px; margin: 8px 0 24px; padding: 36px 40px; background: var(--card); border: 1px dashed var(--line-4); border-radius: var(--radius-lg); }
.empty-state__title { margin: 0 0 10px; font-family: var(--serif); font-size: 24px; line-height: 1.3; color: var(--ink); }
.empty-state__text { margin: 0 0 22px; color: var(--ink-2); }
.timeline-bottom { border-top: 1px solid var(--line); padding-top: 8px; }

/* ---------- 10. Страница героя ---------- */
.hero-intro { padding: 48px 0; }
.hero-intro__grid { display: grid; grid-template-columns: minmax(0, 1fr) 460px; gap: 56px; align-items: start; }
.hero-intro__meta { margin: 26px 0 10px; font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.hero-intro__title { margin: 0 0 8px; font-family: var(--serif); font-size: clamp(36px, 4.4vw, 50px); line-height: 1.1; font-weight: 400; animation: fadeUp .7s var(--ease) both; }
.hero-intro__back + .hero-intro__title { margin-top: 26px; }
.hero-intro__role { margin: 0 0 24px; font-size: 16px; color: var(--muted); }
.hero-intro__desc { margin: 0 0 28px; font-size: 18px; line-height: 1.65; color: var(--ink-2); text-wrap: pretty; }
.value-chips { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 0 30px; padding: 0; list-style: none; }
.value-chips li { border: 1.5px solid var(--line-3); border-radius: 999px; padding: 8px 18px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.hero-intro__actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.hero-intro__portrait { position: relative; margin: 0; height: 420px; border-radius: 16px; overflow: hidden; box-shadow: 0 22px 44px rgba(43, 38, 32, .22); background: var(--paper-3); animation: fadeUp .7s var(--ease) .15s both; }
.hero-intro__portrait img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 22%; }
.hero-intro__admin { margin-top: 18px; }

.scenario { padding: 72px 0; }
.scenario__title { margin: 0 0 20px; font-family: var(--serif); font-size: clamp(26px, 3vw, 34px); font-weight: 400; max-width: 860px; line-height: 1.3; color: var(--paper); }
.scenario__goal { margin: 0 0 40px; font-size: 17px; line-height: 1.65; color: var(--dark-text); max-width: 780px; text-wrap: pretty; }
.scenario__goal-label { display: block; margin-bottom: 8px; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); font-weight: 700; }
.scenario-tasks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-bottom: 48px; }
.scenario-task { border: 1px solid var(--dark-line); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 8px; }
.scenario-task__k { margin: 0; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); font-weight: 700; }
.scenario-task__v {
  margin: 0; font-size: 15px; line-height: 1.6; color: var(--dark-text);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 8; line-clamp: 8; overflow: hidden;
}
.scenario-parts { margin: 0 0 44px; }
.scenario-parts__title { margin: 0 0 24px; font-family: var(--serif); font-size: 24px; font-weight: 400; color: var(--paper); }
.scenario-part { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 24px; padding: 22px 0; border-top: 1px solid var(--dark-line); }
.scenario-part__n { margin: 0; font-family: var(--serif); font-size: 30px; color: var(--gold); line-height: 1.1; }
.scenario-part__t { margin: 0 0 6px; font-size: 18px; font-weight: 700; color: var(--paper); }
.scenario-part__d { margin: 0; font-size: 15.5px; line-height: 1.6; color: var(--dark-text); }
.scenario-part--final .scenario-part__t { font-family: var(--serif); font-weight: 400; font-size: 19px; line-height: 1.55; }

.doc-preview {
  position: relative; max-height: 380px; overflow: hidden;
  border-radius: var(--radius); border: 1px solid var(--dark-line);
  background: var(--card); color: var(--ink);
  padding: 34px 40px; margin: 0 0 26px;
}
.doc-preview__fade { position: absolute; left: 0; right: 0; bottom: 0; height: 170px; background: linear-gradient(180deg, rgba(255, 253, 246, 0) 0%, var(--card) 85%); pointer-events: none; }
.doc-preview .prose { font-size: 15.5px; }
.doc-preview.is-empty { display: none; }
.doc-actions { display: flex; gap: 12px 16px; flex-wrap: wrap; align-items: center; }
.doc-actions .attach { margin: 0; }
.doc-note { margin: 0 0 26px; padding: 22px 26px; border: 1px dashed var(--dark-line); border-radius: var(--radius); color: var(--muted-2); font-size: 15.5px; }
.link-print { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14.5px; color: var(--gold); }
.link-print:hover, a:hover > .link-print { color: var(--gold-2); }
.section--dark a:hover .link-print { color: var(--gold-2); }

.poems { margin-top: 64px; padding-top: 48px; border-top: 1px solid var(--dark-line); display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px 56px; }
.poems__title { margin: 0; font-family: var(--serif); font-size: 28px; font-weight: 400; color: var(--paper); }
.poems__teaser { margin: 0 0 24px; font-family: var(--serif); font-size: 18px; line-height: 1.7; color: var(--paper); white-space: pre-line; max-height: 13.6em; overflow: hidden; position: relative; }
.poems__teaser::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4em; background: linear-gradient(180deg, rgba(43, 38, 32, 0), var(--dark)); }
.poems__teaser.is-short::after { display: none; }
.poems__source { display: none; }

.materials { padding: 72px 0; }
.materials-nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 48px; }
.materials-nav:empty { display: none; }
.mat-card { display: flex; flex-direction: column; gap: 8px; padding: 22px 24px; background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius); color: var(--ink); transition: border-color .2s, box-shadow .2s, transform .2s; }
.mat-card:hover { color: var(--ink); border-color: var(--accent); box-shadow: 0 12px 24px rgba(43, 38, 32, .1); transform: translateY(-2px); }
.mat-card__icon { color: var(--accent); }
.mat-card__icon .i { width: 26px; height: 26px; }
.mat-card__title { font-size: 17px; font-weight: 700; }
.mat-card__note { font-size: 14px; color: var(--muted); }
.mat-card__go { margin-top: 4px; font-size: 14px; font-weight: 600; color: var(--accent); }

.material { padding: 40px 0; border-top: 1px solid var(--line); scroll-margin-top: var(--header-offset); }
.material.is-empty { display: none; }
.material__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; margin-bottom: 22px; }
.material__title { margin: 0; font-family: var(--serif); font-size: 26px; font-weight: 400; display: flex; align-items: center; gap: 12px; }
.material__title .i { width: 26px; height: 26px; color: var(--accent); }
.material__note { margin: 0; color: var(--muted); font-size: 15px; }
.material__files { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 20px; }
.material__links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.material__links a, .video-card__dl a, a.dl-link {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: 999px;
  border: 1.5px solid var(--line-4); color: var(--ink); font-weight: 600; font-size: 14.5px; background: transparent;
}
.material__links a:hover, .video-card__dl a:hover, a.dl-link:hover { border-color: var(--accent); color: var(--accent); }
.material__links a::before, .video-card__dl a::before, a.dl-link::before {
  content: ""; width: 16px; height: 16px; flex: none;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4v11'/%3E%3Cpath d='M7 10.5l5 5 5-5'/%3E%3Cpath d='M5 20h14'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4v11'/%3E%3Cpath d='M7 10.5l5 5 5-5'/%3E%3Cpath d='M5 20h14'/%3E%3C/svg%3E") center / contain no-repeat;
}

.embed { position: relative; width: 100%; aspect-ratio: 16 / 10; border-radius: var(--radius); overflow: hidden; background: var(--dark-2); box-shadow: var(--shadow); }
.embed iframe, .embed object, .embed embed, .embed video { position: absolute; inset: 0; width: 100% !important; height: 100% !important; border: 0; }
.embed--slides { aspect-ratio: 16 / 9.8; max-width: 960px; }

.player { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--dark-2); box-shadow: var(--shadow); }
.player center { display: block; }
.player [id^="playerjs"] { width: 100% !important; max-width: 100% !important; }
.player .dlevideoplayer { max-width: 100% !important; }
.player--lesson { max-width: 960px; }

.video-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.video-card { margin: 0; display: flex; flex-direction: column; gap: 12px; }
.video-card figcaption { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.video-card__num { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.video-card__dl a { padding: 7px 16px; font-size: 13.5px; }

/* Вложения DLE (attachment.tpl) */
.attach { display: inline-flex; align-items: center; gap: 16px; padding: 16px 18px; background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius); color: var(--ink); max-width: 100%; min-width: 280px; }
.attach__icon { position: relative; flex: none; width: 46px; height: 54px; border-radius: 8px; background: var(--paper-2); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.attach__icon .i { width: 24px; height: 24px; }
.attach__ext { position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%); padding: 1px 6px; border-radius: 4px; background: var(--accent); color: var(--paper); font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.attach__ext:empty { display: none; }
.attach__info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.attach__name { font-weight: 600; font-size: 14.5px; line-height: 1.35; color: var(--ink); max-width: 320px; overflow: hidden; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.attach__meta { font-size: 13px; color: var(--muted); }
.attach__actions { display: flex; gap: 8px; flex: none; }
.attach__btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 600; border: 1.5px solid var(--line-4); color: var(--ink); white-space: nowrap; }
.attach__btn:hover { border-color: var(--accent); color: var(--accent); }
.attach__btn--primary { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.attach__btn--primary:hover { background: var(--accent-2); border-color: var(--accent-2); color: var(--paper); }
.attach__btn .i { width: 15px; height: 15px; }
.attach--denied { color: var(--muted); font-size: 14px; }
.section--dark .attach { border-color: var(--dark-line); }

.hero-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding-top: 36px; padding-bottom: 72px; border-top: 1px solid var(--line); }
.hero-pager a { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 26px; display: flex; flex-direction: column; gap: 4px; color: var(--ink); transition: border-color .2s, box-shadow .2s; }
.hero-pager a:hover { color: var(--ink); border-color: var(--accent); box-shadow: var(--shadow-sm); }
.hero-pager a.is-next { text-align: right; align-items: flex-end; }
.hero-pager small { font-size: 13px; color: var(--muted); }
.hero-pager strong { font-family: var(--serif); font-size: 20px; font-weight: 400; }
.hero-pager-wrap .hero-pager { border-top: 1px solid var(--line); }

/* Режим обычной статьи (новость без материалов классного часа) */
.hero-page--article .hero-intro__grid { grid-template-columns: minmax(0, 1fr) 380px; }
.hero-page--article .hero-intro__portrait { height: 300px; }
.hero-page--article .scenario { background: transparent; color: var(--ink); padding-top: 0; }
.hero-page--article .scenario .eyebrow, .hero-page--article .scenario__title, .hero-page--article .scenario-summary, .hero-page--article .doc-preview__fade, .hero-page--article .doc-actions [data-reader-open], .hero-page--article .materials-nav { display: none; }
.hero-page--article .doc-preview { max-height: none; border: 0; padding: 0; background: transparent; max-width: 820px; }
.hero-page--article .doc-preview .prose { font-size: 17px; }
.hero-page--article .hero-intro__actions { display: none; }

/* ---------- 11. Окно чтения (сценарий, стихи) ---------- */
.reader { position: fixed; inset: 0; z-index: 120; display: flex; justify-content: center; }
.reader__backdrop { position: absolute; inset: 0; background: rgba(24, 20, 16, .72); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: fadeIn .25s ease both; }
.reader__panel {
  position: relative; display: flex; flex-direction: column;
  width: min(900px, 100%); margin: 28px 20px; max-height: calc(100% - 56px);
  background: var(--card); border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: 0 40px 80px rgba(0, 0, 0, .4); animation: fadeUp .35s var(--ease) both;
}
.reader__bar { display: flex; align-items: center; gap: 16px; padding: 16px 20px 16px 30px; border-bottom: 1px solid var(--line); background: var(--paper); }
.reader__heading { flex: 1; min-width: 0; }
.reader__kicker { margin: 0; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.reader__title { margin: 2px 0 0; font-family: var(--serif); font-size: 20px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader__tools { display: flex; align-items: center; gap: 8px; }
.reader__tools .icon-btn { width: 40px; height: 40px; font-weight: 700; font-size: 14px; }
.reader__body { flex: 1; overflow-y: auto; padding: 40px 56px 56px; font-size: calc(17px * var(--reader-scale, 1)); -webkit-overflow-scrolling: touch; }
.reader-open { overflow: hidden; }

/* ---------- 12. Типографика контента (новости, статика, сценарии) ---------- */
.prose { font-size: 17px; line-height: 1.75; color: var(--ink-2); overflow-wrap: break-word; }
.prose > *:first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose table, .prose figure, .prose pre { margin: 0 0 1.1em; }
.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 { color: var(--ink); margin: 1.6em 0 .6em; line-height: 1.3; }
.prose h1 { font-size: 1.75em; }
.prose h2 { font-size: 1.5em; }
.prose h3 { font-size: 1.28em; }
.prose h4 { font-size: 1.12em; }
.prose h5, .prose h6 { font-size: 1em; font-family: var(--sans); font-weight: 700; }
.prose b, .prose strong { color: var(--ink); }
.prose p.stage { margin-top: 1.6em; }
.prose a { text-decoration: underline; text-decoration-color: rgba(122, 31, 31, .35); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: currentColor; }
.prose a.btn, .prose .attach a { text-decoration: none; }
.prose ul { list-style: none; padding-left: 0; }
.prose ul > li { position: relative; padding-left: 1.4em; margin-bottom: .45em; }
.prose ul > li::before { content: ""; position: absolute; left: .2em; top: .72em; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.prose ol { padding-left: 1.4em; }
.prose ol > li { margin-bottom: .45em; padding-left: .2em; }
.prose ol > li::marker { color: var(--accent); font-weight: 700; }
.prose img { max-width: 100%; height: auto; border-radius: 12px; }
.prose hr { margin: 2.2em 0; }
.prose table { width: 100%; display: block; overflow-x: auto; font-size: .94em; }
.prose table td, .prose table th { border: 1px solid var(--line); padding: 10px 14px; vertical-align: top; text-align: left; }
.prose table th { background: var(--paper-2); color: var(--ink); }
.prose iframe { border: 0; border-radius: 12px; max-width: 100%; }
.prose video { max-width: 100%; border-radius: 12px; }
.prose [style*="font-family"] { font-family: inherit !important; }
.prose span[style*="font-size"], .prose p[style*="font-size"], .prose font { font-size: inherit !important; }
.prose p[style*="text-indent"] { text-indent: 0 !important; }
.prose p[style*="margin"] { margin: 0 0 1.1em !important; }
.prose [style*="color: rgb(0, 0, 0)"], .prose [style*="color:#000"], .prose [style*="color: #000"] { color: inherit !important; }
.prose [style*="background-color"] { background-color: transparent !important; }
.prose span[style*="background"] { background: transparent !important; }
.prose [style*="text-align:justify"], .prose [style*="text-align: justify"] { text-align: left !important; }
.prose .dlevideoplayer ul, .prose .dleaudioplayer ul { list-style: none; padding: 0; margin: 0; }
.prose .dlevideoplayer li, .prose .dleaudioplayer li { padding: 0; margin: 0; }
.prose .dlevideoplayer li::before, .prose .dleaudioplayer li::before { display: none; }

/* Froala: картинки и выравнивание */
.prose .fr-dib { display: block; margin: 1em auto; }
.prose .fr-dii { display: inline-block; margin: .3em .6em; vertical-align: bottom; }
.prose .fr-fir { float: right; margin: .2em 0 1em 1.6em !important; max-width: min(45%, 360px); }
.prose .fr-fil { float: left; margin: .2em 1.6em 1em 0 !important; max-width: min(45%, 360px); }
.prose .fr-rounded { border-radius: 50%; }
.prose .fr-bordered { border: 6px solid var(--card); box-shadow: var(--shadow-sm); }
.prose .fr-shadow { box-shadow: var(--shadow); }
.prose .fr-video { display: block; position: relative; margin: 1em 0; }
.prose::after { content: ""; display: table; clear: both; }

/* Элементы сценариев из базы: цель, задачи, цитаты историков, таблица стихов */
.prose .goal, .prose .tasks, .prose .concepts { padding: 20px 26px; margin: 0 0 1.2em; border-radius: 12px; background: var(--paper-2); }
.prose .goal h3, .prose .tasks h3, .prose .concepts h3 { margin-top: 0; font-size: 1.1em; }
.prose .goal > :last-child, .prose .tasks > :last-child, .prose .concepts > :last-child { margin-bottom: 0; }
.prose .quote, .prose blockquote {
  margin: 1.4em 0; padding: 18px 24px; border: 0; border-left: 3px solid var(--gold);
  background: var(--paper-2); border-radius: 0 12px 12px 0;
  font-family: var(--sans); font-style: normal; color: var(--ink-2);
}
.prose .quote > :last-child, .prose blockquote > :last-child { margin-bottom: 0; }
.prose .page-break { height: 0; margin: 2em 0; border-top: 1px dashed var(--line-3); }
.prose .page-break br { display: none; }
.prose .page-break + h1 { display: none; }
.prose table.poem-table { display: table; border: 0; width: auto; margin: 1.2em 0 1.6em; }
.prose table.poem-table td { border: 0; border-bottom: 1px solid var(--line); padding: 14px 18px 14px 0; font-family: var(--serif); font-size: 1.02em; line-height: 1.75; color: var(--ink); }
.prose table.poem-table td.slide-number { width: 64px; padding-right: 18px; font: 700 12px/1.4 var(--sans); color: var(--muted); letter-spacing: .06em; white-space: nowrap; }
.prose table.poem-table td.slide-number::before { content: "слайд"; display: block; font-weight: 500; text-transform: uppercase; font-size: 10px; letter-spacing: .12em; color: var(--muted); }
.prose .dlevideoplayer, .prose .dleaudioplayer { margin: 1.2em auto; }

/* Спойлеры, скрытый текст, цитаты DLE */
.prose .title_spoiler, .prose .text_spoiler { background: var(--card); border: 1px solid var(--line-2); padding: 14px 20px; }
.prose .title_spoiler { border-radius: 12px 12px 0 0; font-weight: 600; }
.prose .text_spoiler { border-radius: 0 0 12px 12px; }
.prose .title_quote { background: var(--card); border: 1px solid var(--line-2); padding: 10px 20px; border-radius: 12px 12px 0 0; font-weight: 700; }
.prose .scriptcode { border-radius: 12px; }

/* Статические страницы: разделы с заголовком слева */
.static-page .page-head { padding-bottom: 40px; }
.static-body { padding-bottom: 80px; }
.static-body .prose { max-width: 820px; }
.prose-sections .prose-section { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px 56px; padding: 56px 0; border-top: 1px solid var(--line); scroll-margin-top: var(--header-offset); }
.prose-sections .prose-section:last-child { border-bottom: 1px solid var(--line); }
.prose-section__title { margin: 0 !important; font-family: var(--serif) !important; font-size: 30px !important; font-weight: 400 !important; line-height: 1.25 !important; color: var(--ink) !important; text-align: left !important; position: sticky; top: calc(var(--header-offset) - 10px); align-self: start; }
.prose-section__body { max-width: 760px; }
.prose-section__body > *:first-child { margin-top: 0; }
.prose-section__lead { color: var(--ink); font-size: 1.06em; }
.prose-sections .prose-section--dark { background: var(--dark); color: var(--dark-text); border-top: 0; margin: 0 calc(50% - 50vw); padding-left: calc(50vw - 50% + var(--gutter)); padding-right: calc(50vw - 50%); }
.prose-intro { max-width: 820px; margin-bottom: 40px; }
.static-body--sections .prose { max-width: none; }

/* Вариант «этапы»: номер слева */
.prose-steps .prose-section { grid-template-columns: 120px minmax(0, 1fr); gap: 40px; padding: 44px 0; }
.prose-step__aside { display: flex; flex-direction: column; gap: 10px; }
.prose-step__num { font-family: var(--serif); font-size: 56px; line-height: 1; color: var(--accent); }
.prose-step__when { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; line-height: 1.4; }
.prose-steps .prose-section__title { position: static; margin: 0 0 14px !important; font-size: 28px !important; }
.prose-steps .prose-section__body { max-width: 780px; }
.static-cta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 44px; }
.static-pages:empty { display: none; }

/* ---------- 13. Формы ---------- */
select, textarea,
input[type="text"], input[type="password"], input[type="email"], input[type="url"],
input[type="search"], input[type="tel"], input[type="number"], input[type="date"] {
  height: 50px; width: 100%;
  padding: 12px 18px;
  border: 1.5px solid var(--line-3); border-radius: 12px;
  background: var(--card); color: var(--ink);
  font: 400 16px/1.4 var(--sans);
  box-shadow: none; -webkit-appearance: none; appearance: none; box-sizing: border-box;
  transition: border-color .2s, box-shadow .2s;
}
textarea { height: auto; min-height: 150px; line-height: 1.6; resize: vertical; }
select { padding-right: 44px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238a7f68' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 18px center; }
select[multiple], select[size] { height: auto; background-image: none; padding-right: 18px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(122, 31, 31, .1); background-color: #fff; }
::placeholder { color: var(--muted); opacity: 1; }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; accent-color: var(--accent); margin: 0 8px 0 0; vertical-align: -3px; }
input[type="file"] { font-size: 14px; }
label { font-size: 14.5px; font-weight: 600; color: var(--ink); }

.ui-form { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.ui-form > li { margin: 0; padding: 0; }
.ui-form > li::before { display: none; }
.form-group label { display: block; margin-bottom: 8px; }
.form-group .checkbox label, .checkbox label { display: inline; font-weight: 500; }
.form-group.combo { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group.imp label::after { content: " *"; color: var(--accent); }
.form-sep { height: 1px; background: var(--line); margin: 8px 0; }
.form_submit { display: flex; align-items: center; gap: 14px 18px; flex-wrap: wrap; margin-top: 22px; }
.form_submit .c-capcha { float: none; order: -1; }
.form-note { font-size: 14px; color: var(--muted); }
.form-card { background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius-lg); padding: 34px; }
.form-card__title { margin: 0 0 22px; font-family: var(--serif); font-size: 26px; font-weight: 400; }
.form-page { max-width: 760px; }
.login_check { display: flex; gap: 10px; }
.login_check .btn { flex: none; }
.c-capcha { display: flex; align-items: center; gap: 10px; }
.c-capcha > a { float: none; margin: 0; }
.c-capcha img { width: 110px; height: 50px; border-radius: 10px; border-color: var(--line-3); }
.c-capcha > input { width: 160px !important; float: none; }
table.xfields { width: 100%; border-collapse: separate; border-spacing: 0 10px; }
table.xfields td { vertical-align: middle; font-size: 14.5px; }
.addvote { background: var(--paper-2); padding: 16px; border-radius: 12px; }
.admin_checkboxs { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 14.5px; }
.bb-editor textarea { border-radius: 0 0 12px 12px; }
.bb-pane { border-radius: 12px 12px 0 0; border-color: var(--line-3); background: var(--paper); }

/* UniForm — встроенная форма обратной связи */
.uf-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.uf-form-grid .uf-full { grid-column: 1 / -1; }
.uf-form-grid textarea { min-height: 130px; }
.uf-form-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px 18px; flex-wrap: wrap; margin-top: 16px; }
.uf-form-foot small { font-size: 13px; color: var(--muted); max-width: 300px; line-height: 1.45; }
.uf-alert { border-radius: 12px; padding: 14px 18px; margin: 0 0 16px; font-size: 15px; }
.uf-alert ul { margin: 6px 0 0; padding-left: 1.2em; }
.uf-alert-error { background: #f8e9e4; color: var(--accent-2); border: 1px solid #ecc9bd; }
.uf-alert-success { background: #eef2e1; color: #3d4a1f; border: 1px solid #d5dfb8; }
.uf-input-error { border-color: #c0584a !important; box-shadow: 0 0 0 4px rgba(192, 88, 74, .12) !important; }
.uf-inline-loading { height: 280px; margin: 0; border: 0; border-radius: 12px; background: linear-gradient(100deg, var(--paper-2) 30%, var(--card) 50%, var(--paper-2) 70%) 0 0 / 300% 100%; animation: shimmer 1.4s linear infinite; text-indent: -9999px; overflow: hidden; width: auto; }
.uf-inline-loading::after { display: none; }
.uf-wrapper { background: var(--card); border-radius: var(--radius-lg); max-width: 460px; margin: 40px auto; position: relative; padding: 0; overflow: hidden; }
.uf-header { padding: 24px 30px; font-family: var(--serif); font-size: 22px; background: var(--paper); border-bottom: 1px solid var(--line); color: var(--ink); }
.uf-content { padding: 24px 30px; }
.uf-field { margin-bottom: 14px; }
.uf-label { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.uf-btn { border: 0; }
.mfp-bg { background: var(--dark-3); opacity: .7; }
.mfp-close { color: var(--ink) !important; opacity: .6; }

/* ---------- 14. Контакты ---------- */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 32px; align-items: start; padding-bottom: 80px; }
.contact-cards { display: grid; gap: 14px; margin-bottom: 20px; }
.contact-card { display: flex; gap: 18px; align-items: flex-start; padding: 22px 24px; background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius); color: var(--ink); }
a.contact-card:hover { color: var(--ink); border-color: var(--accent); }
.contact-card__icon { flex: none; width: 46px; height: 46px; border-radius: 12px; background: var(--paper-2); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.contact-card__icon .i { width: 22px; height: 22px; }
.contact-card__label { display: block; font-size: 12.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-bottom: 4px; }
.contact-card__value { font-size: 16px; line-height: 1.5; }
.map_resp { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line-2); background: var(--paper-2); }
#map { width: 100%; height: 340px; }

/* ---------- 15. Комментарии ---------- */
.comments-block { margin-top: 56px; }
.comments-block__title { font-family: var(--serif); font-size: 28px; font-weight: 400; margin: 0 0 22px; }
.comments-block__title span { color: var(--accent); }
.comment { position: relative; display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 4px 18px; padding: 22px 0; border-top: 1px solid var(--line); }
.comment .avatar { grid-row: 1 / 4; }
.comment .avatar .cover { display: block; width: 52px; height: 52px; border-radius: 50%; background: var(--paper-3) center / cover no-repeat; text-indent: -9999px; overflow: hidden; }
.comment .status { position: absolute; left: 38px; top: 58px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--paper); text-indent: -9999px; overflow: hidden; background: var(--line-4); }
.comment .status.online { background: #6b8e23; }
.comment.online .status.offline { display: none; }
.com_info { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.com_user .name { font-weight: 700; margin-right: 10px; }
.com_user .date { font-size: 13px; color: var(--muted); }
.com_content .text { font-size: 15.5px; line-height: 1.65; color: var(--ink-2); }
.com_content .title { font-family: var(--serif); font-size: 17px; margin: 0 0 6px; }
.com_tools { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 13.5px; }
.com_tools_links { display: flex; gap: 14px; flex-wrap: wrap; }
.com_tools_links a { color: var(--muted); display: inline-flex; align-items: center; gap: 5px; }
.com_tools_links a:hover { color: var(--accent); }
.com_tools_links .i { width: 15px; height: 15px; }
.signature { font-size: 13px; color: var(--muted); margin-top: 8px; }
.comment .comment { margin-left: 0; }
.comments-tree-list { list-style: none; padding-left: 0; }
.comments-tree-list .comments-tree-list { padding-left: 36px; border-left: 2px solid var(--line); }
.addcomment { margin-top: 36px; }

/* Рейтинг */
.rate { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.rate_like a, .rate_like-dislike a { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); }
.rate_like a:hover, .rate_like-dislike a:hover { color: var(--accent); }
.plus_icon { display: inline-flex; width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--line-3); align-items: center; justify-content: center; font-weight: 700; }

/* ---------- 16. Постраничная навигация ---------- */
.navigation { display: flex; justify-content: center; padding: 32px 0 8px; }
.page_next-prev { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; }
.navigation .pages { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.navigation .pages a, .navigation .pages span, .page_prev a, .page_next a, .page_prev > span, .page_next > span {
  display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 44px; padding: 0 14px;
  border-radius: 999px; border: 1.5px solid var(--line-3); color: var(--ink); font-weight: 600; font-size: 15px;
}
.navigation .pages a:hover, .page_prev a:hover, .page_next a:hover { border-color: var(--accent); color: var(--accent); }
.navigation .pages span { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.navigation .pages span.nav_ext { background: transparent; border-color: transparent; color: var(--muted); }
.page_prev > span, .page_next > span { opacity: .35; }
.page_prev .i, .page_next .i { width: 18px; height: 18px; }
.splitnewsnavigation { margin: 24px 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 14.5px; color: var(--muted); }
.splitnewsnavigation a, .splitnewsnavigation span { display: inline-flex; min-width: 38px; height: 38px; align-items: center; justify-content: center; border-radius: 999px; border: 1.5px solid var(--line-3); padding: 0 12px; }
.splitnewsnavigation span { background: var(--accent); color: var(--paper); border-color: var(--accent); }

/* ---------- 17. Общие страницы, списки, боковая колонка ---------- */
.generic { padding: 0 0 80px; }
.generic__single { padding-top: 48px; max-width: 900px; }
.generic__cols { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 48px; padding-top: 48px; align-items: start; }
.generic__aside { position: sticky; top: calc(var(--header-offset) + 10px); }

.widget { background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; }
.widget__title { margin: 0 0 16px; font-family: var(--serif); font-size: 20px; font-weight: 400; }
.widget--dark { background: var(--dark); color: var(--paper); border-color: var(--dark); }
.widget--dark p { color: var(--muted-2); font-size: 15px; }
.widget__text { margin: 0 0 14px; font-size: 15px; color: var(--ink-2); }
.widget__more { margin: 16px 0 0; }
.mini-list { display: flex; flex-direction: column; gap: 12px; }
.mini-item { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 14px; align-items: center; color: var(--ink); }
.mini-item:hover { color: var(--accent); }
.mini-item__img { width: 56px; height: 56px; border-radius: 10px; background: var(--paper-3) center / cover no-repeat; display: block; }
.mini-item__title { font-size: 14.5px; line-height: 1.4; font-weight: 600; }
.mini-item__date { display: block; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.cat-menu ul { list-style: none; margin: 0; padding: 0; }
.cat-menu li { margin: 0; }
.cat-menu a { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; color: var(--ink-2); border-bottom: 1px solid var(--line); font-size: 14.5px; }
.cat-menu a:hover, .cat-menu a.active { color: var(--accent); }
.cat-menu ul ul a { padding-left: 16px; font-size: 14px; }
.cat-menu ul ul ul a { padding-left: 32px; }
.cat-menu__count { color: var(--muted); font-weight: 600; }

/* Карточка обычной новости (список, поиск) */
.story-card { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; }
.story-card__media { display: block; height: 190px; background: var(--paper-3); }
.story-card__media img { width: 100%; height: 100%; object-fit: cover; }
.story-card__body { padding: 20px 22px 24px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.story-card__meta { font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.story-card__meta a { color: var(--accent); }
.story-card__title { margin: 0; font-family: var(--serif); font-size: 20px; line-height: 1.3; font-weight: 400; }
.story-card__title a { color: var(--ink); }
.story-card__title a:hover { color: var(--accent); }
.story-card__text { font-size: 14.5px; color: var(--ink-2); line-height: 1.6; }
.story-line { display: block; padding: 14px 0; border-top: 1px solid var(--line); }
.story-line__title { font-family: var(--serif); font-size: 18px; margin: 0 0 4px; }
.story-line__meta { font-size: 13px; color: var(--muted); }

/* Поиск DLE */
.search-page .searchtable { background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 24px 28px; margin: 24px 0; }
.searchtable table { width: 100%; }
.searchtable td { padding: 6px; vertical-align: top; font-size: 14.5px; }
.searchtable fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px 18px; margin: 0 0 14px; min-width: 0; }
.searchtable legend { padding: 0 8px; font-weight: 700; font-size: 14px; color: var(--ink); }
.searchtable input[type="button"], .searchtable input[type="submit"] { width: auto; height: 46px; padding: 0 24px; border: 0; border-radius: 999px; background: var(--accent); color: var(--paper); font-weight: 600; cursor: pointer; }
.searchtable input[type="button"]:hover, .searchtable input[type="submit"]:hover { background: var(--accent-2); }
.searchtable #searchinput { max-width: 520px; }
.search_result_num { margin: 0 0 24px; font-size: 15px; color: var(--muted); }
.search-short { padding: 22px 0; border-top: 1px solid var(--line); }
.search-short__title { margin: 0 0 6px; font-family: var(--serif); font-size: 20px; font-weight: 400; }
.search-short__meta { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.search-short__text { font-size: 15px; color: var(--ink-2); }
#searchsuggestions { border-radius: 14px; border-color: var(--line-2); background: var(--card); }

/* Профиль, ЛС, статистика, теги, опросы */
.userinfo-head { display: flex; gap: 24px; align-items: center; margin: 0 0 28px; flex-wrap: wrap; }
.userinfo-head .avatar .cover { display: block; width: 96px; height: 96px; border-radius: 50%; background: var(--paper-3) center / cover no-repeat; text-indent: -9999px; overflow: hidden; }
.userinfo-head .page-title { font-size: clamp(28px, 3.4vw, 40px); margin: 0 0 6px; }
.userinfo_status { font-size: 14px; color: var(--muted); }
.tabs-nav { display: flex; gap: 8px; flex-wrap: wrap; list-style: none; padding: 0; margin: 0 0 22px; }
.tabs-nav li { margin: 0; }
.tabs-nav a { display: inline-flex; padding: 9px 18px; border-radius: 999px; border: 1.5px solid var(--line-3); color: var(--ink-2); font-weight: 600; font-size: 14.5px; }
.tabs-nav li.active a, .tabs-nav a.is-active { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }
.usinf { list-style: none; margin: 0 0 20px; padding: 0; }
.usinf li { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.usinf li::before { display: none; }
.ui-c1 { color: var(--muted); }
.pm-box { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center; margin-bottom: 20px; }
#pm-menu { display: flex; gap: 8px; flex-wrap: wrap; }
#pm-menu a, #pm-menu span { display: inline-flex; padding: 9px 18px; border-radius: 999px; border: 1.5px solid var(--line-3); font-weight: 600; font-size: 14.5px; }
.pm_status { font-size: 14px; color: var(--muted); min-width: 220px; }
.pm_progress_bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin-bottom: 6px; }
.pm_progress_bar span { display: block; height: 100%; background: var(--accent); }
.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin: 20px 0; }
.stats-grid ul { list-style: none; margin: 0; padding: 0; }
.stats-grid li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.stats-grid h5 { font-family: var(--sans); font-weight: 700; font-size: 16px; margin: 0 0 10px; }
.stats-periods { display: grid; gap: 10px; list-style: none; padding: 0; margin: 20px 0; }
.stats-periods li { padding: 14px 18px; background: var(--card); border: 1px solid var(--line-2); border-radius: 12px; font-size: 15px; }
.tag_list { display: flex; flex-wrap: wrap; gap: 8px 10px; }
.tag_list a { display: inline-flex; padding: 7px 16px; border-radius: 999px; border: 1.5px solid var(--line-3); color: var(--ink-2); font-weight: 600; }
.tag_list a:hover { border-color: var(--accent); color: var(--accent); }
.tag_list span.clouds_xsmall a { font-size: 12.5px; } .tag_list span.clouds_small a { font-size: 13.5px; } .tag_list span.clouds_medium a { font-size: 15px; } .tag_list span.clouds_large a { font-size: 16.5px; } .tag_list span.clouds_xlarge a { font-size: 18px; }
.poll_block, #votes { background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 24px; margin: 24px 0; }
.poll_block .title, .vote_title { font-family: var(--serif); font-size: 20px; font-weight: 400; margin: 0 0 14px; }
.vote_list { margin-bottom: 16px; font-size: 15px; }
.vote_list label { font-weight: 500; }
.vote_votes { font-size: 13.5px; color: var(--muted); margin-bottom: 12px; }
.vote_more { font-size: 13.5px; margin-bottom: 10px; }
.vote_result_btn { border: 1.5px solid var(--line-3); background: transparent; border-radius: 999px; height: 46px; padding: 0 16px; }
.poll_block .btn + .btn, #votes .btn + .vote_result_btn { margin-left: 8px; }

/* ---------- 18. Вход на сайт ---------- */
.login-trigger { background: none; border: 0; padding: 0; color: var(--muted-2); font-size: 13.5px; display: inline-flex; align-items: center; gap: 8px; }
.login-trigger:hover { color: var(--paper); }
.login-trigger .i { width: 16px; height: 16px; }
.modal { position: fixed; inset: 0; z-index: 130; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(24, 20, 16, .7); animation: fadeIn .2s ease both; }
.modal__panel { position: relative; width: min(420px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; background: var(--card); border-radius: var(--radius-lg); padding: 34px 32px 30px; box-shadow: 0 40px 80px rgba(0, 0, 0, .4); animation: fadeUp .3s var(--ease) both; color: var(--ink); }
.modal__close { position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; }
.modal__title { margin: 0 0 20px; font-family: var(--serif); font-size: 26px; font-weight: 400; }
.login-form { display: flex; flex-direction: column; gap: 12px; }
.login-form .btn { width: 100%; margin-top: 4px; }
.login-form__row { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.login-form__check { font-size: 14px; font-weight: 500; color: var(--ink-2); display: flex; align-items: center; }
.login-social { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.login-social img { width: 30px; height: 30px; }
.user-menu__head { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; }
.user-menu__ava { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; background: var(--paper-3); }
.user-menu__name { font-family: var(--serif); font-size: 20px; }
.user-menu__list { list-style: none; margin: 0; padding: 0; }
.user-menu__list li { margin: 0; }
.user-menu__list a { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); color: var(--ink); font-size: 15px; }
.user-menu__list a:hover { color: var(--accent); }
.user-menu__list .i { color: var(--muted); width: 18px; height: 18px; }

/* ---------- 19. Подвал ---------- */
.site-footer { background: var(--dark); color: var(--muted-2); margin-top: auto; }
.site-footer a { color: var(--muted-2); }
.site-footer a:hover { color: var(--paper); }
.footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px 48px; padding-top: 56px; padding-bottom: 40px; }
.footer__brand { display: flex; flex-direction: column; gap: 16px; }
.footer__logo { display: inline-flex; width: fit-content; background: var(--dark-2); border-radius: 10px; padding: 8px 12px; }
.footer__logo img { display: block; width: auto; height: 70px; }
.footer__about { margin: 0; font-size: 14.5px; line-height: 1.6; max-width: 380px; }
.footer__col { display: flex; flex-direction: column; gap: 10px; font-size: 14.5px; }
.footer__title { margin: 0 0 4px; color: var(--paper); font: 700 14.5px/1.4 var(--sans); }
.footer__col p { margin: 0; line-height: 1.6; }
.footer__col a { display: inline-flex; align-items: center; gap: 8px; }
.footer__col .i { width: 16px; height: 16px; opacity: .8; }
.footer__bottom { border-top: 1px solid var(--dark-line-2); }
.footer__bottom-in { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; padding-top: 18px; padding-bottom: 18px; font-size: 13px; }
.footer__bottom p { margin: 0; }

.to-top {
  position: fixed; right: 24px; bottom: 24px; z-index: 50;
  width: 50px; height: 50px; border-radius: 50%; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--paper); border: 0; box-shadow: 0 12px 26px rgba(122, 31, 31, .35);
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: opacity .3s, transform .3s, visibility 0s .3s, background-color .2s;
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; transition: opacity .3s, transform .3s, background-color .2s; }
.to-top:hover { background: var(--accent-2); }
.to-top .i { width: 22px; height: 22px; }

/* ---------- 20. Служебные окна DLE (jQuery UI) ---------- */
.ui-dialog { border-radius: var(--radius-lg); border: 0; background: var(--card); box-shadow: 0 40px 80px rgba(0, 0, 0, .35); font-family: var(--sans); color: var(--ink); }
.ui-dialog-titlebar { padding: 20px 24px; border-bottom: 1px solid var(--line); background: var(--paper); }
.ui-dialog-title { font-family: var(--serif); font-weight: 400; font-size: 19px; }
.ui-dialog-content { padding: 24px; }
.ui-dialog .ui-dialog-buttonpane { border-top: 1px solid var(--line); padding: 16px 24px; background: var(--paper); }
.ui-dialog .ui-dialog-buttonpane button, .ui-button { height: 40px; padding: 0 20px; border-radius: 999px; background: var(--accent); background-image: none; color: var(--paper) !important; font-weight: 600; font-size: 14px; text-transform: none; box-shadow: none; }
.ui-dialog .ui-dialog-buttonpane button:hover, .ui-button:hover { background: var(--accent-2); }
.ui-widget-overlay { background: var(--dark-3); opacity: .65; }
#dropmenudiv { border-radius: 12px; background: var(--card); border-color: var(--line-2); font-size: 14px; }
#dropmenudiv a:hover { background: var(--accent); color: var(--paper); }
#loading-layer:before { background-color: var(--accent); }
#loading-layer:after { background-color: var(--gold); }

/* ---------- 20b. Дополнения к страницам ---------- */
.generic__single { padding-top: 0; max-width: none; }
.generic .page-head { padding-top: 48px; }
.generic .speedbar + .page-head, .generic .speedbar + .generic__single .page-head { padding-top: 28px; }
.page-head--generic { padding-bottom: 0; }
.generic__cols .page-head { padding-top: 0; }
.form-page { max-width: 760px; }
.form-page--wide { max-width: 980px; }
.contact-page .page-head, .search-page .page-head, .userinfo .page-head, .pm-page .page-head, .stats-page .page-head, .tags-page .page-head, .form-page .page-head { padding-left: 0; padding-right: 0; }
.cards-grid { margin: 8px 0 24px; }
.hero-card__excerpt:empty { display: none; }
.timeline .hero-card__excerpt, .timeline .hero-card__more, .heroes-list .hero-card__more { display: none; }
.hero-intro__admin:empty { display: none; }
.scenario-summary:empty { display: none; }
.poems__head .eyebrow { margin-bottom: 10px; }
.doc-actions__file { display: inline-flex; min-width: 0; max-width: 100%; }
.prose-step__main { min-width: 0; }
.article-body { padding-bottom: 72px; }
.article-rate { margin: 28px 0; }
.mini-item__img.is-noimg { background-image: url("../dleimages/no_image.jpg") !important; }
.widget .mini-list[data-sort-heroes] { max-height: 460px; overflow-y: auto; padding-right: 6px; scrollbar-width: thin; }
.pm-compose { margin-top: 28px; }
.pmlist table { width: 100%; }
.vote-block .vote_list label, .poll_block .vote_list label { display: inline; }
.heroes-list .alert { margin-top: 12px; }
.material__files .attach { flex: 0 1 auto; }

/* ---------- 21. Анимации ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes kenburns { from { transform: scale(1.02); } to { transform: scale(1.12); } }
@keyframes sliderProgress { from { width: 0; } to { width: 100%; } }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }
.js .reveal-stagger > * { opacity: 0; transform: translateY(20px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .reveal-stagger.is-visible > * { opacity: 1; transform: none; }
.js .reveal-stagger.is-visible > *:nth-child(2) { transition-delay: .08s; }
.js .reveal-stagger.is-visible > *:nth-child(3) { transition-delay: .16s; }
.js .reveal-stagger.is-visible > *:nth-child(4) { transition-delay: .24s; }
.js .reveal-stagger.is-visible > *:nth-child(5) { transition-delay: .32s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .js .reveal, .js .reveal-stagger > * { opacity: 1; transform: none; }
  .slide.is-active .slide__bg img { animation: none; }
}

/* ---------- 22. Адаптив ---------- */
@media (max-width: 1180px) {
  .footer__grid { grid-template-columns: 1.3fr 1fr 1fr; }
  .footer__brand { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 24px; }
}

@media (max-width: 1100px) {
  :root { --header-offset: 120px; }
  .topbar__label { display: none; }
  .section-switch__link { white-space: nowrap; }
  .main-nav { display: none; }
  .burger { display: inline-flex; }
  .mainbar__tools { margin-left: auto; }
  .hero-intro__grid { grid-template-columns: minmax(0, 1fr) 380px; gap: 40px; }
  .rail__track { grid-auto-columns: calc((100% - 2 * 18px) / 3); }
  .generic__cols { grid-template-columns: minmax(0, 1fr) 280px; gap: 32px; }
}

@media (max-width: 960px) {
  .grid--4, .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .partners__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .slide__row { grid-template-columns: 1fr; gap: 28px; }
  .extra-grid { grid-template-columns: minmax(0, 1fr); }
  .slide__facts { max-width: 640px; }
  .slide__content { padding-bottom: 140px; }
  .hero-slider { --brand-w: 140px; --brand-top: 28px; }
  .hero-slider__brand { top: var(--brand-top); bottom: auto; align-items: flex-start; }
  .hero-slider__brand picture { padding: 9px; border-radius: 16px; box-shadow: 0 0 0 4px rgba(245, 241, 232, .1), 0 16px 36px rgba(0, 0, 0, .45); }
  /* слайды разной длины: заголовок – под логотипом, описание и кнопки – у нижнего края */
  .hero-slider .slide { align-items: stretch; }
  .hero-slider .slide__content { display: flex; flex-direction: column; padding-top: calc(var(--brand-top) + var(--brand-w) + 28px); }
  .hero-slider .slide__row { margin-top: auto; }
  .cta--form .cta__in { grid-template-columns: 1fr; gap: 32px; }
  .timeline-group { grid-template-columns: 1fr; gap: 20px; padding: 32px 0; }
  .timeline-group__aside { padding-left: 26px; }
  .timeline-group__aside::after { display: none; }
  .timeline-group__title { position: static; }
  .hero-grid, .heroes-list #dle-content { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-intro__grid, .hero-page--article .hero-intro__grid { grid-template-columns: 1fr; gap: 32px; }
  .hero-intro__portrait { height: 360px; order: -1; max-width: 640px; }
  .scenario-tasks { grid-template-columns: 1fr; }
  .poems { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .prose-sections .prose-section { grid-template-columns: 1fr; gap: 16px; padding: 40px 0; }
  .prose-section__title { position: static; font-size: 26px !important; }
  .prose-steps .prose-section { grid-template-columns: 1fr; gap: 12px; }
  .prose-step__aside { flex-direction: row; align-items: baseline; gap: 16px; }
  .prose-step__num { font-size: 44px; }
  .generic__cols { grid-template-columns: 1fr; }
  .generic__aside { position: static; }
  .usinf li { grid-template-columns: 1fr; gap: 2px; }
  .stats-grid { grid-template-columns: 1fr; }
}

@media (min-width: 721px) and (max-width: 960px) {
  .grid--3 > :last-child:nth-child(odd) { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  :root { --gutter: 20px; --header-offset: 104px; }
  .section-link { white-space: normal; }
  .section-head { margin-bottom: 26px; }
  body { font-size: 15.5px; }
  .section, .materials, .scenario { padding: 56px 0; }
  .topbar__in { min-height: 34px; gap: 8px 16px; }
  .topbar__mail, .topbar__label, .topbar__social { display: none; }
  .topbar__in { flex-wrap: wrap; justify-content: center; }
  .topbar__a11y { padding: 4px 12px; }
  .section-switch { gap: 18px; width: 100%; justify-content: center; }
  .extra-main .extra-main__lead { font-size: 19px; }
  .extra-main p { font-size: 16px; }
  .extra-aside { padding: 24px 22px; }
  .extra-aside .extra-aside__num { font-size: 40px; }
  .logo { padding: 5px 7px; }
  .logo img { height: 43px; }
  .is-scrolled .logo img { height: 40px; }
  .slide { min-height: 0; }
  .slide__content { padding-top: 56px; padding-bottom: 128px; }
  .hero-slider { --brand-w: 116px; --brand-top: 20px; }
  .hero-slider__brand picture { padding: 7px; border-radius: 14px; }
  .slide__lead { font-size: 16px; }
  .slide__actions .btn { flex: 1 1 auto; }
  .slide__facts li { font-size: 14px; padding: 11px 0; }
  .slide__facts li b { font-size: 22px; min-width: 38px; }
  .hero-slider__controls { bottom: 24px; }
  .slider-tabs { gap: 10px; }
  .slider-tab { grid-template-columns: 1fr; }
  .slider-tab__label { display: none; }
  .slider-arrow { width: 44px; height: 44px; }
  .stats-section { padding-top: 48px; }
  .stat { padding: 22px; }
  .stat__num { font-size: 36px; }
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
  .rail__track { grid-auto-columns: 78%; }
  .heroes-rail .hero-card__link { height: 280px; }
  .partners__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-grid, .heroes-list #dle-content { grid-template-columns: 1fr; }
  .hero-intro { padding: 32px 0; }
  .hero-intro__portrait { height: 300px; }
  .hero-pager { grid-template-columns: 1fr; }
  .hero-pager a.is-next { text-align: left; align-items: flex-start; }
  .doc-preview { padding: 24px 22px; max-height: 320px; }
  .video-grid { grid-template-columns: 1fr; }
  .attach { min-width: 0; width: 100%; flex-wrap: wrap; }
  .attach__actions { width: 100%; }
  .attach__btn { flex: 1; justify-content: center; }
  .attach__name { white-space: normal; }
  .reader__panel { margin: 0; max-height: 100%; height: 100%; border-radius: 0; }
  .reader__bar { padding: 12px 12px 12px 18px; }
  .reader__body { padding: 26px 20px 40px; }
  .reader__tools [data-reader-font] { display: none; }
  .form-group.combo, .uf-form-grid { grid-template-columns: 1fr; }
  .form-card, .cta__form { padding: 24px 20px; }
  .footer__grid { grid-template-columns: 1fr; gap: 30px; padding-top: 44px; }
  .footer__brand { flex-direction: column; align-items: flex-start; }
  .page-head { padding: 44px 0 20px; }
  .page-lead { font-size: 16.5px; }
  .searchtable table, .searchtable tbody, .searchtable tr, .searchtable td { display: block; width: 100% !important; }
  .searchtable td { padding: 4px 0; }
  .searchtable input[type="text"], .searchtable select, .searchtable [style*="width"] { max-width: 100% !important; }
  .searchtable input[type="text"], .searchtable select { width: 100% !important; }
  .search-page .searchtable { padding: 18px 16px; }
  .site-search__form { flex-wrap: wrap; }
  .site-search__form input[type="search"] { min-width: 0; flex-basis: 100%; }
  .site-search__form button { width: 100%; }
  table.xfields, table.xfields tbody, table.xfields tr, table.xfields td { display: block; width: 100%; }
  table.xfields tr { padding: 12px 0; border-bottom: 1px solid var(--line); }
  table.xfields td { padding: 2px 0; }
  table.xfields input, table.xfields select, table.xfields textarea { max-width: 100% !important; width: 100% !important; }
  .form-card .ui-form { padding-left: 0; }
  .form-card .form-group { min-width: 0; }
  .filter-row { flex-wrap: nowrap; overflow-x: auto; margin: 0 calc(-1 * var(--gutter)); padding: 2px var(--gutter) 6px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .filter-row::-webkit-scrollbar { display: none; }
  .filter-row .chip { flex: none; }
  .filter-row__label { display: none; }
  .prose h1 { font-size: 1.5em; }
  .prose h2 { font-size: 1.35em; }
  .prose { font-size: 16px; }
  .prose .fr-fir, .prose .fr-fil { float: none; margin: 1em auto !important; max-width: 100%; display: block; }
  .to-top { right: 16px; bottom: 16px; width: 46px; height: 46px; }
  .cta__in { padding-top: 52px; padding-bottom: 52px; }
}

@media (max-width: 420px) {
  :root { --gutter: 16px; }
  .logo img { height: 44px; }
  .is-scrolled .logo img { height: 40px; }
  .mainbar__in { gap: 8px; }
  .section-switch__link { font-size: 11.5px; }
  .btn--lg { padding: 14px 24px; font-size: 15px; }
  .slide__title { font-size: 31px; }
  .partners__grid { grid-template-columns: 1fr; }
}

/* ---------- 22a. Версия для слабовидящих (плагин public/a11y) ---------- */
/* кнопки включения: в верхней полосе, мобильном меню и подвале */
.topbar__a11y, .footer__a11y {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 13px; border: 1px solid rgba(216, 185, 138, .6); border-radius: 999px;
  background: transparent; color: var(--gold-2); cursor: pointer;
  font: 600 12.5px/1.25 var(--sans); letter-spacing: .04em;
  transition: color .2s, border-color .2s, background-color .2s;
}
.topbar__a11y:hover, .footer__a11y:hover { color: var(--paper); border-color: var(--gold); background: rgba(216, 185, 138, .12); }
.topbar__a11y .i, .footer__a11y .i, .mobile-menu__a11y .i { width: 18px; height: 18px; flex: none; }
.footer__a11y { font-size: 13px; }
.mobile-menu__a11y {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  padding: 12px 14px; border: 1px solid var(--line-3); border-radius: 999px;
  background: var(--card); color: var(--ink); cursor: pointer;
  font: 700 14px/1.25 var(--sans);
}

/* поправки вёрстки в режиме для слабовидящих: крупный шрифт, без фоновых фото и наложений */
html.a11y-on .site-header { position: static !important; }
html.a11y-on .topbar__in, html.a11y-on .mainbar__in { flex-wrap: wrap; row-gap: 10px; }
html.a11y-on .topbar__mail { margin-left: 0; }
html.a11y-on .main-nav { flex-wrap: wrap; gap: 8px 20px; }
html.a11y-on .logo img { height: 64px !important; }
html.a11y-on:not(#a11y-boost) .burger span, html.a11y-on:not(#a11y-boost) .burger span::before, html.a11y-on:not(#a11y-boost) .burger span::after { background-color: var(--a11y-fg) !important; }
html.a11y-on .js .reveal, html.a11y-on .js .reveal-stagger > *, html.a11y-on .reveal, html.a11y-on .reveal-stagger > * { opacity: 1 !important; transform: none !important; }
html.a11y-on .slide { min-height: 0 !important; align-items: stretch !important; }
html.a11y-on .slide__bg, html.a11y-on .slide::before, html.a11y-on .hero-slider__brand { display: none !important; }
html.a11y-on .hero-slider .slide__content { padding: 40px var(--gutter) 130px !important; }
html.a11y-on .slide__row { grid-template-columns: minmax(0, 1fr) !important; }
html.a11y-on .hero-slider .slide__facts { grid-template-columns: minmax(0, 1fr) !important; }
html.a11y-on .slider-tab__label { white-space: normal; }
html.a11y-on .hero-card__link, html.a11y-on .heroes-rail .hero-card__link { height: auto !important; min-height: 0 !important; }
html.a11y-on .hero-card__body { position: static !important; }
html.a11y-on .rail__track { grid-auto-columns: minmax(280px, 1fr) !important; }
html.a11y-on .hero-intro__grid, html.a11y-on .generic__cols, html.a11y-on .footer__grid { grid-template-columns: minmax(0, 1fr) !important; }
html.a11y-on .doc-preview { max-height: none !important; }
html.a11y-on .doc-preview__fade { display: none !important; }
html.a11y-on .status.offline, html.a11y-on .hero-meta-source { display: none !important; }
html.a11y-on:not(#a11y-boost) .to-top { font-size: 16px !important; width: 52px; height: 52px; }
html.a11y-on .filter-row, html.a11y-on .section-switch { flex-wrap: wrap !important; overflow: visible !important; }

/* ---------- 23. Печать ---------- */
@media print {
  .site-header, .mobile-menu, .site-footer, .cta, .to-top, .hero-slider__controls, .hero-pager, .materials-nav, .doc-actions, .hero-intro__actions, .partners { display: none !important; }
  body { background: #fff; color: #000; font-size: 12pt; }
  .section--dark, .scenario { background: #fff !important; color: #000 !important; }
  .doc-preview { max-height: none !important; border: 0; padding: 0; }
  .doc-preview__fade { display: none; }
  a { color: #000; }
  .reader-open .site-main, .reader-open .site-header, .reader-open .site-footer { display: none !important; }
  .reader-open .reader { position: static; display: block; }
  .reader-open .reader__backdrop, .reader-open .reader__tools { display: none !important; }
  .reader-open .reader__panel { box-shadow: none; margin: 0; max-height: none; width: auto; border-radius: 0; overflow: visible; }
  .reader-open .reader__body { overflow: visible; padding: 0; }
  .reader-open .reader__bar { background: #fff; padding: 0 0 12pt; }
}
