/* ==========================================================================
   Методические материалы: осмотр и ремонт вагонов и контейнеров
   Дизайн-система. Чистый CSS, без препроцессоров и внешних зависимостей.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Токены
   -------------------------------------------------------------------------- */
:root {
  /* Поверхности */
  --bg: #eef0f4;
  --bg-deep: #e4e7ec;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --surface-3: #f0f2f5;

  /* Текст */
  --ink: #15181d;
  --ink-2: #414852;
  --ink-3: #6b7280;
  --ink-inv: #ffffff;

  /* Линии */
  --line: #dfe3e9;
  --line-2: #eceef2;
  --line-strong: #c9cfd8;

  /* Акцент (красный РЖД) */
  --accent: #c52929;
  --accent-600: #a81f1f;
  --accent-700: #8a1818;
  --accent-soft: #fdf2f2;
  --accent-soft-2: #fbe3e3;
  --accent-line: #f0c9c9;

  /* Сталь (для тёмных акцентных блоков) */
  --steel-900: #171b21;
  --steel-800: #1f242c;
  --steel-700: #2b313a;
  --steel-500: #4a525e;
  --steel-300: #8b93a1;

  /* Фокус */
  --focus: #1a73e8;

  /* Радиусы */
  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-full: 999px;

  /* Тени */
  --sh-1: 0 1px 2px rgba(21, 24, 29, .06), 0 1px 3px rgba(21, 24, 29, .04);
  --sh-2: 0 2px 4px rgba(21, 24, 29, .05), 0 6px 16px rgba(21, 24, 29, .06);
  --sh-3: 0 10px 24px rgba(21, 24, 29, .10), 0 2px 6px rgba(21, 24, 29, .06);
  --sh-4: 0 24px 60px rgba(21, 24, 29, .18);

  /* Размеры */
  --topbar-h: 66px;
  --sidenav-w: 302px;
  --content-max: 1180px;
  --prose-max: 74ch;

  /* Шрифты */
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-head: var(--font);
  --font-mono: "Cascadia Mono", "Consolas", "SF Mono", ui-monospace, monospace;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar-h) + 16px);
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

img { height: auto; }

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

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

a {
  color: var(--accent-600);
  text-decoration-color: rgba(168, 31, 31, .35);
  text-underline-offset: 2px;
}
a:hover { color: var(--accent-700); text-decoration-color: currentColor; }

ul, ol { margin: 0 0 1em; padding-left: 1.35em; }
li { margin: .3em 0; }

strong, b { font-weight: 650; }

code, kbd, samp {
  font-family: var(--font-mono);
  font-size: .92em;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 32px 0;
}

button, input, select, textarea { font: inherit; color: inherit; }

[hidden] { display: none !important; }

body.has-overlay { overflow: hidden; }

::selection { background: var(--accent-soft-2); color: var(--accent-700); }

:focus-visible {
  outline: 3px solid rgba(26, 115, 232, .55);
  outline-offset: 2px;
  border-radius: 4px;
}

[id] { scroll-margin-top: calc(var(--topbar-h) + 20px); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 200;
  transform: translateY(-160%);
  padding: 10px 18px;
  border-radius: var(--r-sm);
  background: var(--accent);
  color: var(--ink-inv);
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--sh-3);
  transition: transform .18s ease;
}
.skip-link:focus { transform: translateY(0); color: var(--ink-inv); }

/* --------------------------------------------------------------------------
   3. Шапка
   -------------------------------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar.is-stuck { box-shadow: 0 6px 20px rgba(21, 24, 29, .08); }

.topbar::after {
  content: "";
  display: block;
  height: 3px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-600) 42%, var(--line) 42%, var(--line) 100%);
}

.topbar__inner {
  max-width: var(--content-max);
  margin: 0 auto;
  min-height: var(--topbar-h);
  padding: 8px 20px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}
.brand__logo {
  width: 34px;
  height: 48px;
  object-fit: contain;
  flex: none;
  border-radius: 4px;
  background: var(--surface-3);
}
.brand__text { display: flex; flex-direction: column; min-width: 0; }
.brand__title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand__sub {
  font-size: 12px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topnav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 2px;
}
.topnav a {
  position: relative;
  padding: 9px 13px;
  border-radius: var(--r-sm);
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink-2);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .15s ease, color .15s ease;
}
.topnav a:hover { background: var(--surface-3); color: var(--ink); }
.topnav a[aria-current="page"] { color: var(--accent-600); background: var(--accent-soft); }
.topnav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 13px;
  right: 13px;
  bottom: 3px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

/* Бургер */
.burger {
  display: none;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  cursor: pointer;
  place-items: center;
  gap: 5px;
  flex-direction: column;
}
.burger span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--ink);
  transition: transform .2s ease, opacity .2s ease;
}
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.burger:hover { border-color: var(--line-strong); background: var(--surface-2); }

/* --------------------------------------------------------------------------
   4. Каркас
   -------------------------------------------------------------------------- */
.shell {
  flex: 1 0 auto;
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: var(--sidenav-w) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

.main { min-width: 0; padding: 28px 0 64px; }
.main:focus { outline: none; }

/* --------------------------------------------------------------------------
   5. Сайдбар
   -------------------------------------------------------------------------- */
.sidebar {
  position: sticky;
  top: calc(var(--topbar-h) + 3px);
  max-height: calc(100vh - var(--topbar-h) - 3px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 28px 0 40px;
  scrollbar-width: thin;
}
.sidebar::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 8px; }

.sidenav__label {
  margin: 0 0 10px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.sidenav__list,
.sidenav__sub {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidenav__item + .sidenav__item { margin-top: 4px; }

.sidenav__link {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px 10px 14px;
  border-radius: var(--r-sm);
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink-2);
  text-decoration: none;
  transition: background-color .15s ease, color .15s ease;
}
.sidenav__link::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 3px;
  background: var(--accent);
  opacity: 0;
  transform: scaleY(.4);
  transition: opacity .18s ease, transform .18s ease;
}
.sidenav__link:hover { background: var(--surface-3); color: var(--ink); }
.sidenav__link.is-current { background: var(--accent-soft); color: var(--accent-700); }
.sidenav__link.is-current::before { opacity: 1; transform: none; }

.sidenav__num {
  flex: none;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  display: grid;
  place-items: center;
  border-radius: var(--r-xs);
  background: var(--surface-3);
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
}
.sidenav__link.is-current .sidenav__num { background: var(--accent); color: var(--ink-inv); }

.sidenav__sub {
  margin: 2px 0 8px;
  padding: 4px 0 4px 26px;
  border-left: 2px solid var(--line-2);
}
.sidenav__sub a {
  display: block;
  padding: 6px 10px;
  border-radius: var(--r-xs);
  font-size: 13.5px;
  color: var(--ink-3);
  text-decoration: none;
  transition: color .15s ease, background-color .15s ease;
}
.sidenav__sub a:hover { color: var(--accent-600); background: var(--accent-soft); }

.sidebar__card {
  margin-top: 26px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--sh-1);
}
.sidebar__card p { margin: 0 0 8px; font-size: 13.5px; color: var(--ink-2); }
.sidebar__card p:last-child { margin-bottom: 0; }
.sidebar__card .btn { width: 100%; justify-content: center; }

.overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(21, 24, 29, .5);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.overlay.is-visible { opacity: 1; pointer-events: auto; }

/* --------------------------------------------------------------------------
   6. Кнопки и ссылки-действия
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  font-size: 15px;
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease,
              box-shadow .16s ease, transform .16s ease;
}
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--accent);
  color: var(--ink-inv);
  box-shadow: 0 2px 6px rgba(197, 41, 41, .28);
}
.btn--primary:hover { background: var(--accent-600); color: var(--ink-inv); box-shadow: 0 6px 18px rgba(197, 41, 41, .3); }

.btn--ghost {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink);
}
.btn--ghost:hover { background: var(--surface-2); border-color: var(--ink-3); color: var(--ink); }

.btn--steel {
  background: var(--steel-800);
  color: var(--ink-inv);
}
.btn--steel:hover { background: var(--steel-700); color: var(--ink-inv); }

.btn--sm { padding: 8px 13px; font-size: 13.5px; }
.btn--block { width: 100%; justify-content: center; }

.btn .ico { width: 18px; height: 18px; flex: none; }

.link-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 650;
  font-size: 15px;
  text-decoration: none;
}
.link-more .ico { width: 16px; height: 16px; transition: transform .18s ease; }
.link-more:hover .ico { transform: translateX(3px); }

/* --------------------------------------------------------------------------
   7. Заголовки страниц, крошки
   -------------------------------------------------------------------------- */
.crumbs {
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-3);
}
.crumbs li { display: flex; align-items: center; gap: 6px; margin: 0; }
.crumbs li + li::before { content: "/"; color: var(--line-strong); }
.crumbs a { color: var(--ink-3); text-decoration: none; }
.crumbs a:hover { color: var(--accent-600); text-decoration: underline; }
.crumbs [aria-current="page"] { color: var(--ink-2); }

.page-head { margin-bottom: 26px; }
.page-head__eyebrow {
  display: inline-block;
  margin: 0 0 10px;
  padding: 5px 11px;
  border-radius: var(--r-full);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent-700);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.page-head h1 { font-size: clamp(28px, 3.4vw, 40px); }
.page-head__lead {
  margin: 14px 0 0;
  max-width: var(--prose-max);
  font-size: 17.5px;
  color: var(--ink-2);
}

/* --------------------------------------------------------------------------
   8. Главная: герой
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  margin: 0 0 34px;
  padding: clamp(26px, 3.4vw, 44px);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background:
    radial-gradient(120% 140% at 100% 0%, #ffffff 0%, #f6f7f9 46%, #eef0f4 100%);
  box-shadow: var(--sh-2);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-700) 100%);
}
.hero__grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: clamp(24px, 3vw, 40px);
  align-items: center;
}
.hero h1 {
  font-size: clamp(30px, 4.1vw, 46px);
  letter-spacing: -.025em;
}
.hero__kicker {
  margin: 0 0 12px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent-600);
}
.hero__lead {
  margin: 16px 0 0;
  max-width: 52ch;
  font-size: 18px;
  color: var(--ink-2);
}
.hero__actions {
  margin-top: 26px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.hero__figure { margin: 0; }
.hero__figure img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface-3);
  box-shadow: var(--sh-3);
}
.hero__figure figcaption {
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--ink-3);
  text-align: center;
}

.stats {
  margin: 30px 0 0;
  padding: 18px 0 0;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.stats div { margin: 0; }
.stats dt {
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--ink);
}
.stats dd {
  margin: 2px 0 0;
  font-size: 13.5px;
  color: var(--ink-3);
}

/* --------------------------------------------------------------------------
   9. Главная: секции и карточки
   -------------------------------------------------------------------------- */
.section { margin: 0 0 40px; }
.section__head { margin: 0 0 20px; max-width: 68ch; }
.section__title {
  font-size: clamp(22px, 2.4vw, 30px);
  display: flex;
  align-items: center;
  gap: 12px;
}
.section__title::before {
  content: "";
  width: 26px;
  height: 3px;
  border-radius: 3px;
  background: var(--accent);
  flex: none;
}
.section__lead { margin: 10px 0 0; color: var(--ink-2); }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(268px, 1fr));
  gap: 18px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px 22px 22px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--sh-1);
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .22s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--sh-3); border-color: var(--line-strong); }
.card:hover::before { transform: none; }

.card__icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: var(--r-md);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent-600);
}
.card__icon .ico { width: 24px; height: 24px; }

.card__num {
  position: absolute;
  top: 20px;
  right: 20px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--line-strong);
}

.card__title { font-size: 19px; }
.card__text { margin: 0; font-size: 15px; color: var(--ink-2); }
.card__list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
  color: var(--ink-3);
  border-top: 1px dashed var(--line);
  padding-top: 12px;
}
.card__list li {
  position: relative;
  margin: 0 0 6px;
  padding-left: 18px;
}
.card__list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: .62em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-line);
}
.card__list li:last-child { margin-bottom: 0; }
.card__foot { margin-top: auto; padding-top: 6px; }

/* Карточка всей страницы (ссылка целиком) */
.card--link { color: inherit; text-decoration: none; }
.card--link:hover { color: inherit; }
.card--link:focus-visible { outline: 3px solid rgba(26, 115, 232, .55); outline-offset: 3px; }

/* Шаги */
.steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  counter-reset: step;
}
.steps li {
  counter-increment: step;
  position: relative;
  margin: 0;
  padding: 20px 20px 20px 58px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--sh-1);
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 18px;
  top: 18px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--steel-800);
  color: var(--ink-inv);
  font-size: 14px;
  font-weight: 700;
}
.steps h3 { font-size: 16.5px; margin-bottom: 4px; }
.steps p { margin: 0; font-size: 14.5px; color: var(--ink-2); }

/* Блок-призыв */
.cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: clamp(22px, 2.6vw, 32px);
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, var(--steel-900) 0%, var(--steel-700) 100%);
  color: var(--steel-300);
  box-shadow: var(--sh-3);
}
.cta h2 { color: var(--ink-inv); font-size: clamp(20px, 2.2vw, 26px); }
.cta p { margin: 8px 0 0; max-width: 56ch; font-size: 15px; }
.cta .btn--primary { box-shadow: 0 8px 24px rgba(0, 0, 0, .3); }

/* --------------------------------------------------------------------------
   10. Издатели
   -------------------------------------------------------------------------- */
.people {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}
.person {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--sh-1);
  transition: transform .18s ease, box-shadow .18s ease;
}
.person:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
.person__avatar {
  flex: none;
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--accent) 0%, var(--accent-700) 100%);
  color: var(--ink-inv);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .02em;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .22);
}
.person__name { font-size: 18px; margin-bottom: 4px; }
.person__role { margin: 0; font-size: 14.5px; color: var(--ink-3); }
.person__tag {
  display: inline-block;
  margin-top: 10px;
  padding: 4px 10px;
  border-radius: var(--r-full);
  background: var(--surface-3);
  border: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink-2);
}

.facts {
  margin: 0;
  display: grid;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--line-2);
}
.facts div {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  padding: 14px 18px;
  background: var(--surface);
}
.facts dt { font-weight: 650; color: var(--ink-2); margin: 0; }
.facts dd { margin: 0; color: var(--ink); }

/* --------------------------------------------------------------------------
   11. Панель инструментов контентных страниц
   -------------------------------------------------------------------------- */
.toolbar {
  position: sticky;
  top: calc(var(--topbar-h) + 3px);
  z-index: 40;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 20px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(8px);
  box-shadow: var(--sh-1);
}
.toolbar__status {
  margin: 0 0 0 auto;
  font-size: 13px;
  color: var(--ink-3);
}

.search {
  position: relative;
  flex: 1 1 240px;
  display: flex;
  align-items: center;
  min-width: 0;
}
.search .ico {
  position: absolute;
  left: 12px;
  width: 17px;
  height: 17px;
  color: var(--ink-3);
  pointer-events: none;
}
.search input {
  width: 100%;
  padding: 10px 36px 10px 36px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  font-size: 14.5px;
  transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.search input::placeholder { color: var(--ink-3); }
.search input:focus {
  outline: none;
  background: var(--surface);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft-2);
}
.search__clear {
  position: absolute;
  right: 6px;
  width: 26px;
  height: 26px;
  display: none;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--ink-2);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
}
.search.has-value .search__clear { display: grid; }
.search__clear:hover { background: var(--line-strong); }

.empty-state {
  padding: 40px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-lg);
  background: var(--surface-2);
  text-align: center;
}
.empty-state h3 { margin-bottom: 6px; font-size: 18px; }
.empty-state p { margin: 0; color: var(--ink-3); }

/* --------------------------------------------------------------------------
   12. Аккордеон
   -------------------------------------------------------------------------- */
.acc {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--sh-1);
  overflow: hidden;
  scroll-margin-top: calc(var(--topbar-h) + 76px);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.acc + .acc { margin-top: 12px; }
.acc:target { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft-2); }
.acc.is-open { border-color: var(--accent-line); box-shadow: var(--sh-2); }
.acc.is-match { border-color: var(--accent); }
.acc[hidden] { display: none; }

.acc__heading { margin: 0; font-size: inherit; font-weight: inherit; letter-spacing: normal; }

.acc__trigger {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px 18px;
  border: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 650;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
  transition: background-color .16s ease, color .16s ease;
}
.acc__trigger:hover { background: var(--surface-2); }
.acc.is-open .acc__trigger { color: var(--accent-700); background: var(--accent-soft); }

.acc__num {
  flex: none;
  min-width: 34px;
  height: 28px;
  padding: 0 8px;
  display: grid;
  place-items: center;
  border-radius: var(--r-xs);
  background: var(--surface-3);
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  transition: background-color .16s ease, color .16s ease;
}
.acc.is-open .acc__num { background: var(--accent); color: var(--ink-inv); }

.acc__title { flex: 1 1 auto; min-width: 0; }

.acc__chevron {
  flex: none;
  width: 20px;
  height: 20px;
  color: var(--ink-3);
  transition: transform .22s ease, color .16s ease;
}
.acc.is-open .acc__chevron { transform: rotate(180deg); color: var(--accent-600); }

.acc__panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .26s ease;
}
.acc.is-open .acc__panel { grid-template-rows: 1fr; }
.acc__inner { overflow: hidden; }
.acc__inner > :last-child { margin-bottom: 0; }

.acc__body {
  padding: 4px 22px 24px;
  border-top: 1px solid var(--line-2);
  margin-top: 0;
}

/* Карточка документа (PDF) */
.doc-card {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  margin: 22px 0;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--surface-2) 0%, var(--surface) 60%);
  box-shadow: var(--sh-1);
}
.doc-card__icon {
  flex: none;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: var(--r-md);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent-600);
}
.doc-card__body h3 { font-size: 17px; margin-bottom: 6px; }
.doc-card__body p { margin: 0 0 14px; font-size: 14.5px; color: var(--ink-2); }

/* --------------------------------------------------------------------------
   13. Проза (внутри панелей)
   -------------------------------------------------------------------------- */
.prose { max-width: var(--prose-max); }
.prose > h2,
.prose > h3,
.prose > h4 {
  margin: 30px 0 10px;
  scroll-margin-top: calc(var(--topbar-h) + 90px);
}
.prose > h2 { font-size: 22px; }
.prose > h3 { font-size: 18.5px; }
.prose > h4 { font-size: 16.5px; color: var(--ink-2); }
.prose > :first-child { margin-top: 18px; }

.prose p { margin: 0 0 14px; text-align: justify; hyphens: auto; }
.prose p strong { color: var(--ink); }

.prose ul,
.prose ol { margin: 0 0 16px; padding-left: 1.4em; }
.prose li { margin: 0 0 8px; }
.prose li::marker { color: var(--accent); font-weight: 600; }
.prose ul ul, .prose ol ol, .prose ul ol, .prose ol ul { margin: 8px 0 0; }

.prose a {
  font-weight: 550;
  background-image: linear-gradient(var(--accent-line), var(--accent-line));
  background-size: 100% 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
}
.prose a:hover { background-image: linear-gradient(var(--accent), var(--accent)); }

/* Врезка-примечание */
.prose .note {
  margin: 20px 0;
  padding: 14px 18px;
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  background: var(--accent-soft);
  font-size: 15px;
}

/* --------------------------------------------------------------------------
   14. Изображения и lightbox
   -------------------------------------------------------------------------- */
.figure {
  margin: 22px 0;
  max-width: 100%;
}
.figure a {
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background:
    linear-gradient(135deg, var(--surface-2) 0%, var(--surface-3) 100%);
  overflow: hidden;
  box-shadow: var(--sh-1);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.figure a:hover { border-color: var(--accent-line); box-shadow: var(--sh-3); transform: translateY(-2px); }
.figure img {
  display: block;
  width: 100%;
  height: auto;
  padding: 10px;
}
.figure figcaption {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--ink-3);
}
.figure figcaption .ico { width: 14px; height: 14px; flex: none; color: var(--ink-3); }
.figure figcaption .filename { font-family: var(--font-mono); }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 18, 22, .9);
  backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .2s ease, visibility .2s ease;
}
.lightbox.is-visible { opacity: 1; visibility: visible; pointer-events: auto; }
.lightbox__label { color: #dfe3e9; }
.lightbox .btn--ghost {
  margin-left: 10px;
  background: rgba(255, 255, 255, .12);
  border-color: rgba(255, 255, 255, .3);
  color: #fff;
}
.lightbox .btn--ghost:hover { background: rgba(255, 255, 255, .22); border-color: rgba(255, 255, 255, .55); color: #fff; }
.lightbox__figure {
  margin: 0;
  max-width: min(1400px, 96vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.lightbox__figure img {
  max-width: 100%;
  max-height: 82vh;
  width: auto;
  border-radius: var(--r-sm);
  background: #fff;
  box-shadow: var(--sh-4);
}
.lightbox__caption { margin: 0; color: #dfe3e9; font-size: 13.5px; text-align: center; }
.lightbox__close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 50%;
  background: rgba(255, 255, 255, .1);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background-color .16s ease, border-color .16s ease;
}
.lightbox__close:hover { background: rgba(255, 255, 255, .2); border-color: rgba(255, 255, 255, .5); }

/* --------------------------------------------------------------------------
   15. Подвал и кнопка «наверх»
   -------------------------------------------------------------------------- */
.footer {
  flex: none;
  margin-top: auto;
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.footer__inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 30px 20px 34px;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr));
  gap: 24px;
}
.footer__title { margin: 0 0 6px; font-size: 15px; font-weight: 700; }
.footer p { margin: 0; font-size: 13.5px; color: var(--ink-3); }
.footer__label {
  margin: 0 0 10px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.footer ul { margin: 0; padding: 0; list-style: none; }
.footer li { margin: 0 0 7px; }
.footer a { font-size: 14px; color: var(--ink-2); text-decoration: none; }
.footer a:hover { color: var(--accent-600); text-decoration: underline; }
.footer__bottom {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 14px 20px 22px;
  border-top: 1px solid var(--line-2);
  font-size: 12.5px;
  color: var(--ink-3);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  justify-content: space-between;
}

.to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 55;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink-2);
  box-shadow: var(--sh-3);
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease, color .16s ease, border-color .16s ease;
}
.to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { color: var(--accent-600); border-color: var(--accent-line); }
.to-top .ico { width: 20px; height: 20px; }

/* --------------------------------------------------------------------------
   16. Адаптивность
   -------------------------------------------------------------------------- */
@media (max-width: 1100px) {
  .hero__grid { grid-template-columns: minmax(0, 1fr); }
  .hero__figure { order: -1; }
  .hero__figure img { aspect-ratio: 21 / 9; }
}

@media (max-width: 1024px) {
  .shell { grid-template-columns: minmax(0, 1fr); gap: 0; }

  .burger { display: flex; }
  .topnav { display: none; }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 80;
    width: min(330px, 88vw);
    max-height: none;
    height: 100dvh;
    padding: 22px 18px 40px;
    background: var(--surface);
    border-right: 1px solid var(--line);
    box-shadow: var(--sh-4);
    transform: translateX(-102%);
    transition: transform .26s ease;
    visibility: hidden;
  }
  .sidebar.is-open { transform: none; visibility: visible; }

  body.nav-open { overflow: hidden; }

  .main { padding: 22px 0 56px; }
  .toolbar { top: calc(var(--topbar-h) + 3px); }
}

@media (max-width: 760px) {
  body { font-size: 16.5px; }
  .shell { padding: 0 16px; }
  .topbar__inner { padding: 8px 16px; }
  .brand__sub { display: none; }

  .hero { padding: 22px 20px; border-radius: var(--r-lg); }
  .hero__actions .btn { flex: 1 1 100%; justify-content: center; }
  .stats { grid-template-columns: 1fr; gap: 12px; }
  .stats div { display: flex; align-items: baseline; gap: 10px; }
  .stats dd { margin: 0; }

  .card { padding: 20px 18px; }
  .acc__trigger { padding: 14px 14px; font-size: 16.5px; gap: 10px; }
  .acc__body { padding: 4px 16px 20px; }
  .prose p { text-align: left; hyphens: none; }

  .toolbar { padding: 8px; }
  .toolbar .btn { flex: 1 1 auto; justify-content: center; }
  .toolbar__status { margin-left: 0; flex: 1 1 100%; }

  .facts div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .footer__inner { grid-template-columns: minmax(0, 1fr); gap: 20px; }

  .to-top { right: 14px; bottom: 14px; }
}

@media (max-width: 420px) {
  .person { flex-direction: column; }
  .steps li { padding: 18px 18px 18px 54px; }
}

/* --------------------------------------------------------------------------
   17. Доступность: движение и контраст
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

@media (prefers-contrast: more) {
  :root { --line: #9aa2ae; --ink-2: #262b33; --ink-3: #3d444e; }
}

/* --------------------------------------------------------------------------
   18. Печать
   -------------------------------------------------------------------------- */
@media print {
  :root { --bg: #fff; }
  body { background: #fff; font-size: 11.5pt; line-height: 1.5; }
  .topbar, .sidebar, .footer, .to-top, .toolbar, .overlay,
  .lightbox, .skip-link, .figure figcaption .ico { display: none !important; }
  .shell { display: block; max-width: none; padding: 0; }
  .main { padding: 0; }
  .acc, .card, .person, .steps li, .cta { box-shadow: none !important; border-color: #999 !important; break-inside: avoid; }
  .acc__panel { grid-template-rows: 1fr !important; }
  .acc__inner { overflow: visible !important; }
  .acc__chevron { display: none; }
  .acc__trigger { padding: 8pt 0; font-size: 13pt; color: #000 !important; background: none !important; }
  .prose p { text-align: left; }
  .figure { break-inside: avoid; }
  .figure a { border-color: #bbb; box-shadow: none; }
  .figure img { padding: 0; }
  a { color: #000; text-decoration: none; }
  .cta { background: none !important; color: #000; }
  .cta h2 { color: #000; }
  .page-head h1 { font-size: 20pt; }
}
