/* ============================================================
   «ФОРМАТ» (fmt) — базовый слой: токены, типографика, сетка, UI.
   Загружается после theme.css / theme-extra.css и переопределяет
   визуальную систему темы «Редакция», сохраняя разметку и поведение.
   ============================================================ */

:root {
  /* Палитра */
  --fmt-bg:        #eef1f6;
  --fmt-bg-2:      #e4e9f1;
  --fmt-paper:     #ffffff;
  --fmt-paper-2:   #f7f9fc;
  --fmt-ink:       #0b1220;
  --fmt-ink-2:     #2b3445;
  --fmt-muted:     #5c6678;
  --fmt-line:      #dfe4ec;
  --fmt-line-2:    #c6cedb;
  --fmt-brand:     #1b45c8;
  --fmt-brand-2:   #12309b;
  --fmt-brand-soft:#e8eeff;
  --fmt-accent:    #f2a012;
  --fmt-accent-2:  #9a5c00;
  --fmt-accent-soft:#fff3dc;
  --fmt-dark:      #0b1220;
  --fmt-dark-2:    #121b2e;
  --fmt-dark-3:    #1a2540;
  --fmt-success:   #137a4b;
  --fmt-danger:    #c53b3b;

  /* Форма */
  --fmt-radius:    12px;
  --fmt-radius-s:  8px;
  --fmt-radius-l:  20px;
  --h2-size:       32px;
  --fmt-shadow:    0 28px 70px -40px rgba(11, 18, 32, .45);
  --fmt-shadow-s:  0 14px 34px -24px rgba(11, 18, 32, .35);

  /* Шрифты */
  --fmt-display: "Unbounded", "Onest", system-ui, sans-serif;
  --fmt-sans:    "Onest", "Inter", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;

  /* Перекрываем токены движка v2 — унаследованные блоки получают палитру «Формат» */
  --v2-paper:       var(--fmt-bg);
  --v2-paper-deep:  var(--fmt-bg-2);
  --v2-card:        var(--fmt-paper);
  --v2-ink:         var(--fmt-ink);
  --v2-ink-soft:    var(--fmt-ink-2);
  --v2-line:        var(--fmt-line);
  --v2-line-strong: var(--fmt-line-2);
  --v2-muted:       var(--fmt-muted);
  --v2-green:       var(--fmt-brand);
  --v2-green-dark:  var(--fmt-brand-2);
  --v2-green-soft:  var(--fmt-brand-soft);
  --v2-gold:        var(--fmt-accent-2);
  --v2-serif:       var(--fmt-display);
  --v2-sans:        var(--fmt-sans);
  --v2-radius:      var(--fmt-radius);
  --v2-shadow:      none;

  /* Tailwind-переменные исходного сайта */
  --background: 220 33% 95%;
  --foreground: 221 45% 8%;
  --card: 0 0% 100%;
  --card-foreground: 221 45% 8%;
  --popover: 0 0% 100%;
  --popover-foreground: 221 45% 8%;
  --primary: 225 76% 45%;
  --primary-foreground: 0 0% 100%;
  --secondary: 220 27% 93%;
  --secondary-foreground: 221 45% 10%;
  --muted: 220 25% 93%;
  --muted-foreground: 220 9% 42%;
  --accent: 225 76% 45%;
  --accent-foreground: 0 0% 100%;
  --destructive: 0 65% 50%;
  --destructive-foreground: 0 0% 100%;
  --border: 220 18% 91%;
  --input: 220 18% 88%;
  --ring: 225 76% 45%;
  --radius: 0.75rem;
  --font-body: var(--fmt-sans);
  --font-heading: var(--fmt-display);
}

/* ---------- база ---------- */
html { scroll-behavior: smooth; }
body {
  background: var(--fmt-bg) !important;
  color: var(--fmt-ink) !important;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.v2-drawer-open, body.v2-rail-open { overflow: hidden; }

h1, h2, h3, h4, h5, h6,
.v2-display, .v2-arthead__title, .v2-pagehead__title, .v2-section__title,
.v2-hero h1, .v2-panel__title, .v2-brand__name {
  font-family: var(--fmt-display) !important;
  font-weight: 500 !important;
  letter-spacing: -.03em;
  color: var(--fmt-ink);
}
h1 { font-size: clamp(34px, 4.4vw, 68px); line-height: 1.02; }
h2 { font-size: var(--h2-size, 32px); line-height: 1.15; }
h3 { font-size: clamp(19px, 1.6vw, 24px); line-height: 1.18; }
h4 { font-size: 18px; line-height: 1.25; }
p { color: var(--fmt-ink-2); }
strong, b { color: var(--fmt-ink); }
a { color: inherit; }
::selection { background: var(--fmt-brand); color: #fff; }

:focus-visible {
  outline: 2px solid var(--fmt-brand);
  outline-offset: 3px;
  border-radius: 4px;
}
.v2 a:not(.v2-btn):not(.fmt-btn) { text-decoration: none; }

/* служебное */
.fmt-sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
[id] { scroll-margin-top: 104px; }

/* ---------- каркас ---------- */
.fmt-body, .v2-body { background: transparent !important; }
.fmt-shell {
  width: 100%;
  max-width: 1720px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 328px minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}
.fmt-shell.v2-shell--right { grid-template-columns: minmax(0, 1fr) 340px; }
.fmt-main {
  min-width: 0;
  padding: 34px 0 72px;
}
.fmt-main .max-w-7xl { max-width: none; }
/* на мобильном боковой отступ даёт .fmt-shell — обёртку не добавляем */
@media (max-width: 767px) {
  .fmt-main .max-w-7xl, .v2-main .max-w-7xl { padding-left: 0; padding-right: 0; }
}
.fmt-main .max-w-6xl { max-width: 100%; }
.fmt-main .max-w-5xl, .fmt-main .max-w-4xl { max-width: 62rem; }
.fmt-main > main { display: block; }

@media (max-width: 1180px) {
  .fmt-shell, .fmt-shell.v2-shell--right {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding: 0 22px;
  }
  .fmt-main { padding-top: 22px; }
}
@media (max-width: 640px) {
  .fmt-shell { padding: 0 16px; }
  .fmt-main { padding: 16px 0 56px; }
}

/* ---------- кнопки ---------- */
.v2-btn, .fmt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: var(--fmt-radius-s);
  background: transparent;
  color: var(--fmt-ink);
  font-family: var(--fmt-sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .005em;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background .18s var(--fmt-ease, ease), color .18s ease, border-color .18s ease, transform .18s ease;
}
.v2-btn:hover, .fmt-btn:hover { transform: translateY(-1px); }
.v2-btn:active, .fmt-btn:active { transform: translateY(0); }
.v2-btn--lg { min-height: 54px; padding: 0 26px; font-size: 15px; }
.v2-btn--primary, .fmt-btn--primary {
  background: var(--fmt-brand);
  border-color: var(--fmt-brand);
  color: #fff;
}
.v2-btn--primary:hover, .fmt-btn--primary:hover { background: var(--fmt-brand-2); border-color: var(--fmt-brand-2); }
.v2-btn--accent, .fmt-btn--accent {
  background: var(--fmt-accent);
  border-color: var(--fmt-accent);
  color: var(--fmt-ink);
}
.v2-btn--accent:hover, .fmt-btn--accent:hover { background: var(--fmt-accent-2); border-color: var(--fmt-accent-2); color: #fff; }
.v2-btn--outline, .fmt-btn--line {
  background: var(--fmt-paper);
  border-color: var(--fmt-line-2);
  color: var(--fmt-ink);
}
.v2-btn--outline:hover, .fmt-btn--line:hover { border-color: var(--fmt-ink); }
.v2-btn--ghost { color: var(--fmt-ink-2); padding: 0 8px; min-height: 38px; }
.v2-btn--ghost:hover { color: var(--fmt-brand); }
.fmt-btn--light { background: #fff; border-color: #fff; color: var(--fmt-ink); }
.fmt-btn--light:hover { background: var(--fmt-accent); border-color: var(--fmt-accent); }
.v2-btn:disabled, .fmt-btn:disabled { opacity: .55; cursor: wait; transform: none; }

/* ---------- поля ---------- */
.v2-input, .fmt-input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--fmt-line-2);
  border-radius: var(--fmt-radius-s);
  background: #fff;
  color: var(--fmt-ink);
  font-family: var(--fmt-sans);
  font-size: 15px;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.v2-input::placeholder, .fmt-input::placeholder { color: #7b8595; }
.v2-input:focus, .fmt-input:focus {
  outline: none;
  border-color: var(--fmt-brand);
  box-shadow: 0 0 0 3px rgba(33, 81, 224, .16);
}
.v2-label, .fmt-label {
  display: block;
  margin: 0 0 6px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--fmt-muted);
}
.fmt-label__hint { font-weight: 500; letter-spacing: .04em; text-transform: none; color: #98a1b0; }
.fmt-field { display: flex; flex-direction: column; gap: 0; margin-bottom: 12px; }
.fmt-select {
  appearance: none;
  padding-right: 34px;
  background-image: linear-gradient(45deg, transparent 50%, var(--fmt-ink) 50%),
                    linear-gradient(135deg, var(--fmt-ink) 50%, transparent 50%);
  background-position: calc(100% - 18px) 21px, calc(100% - 13px) 21px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.fmt-note {
  margin: 10px 0 0;
  font-size: 11.5px;
  line-height: 1.45;
  color: #6b7486;
}
.fmt-status { margin: 8px 0 0; font-size: 12.5px; line-height: 1.4; min-height: 1px; }
.fmt-status.is-ok, .v2-quick__status.is-ok { color: #7ee2b0; }
.fmt-status.is-error, .v2-quick__status.is-error { color: #ffb3a8; }

/* ---------- типографские утилиты ---------- */
.fmt-kicker, .v2-kicker, .v2-section__kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  font-family: var(--fmt-sans);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--fmt-brand);
}
.fmt-kicker::before, .v2-kicker::before, .v2-section__kicker::before {
  content: "";
  width: 22px;
  height: 2px;
  background: var(--fmt-accent);
  display: inline-block;
}

/* ---------- первый экран внутренних страниц ---------- */
.v2-pagehead {
  position: relative;
  padding: 26px 0 34px;
  margin: 0 0 34px;
  border-bottom: 1px solid var(--fmt-line-2);
}
.v2-pagehead--row {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, .78fr);
  gap: 48px;
  align-items: end;
}
.v2-pagehead__main { min-width: 0; }
.v2-pagehead__title {
  font-size: clamp(32px, 3.7vw, 58px);
  line-height: 1.03 !important;
  margin: 0 0 18px;
  max-width: 20ch;
  text-wrap: balance;
}
.v2-pagehead__lead {
  margin: 0;
  max-width: 58ch;
  font-size: 16px;
  line-height: 1.62;
  color: var(--fmt-ink-2);
}
.v2-pagehead__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.v2-pagehead__aside { min-width: 0; }
.v2-facts {
  margin: 0;
  border-top: 1px solid var(--fmt-ink);
  display: flex;
  flex-direction: column;
}
.v2-facts__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 0;
  border-bottom: 1px solid var(--fmt-line);
}
.v2-facts dt { margin: 0; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--fmt-muted); }
.v2-facts dd { margin: 0; font-size: 14px; font-weight: 700; text-align: right; color: var(--fmt-ink); }
.v2-facts__link { color: var(--fmt-brand); }

/* ---------- секции контента ---------- */
.v2-section { margin: 0 0 52px; }
.v2-section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px 24px;
  padding: 0 0 16px;
  margin: 0 0 26px;
  border-bottom: 1px solid var(--fmt-line-2);
}
.v2-section__head > .v2-section__kicker { flex: 0 0 100%; margin: 0; }
.v2-section__head > .v2-section__title { flex: 1 1 auto; min-width: 0; max-width: 100%; }
.v2-section__head > .v2-section__lead { flex: 0 0 100%; }
.v2-section__head > div { min-width: 0; }
.v2-section__head > div:first-child { flex: 1 1 auto; }
.v2-section__title { margin: 0; overflow-wrap: break-word; }
.v2-section__lead { margin: 8px 0 0; max-width: 62ch; color: var(--fmt-muted); }
.v2-section__actions { flex: 0 0 auto; }

/* индексы-строки */
.v2-index { display: grid; border-top: 1px solid var(--fmt-ink); }
.v2-index__link {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto 28px;
  align-items: center;
  gap: 18px;
  padding: 20px 6px;
  border-bottom: 1px solid var(--fmt-line-2);
  text-decoration: none;
  transition: background .16s ease, padding .16s ease;
}
.v2-index__link:hover { background: var(--fmt-paper); padding-left: 16px; padding-right: 16px; }
.v2-index__num { font-family: var(--fmt-display); font-size: 15px; font-weight: 500; color: var(--fmt-brand); }
.v2-index__label { font-family: var(--fmt-display); font-size: clamp(18px, 1.7vw, 24px); font-weight: 500; letter-spacing: -.02em; color: var(--fmt-ink); }
.v2-index__label small { display: block; margin-top: 4px; font-family: var(--fmt-sans); font-size: 12.5px; font-weight: 500; letter-spacing: 0; color: var(--fmt-muted); }
.v2-index__meta { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--fmt-muted); }
.v2-index__arrow { font-size: 18px; color: var(--fmt-accent-2); transition: transform .16s ease; }
.v2-index__link:hover .v2-index__arrow { transform: translateX(4px); }

/* ---------- карточки документов (legacy Tailwind-разметка) ---------- */
.fmt-main .rounded-xl.text-card-foreground {
  position: relative;
  border: 1px solid var(--fmt-line-2) !important;
  border-radius: var(--fmt-radius) !important;
  background: var(--fmt-paper) !important;
  box-shadow: none !important;
  overflow: hidden;
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}
.fmt-main .rounded-xl.text-card-foreground:hover {
  transform: translateY(-4px);
  border-color: var(--fmt-ink) !important;
  box-shadow: var(--fmt-shadow-s) !important;
}
.fmt-main .product-image-container {
  background: #e9eef7 !important;
  border-bottom: 1px solid var(--fmt-line);
  min-height: 200px !important;
  padding: 26px 18px !important;
  overflow: hidden;
}
.fmt-main .product-image-container img {
  mix-blend-mode: multiply;
  max-height: 172px;
  width: auto;
  object-fit: contain;
}
.fmt-main .product-discount-badge {
  position: absolute !important;
  top: 12px !important;
  left: 12px !important;
  right: auto !important;
  bottom: auto !important;
  width: auto !important;
  padding: 5px 9px !important;
  border-radius: 6px !important;
  background: var(--fmt-ink) !important;
  color: #fff !important;
  font-size: 10.5px !important;
  font-weight: 700 !important;
  letter-spacing: .05em;
  box-shadow: none !important;
  z-index: 2;
}
.fmt-main .fit-title {
  font-family: var(--fmt-sans) !important;
  font-size: 16.5px !important;
  font-weight: 700 !important;
  letter-spacing: -.01em !important;
  text-align: left !important;
  line-height: 1.3 !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  display: block !important;
  min-height: 2.6em;
}
.fmt-main .fit-title a { display: block; }
.fmt-main .fit-title a:hover { color: var(--fmt-brand); }
.fmt-main .pc-body { padding: 16px !important; }
.fmt-main .pc-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--fmt-brand);
}
.fmt-main .pc-more__arrow { color: var(--fmt-accent-2); }
.fmt-main .pc-body > .flex.items-center.justify-between {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--fmt-line);
}
.fmt-main .pc-body .text-lg.font-black,
.fmt-main .text-lg.font-black.text-foreground {
  font-family: var(--fmt-display);
  font-size: 18px !important;
  font-weight: 600 !important;
  color: var(--fmt-ink) !important;
  letter-spacing: -.02em;
}
.fmt-main .pc-body a[style*="background:hsl(var(--primary))"] {
  border-radius: 7px !important;
  min-height: 36px;
  font-size: 13px !important;
  font-weight: 600 !important;
  box-shadow: none !important;
}
.fmt-main .pc-body a[style*="background:hsl(var(--primary))"]:hover { background: var(--fmt-brand-2) !important; }

/* кнопка «Заказать документ» на главной */
.fmt-main button.w-full.bg-accent {
  border-radius: 7px !important;
  background: var(--fmt-ink) !important;
  color: #fff !important;
  font-family: var(--fmt-sans);
  font-size: 13px !important;
  font-weight: 600 !important;
  letter-spacing: .02em;
  min-height: 38px;
  box-shadow: none !important;
}
.fmt-main button.w-full.bg-accent:hover { background: var(--fmt-brand) !important; }
.fmt-main button.w-full.bg-accent span { display: none; }

/* чипы характеристик в карточках */
.fmt-main .rounded-xl .bg-secondary\/80 {
  background: var(--fmt-paper-2) !important;
  border: 1px solid var(--fmt-line);
  border-radius: 5px !important;
  color: var(--fmt-ink-2) !important;
}

/* ---------- хлебные крошки ---------- */
.fmt-main .bcbar {
  padding: 0 0 18px;
  margin: 0 0 8px;
  border-bottom: 1px solid var(--fmt-line);
  background: none !important;
}
.fmt-main .bcbar nav, .fmt-main .bcbar {
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--fmt-muted);
  line-height: 1.7;
  white-space: normal;
}
.fmt-main .bcbar nav a { white-space: normal; }
.fmt-main .bcbar a { color: var(--fmt-muted); }
.fmt-main .bcbar a:hover { color: var(--fmt-brand); }

/* ---------- таблицы, контент статей ---------- */
.v2-article-body {
  max-width: 72ch;
  font-size: 16.5px;
  line-height: 1.72;
  color: var(--fmt-ink-2);
}
.v2-article-body h2 { font-size: var(--h2-size, 32px); margin: 1.9em 0 .65em; }
.v2-article-body h3 { font-size: clamp(18px, 1.7vw, 22px); margin: 1.6em 0 .5em; }
.v2-article-body a { color: var(--fmt-brand); text-decoration: underline; text-decoration-color: rgba(33, 81, 224, .35); text-underline-offset: 3px; }
.v2-article-body a:hover { text-decoration-color: var(--fmt-brand); }
.v2-article-body ul, .v2-article-body ol { padding-left: 22px; }
.v2-article-body li { margin-bottom: .5em; }
.v2-article-body blockquote {
  margin: 28px 0;
  padding: 18px 24px;
  border-left: 3px solid var(--fmt-accent);
  background: var(--fmt-paper);
  font-size: 18px;
  line-height: 1.55;
}
.v2-article-body table { width: 100%; border-collapse: collapse; margin: 24px 0; font-size: 14.5px; }
.v2-article-body th, .v2-article-body td { border-bottom: 1px solid var(--fmt-line); padding: 11px 12px; text-align: left; vertical-align: top; }
.v2-article-body th { background: var(--fmt-paper-2); font-weight: 700; }
.v2-article-body img { max-width: 100%; height: auto; border-radius: var(--fmt-radius); }

/* автолинковка и родственные блоки */
.hs-autolink {
  margin: 26px 0 0;
  padding: 18px 20px;
  border: 1px solid var(--fmt-line);
  border-left: 3px solid var(--fmt-brand);
  background: var(--fmt-paper);
  border-radius: 0 var(--fmt-radius-s) var(--fmt-radius-s) 0;
}
.hs-autolink-title { margin: 0 0 8px !important; font-size: 11px !important; font-weight: 700 !important; letter-spacing: .14em; text-transform: uppercase; color: var(--fmt-brand) !important; }
.hs-autolink ul { margin: 0 !important; padding: 0 !important; list-style: none; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.hs-autolink li { margin: 0 !important; }
.hs-autolink a { font-size: 14px; font-weight: 500; color: var(--fmt-ink-2) !important; text-decoration: none !important; border-bottom: 1px dashed var(--fmt-line-2); }
.hs-autolink a:hover { color: var(--fmt-brand) !important; border-color: var(--fmt-brand); }

/* «Связанные материалы» внизу статьи (режим left) — см. pages.css */

/* ---------- вспомогательные элементы движка ---------- */
.v2-panel { background: var(--fmt-paper); border: 1px solid var(--fmt-line); border-radius: var(--fmt-radius); padding: 20px; }
.v2-panel__title { font-size: 14px; margin: 0 0 14px; }
.v2-catlist__link, .v2-linklist__link { color: var(--fmt-ink-2); }
.v2-catlist__link:hover, .v2-linklist__link:hover { color: var(--fmt-brand); }
.v2-note { color: var(--fmt-muted); }
.v2-checks { list-style: none; margin: 30px 0 0; padding: 22px 0 0; border-top: 1px solid var(--fmt-line-2); display: grid; grid-template-columns: 1fr 1fr; gap: 14px 30px; }
.v2-checks li { position: relative; padding-left: 30px; font-size: 14.5px; line-height: 1.45; color: var(--fmt-ink); }
.v2-checks li::before {
  content: "→";
  position: absolute; left: 0; top: 0;
  font-family: var(--fmt-sans); font-weight: 700; color: var(--fmt-accent-2);
}
.v2-numlist { list-style: none; counter-reset: fmtnum; margin: 0; padding: 0; display: grid; gap: 14px; }
.v2-numlist li { counter-increment: fmtnum; position: relative; padding-left: 40px; font-size: 14px; line-height: 1.5; }
.v2-numlist li::before {
  content: counter(fmtnum, decimal-leading-zero);
  position: absolute; left: 0; top: 0;
  font-family: var(--fmt-display); font-size: 11px; font-weight: 500;
  color: var(--fmt-accent-2);
}

/* ---------- анимация появления ---------- */
.fmt-reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.fmt-reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .fmt-reveal { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- адаптив базовых блоков ---------- */
@media (max-width: 1024px) {
  .v2-pagehead--row { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .v2-pagehead__title { max-width: none; }
  .v2-pagehead__aside { max-width: 520px; }
  .v2-related__list { grid-template-columns: 1fr; }
}
@media (max-width: 767px) {
  .v2-section__head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .v2-index__link { grid-template-columns: 44px minmax(0, 1fr) 22px; gap: 12px; }
  .v2-index__meta { display: none; }
  .v2-checks { grid-template-columns: 1fr; }
  .v2-pagehead { padding-top: 14px; }
}

/* skip-link для клавиатуры */
.fmt-skip {
  position: fixed;
  top: -80px;
  left: 16px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--fmt-accent);
  color: var(--fmt-ink);
  font-family: var(--fmt-sans);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: top .18s ease;
}
.fmt-skip:focus { top: 12px; }

/* состояния загрузки быстрой формы */
.v2-quick.is-busy .fmt-input,
.v2-quick.is-busy .fmt-select { opacity: .65; pointer-events: none; }
.v2-quick.is-busy .fmt-quick__submit { opacity: .7; cursor: wait; }
.fmt-status:empty { display: none; }

/* единственный основной ориентир страницы */
.fmt-content { display: block; min-width: 0; }
.fmt-content:focus { outline: none; }

/* длинные слова в заголовках не должны давать горизонтальный скролл */
.fmt-main h1, .fmt-main h2, .fmt-main .v2-arthead__title, .fmt-main .v2-pagehead__title {
  overflow-wrap: anywhere;
  word-break: normal;
}

/* инлайновая антиква старых шаблонов → заголовочный шрифт «ФОРМАТ» */
.fmt-main [style*="Cormorant Garamond"] { font-family: var(--fmt-display) !important; }

/* скрываем чат, пока открыта шторка меню или панели */
body.v2-drawer-open #ds-chat-btn,
body.v2-rail-open #ds-chat-btn,
body.v2-drawer-open #ds-chat-panel,
body.v2-rail-open #ds-chat-panel {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* компактная кнопка звонка на телефоне */
.fmt-call {
  display: none;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--fmt-line-2);
  border-radius: 8px;
  background: #fff;
  color: var(--fmt-ink);
  text-decoration: none;
}
.fmt-call:hover { border-color: var(--fmt-ink); }
.fmt-main .pc-more { min-height: 34px; padding: 5px 0; }
.fmt-footer__email { padding: 4px 0; display: inline-block; }

@media (max-width: 640px) {
  .fmt-call { display: grid; }
}
@media (max-width: 420px) {
  .fmt-railbar { flex-wrap: nowrap; }
  .fmt-railbar .fmt-chip { flex: 1 1 0; min-width: 0; justify-content: center; }
}

@media (max-width: 420px) {
  .fmt-railbar .fmt-chip { font-size: 10px; padding: 0 10px; white-space: nowrap; }
  .fmt-railbar .fmt-chip__ico { display: none; }
}

/* ─────────────────────────────────────────────────────────────────────
   Единый боковой отступ контента для десктопа (аудит 2026-11-11).
   Раньше отступ задавали сами секции: 12 id-секций главной получали 34px
   через home.css, все остальные — 0. Теперь 24px даёт обёртка .max-w-7xl,
   а секции без обёртки получают отступ сами. Мобильный (<768) не затронут.
   ───────────────────────────────────────────────────────────────────── */
@media (min-width: 768px) {
  .fmt-main .max-w-7xl,
  .v2-main .max-w-7xl { padding-left: 24px; padding-right: 24px; }

  /* Секции-карточки главной получают отступ от своего padding (home.css),
     поэтому их обёртку обнуляем — там, где home.css и правда подключён
     (главная, /faq/, /how-we-work/; см. конец home.css). */

  /* полосы без обёртки .max-w-7xl */
  .fmt-main > main > section:not(:has(.max-w-7xl)),
  .fmt-main > main > .mt-5 > section:not(:has(.max-w-7xl)) { padding-left: 24px; padding-right: 24px; }

  /* тело статьи в блоге: <article> лежит прямо в main, без .max-w-7xl */
  .fmt-main > main > article.v2-article-body { padding-left: 24px; padding-right: 24px; }

  /* блоки товаров и разделов под статьёй (в blog-split поля уже есть) */
  .fmt-main > main > div.mt-12,
  .fmt-main > main > div.mt-10:not(.blog-split) { padding-left: 24px; padding-right: 24px; }
}

/* ---------- шкала H2 (2026-11-13): 32px на десктопе, ступенчато вниз ---------- */
@media (max-width: 1199px) { :root { --h2-size: 30px; } }
@media (max-width: 1023px) { :root { --h2-size: 28px; } }
@media (max-width: 767px)  { :root { --h2-size: 24px; } }
@media (max-width: 479px)  { :root { --h2-size: 22px; } }
