/*
 * Серия «Договор на SEO» — стили поверх /blog.css сайта xseo74.ru.
 * Компоненты статьи — как в блоге ТД «УМК» (граф серии, обложка со схемой, ключевые цифры, схемы,
 * мини-инфографика, термины, вопросы, «Читать дальше»), но в стиле сайта: чёрный матовый, монохром,
 * акцент — белый. Шрифты системные (CSP сайта пускает только свои файлы).
 * Светлая тема сайта (кнопка в шапке, :root[data-theme="light"], с 06.10.2026) — те же переменные ниже,
 * монохром наоборот: белая бумага, чёрные линии, выделение — чёрная плашка.
 * Всё под классами .dg и .bf — на остальные страницы сайта не влияет.
 */

:root {
  --dg-card: linear-gradient(180deg, #151515 0%, #101010 100%);
  --dg-grid: rgba(255, 255, 255, .035);
  --dg-art: radial-gradient(120% 90% at 50% 0%, #171717, #0c0c0c);
  --dg-row: rgba(255, 255, 255, .015);
  --dg-hover: #3a3a3a;
  --dg-plan: #2a2a2a;
  /* схемы */
  --bf-ink: #d6d6d6; --bf-ink2: #b4b4b4; --bf-soft: #6e6e6e; --bf-line: #8a8a8a;
  --bf-hi: #ffffff; --bf-on-hi: #0a0a0a; --bf-on-hi-soft: #555555;
  --bf-bg: #121212; --bf-bg2: #191919;
  --bf-rule: #3a3a3a; --bf-faint: #333333; --bf-dimline: #3c3c3c; --bf-pill: #4a4a4a;
  --bf-bar: #2a2a2a; --bf-bar-mid: #8a8a8a; --bf-bar-low: #4a4a4a; --bf-bar-tax: #2c2c2c; --bf-bar-tax-line: #5a5a5a; --bf-bar-res: #353535;
  --bf-zone: rgba(255, 255, 255, .025);
  --bf-curve-mid: #9a9a9a; --bf-curve-low: #5a5a5a; --bf-dot-dim: #555555; --bf-x: #8a8a8a;
  --bf-sk: #4a4a4a; --bf-sk-h: #7c7c7c; --bf-sk-num: #383838; --bf-sk-big: #9a9a9a;
  /* граф серии */
  --sg-dot: #6a6a6a; --sg-plan: #3a3a3a; --sg-cur-line: #4a4a4a; --sg-glow: rgba(255, 255, 255, .12);
  /* инфографика */
  --ig-bar: #7a7a7a; --ig-tick: #4a4a4a; --ig-axis: linear-gradient(90deg, #3a3a3a, #bdbdbd); --ig-legend-line: #444444;
  --ig-c0: #f4f4f4; --ig-t0: #0a0a0a; --ig-c1: #a8a8a8; --ig-t1: #0a0a0a; --ig-c2: #6a6a6a; --ig-t2: #f4f4f4;
  --ig-c3: #3d3d3d; --ig-t3: #f4f4f4; --ig-c4: #262626; --ig-t4: #d8d8d8;
}
:root[data-theme="light"] {
  --dg-card: linear-gradient(180deg, #ffffff 0%, #fafaf8 100%);
  --dg-grid: rgba(0, 0, 0, .045);
  --dg-art: radial-gradient(120% 90% at 50% 0%, #ffffff, #efefec);
  --dg-row: rgba(0, 0, 0, .02);
  --dg-hover: #c4c4bf;
  --dg-plan: #d6d6d1;
  --bf-ink: #222222; --bf-ink2: #444444; --bf-soft: #8a8a85; --bf-line: #6e6e6a;
  --bf-hi: #111111; --bf-on-hi: #f5f5f3; --bf-on-hi-soft: #b8b8b3;
  --bf-bg: #ffffff; --bf-bg2: #f1f1ee;
  --bf-rule: #d4d4cf; --bf-faint: #cfcfca; --bf-dimline: #c9c9c4; --bf-pill: #b5b5b0;
  --bf-bar: #e6e6e2; --bf-bar-mid: #6e6e6a; --bf-bar-low: #b9b9b4; --bf-bar-tax: #ededeb; --bf-bar-tax-line: #a9a9a4; --bf-bar-res: #d4d4cf;
  --bf-zone: rgba(0, 0, 0, .025);
  --bf-curve-mid: #6e6e6a; --bf-curve-low: #a9a9a4; --bf-dot-dim: #b5b5b0; --bf-x: #8a8a85;
  --bf-sk: #c9c9c4; --bf-sk-h: #9a9a95; --bf-sk-num: #dededa; --bf-sk-big: #6e6e6a;
  --sg-dot: #a8a8a3; --sg-plan: #c9c9c4; --sg-cur-line: #a9a9a4; --sg-glow: rgba(0, 0, 0, .12);
  --ig-bar: #9a9a95; --ig-tick: #b5b5b0; --ig-axis: linear-gradient(90deg, #d4d4cf, #444444); --ig-legend-line: #b5b5b0;
  --ig-c0: #111111; --ig-t0: #f5f5f3; --ig-c1: #5c5c5c; --ig-t1: #f5f5f3; --ig-c2: #9a9a95; --ig-t2: #111111;
  --ig-c3: #c9c9c4; --ig-t3: #111111; --ig-c4: #e6e6e2; --ig-t4: #2b2b2b;
}

.dg {
  --dg-dim: var(--dim);
  --mono: ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace;
}

/* ---------- Полоса прочитанного ---------- */
.readbar { position: fixed; left: 0; right: 0; top: 0; z-index: 25; height: 2px; pointer-events: none; }
.readbar i { display: block; height: 100%; background: var(--hi); transform: scaleX(0); transform-origin: left; }

/* ---------- Обложка статьи ---------- */
.dg-hero { margin-bottom: 40px; }
.dg-hero__grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 28px 48px; align-items: center; margin-top: 26px; }
.dg-hero__head { min-width: 0; }
.dg-hero__head .chip { margin-bottom: 18px; }
.dg-hero h1 { margin: 0; font-size: clamp(30px, 4.2vw, 48px); line-height: 1.1; font-weight: 700; letter-spacing: -.022em; text-wrap: balance; overflow-wrap: break-word; hyphens: auto; }
.dg-hero .post__lead { font-size: 18px; }
.dg-hero__cover {
  margin: 0; aspect-ratio: 12 / 7; border-radius: 18px; overflow: hidden; border: 1px solid var(--line-2);
  background:
    linear-gradient(var(--dg-grid) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, var(--dg-grid) 1px, transparent 1px) 0 0 / 24px 24px,
    var(--dg-art);
  box-shadow: inset 0 1px 0 var(--edge);
}
.dg-hero__cover .bf { width: 100%; height: 100%; }
.dg-rub { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--text); font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }

/* Ключевые цифры — плитками */
.dg-facts { list-style: none; margin: 30px 0 0; padding: 0; display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: 1px; border-radius: 16px; overflow: hidden; border: 1px solid var(--line-2); background: var(--line-2); }
.dg-facts li { display: grid; align-content: start; gap: 6px; padding: 18px 20px 20px; background: var(--dg-card); }
.dg-facts i { font: 600 11.5px var(--mono); font-style: normal; color: var(--dg-dim); letter-spacing: .06em; }
.dg-facts b { font-size: clamp(22px, 2.4vw, 30px); line-height: 1.08; font-weight: 700; letter-spacing: -.02em; color: var(--text); overflow-wrap: break-word; }
.dg-facts span { font-size: 14px; line-height: 1.45; color: var(--muted); }

/* ---------- Граф серии ---------- */
.sg { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px 18px; padding: 12px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: inset 0 1px 0 var(--edge); }
.sg__root { font-size: 13px; font-weight: 700; letter-spacing: .02em; color: var(--text); white-space: nowrap; }
.sg__root:hover { text-decoration: underline; text-underline-offset: 3px; }
.sg__parts { list-style: none; margin: 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
.sg__part { display: grid; gap: 6px; min-width: 0; }
.sg__lbl { display: flex; align-items: baseline; gap: 6px; min-width: 0; color: var(--dim); font-size: 12px; line-height: 1.2; }
.sg__lbl b { font: 600 11px var(--mono); }
.sg__lbl span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg__lbl:hover { color: var(--text); }
.sg__part.is-cur .sg__lbl { color: var(--text); }
.sg__line { position: relative; display: flex; align-items: center; justify-content: space-between; height: 14px; padding: 0 2px; }
.sg__line::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--line-2); }
.sg__part.is-cur .sg__line::before { background: var(--sg-cur-line); }
.sg__dot { position: relative; display: grid; place-items: center; width: 14px; height: 14px; }
.sg__dot i { width: 7px; height: 7px; border-radius: 50%; background: var(--sg-dot); transition: transform .15s ease, background .15s ease; }
.sg__dot.is-plan i { background: var(--bg); box-shadow: inset 0 0 0 1px var(--sg-plan); width: 6px; height: 6px; }
a.sg__dot:hover i { background: var(--text); transform: scale(1.3); }
.sg__dot.is-cur i { width: 11px; height: 11px; background: var(--hi); box-shadow: 0 0 0 3px var(--sg-glow); }
.sg__count { font: 600 12px var(--mono); color: var(--dim); white-space: nowrap; }
.sg__count b { color: var(--text); font-size: 14px; }

/* ---------- Текст статьи ---------- */
/* Текст — в читаемой колонке сайта (70ch), схемы, инфографика, таблицы и карточки — на всю ширину колонки */
.dg-body.prose { max-width: none; }
.dg-body > * { max-width: var(--measure); }
.dg-body > :is(.bfig, .ig, .table, ul.ulcards, .aquote) { max-width: none; }
.dg-body h2 .dg-n { display: block; margin-bottom: 8px; font: 600 12px var(--mono); letter-spacing: .1em; color: var(--dg-dim); }
.dg-body h2, .dg-body h3 { overflow-wrap: break-word; hyphens: auto; }
/* На сайте <b> в начале пункта списка — подзаголовок пункта; в тексте серии выделение бывает и посреди фразы */
.dg-body li b { display: inline; }
.dg-body b { color: var(--text); font-weight: 650; }

/* Список, где каждый пункт начинается с выделенного слова, — карточки в две колонки */
.dg-body ul.ulcards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 1.3em 0 1.5em; }
.dg-body ul.ulcards > li { padding: 15px 17px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: inset 0 1px 0 var(--edge); font-size: .9em; line-height: 1.6; }
.dg-body ul.ulcards > li::before { display: none; }
.dg-body ul.ulcards > li > b:first-child { display: block; margin-bottom: 4px; font-size: 1.04em; line-height: 1.35; }

/* Нумерованный список — шаги с линией */
.dg-body ol.steps { gap: 0; margin: 1.3em 0 1.6em; }
.dg-body ol.steps > li { padding: 0 0 16px 2.6em; }
.dg-body ol.steps > li:last-child { padding-bottom: 0; }
.dg-body ol.steps > li::before { top: .1em; min-width: 1.7em; height: 1.7em; border-radius: 50%; font: 700 .74em/1 var(--mono); }
.dg-body ol.steps > li::after { content: ""; position: absolute; left: .85em; top: 1.95em; bottom: 2px; width: 1px; background: var(--line-2); }
.dg-body ol.steps > li:last-child::after { display: none; }

/* Таблица: шапка — как на сайте (белая), строки чуть светлее на чётных */
.dg-body .table { margin: 1.5em 0; }
.dg-body tbody tr:nth-child(even) td { background: var(--dg-row); }

/* Врезка */
.dg-body .note p { margin: 0 0 .6em; }
.dg-body .note p:last-child { margin-bottom: 0; }

/* ---------- Схема ---------- */
.bfig { margin: 2.2em 0; max-width: none; }
.dg-body .bfig { width: min(100%, 980px); }
.bfig__art {
  padding: clamp(8px, 2vw, 20px); border-radius: 18px; border: 1px solid var(--line-2);
  background:
    linear-gradient(var(--dg-grid) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, var(--dg-grid) 1px, transparent 1px) 0 0 / 24px 24px,
    var(--dg-art);
  box-shadow: inset 0 1px 0 var(--edge);
}
.bfig figcaption { margin-top: 12px; font-size: 14.5px; line-height: 1.6; color: var(--muted); }

.bf {
  display: block; width: 100%; height: auto; overflow: visible;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.bf :is(.bf-l, .bf-t, .bf-lead, .bf-arrow, .bf-head, .bf-flow, .bf-rule, .bf-check, .bf-x, .bf-ico, .bf-curve) { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.bf .bf-l { stroke: var(--bf-line); stroke-width: 1.5; }
.bf .bf-solid { fill: var(--bf-bg); }
.bf .bf-t { stroke: var(--bf-soft); stroke-width: 1; }
.bf .bf-dash { stroke-dasharray: 6 6; }
.bf .bf-lead { stroke: var(--bf-soft); stroke-width: 1; stroke-dasharray: 3 4; }
.bf .bf-rule { stroke: var(--bf-rule); stroke-width: 3; }
.bf .bf-txt { font-size: 13px; fill: var(--bf-ink2); }
.bf .bf-h { font-size: 14px; font-weight: 650; fill: var(--bf-ink); }
.bf .bf-hs { font-size: 12.5px; font-weight: 650; fill: var(--bf-ink); }
.bf .bf-big { font-size: 22px; font-weight: 700; fill: var(--bf-hi); letter-spacing: -.01em; }
.bf .bf-val { font-size: 17px; font-weight: 700; fill: var(--bf-hi); letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.bf .bf-num { font: 600 11.5px ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace; fill: var(--bf-soft); letter-spacing: .04em; }
.bf .bf-pt { font-size: 12px; font-weight: 650; fill: var(--bf-ink); }

/* Блоки */
.bf .bf-box { fill: var(--bf-bg); stroke: var(--bf-line); stroke-width: 1.4; }
.bf .bf-node--dash .bf-box { stroke-dasharray: 5 5; fill: transparent; }
.bf .bf-node--dim .bf-box { stroke: var(--bf-dimline); }
.bf .bf-node--dim .bf-h { fill: var(--bf-soft); }
/* Выделение — «негатив»: белая плашка, чёрные подписи */
.bf .bf-node--hot .bf-box { fill: var(--bf-hi); stroke: var(--bf-hi); }
.bf .bf-node--hot :is(.bf-h, .bf-hs, .bf-txt, .bf-val, .bf-pt) { fill: var(--bf-on-hi); }
.bf .bf-node--hot .bf-num { fill: var(--bf-on-hi-soft); }
.bf .bf-node--hot { animation: bf-pulse 4.5s ease-in-out infinite; }
@keyframes bf-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .82; } }
.bf .bf-doc { fill: var(--bf-bg); stroke: var(--bf-line); stroke-width: 1.4; stroke-linejoin: round; }
.bf .bf-zone { fill: var(--bf-zone); stroke: var(--bf-faint); stroke-width: 1; stroke-dasharray: 4 5; }
.bf .bf-ring { fill: none; stroke: var(--bf-rule); stroke-width: 1.2; }
.bf .bf-ring--hi { stroke: var(--bf-line); }
.bf .bf-fill { fill: var(--bf-bg2); stroke: none; }
.bf .bf-hifill { fill: var(--bf-hi); stroke: none; }
.bf .bf-bar { fill: var(--bf-bar); stroke: none; }
.bf .bf-bar--hi { fill: var(--bf-hi); }
.bf .bf-bar--mid { fill: var(--bf-bar-mid); }
.bf .bf-bar--low { fill: var(--bf-bar-low); }
.bf .bf-bar--tax { fill: var(--bf-bar-tax); stroke: var(--bf-bar-tax-line); stroke-width: 1; }
.bf .bf-bar--res { fill: var(--bf-bar-res); }
.bf .bf-tread { stroke-width: 3; }

/* Стрелки */
.bf .bf-arrow { stroke: var(--bf-line); stroke-width: 1.5; }
.bf .bf-head { stroke: var(--bf-line); stroke-width: 1.5; }
.bf .bf-hotline { stroke: var(--bf-hi); stroke-width: 1.8; }
.bf .bf-flow { stroke: var(--bf-hi); stroke-width: 2; stroke-dasharray: 4 14; opacity: .75; animation: bf-flow 1.8s linear infinite; }
@keyframes bf-flow { to { stroke-dashoffset: -36; } }
.bf .bf-curve { stroke: var(--bf-hi); stroke-width: 2; }
.bf .bf-curve--mid { stroke: var(--bf-curve-mid); stroke-width: 1.6; stroke-dasharray: 7 6; }
.bf .bf-curve--low { stroke: var(--bf-curve-low); stroke-width: 1.6; stroke-dasharray: 2 5; }

/* Точки, галочки, метки */
.bf .bf-dot { fill: var(--bf-hi); }
.bf .bf-dot--dim { fill: var(--bf-dot-dim); }
.bf .bf-run { fill: var(--bf-hi); }
.bf .bf-cbox { fill: var(--bf-bg); stroke: var(--bf-line); stroke-width: 1.3; }
.bf .bf-check { stroke: var(--bf-hi); stroke-width: 2.2; stroke-dasharray: 100; stroke-dashoffset: 0; }
.bf .bf-x { stroke: var(--bf-x); stroke-width: 1.8; }
.bf .bf-ico { stroke: var(--bf-ink); stroke-width: 1.6; }
.bf .bf-ico--hi { stroke: var(--bf-hi); }
.bf .bf-pillbox { fill: var(--bf-bg); stroke: var(--bf-pill); stroke-width: 1.2; }
.bf .bf-pill--hot .bf-pillbox { fill: var(--bf-hi); stroke: var(--bf-hi); }
.bf .bf-pill--hot .bf-pt { fill: var(--bf-on-hi); }
.bf .bf-spin { transform-box: view-box; animation: bf-spin var(--dur, 60s) linear infinite; }
@keyframes bf-spin { to { transform: rotate(360deg); } }

/* Галочки проставляются по очереди, когда схема показалась (класс is-in ставит dogovor.js) */
.bfig .bf-check { stroke-dashoffset: 100; }
.bfig.is-in .bf-check { animation: bf-draw .5s ease forwards; animation-delay: calc(var(--i, 0) * .22s + .2s); }
@keyframes bf-draw { to { stroke-dashoffset: 0; } }
.bf-fade { opacity: 0; }
.bfig.is-in .bf-fade { animation: bf-in .6s ease forwards; animation-delay: calc(var(--i, 0) * .12s); }
@keyframes bf-in { to { opacity: 1; } }

/* Превью: подписи — серыми полосками (site/figs.mjs, sketch) */
.bf--thumb :is(.bf-txt, .bf-h, .bf-num, .bf-lead, .bf-pt, .bf-big) { display: none; }
.bf .bf-sk { fill: var(--bf-sk); }
.bf .bf-sk--h { fill: var(--bf-sk-h); }
.bf .bf-sk--num { fill: var(--bf-sk-num); }
.bf .bf-sk--big { fill: var(--bf-sk-big); }
.bf .bf-node--hot .bf-sk, .bf .bf-pill--hot .bf-sk { fill: var(--bf-on-hi); opacity: .55; }
.bf--thumb { padding: 6%; box-sizing: border-box; }
.bf--thumb .bf-check { stroke-dashoffset: 0; }
.bf--thumb .bf-fade { opacity: 1; }
.bf--thumb .bf-node--hot { animation: none; }

/* ---------- Мини-инфографика ---------- */
.ig { margin: 2em 0; padding: 18px 20px 20px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: inset 0 1px 0 var(--edge); max-width: none; }
.dg-body .ig { width: min(100%, 980px); }
.ig__h { margin: 0 0 14px; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); line-height: 1.4; }
.ig__h span { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--dim); }
.ig__note { margin: 12px 0 0 !important; font-size: 13.5px; line-height: 1.5; color: var(--dim); }
.dg-body .ig ul, .dg-body .ig ol { margin: 0; padding: 0; gap: 0; display: grid; }
.dg-body .ig li { padding: 0; }
.dg-body .ig li::before, .dg-body .ig li::after { display: none; }

/* stats */
.ig-stats { grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: 12px !important; }
.ig-stats li { display: grid; align-content: start; gap: 6px; padding: 14px 16px !important; border-radius: 12px; background: var(--matte-2); border: 1px solid var(--line); }
.ig-stats b { font-size: clamp(22px, 2.6vw, 30px); line-height: 1.05; font-weight: 700; letter-spacing: -.02em; color: var(--text); }
.ig-stats span { font-size: 14px; line-height: 1.45; color: var(--muted); }

/* bars */
.ig-bars { gap: 10px !important; }
.ig-bars li { display: grid; grid-template-columns: minmax(120px, 34%) minmax(0, 1fr) auto; align-items: center; gap: 12px; font-size: 14.5px; line-height: 1.35; }
.ig-bars__l { color: var(--body); }
.ig-bars__bar { position: relative; height: 10px; border-radius: 6px; background: var(--matte-2); border: 1px solid var(--line); overflow: hidden; }
.ig-bars__bar i { position: absolute; inset: 0; background: var(--ig-bar); transform-origin: left; transform: scaleX(var(--iw)); transition: transform .9s cubic-bezier(.2, .7, .2, 1); transition-delay: calc(var(--i) * .08s); }
.ig-bars li.is-max .ig-bars__bar i { background: var(--hi); }
.ig:not(.is-in) .ig-bars__bar i { transform: scaleX(0); }
.ig-bars__v { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* split */
.ig-split { display: flex; height: 38px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line-2); }
.ig-split > span { flex: var(--iw) 1 0; display: grid; place-items: center; min-width: 0; transition: flex-grow .9s cubic-bezier(.2, .7, .2, 1); }
.ig:not(.is-in) .ig-split > span { flex-grow: .0001; }
.ig-split > span b { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; }
.ig-c0 { --c: var(--ig-c0); --t: var(--ig-t0); } .ig-c1 { --c: var(--ig-c1); --t: var(--ig-t1); } .ig-c2 { --c: var(--ig-c2); --t: var(--ig-t2); } .ig-c3 { --c: var(--ig-c3); --t: var(--ig-t3); } .ig-c4 { --c: var(--ig-c4); --t: var(--ig-t4); }
.ig-split > span { background: var(--c); color: var(--t); }
.ig-split__lg { margin-top: 12px !important; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px 18px !important; }
.ig-split__lg li { display: flex; align-items: baseline; gap: 9px; font-size: 14px; line-height: 1.45; color: var(--muted); }
.ig-split__lg i { flex: 0 0 10px; height: 10px; border-radius: 3px; background: var(--c); border: 1px solid var(--ig-legend-line); transform: translateY(1px); }
.ig-split__lg b { color: var(--text); }

/* steps */
.ig-steps { grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: 10px !important; counter-reset: igs; }
.ig-steps li { position: relative; display: grid; align-content: start; gap: 4px; padding: 30px 14px 14px !important; border-radius: 12px; background: var(--matte-2); border: 1px solid var(--line); counter-increment: igs; }
.ig-steps li::before { content: counter(igs, decimal-leading-zero) !important; display: block !important; position: absolute; left: 14px; top: 10px; font: 600 11px var(--mono); color: var(--dim); }
.ig-steps li:not(:last-child)::after { content: "" !important; display: block !important; position: absolute; right: -9px; top: 17px; width: 8px; height: 1px; background: var(--ig-tick); }
.ig-steps b { font-size: 15px; line-height: 1.3; color: var(--text); }
.ig-steps span { font-size: 13.5px; line-height: 1.45; color: var(--muted); }

/* scale */
.ig-scale { position: relative; height: 118px; margin: 6px 4px 0; }
.ig-scale__axis { position: absolute; left: 0; right: 0; top: 50%; height: 2px; border-radius: 2px; background: var(--ig-axis); }
.ig-scale__m { position: absolute; left: calc(var(--x) * 100%); top: 50%; width: 140px; margin-left: -70px; display: grid; justify-items: center; text-align: center; gap: 2px; padding-top: 14px; font-size: 13px; line-height: 1.3; color: var(--muted); }
.ig-scale__m::before { content: ""; position: absolute; top: -5px; left: 50%; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: var(--bg); border: 2px solid var(--hi); }
.ig-scale__m b { color: var(--text); font-size: 15px; }
.ig-scale__m.is-up { top: auto; bottom: 50%; padding: 0 0 14px; }
.ig-scale__m.is-up::before { top: auto; bottom: -5px; }
.ig-scale__m.is-l { margin-left: -10px; justify-items: start; text-align: left; }
.ig-scale__m.is-l::before { left: 10px; }
.ig-scale__m.is-r { margin-left: -130px; justify-items: end; text-align: right; }
.ig-scale__m.is-r::before { left: auto; right: 10px; margin-left: 0; margin-right: -5px; }

/* «Содержание» на телефоне: вся плашка — зона нажатия (у сайта нажимается только строка 20 px) */
.dg .toc--inline { padding: 0 16px; }
.dg .toc--inline summary { min-height: 48px; }
.dg .toc--inline ol { margin-top: 0; padding-bottom: 14px; }

/* timeline */
.ig-tl { grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: 0 !important; }
.ig-tl li { position: relative; display: grid; align-content: start; gap: 6px; padding: 22px 12px 0 0 !important; }
.ig-tl li::before { content: "" !important; display: block !important; position: absolute; left: 0; right: 0; top: 7px; height: 1px; background: var(--line-2); }
.ig-tl li::after { content: "" !important; display: block !important; position: absolute; left: 0; top: 2px; width: 11px; height: 11px; border-radius: 50%; background: var(--bg); border: 2px solid var(--hi); }
.ig-tl b { font-size: 14px; color: var(--text); }
.ig-tl span { font-size: 13.5px; line-height: 1.45; color: var(--muted); }

/* compare */
.ig-cmp { display: grid; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); gap: 12px; }
.ig-cmp__col { padding: 14px 16px; border-radius: 12px; background: var(--matte-2); border: 1px solid var(--line); }
.ig-cmp__col:first-child { border-color: var(--dg-hover); }
.ig-cmp__h { margin: 0 0 10px !important; font-size: 15px; font-weight: 700; color: var(--text); }
.ig-cmp ul { gap: 7px !important; }
.ig-cmp li { position: relative; padding-left: 16px !important; font-size: 14px; line-height: 1.5; color: var(--body); }
.ig-cmp li::before { content: "" !important; display: block !important; position: absolute; left: 1px; top: .62em; width: 6px; height: 6px; border-radius: 1px; background: var(--muted); transform: rotate(45deg); }

/* ---------- Цитата ---------- */
.aquote { margin: 2em 0; padding: 4px 0 4px 22px; border-left: 2px solid var(--hi); max-width: none; }
.aquote blockquote { margin: 0; }
.aquote blockquote p { margin: 0; font-size: 1.12em; line-height: 1.55; color: var(--text); font-style: italic; }
.aquote figcaption { display: grid; gap: 2px; margin-top: 12px; font-size: 14px; line-height: 1.45; color: var(--muted); }
.aquote figcaption b { color: var(--text); }
.aquote cite { font-style: normal; color: var(--dim); }

/* ---------- Термины и вопросы ---------- */
.dg-terms, .dg-faq { margin-top: 3em; padding-top: 1.6em; border-top: 1px solid var(--line-2); }
.dg-terms h2, .dg-faq h2 { margin-top: 0 !important; }
.dg-terms dl { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 28px; }
.dg-terms dt { color: var(--text); font-weight: 650; font-size: .95em; }
.dg-terms dd { margin: 3px 0 0; font-size: .86em; line-height: 1.55; color: var(--muted); }
.dg-faq details { border-bottom: 1px solid var(--line-2); }
.dg-faq summary { position: relative; padding: 15px 36px 15px 0; cursor: pointer; list-style: none; color: var(--text); font-weight: 650; font-size: .98em; line-height: 1.45; }
.dg-faq summary::-webkit-details-marker { display: none; }
.dg-faq summary::after { content: ""; position: absolute; right: 8px; top: 50%; width: 8px; height: 8px; margin-top: -6px; border: solid var(--muted); border-width: 0 2px 2px 0; transform: rotate(45deg); transition: transform .2s ease; }
.dg-faq details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.dg-faq details p { margin: 0 0 16px; color: var(--body); font-size: .94em; }
.dg-disclaimer { margin-top: 2.4em !important; padding-top: 1em; border-top: 1px solid var(--line); font-size: 13.5px !important; line-height: 1.55 !important; color: var(--dim); }

/* Боковая колонка: строка серии над оглавлением */
.toc--side .dg-side { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; margin: 0 0 18px; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); box-shadow: inset 0 1px 0 var(--edge); }
.toc--side .dg-side::before { content: none; display: none; }
.toc--side .dg-side b { white-space: nowrap; }
.toc--side .dg-side span { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.toc--side .dg-side b { font-size: 22px; font-weight: 700; letter-spacing: -.01em; color: var(--text); font-variant-numeric: tabular-nums; }
.toc--side .dg-side:hover { border-color: var(--dg-hover); }

/* ---------- Читать дальше ---------- */
.dg-next { margin-top: 72px; }
.dg-next h2, .dg-cta h2 { margin: 0 0 18px; font-size: 24px; letter-spacing: -.01em; }
.dg-next__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dg-nav { display: grid; grid-template-columns: clamp(170px, 16vw, 240px) minmax(0, 1fr); grid-template-rows: auto auto 1fr; column-gap: 20px; align-items: start; padding: 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: inset 0 1px 0 var(--edge); color: var(--text); transition: border-color .2s ease, transform .25s ease; }
.dg-nav:hover { border-color: var(--dg-hover); transform: translateY(-2px); color: var(--text); }
.dg-nav--plain { grid-template-columns: 1fr; }
.dg-nav__art { grid-row: 1 / 4; aspect-ratio: 12 / 7; border-radius: 11px; overflow: hidden; border: 1px solid var(--line); background: var(--dg-art); }
.dg-nav__art .bf { width: 100%; height: 100%; }
.dg-nav__k { font: 600 12px var(--mono); letter-spacing: .04em; color: var(--dim); }
.dg-nav__t { margin-top: 6px; font-size: 18px; line-height: 1.3; font-weight: 700; letter-spacing: -.01em; }
.dg-nav__d { margin-top: 8px; font-size: 14px; line-height: 1.5; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.dg-nav--next { text-align: right; grid-template-columns: minmax(0, 1fr) clamp(170px, 16vw, 240px); }
.dg-nav--next .dg-nav__art { grid-column: 2; }
.dg-nav--next.dg-nav--plain { grid-template-columns: 1fr; }

/* ---------- Блок xseo74 в конце статьи ---------- */
.dg-cta { display: grid; grid-template-columns: minmax(0, 1.5fr) auto; gap: 24px 40px; align-items: end; margin-top: 56px; padding: clamp(22px, 3vw, 36px); border-radius: 18px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: inset 0 1px 0 var(--edge); }
.dg-cta__k { margin: 0 0 6px; font: 700 12px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.dg-cta h2 { margin-bottom: 10px; }
.dg-cta p { margin: 0; max-width: 64ch; color: var(--muted); line-height: 1.6; }
.dg-cta__act { display: flex; flex-wrap: wrap; gap: 10px; }
.dg-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid var(--dg-hover); background: var(--surface); color: var(--text); font-size: 15px; font-weight: 650; white-space: nowrap; transition: background .15s ease, color .15s ease, border-color .15s ease; }
.dg-btn:hover { border-color: var(--hi); color: var(--text); }
.dg-btn--hi { background: var(--hi); border-color: var(--hi); color: var(--ink); }
.dg-btn--hi:hover { color: var(--ink); filter: brightness(.92); }

/* ---------- Страница раздела: блок серии ---------- */
.dg-group .dg-intro { display: grid; gap: 6px; max-width: 76ch; margin: -2px 0 26px; }
.dg-intro p { margin: 0; color: var(--body); font-size: 16.5px; line-height: 1.6; }
.dg-intro .dg-intro__meta { color: var(--dim); font-size: 14px; font-variant-numeric: tabular-nums; }
.dg-part { margin-top: 30px; scroll-margin-top: 90px; }
.dg-part__head { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; gap: 4px 14px; margin-bottom: 16px; }
.dg-part__n { font: 700 12px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.dg-part__head h3 { margin: 0; font-size: clamp(19px, 2vw, 22px); letter-spacing: -.01em; }
.dg-part__head p { grid-column: 2; margin: 0; max-width: 80ch; color: var(--muted); font-size: 14.5px; line-height: 1.55; }
.dg-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.dg-card { display: flex; flex-direction: column; gap: 10px; height: 100%; padding: 12px 12px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: inset 0 1px 0 var(--edge); color: var(--text); transition: transform .25s ease, border-color .2s ease; }
a.dg-card:hover { transform: translateY(-3px); border-color: var(--dg-hover); color: var(--text); }
.dg-card__art { display: block; aspect-ratio: 12 / 7; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--dg-art); }
.dg-card__art .bf { width: 100%; height: 100%; }
.dg-card__meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dg-card__no { font: 700 13px var(--mono); color: var(--text); }
.dg-card__time { margin-left: auto; font-size: 12.5px; color: var(--dim); }
.dg-card__t { font-size: 16px; line-height: 1.3; font-weight: 650; letter-spacing: -.005em; }
.dg-card__soon { font: 600 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.dg-cards--plan { gap: 8px; }
.dg-card--plan { padding: 12px 14px 14px; background: transparent; border-style: dashed; border-color: var(--dg-plan); box-shadow: none; color: var(--muted); }
.dg-card--plan .dg-card__no { color: var(--dim); }
.dg-card--plan .dg-card__t { font-size: 14.5px; font-weight: 600; }
.dg-links { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 2px 24px; }
.dg-links a { display: block; padding: 9px 0; border-bottom: 1px solid var(--line); color: var(--body); }
.dg-links a:hover { color: var(--text); }

/* ---------- Страница раздела: подбор по задаче и аудитории ---------- */
.dg-facets { display: grid; gap: 10px; margin: 26px 0 8px; padding: 16px 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: inset 0 1px 0 var(--edge); }
.dg-facets[hidden] { display: none; }
.dg-facets__row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.dg-facets__h { flex: 0 0 auto; min-width: 92px; color: var(--muted); font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.dg-facets .filter { cursor: pointer; font: inherit; font-size: 14px; background: transparent; }
.dg-facets .filter.is-on { color: var(--ink); background: var(--hi); border-color: var(--hi); }
.dg-facets .filter[hidden] { display: none; }
.dg-facets .filter[disabled] { opacity: .38; cursor: default; }
.dg-facets .filter span { font-variant-numeric: tabular-nums; }
.dg-facets__sum { display: flex; align-items: center; gap: 14px; margin: 2px 0 0; color: var(--dim); font-size: 14px; font-variant-numeric: tabular-nums; }
.dg-facets__reset { min-height: 36px; padding: 0 6px; border: 0; background: none; color: var(--text); font: inherit; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.dg-facets__reset[hidden] { display: none; }
.sec-group[hidden], .dg-part[hidden], .filters a[hidden], .cards > a.card[hidden], .dg-cards > li[hidden] { display: none; }
@media (max-width: 560px) {
  .dg-facets { padding: 12px 12px 14px; }
  .dg-facets__h { flex-basis: 100%; min-width: 0; }
}

/* ---------- Экраны ---------- */
@media (max-width: 1180px) {
  .dg-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .dg-hero__grid { grid-template-columns: minmax(0, 1fr); }
  .dg-hero__cover { max-width: 640px; }
  .dg-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dg-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dg-next__grid { grid-template-columns: minmax(0, 1fr); }
  .ig-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ig-steps li:not(:last-child)::after { display: none !important; }
  .ig-tl { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 16px !important; }
  .dg-cta { grid-template-columns: minmax(0, 1fr); align-items: start; }
}
/* Граф серии: на узком экране части — колонками в два ряда, счётчик — над ними */
@media (max-width: 760px) {
  .sg { grid-template-columns: minmax(0, 1fr) auto; }
  .sg__parts { grid-column: 1 / -1; grid-row: 2; grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
  .sg__count { grid-row: 1; grid-column: 2; }
  .dg-body ul.ulcards { grid-template-columns: minmax(0, 1fr); }
  .dg-terms dl { grid-template-columns: minmax(0, 1fr); }
  .dg-nav, .dg-nav--next { grid-template-columns: 132px minmax(0, 1fr); column-gap: 14px; text-align: left; }
  .dg-nav--next .dg-nav__art { grid-column: 1; }
  .dg-nav__d { -webkit-line-clamp: 2; }
  .ig-stats { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .ig-cmp { grid-template-columns: minmax(0, 1fr); }
  .ig-bars li { grid-template-columns: minmax(0, 1fr) auto; }
  .ig-bars__bar { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 560px) {
  .dg-hero { margin-bottom: 28px; }
  .dg-hero__grid { margin-top: 20px; gap: 20px; }
  .dg-hero .post__lead { font-size: 17px; }
  .dg-facts li { padding: 14px 14px 16px; }
  .dg-facts span { font-size: 13px; }
  .dg-cards { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .dg-card { flex-direction: row; align-items: center; gap: 12px; padding: 10px; }
  .dg-card__art { flex: 0 0 112px; }
  .dg-card__meta { order: 2; }
  .dg-card > .dg-card__t { order: 1; }
  a.dg-card { display: grid; grid-template-columns: 112px minmax(0, 1fr); grid-template-rows: auto 1fr; column-gap: 12px; row-gap: 6px; align-items: start; }
  a.dg-card .dg-card__art { grid-row: 1 / 3; }
  .dg-card--plan { display: grid; gap: 4px; }
  .dg-part__head { grid-template-columns: minmax(0, 1fr); }
  .dg-part__head p { grid-column: 1; }
  .ig { padding: 14px 14px 16px; }
  .ig-steps { grid-template-columns: minmax(0, 1fr); }
  .ig-tl { grid-template-columns: minmax(0, 1fr); }
  .ig-scale__m { width: 104px; margin-left: -52px; font-size: 12px; }
  .ig-scale__m.is-l { margin-left: -10px; }
  .ig-scale__m.is-r { margin-left: -94px; }
  .bfig__art { border-radius: 14px; }
  /* Схема на телефоне не сжимается до нечитаемых подписей: листается вбок внутри рамки */
  .bfig__art { overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; }
  .bfig .bf { min-width: 600px; }
  .bfig figcaption::before { content: "Схему можно листать вбок →"; display: block; margin-bottom: 6px; font: 600 11.5px var(--mono); letter-spacing: .04em; color: var(--dim); }
  .dg-nav, .dg-nav--next { grid-template-columns: 104px minmax(0, 1fr); padding: 12px; }
  .dg-nav__t { font-size: 16px; }
  .dg-cta__act { flex-direction: column; align-items: stretch; }
}
@media (max-width: 560px) {
  .sg { padding: 10px 12px; gap: 8px 12px; }
  .sg__parts { gap: 6px 12px; }
  .sg__lbl { font-size: 11.5px; }
  .sg__dot { width: 12px; height: 12px; }
  .sg__line { height: 12px; padding: 0; }
}
@media (max-width: 380px) {
  .sg__dot { width: 10px; }
  .dg-facts b { font-size: 21px; }
}
@media (max-width: 339px) {
  .dg-facts { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .bf .bf-flow, .bf .bf-spin, .bf .bf-node--hot { animation: none; }
  .bfig .bf-check { stroke-dashoffset: 0; }
  .bf-fade { opacity: 1; }
  .ig-bars__bar i, .ig-split > span { transition: none; }
  .ig:not(.is-in) .ig-bars__bar i { transform: scaleX(var(--iw)); }
  .ig:not(.is-in) .ig-split > span { flex-grow: var(--iw); }
}

@media print {
  .top, .readbar, .sg, .toc, .dg-next, .dg-cta { display: none !important; }
}
