/* ============ Font: Manrope, self-hosted (variable, 200–800) ============ */
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("assets/fonts/manrope-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("assets/fonts/manrope-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ============ Tokens ============ */
:root {
  --bg: #F5F3F0;
  --surface: #FFFFFF;
  --ink: #131112;
  --ink-2: #4A4547;
  --ink-3: #6E676A;
  --line: #E4E0DC;
  --accent: #D8232A;          /* красный РЗТ */
  --accent-soft: #FBE9E9;
  --bad: #B01C22;             /* красный текст на --accent-soft */
  --warn: #8A5A0B;            /* жёлтый статус: текст */
  --warn-soft: #FBF1DC;       /* жёлтый статус: фон */
  --good: #1F9D55;
  --insight: #E2F1E6;         /* пастельно-зелёный фон блоков с выводами */
  --insight-ink: #1D7042;     /* зелёный номеров на белом и на пастельно-зелёном */
  --stage: #0E0B0C;           /* тёмная «сцена» для экранов РЗТ */
  --stage-2: #1A1517;
  --stage-line: #2A2326;
  --radius: 16px;
  --radius-s: 10px;
  --sidebar: 288px;
  --text: 720px;
  --wide: 1120px;
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 32px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 17px/1.65 var(--font);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
::selection { background: var(--accent); color: #fff; }

/* ============ Layout ============ */
.layout { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }

/* ---- Sidebar / TOC ---- */
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  padding: 32px 20px 32px 28px; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 28px;
  scrollbar-width: thin;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex: none; }
.brand__name { font-weight: 700; font-size: 15px; letter-spacing: -.01em; }
.brand__sub { display: block; font-size: 12px; color: var(--ink-3); font-weight: 500; }

.progress { height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; }
.progress__bar { height: 100%; width: 0; background: var(--accent); transition: width .1s linear; }

.toc { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.toc > li { counter-increment: toc; }
.toc a {
  display: flex; gap: 10px; padding: 6px 10px; margin: 1px 0; border-radius: 8px;
  font-size: 14px; line-height: 1.35; color: var(--ink-2); text-decoration: none;
  transition: background .15s, color .15s;
}
.toc > li > a::before {
  content: counter(toc, decimal-leading-zero);
  font-size: 11px; font-weight: 600; color: var(--ink-3); padding-top: 2px;
  font-variant-numeric: tabular-nums; min-width: 18px;
}
.toc a:hover { background: rgba(0,0,0,.04); color: var(--ink); }
.toc a.is-active { color: var(--ink); font-weight: 600; background: var(--surface); box-shadow: 0 1px 0 var(--line); }
.toc > li > a.is-active::before { color: var(--accent); }
.toc ul { list-style: none; margin: 0 0 6px; padding: 0 0 0 28px; display: none; }
.toc li.is-open > ul { display: block; }
.toc ul a { font-size: 13px; padding: 4px 10px; color: var(--ink-3); }
.toc ul a.is-active { background: none; box-shadow: none; color: var(--accent); }

/* group labels: Исследование / Дизайн / Результат */
.toc > li.toc__group {
  counter-increment: none; margin: 18px 0 6px; padding: 0 10px;
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3);
}
.toc > li.toc__group:first-child { margin-top: 4px; }

/* items with sub-items: chevron button */
.toc > li.has-sub { position: relative; }
.toc > li.has-sub > a { padding-right: 40px; }
.toc__exp {
  position: absolute; top: 1px; right: 0; width: 36px; height: 32px;
  display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px;
  background: none; color: var(--ink-3); cursor: pointer; transition: background .15s, color .15s;
}
.toc__exp:hover { background: rgba(0,0,0,.05); color: var(--ink); }
.toc__exp svg { transition: transform .2s ease; transform: rotate(-90deg); }
.toc li.is-open > .toc__exp svg { transform: none; }
.toc li.is-open > .toc__exp { color: var(--ink); }

/* focus + skip link */
.toc a:focus-visible, .toc__exp:focus-visible, .mbar__btn:focus-visible, .jump-note:focus-visible, .skip:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.skip {
  position: fixed; left: 16px; top: -60px; z-index: 100; padding: 10px 16px; border-radius: 10px;
  background: var(--ink); color: #fff; font-weight: 600; text-decoration: none; transition: top .15s;
}
.skip:focus { top: 16px; }
main:focus { outline: none; }

/* note shown when the case opens straight on the design part */
.jump-note {
  display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; margin: 0 0 28px; padding: 12px 16px;
  border: 1px dashed var(--line); border-radius: var(--radius-s); background: var(--surface);
  font-size: 14px; color: var(--ink-2); text-decoration: none; transition: border-color .15s, color .15s;
}
.jump-note span { color: var(--accent); font-weight: 600; }
.jump-note:hover { border-color: var(--accent); color: var(--ink); }
.jump-note[hidden] { display: none; }

.sidebar__foot { margin-top: auto; font-size: 13px; color: var(--ink-3); display: grid; gap: 6px; }
.sidebar__foot a { text-decoration: none; }
.sidebar__foot a:hover { color: var(--ink); }

/* ---- Mobile bar ---- */
.mbar { display: none; }

/* ---- Content ---- */
.content { min-width: 0; padding: 0 56px 120px; }
.section { max-width: var(--wide); margin: 0 auto; padding-top: 112px; }
.section > *:not(.wide):not(.full) { max-width: var(--text); }
.wide { max-width: var(--wide); }

/* ============ Typography ============ */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent);
  margin: 0 0 16px;
}
.eyebrow::before { content: ""; width: 18px; height: 2px; background: currentColor; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.025em; line-height: 1.12; font-weight: 700; }
h1 { font-size: clamp(38px, 5.2vw, 68px); letter-spacing: -.035em; line-height: 1.02; }
h2 { font-size: clamp(30px, 3.4vw, 44px); margin-bottom: 20px; }
h3 { font-size: 24px; margin: 64px 0 14px; letter-spacing: -.02em; }
h4 { font-size: 17px; margin: 0 0 8px; letter-spacing: -.01em; }
p { margin: 0 0 16px; }
/* переносы: заголовки ровными строками, в абзацах и подписях без одиноких слов в конце */
h1, h2, h3, h4 { text-wrap: balance; }
p, li, dd, figcaption, td, th, .small, .stat__l { text-wrap: pretty; }
.lead { font-size: 20px; line-height: 1.55; color: var(--ink); }
.muted { color: var(--ink-3); }
.small { font-size: 14px; line-height: 1.55; }
strong { font-weight: 700; }
.accent { color: var(--accent); }

ul.list, ol.list { margin: 0 0 16px; padding: 0; list-style: none; display: grid; gap: 10px; }
ul.list li { position: relative; padding-left: 22px; }
ul.list li::before { content: ""; position: absolute; left: 2px; top: .7em; width: 8px; height: 2px; background: var(--ink-3); }
ul.list--good li::before { background: var(--good); }
ul.list--bad li::before { background: var(--bad); }
ol.list { counter-reset: ol; }
ol.list li { counter-increment: ol; position: relative; padding-left: 36px; }
ol.list li::before {
  content: counter(ol); position: absolute; left: 0; top: 1px;
  width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: #fff;
  font-size: 12px; font-weight: 700; display: grid; place-items: center;
}

/* ============ Hero ============ */
.hero__tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.tag {
  display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 99px;
  font-size: 13px; font-weight: 600; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2);
}
.tag--accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.hero { padding-top: 72px; container-type: inline-size; }
.hero h1 { max-width: var(--wide); }
/* Two lines on wide screens: size follows the column so line 1 always fits */
.hero__br { display: none; }
@container (min-width: 700px) {
  .hero h1 { font-size: min(60px, 5.7cqi); }
  .hero__br { display: inline; }
}
.hero .lead { max-width: var(--text); margin-top: 24px; }

.meta {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin: 48px 0 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.meta div { padding: 20px 20px 20px 0; }
.meta div + div { padding-left: 20px; border-left: 1px solid var(--line); }
.meta dt { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; }
.meta dd { margin: 0; font-size: 15px; line-height: 1.45; font-weight: 500; }

.hero__shot { margin-top: 48px; }

/* ============ Slider (onboarding steps) ============ */
.slider { margin: 28px 0 0; }
.slider__viewport { position: relative; border-radius: 24px; overflow: hidden; background: var(--stage); }
.slider__track {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  scrollbar-width: none; outline: none;
}
.slider__track::-webkit-scrollbar { display: none; }
.slider__track:focus-visible { box-shadow: inset 0 0 0 3px var(--accent); }
.slider__slide { flex: 0 0 100%; scroll-snap-align: start; }
.slider__slide img { display: block; width: 100%; height: auto; }
.slider--fit .slider__slide { display: grid; place-items: center; padding: 40px 88px; }
.slider--fit .slider__slide img { width: auto; max-width: 100%; max-height: 640px; border-radius: 16px; }
.slider__arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 48px; height: 48px; border-radius: 50%; border: 0; padding: 0;
  display: grid; place-items: center; cursor: pointer;
  background: var(--surface); color: var(--ink); box-shadow: 0 6px 20px rgba(0,0,0,.35);
  transition: opacity .2s ease, transform .2s ease;
}
.slider__arrow:hover { transform: translateY(-50%) scale(1.06); }
.slider__arrow:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.slider__arrow:disabled { opacity: 0; pointer-events: none; }
.slider__arrow--prev { left: 16px; }
.slider__arrow--next { right: 16px; }
.slider__foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 14px; }
.slider__status { margin: 0; font-size: 14px; color: var(--ink-3); }
.slider__status b { color: var(--ink); }
.slider__dots { display: flex; gap: 4px; }
.slider__dot {
  width: 24px; height: 24px; border: 0; padding: 0; background: none; cursor: pointer;
  display: grid; place-items: center;
}
.slider__dot::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--line);
  transition: background .2s ease, width .2s ease;
}
.slider__dot.is-active::before { width: 20px; border-radius: 99px; background: var(--accent); }
.slider__dot:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 6px; }
@media (max-width: 720px) {
  .slider__viewport { border-radius: 18px; }
  .slider__arrow { width: 36px; height: 36px; }
  .slider__arrow--prev { left: 8px; }
  .slider__arrow--next { right: 8px; }
  .slider--fit .slider__slide { padding: 20px 12px; }
}
@media (prefers-reduced-motion: reduce) { .slider__track { scroll-behavior: auto; } }

/* ============ Stage (dark frame for RZT screens) ============ */
.stage {
  background: var(--stage); border-radius: 24px; padding: 28px; position: relative; overflow: hidden;
  color: #EDE7E8;
}
.stage--glow::before {
  content: ""; position: absolute; inset: -40% -10% auto; height: 80%;
  background: radial-gradient(ellipse at 50% 100%, rgba(216,35,42,.28), transparent 60%);
  pointer-events: none;
}
.stage img { border-radius: 12px; position: relative; }
.stage--flush { padding: 0; }
.stage--flush img { border-radius: 0; }

/* Browser-like scroll frame for tall screens */
.frame {
  border-radius: 14px; overflow: hidden; background: var(--stage-2);
  border: 1px solid var(--stage-line); position: relative;
}
.frame__bar {
  height: 34px; display: flex; align-items: center; gap: 6px; padding: 0 14px;
  background: #161214; border-bottom: 1px solid var(--stage-line);
}
.frame__bar i { width: 9px; height: 9px; border-radius: 50%; background: #3A3135; }
.frame__bar span { margin-left: 12px; font-size: 12px; color: #8C8387; }
.frame__scroll { max-height: 680px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #3A3135 transparent; }
.frame__scroll img { border-radius: 0; width: 100%; }
.frame--device { box-shadow: 0 30px 60px -20px rgba(22,18,20,.35), 0 8px 20px rgba(22,18,20,.08); }

/* ============ Figures ============ */
figure { margin: 32px 0; }
figcaption { margin-top: 12px; font-size: 14px; color: var(--ink); display: flex; justify-content: space-between; gap: 16px; align-items: baseline; }
.stage + figcaption, .stage figcaption, figcaption.muted { color: var(--ink); }
.paper {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; overflow: hidden;
}
.paper img { border-radius: 8px; }
.zoomable { cursor: zoom-in; }
.zoom-btn {
  flex: none; display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 0;
  font: 600 14px var(--font); color: var(--ink); cursor: pointer; white-space: nowrap;
  min-height: 24px;
}
.zoom-btn:hover { color: var(--accent); }
.zoom-btn svg { width: 16px; height: 16px; }

/* Peek: tall artifact preview with fade */
.peek { position: relative; max-height: 560px; overflow: hidden; cursor: zoom-in; }
.peek::after {
  content: "Открыть полностью"; position: absolute; left: 0; right: 0; bottom: 0; height: 160px;
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: 20px;
  background: linear-gradient(to bottom, rgba(255,255,255,0), #fff 75%);
  font: 700 14px var(--font); color: var(--ink);
}
.peek:hover::after { color: var(--accent); }
.peek--dark { max-height: 640px; }
.peek--dark::after { background: linear-gradient(to bottom, transparent, var(--stage) 75%); color: #fff; }
.peek--dark:hover::after { color: #fff; text-decoration: underline; }

/* UI-kit fragments in tabs */
.kit-tabs .tabs__panel figure { margin: 0; }
.kit-stack { display: grid; gap: 28px; }

/* ============ Cards / blocks ============ */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px;
}
.card > h3:first-child { margin-top: 0; font-size: 20px; }
.card p:last-child, .card ul:last-child { margin-bottom: 0; }
.card__num { font-size: 13px; font-weight: 700; color: var(--accent); margin-bottom: 10px; font-variant-numeric: tabular-nums; }
.card--dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.card--dark .muted { color: #A8A1A4; }

/* key decisions: decision + where it came from + links both ways */
.dec__item { display: flex; flex-direction: column; }
.dec__shot { aspect-ratio: 16 / 9; margin-bottom: 18px; border-radius: var(--radius-s); overflow: hidden; background: var(--stage); border: 1px solid var(--line); }
.dec__shot img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: transform .3s ease; }
.dec__shot:hover img { transform: scale(1.02); }
.dec__item .small { flex: 1; color: var(--ink-2); }
.dec__from { font-weight: 700; color: var(--ink); }
.dec__links { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 16px 0 0; font-size: 14px; font-weight: 600; }
.dec__links a { color: var(--accent); text-decoration: none; }
.dec__links a:hover { text-decoration: underline; }

/* Insight list */
.insights { display: grid; gap: 0; margin: 24px 0; border-top: 1px solid var(--line); }
.insight { display: grid; grid-template-columns: 40px 1fr; gap: 16px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.insight__n { font-size: 13px; font-weight: 700; color: var(--accent); padding-top: 3px; font-variant-numeric: tabular-nums; }
.insight :is(h3, h4) { font-size: 18px; margin: 0 0 4px; letter-spacing: -.01em; }
.insight p { margin: 0; color: var(--ink); }
/* Takeaways: highlighted block of key insights (conclusions of a research step).
   Equal cards, three per row (.insights--2: two per row) */
.takeaways { margin: 48px 0 16px; padding: 36px; background: var(--insight); border-radius: 24px; }
.takeaways__head { margin-bottom: 24px; }
.takeaways__head h4 { font-size: 32px; letter-spacing: -.025em; margin: 0; }
.insights--cards { grid-template-columns: repeat(3, 1fr); gap: 12px; border-top: 0; margin: 0; }
.insights--cards .insight { grid-template-columns: 1fr; align-content: start; gap: 12px; padding: 24px; background: var(--surface); border: 0; border-radius: var(--radius); }
.insights--cards .insight__n { padding-top: 0; font-size: 15px; color: var(--insight-ink); }
.insights--cards .insight :is(h3, h4) { font-size: 19px; line-height: 1.35; margin-bottom: 8px; }
.insights--cards .insight p { font-size: 15px; line-height: 1.55; color: var(--ink-2); }
.insights--2 { grid-template-columns: repeat(2, 1fr); }
/* joke card that fills the empty sixth slot */
.insights--cards .insight--joke { background: transparent; border: 1.5px dashed color-mix(in srgb, var(--insight-ink) 40%, transparent); place-content: center; justify-items: center; text-align: center; gap: 8px; }
.insight--joke .insight__emoji { font-size: 44px; line-height: 1; }
.insights--cards .insight--joke p { font-size: 17px; font-weight: 600; color: var(--insight-ink); }


/* Audit criteria: what was checked */
ul.list.criteria { margin: 4px 0 32px; gap: 8px; }
ul.list--dots li { padding-left: 24px; }
ul.list--dots li::before { left: 4px; top: .62em; width: 7px; height: 7px; border-radius: 50%; }
@media (max-width: 720px) { .takeaways { padding: 20px; } .insights--cards { grid-template-columns: 1fr; } }

h3.h3--tight { margin-top: 36px; }

/* Task statement (block «Проблема, задача, ограничения») */
.task { background: var(--ink); color: #fff; border-radius: var(--radius); padding: 28px 32px; margin: 32px 0 0; }
.task__label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #A8A1A4; margin-bottom: 14px; }
.task__label::before { content: ""; width: 18px; height: 2px; background: var(--accent); }
.task p { margin: 0; font-size: 22px; line-height: 1.45; font-weight: 600; letter-spacing: -.01em; }

/* Callout */
.callout {
  background: var(--accent-soft); border-radius: var(--radius); padding: 20px 24px; margin: 28px 0;
  font-size: 19px; line-height: 1.55; font-weight: 500;
}
.note {
  background: var(--surface); border: 1px dashed #CFC8C3; border-radius: var(--radius-s);
  padding: 14px 16px; font-size: 14px; color: var(--ink-2); margin: 20px 0;
}

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 32px 0; }
.stats--3 { grid-template-columns: repeat(3, 1fr); }
.stats--2 { grid-template-columns: repeat(2, 1fr); }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 22px 20px; }
.stat__v { font-size: 40px; font-weight: 800; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat__v small { font-size: 20px; font-weight: 700; color: var(--ink-3); letter-spacing: -.02em; }
.stat__l { margin-top: 10px; font-size: 14px; line-height: 1.45; color: var(--ink-2); }

/* Process timeline */
/* Process chain (block «Рабочий процесс») */
.chain { list-style: none; padding: 0; margin: 32px 0 0; }
.chain__card {
  display: grid; grid-template-columns: 36px 1fr; gap: 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px;
}
.chain__num { font-size: 13px; font-weight: 700; color: var(--accent); padding-top: 3px; font-variant-numeric: tabular-nums; }
h3.card__title { font-size: 17px; margin: 0 0 8px; letter-spacing: -.01em; }
h3.chain__title { font-size: 18px; margin: 0 0 6px; letter-spacing: -.01em; line-height: 1.3; }
.chain__card p { margin: 0; color: var(--ink-2); font-size: 15px; line-height: 1.5; }
.chain__why {
  position: relative; margin: 0; padding: 20px 0 26px 76px;
  color: var(--ink-3); font-size: 15px; line-height: 1.5;
}
.chain__why::before { content: ""; position: absolute; left: 33px; top: 0; bottom: 8px; width: 1px; background: #C9C2BD; }
.chain__why::after {
  content: ""; position: absolute; left: 29px; bottom: 9px; width: 8px; height: 8px;
  border-right: 1.5px solid var(--accent); border-bottom: 1.5px solid var(--accent); transform: rotate(45deg);
}

.steps { list-style: none; padding: 0; margin: 28px 0; display: grid; gap: 0; counter-reset: st; }
.steps li {
  counter-increment: st; display: grid; grid-template-columns: 56px 1fr; gap: 16px; align-items: start;
  padding: 18px 0; border-bottom: 1px solid var(--line); position: relative;
}
.steps li:first-child { border-top: 1px solid var(--line); }
.steps li::before {
  content: counter(st, decimal-leading-zero); font-size: 28px; font-weight: 800; letter-spacing: -.04em;
  color: var(--ink); line-height: 1; font-variant-numeric: tabular-nums;
}
.steps b { display: block; font-size: 17px; margin-bottom: 2px; }
.steps span { color: var(--ink); font-size: 15px; }
.steps a { text-decoration: none; }
.steps a:hover b { color: var(--accent); }

/* Problem → solution */
.ps { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 24px 0 8px; }
.ps__col { border-radius: var(--radius); padding: 22px 24px; }
.ps__col--p { background: var(--surface); border: 1px solid var(--line); }
.ps__col--s { background: var(--ink); color: #F4F0F1; }
.ps__label {
  font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.ps__col--p .ps__label { color: var(--bad); }
.ps__col--s .ps__label { color: var(--insight); }
.ps ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; font-size: 15.5px; line-height: 1.55; }
.ps li { padding-left: 18px; position: relative; }
.ps__col--p li::before { content: "–"; position: absolute; left: 0; color: var(--ink-3); }
.ps__col--s li::before { content: "→"; position: absolute; left: 0; color: var(--insight); }

/* Problem → solution by scenario (release page) */
.psr { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin: 24px 0 8px; }
.psr__head, .psr__row { display: grid; grid-template-columns: 200px 1fr 1.35fr; gap: 32px; padding: 0 28px; }
.psr__head {
  padding-top: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line);
  font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3);
}
.psr__head span:nth-child(2) { color: var(--bad); }
.psr__head span:last-child { color: var(--insight-ink); }
.psr__row { padding-top: 22px; padding-bottom: 22px; }
.psr__row + .psr__row { border-top: 1px solid var(--line); }
.psr__scn { margin: 0; font-size: 16px; line-height: 1.45; font-weight: 700; }
.psr ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; align-content: start; font-size: 15.5px; line-height: 1.55; }
.psr li { padding-left: 18px; position: relative; }
.psr__p { color: var(--ink-2); }
.psr__p li::before { content: "–"; position: absolute; left: 0; color: var(--ink-3); }
.psr__s li::before { content: "→"; position: absolute; left: 0; color: var(--insight-ink); }
@media (max-width: 1024px) {
  .psr__head, .psr__row { grid-template-columns: 1fr 1fr; gap: 12px 24px; }
  .psr__head span:first-child { display: none; }
  .psr__scn { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .psr__head { display: none; }
  .psr__head, .psr__row { grid-template-columns: 1fr; padding-left: 20px; padding-right: 20px; }
  .psr ul::before {
    font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: -2px;
  }
  .psr .psr__p::before { content: "Проблемы"; color: var(--bad); }
  .psr .psr__s::before { content: "Решения"; color: var(--insight-ink); }
}

/* Flow: path by stages (#flow) */
.fl { display: grid; grid-template-columns: 64px repeat(5, minmax(0, 1fr)); grid-template-rows: auto auto auto; grid-auto-flow: column; gap: 8px; margin: 24px 0 12px; }
.fl__stage { display: contents; }
.fl__rl { align-self: center; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.fl__rl--now { color: var(--insight-ink); }
.fl__head { display: flex; align-items: baseline; gap: 8px; padding: 0 4px 4px; font-size: 15px; font-weight: 700; line-height: 1.3; }
.fl__n { flex: none; font-size: 13px; font-weight: 700; color: var(--ink-3); }
.fl__cell { border-radius: var(--radius-s); padding: 14px 16px; font-size: 14px; line-height: 1.5; }
.fl__cell p { margin: 0; }
.fl__cell--base { background: var(--surface); border: 1px solid var(--line); }
.fl__cell--exit { background: var(--accent-soft); }
.fl__cell--warn { background: var(--warn-soft); }
.fl__cell--now { background: var(--insight); }
.fl__tag { display: inline-block; margin-bottom: 6px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.fl__cell--exit .fl__tag { color: var(--bad); }
.fl__cell--warn .fl__tag { color: var(--warn); }
@media (max-width: 1280px) {
  .fl { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: none; grid-auto-flow: row; gap: 8px 8px; }
  .fl__corner, .fl__rl { display: none; }
  .fl__head { grid-column: 1 / -1; padding-top: 12px; }
  .fl__cell::before { content: attr(data-side); display: block; margin-bottom: 6px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
  .fl__cell--now::before { color: var(--insight-ink); }
}
@media (max-width: 720px) { .fl { grid-template-columns: 1fr; } }

/* Before / After */
.ba { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-radius: 24px; overflow: hidden; background: var(--stage); margin: 16px 0 32px; }
.ba__side { padding: 22px 24px 26px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.ba__side + .ba__side { border-left: 1px solid var(--stage-line); background: #151012; }
.ba__label { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #8C8387; display: flex; gap: 8px; align-items: center; }
.ba__label::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #5A5053; }
.ba__side--new .ba__label { color: var(--insight); }
.ba__side--new .ba__label::before { background: var(--good); box-shadow: 0 0 0 4px rgba(31,157,85,.25); }
.ba__imgs { display: flex; gap: 12px; align-items: flex-start; justify-content: center; flex: 1; }
.ba__imgs--col { flex-direction: column; align-items: stretch; }
.ba__imgs img { border-radius: 10px; min-width: 0; max-height: 520px; object-fit: contain; width: auto; }
.ba__imgs--col img { width: 100%; max-height: none; }
/* stacked variant for wide screenshots: было сверху, стало снизу */
.ba--stack { grid-template-columns: 1fr; }
.ba--stack .ba__side + .ba__side { border-left: 0; border-top: 1px solid var(--stage-line); }
.ba--stack .ba__side { padding: 24px 32px 30px; }
.ba--stack .ba__imgs--col { align-items: center; }
.ba--stack .ba__imgs--col img { max-width: 860px; }
/* Menu: old list vs new menu at the same visual scale (the new export is ~1.5x denser) */
.ba--menu .ba__imgs { align-items: flex-start; }
.ba--menu .ba__side:first-child img { width: 200px; max-height: none; }
.ba--menu .ba__side--new img { width: 236px; max-height: none; }
.ba__note { margin: 0; font-size: 13px; color: #8C8387; text-align: center; }
.menu-states { display: flex; gap: 28px; justify-content: center; align-items: flex-start; flex-wrap: wrap; margin: 16px 0 24px; }
.menu-states figure { margin: 0; display: flex; flex-direction: column; gap: 12px; }
.menu-states img { width: auto; max-width: 100%; border-radius: 10px; }
.menu-states figure:nth-child(1) img { width: 322px; }
.menu-states figure:nth-child(2) img { width: 248px; }
.menu-states figure:nth-child(3) img { width: 267px; }
.menu-states figcaption { margin: 0; color: #A8A1A4; }
/* Auth block */
.sub-h { margin: 40px 0 8px; font-size: 20px; }
.ba__imgs--modal img { max-width: 300px; }
.ba__imgs--pair img { max-width: calc(50% - 6px); }
.table-cap { margin: 28px 0 -12px; font-size: 14px; color: var(--ink-3); }
.table-cap b { color: var(--ink); }
.err-matrix td.err { color: var(--bad); background: var(--accent-soft); }
.err-matrix td:first-child { font-weight: 600; }
.menu-icons { display: flex; justify-content: center; padding: 12px 20px; }
.menu-icons img { width: 100%; max-width: 860px; height: auto; }
.menu-header { display: grid; gap: 16px; padding: 20px; }
.menu-header img { width: 100%; height: auto; border-radius: 8px; }
#menu .grid-2 { margin: 8px 0 32px; }

/* Tabs (AS IS / TO BE) */
.tabs { margin: 28px 0; }
.tabs__head { display: inline-flex; gap: 0; padding: 0; background: var(--surface); border: 0; border-radius: 99px; overflow: hidden; margin-bottom: 18px; }
.tabs__btn {
  border: 0; background: none; height: 48px; padding: 0 24px; border-radius: 99px; cursor: pointer;
  font: 600 16px var(--font); color: var(--ink);
}
.tabs__btn.is-active { background: var(--ink); color: #fff; }
.tabs__panel[hidden] { display: none; }
@media (max-width: 720px) {
  .tabs__head { display: flex; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .tabs__head::-webkit-scrollbar { display: none; }
  .tabs__btn { flex: none; white-space: nowrap; padding: 0 14px; }
}

/* Chart: paired bars */
.chart { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 28px 28px 20px; margin: 28px 0; }
.chart__head { display: flex; justify-content: space-between; gap: 24px; align-items: flex-end; margin-bottom: 24px; flex-wrap: wrap; }
.chart__title { font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.legend { display: flex; gap: 18px; font-size: 13px; color: var(--ink-2); font-weight: 500; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend .l-old { background: #CFC8C3; }
.legend .l-new { background: var(--good); }
.legend .l-down { background: var(--accent); }
.bars { display: grid; gap: 14px; }
.bar-row { display: grid; grid-template-columns: minmax(180px, 280px) 1fr 92px; gap: 20px; align-items: center; }
.bar-row__label { font-size: 14px; line-height: 1.35; color: var(--ink); }
.bar-row__track { display: grid; gap: 4px; }
.bar { height: 10px; border-radius: 5px; background: #F0ECE9; position: relative; overflow: hidden; }
.bar > span { position: absolute; inset: 0 auto 0 0; border-radius: 5px; width: var(--w); transform-origin: left; transition: transform 1s cubic-bezier(.2,.7,.2,1); }
.bar--old > span { background: #CFC8C3; }
.bar--new > span { background: var(--good); }
.bar--down > span { background: var(--accent); }
.chart:not(.is-in) .bar > span { transform: scaleX(0); }
.bar-row__val { font-size: 13px; font-variant-numeric: tabular-nums; text-align: right; line-height: 1.3; color: var(--ink-3); }
.bar-row__val b { color: var(--ink); font-size: 14px; }
.bar-row__val .down { color: var(--bad); background: var(--accent-soft); padding: 0 5px; border-radius: 4px; }
.bar-row--total { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 4px; }
.bar-row--total .bar-row__label { font-weight: 700; }
.chart__foot { margin-top: 20px; font-size: 13px; color: var(--ink-3); line-height: 1.5; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 24px 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.45; }
th, td { text-align: left; padding: 14px 18px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); background: #FAF9F7; }
tr:last-child td { border-bottom: 0; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }

/* Воронка оценки: столбцы шагов, штриховка — отвал на шаге.
   Полосы метрик ниже стоят в той же сетке и охватывают свои шаги (--from / --to) */
.funnel { padding: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.funnel__steps, .funnel__metrics { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); column-gap: 12px; list-style: none; margin: 0; padding: 0; }
.funnel__step { display: flex; flex-direction: column; gap: 4px; }
.funnel__col { height: 200px; display: flex; flex-direction: column; justify-content: flex-end; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.funnel__bar { height: var(--h); background: color-mix(in srgb, var(--ink) 7%, var(--surface)); border-radius: 8px 8px 0 0; }
.funnel__drop {
  height: calc(var(--prev) - var(--h)); border-radius: 8px 8px 0 0;
  background: repeating-linear-gradient(-45deg, var(--line) 0 2px, transparent 2px 7px);
}
.funnel__drop + .funnel__bar { border-radius: 0; }
.funnel__step:first-child .funnel__bar { border-radius: 8px 8px 0 0; }
.funnel__step--goal .funnel__bar { background: var(--good); }
.funnel__n { font-size: 12px; font-weight: 700; letter-spacing: .06em; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.funnel__name { font-size: 15px; line-height: 1.3; }
.funnel__hint { font-size: 13px; line-height: 1.4; color: var(--ink-2); }
.funnel__metrics { row-gap: 8px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.funnel__metric {
  grid-column: var(--from) / var(--to); display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 10px 14px; border-radius: var(--radius-s); background: var(--bg); font-size: 14px; line-height: 1.35;
}
.funnel__metric span { font-size: 13px; color: var(--ink-3); white-space: nowrap; }
.funnel__metric--main { background: var(--insight); color: var(--insight-ink); }
@media (max-width: 720px) {
  .funnel { padding: 18px 16px; }
  .funnel__steps, .funnel__metrics { grid-template-columns: 1fr; }
  .funnel__steps { row-gap: 18px; }
  .funnel__step { display: grid; grid-template-columns: 28px 1fr; column-gap: 8px; row-gap: 2px; }
  .funnel__col { grid-column: 1 / -1; order: 3; height: 20px; margin: 8px 0 0; flex-direction: row; justify-content: flex-start; border: 0; }
  .funnel__col .funnel__bar { order: -1; width: var(--h); height: 100%; border-radius: 6px 0 0 6px; }
  .funnel__step:first-child .funnel__bar { border-radius: 6px; }
  .funnel__drop { width: calc(var(--prev) - var(--h)); height: 100%; border-radius: 0 6px 6px 0; }
  .funnel__n { line-height: 1.6; }
  .funnel__name { grid-column: 2; }
  .funnel__hint { grid-column: 2; }
  .funnel__metric { grid-column: 1; flex-direction: column; gap: 2px; }
}
td.num.up { color: var(--insight-ink); font-size: 22px; line-height: 1; }

/* «Было → Стало»: карточки, проблема сверху, решение снизу, стрелка между ними.
   subgrid держит стрелки всех карточек ряда на одной линии */
.pairs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 32px 0 8px; }
.pair {
  display: grid; grid-row: span 3; grid-template-rows: subgrid; row-gap: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px 24px;
}
.pair p { margin: 0; }
.pair__label { display: block; margin-bottom: 6px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.pair__was { font-size: 15px; line-height: 1.5; color: var(--ink-3); }
.pair__now { font-size: 16px; line-height: 1.45; font-weight: 600; color: var(--ink); }
.pair__was .pair__label { color: var(--bad); }
.pair__now .pair__label { color: var(--insight-ink); }
.pair__arrow { display: flex; align-items: center; gap: 10px; margin: 16px 0; }
.pair__arrow::before, .pair__arrow::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.pair__arrow i {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--insight); color: var(--insight-ink); font-style: normal; font-size: 16px; font-weight: 700; line-height: 1;
}
@media (max-width: 1024px) { .pairs { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 720px) { .pairs { grid-template-columns: 1fr; } }
.pairs.pairs--2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 720px) { .pairs.pairs--2 { grid-template-columns: 1fr; } }

/* Tree (IA) */
.tree { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin: 24px 0; }
.tree__col { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; font-size: 13.5px; line-height: 1.4; }
.tree__col b { display: block; font-size: 15px; margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.tree__col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; color: var(--ink-2); }
.tree__col li.sub { padding-left: 12px; color: var(--ink-3); font-size: 12.5px; }
.tree__col--home { background: var(--ink); color: #fff; border-color: var(--ink); }
.tree__col--home b { border-color: #333; }
.tree__col--home ul { color: #BDB6B9; }

/* Footer */
.end { margin-top: 140px; padding: 48px; border-radius: 28px; background: var(--ink); color: #fff; max-width: var(--text); margin-left: max(0px, (100% - var(--wide)) / 2); }
.end h2 { color: #fff; }
.end p { color: #BDB6B9; }
.end .btn {
  display: inline-flex; border: 0; font: inherit; font-size: 16px; cursor: pointer; align-items: center; height: 48px; padding: 0 22px; border-radius: 99px;
  background: var(--accent); color: #fff; text-decoration: none; font-weight: 700;
}
.end__contacts { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.end .btn--ghost { background: transparent; box-shadow: inset 0 0 0 1px rgba(255,255,255,.3); }
.end .btn--ghost:hover { box-shadow: inset 0 0 0 1px #fff; }
.end .btn.is-copied { box-shadow: inset 0 0 0 1px var(--accent); }
.end__top { display: inline-block; margin-top: 28px; font-size: 14px; color: #BDB6B9; text-decoration: none; }
.end__top:hover { color: #fff; }
@media (max-width: 720px) { .end .btn { width: 100%; justify-content: center; } }

/* ============ Lightbox ============ */
.lb {
  position: fixed; inset: 0; z-index: 100; background: rgba(10,8,9,.94);
  display: none; flex-direction: column;
}
.lb.is-open { display: flex; }
.lb__bar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; color: #D9D2D5; font-size: 14px; background: var(--stage); }
.lb__title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb__btn {
  height: 36px; min-width: 36px; padding: 0 12px; border-radius: 99px; border: 1px solid #3A3135;
  background: #1A1517; color: #fff; font: 600 13px var(--font); cursor: pointer;
}
.lb__btn:hover { border-color: #6A5F63; }
.lb__view { flex: 1; overflow: auto; cursor: zoom-in; display: flex; }
.lb__view img { margin: auto; max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.lb__view.is-tall img { max-height: none; width: min(100%, 1400px); }
.lb__view.is-zoom { cursor: grab; }
.lb__view.is-zoom img { max-width: none; max-height: none; height: auto; flex-shrink: 0; }
.lb__view.is-drag { cursor: grabbing; }
.lb__loading { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); color: #8C8387; font-size: 14px; }

/* ============ Reveal ============ */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .bar > span { transition: none; }
}

/* ============ Responsive ============ */
@media (max-width: 1280px) {
  .content { padding: 0 40px 100px; }
  .tree { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1024px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: min(320px, 86vw); z-index: 60; background: var(--bg);
    transform: translateX(-100%); transition: transform .25s ease, box-shadow .25s ease; box-shadow: none;
  }
  body.toc-open .sidebar { transform: none; box-shadow: 0 0 60px rgba(0,0,0,.2); }
  body.toc-open .scrim { opacity: 1; pointer-events: auto; }
  .scrim { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 55; opacity: 0; pointer-events: none; transition: opacity .25s; }
  .mbar {
    display: flex; position: sticky; top: 0; z-index: 50; align-items: center; gap: 12px;
    height: 56px; padding: 0 16px; background: rgba(245,243,240,.92); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
  }
  .mbar__btn { border: 1px solid var(--line); background: var(--surface); height: 36px; padding: 0 14px; border-radius: 99px; font: 600 13px var(--font); cursor: pointer; }
  .mbar__cur { font-size: 14px; font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .mbar .progress { position: absolute; left: 0; right: 0; bottom: -1px; }
  html { scroll-padding-top: 72px; }
  .content { padding: 0 24px 80px; }
  .section { padding-top: 80px; }
  .hero { padding-top: 40px; }
  .meta, .stats:not(.stats--3) { grid-template-columns: repeat(2, 1fr); }
  .meta div:nth-child(3) { padding-left: 0; border-left: 0; }
  .meta div:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .lead { font-size: 18px; }
  .content { padding: 0 16px 64px; }
  .grid-2, .grid-3, .ps, .ba { grid-template-columns: 1fr; }
  .ba__side + .ba__side { border-left: 0; border-top: 1px solid var(--stage-line); }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stats--3 .stat--accent { grid-column: 1 / -1; }
  .stat { padding: 16px; }
  .stat__v { font-size: 30px; }
  .stage { padding: 14px; border-radius: 18px; }
  .bar-row { grid-template-columns: 1fr 72px; gap: 8px 12px; }
  .bar-row__label { grid-column: 1 / -1; }
  .chart { padding: 20px 16px 16px; }
  .tree { grid-template-columns: repeat(2, 1fr); }
  .end { padding: 28px; }
  h3 { margin-top: 48px; }
  .frame__scroll { max-height: 520px; }
  /* tables become stacked cards */
  .table-wrap { overflow: visible; border: 0; background: none; border-radius: 0; }
  .table-wrap table, .table-wrap tbody, .table-wrap tr, .table-wrap td { display: block; width: auto; }
  .table-wrap thead { display: none; }
  .table-wrap tr { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; }
  .table-wrap tr + tr { margin-top: 10px; }
  .table-wrap td { padding: 0; border: 0; }
  .table-wrap td + td { margin-top: 12px; }
  .table-wrap td:first-child { font-size: 16px; font-weight: 600; line-height: 1.35; }
  .table-wrap td + td::before {
    content: attr(data-label); display: block; margin-bottom: 4px;
    font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3);
  }
  .table-wrap td.num { display: flex; align-items: baseline; gap: 10px; white-space: normal; }
  .table-wrap td.num::before { margin: 0; }
}

/* ============ Hypothesis cards ============ */
.hyps { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 12px; row-gap: 12px; margin: 28px auto 8px; }
/* subgrid: статус, гипотеза и dl каждой карточки лежат в общих строках ряда, поэтому разделители на одном уровне */
.hyp {
  display: grid; grid-row: span 3; grid-template-rows: subgrid; row-gap: 16px; align-content: start; padding: 24px;
  background: var(--surface); border: 1.5px solid var(--hyp-c);
  border-radius: var(--radius);
}
.hyp--ok,   .verdict--ok   { --hyp-c: var(--good);   --hyp-ink: var(--insight-ink); --hyp-bg: var(--insight); }
.hyp--warn, .verdict--warn { --hyp-c: #D9A23A;       --hyp-ink: var(--warn);        --hyp-bg: var(--warn-soft); }
.hyp--bad,  .verdict--bad  { --hyp-c: var(--bad);    --hyp-ink: var(--bad);         --hyp-bg: var(--accent-soft); }
.hyp__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.hyp__status {
  display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 10px; border-radius: 999px;
  background: var(--hyp-bg); color: var(--hyp-ink); font-size: 13px; font-weight: 700; line-height: 1.5;
}
.hyp__status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--hyp-c); }
.hyp__group { font-size: 13px; color: var(--ink-3); font-weight: 600; }
.hyp h4 { margin: 0; font-size: 17px; font-weight: 600; line-height: 1.4; letter-spacing: -.01em; }
.hyp dl { display: grid; gap: 12px; align-content: start; margin: 0; padding-top: 16px; border-top: 1px solid var(--line); }
.hyp dl > div { display: grid; gap: 2px; }
.hyp dt { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.hyp dd { margin: 0; font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.hyp dd a { color: inherit; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line); }
.hyp dd a:hover { color: var(--accent); text-decoration-color: currentColor; }
@media (max-width: 720px) { .hyps { grid-template-columns: 1fr; } .hyp { padding: 20px; } }

/* Итоговые выводы: карточки в цветах итоговой таблицы */
.verdict { background: var(--hyp-bg); border-color: transparent; }
.verdict__label {
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
  font-size: 13px; font-weight: 700; color: var(--hyp-ink);
}
.verdict__label::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--hyp-c); }
.verdict p { color: var(--ink-2); }

/* Home: block order before / after */
.order { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 24px 0 12px; }
.order__col { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; }
.order__col--new { background: var(--ink); border-color: var(--ink); color: #fff; }
.order__title { margin: 0 0 10px; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.order__col--new .order__title { color: var(--insight); }
.order ol { list-style: none; margin: 0; padding: 0; counter-reset: ord; }
.order li { counter-increment: ord; display: grid; grid-template-columns: 30px 1fr; padding: 8px 0; border-top: 1px solid var(--line); font-size: 15px; line-height: 1.4; }
.order__col--new li { border-top-color: var(--stage-line); }
.order li::before { content: counter(ord, decimal-leading-zero); padding-top: 2px; font-size: 12px; font-weight: 700; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.order li small { grid-column: 2; font-size: 13px; color: var(--ink-3); }
.order__col--new li small { color: #A8A1A4; }
#home .tabs__panel > .ps { margin-top: 20px; }
@media (max-width: 720px) { .order { grid-template-columns: 1fr; } }

/* Keep hyphenated terms (UI-кит, HADI-цикл) on one line */
.nowrap { white-space: nowrap; }


/* Кейс ИБП: вертикальное фото объекта в hero */

/* ================= HMI case: screenshots, pins, strips, matrix ================= */
.shot { display: block; position: relative; border-radius: 14px; overflow: hidden; background: #fff;
  border: 1px solid var(--line); box-shadow: 0 24px 50px -24px rgba(22,18,20,.28), 0 4px 12px rgba(22,18,20,.05); cursor: zoom-in; }
.shot img { display: block; width: 100%; height: auto; }
.shot--doc { padding: 0; background: #fff; }
.shots-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px 24px; margin: 32px 0; }
.shots-2 figure { margin: 0; }
.shots-2 figcaption, .shots-3 figcaption { display: block; }
.shots-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px 20px; margin: 32px 0; }
.shots-3 figure { margin: 0; }
.shots-3 figcaption { font-size: 13px; }
figcaption b { color: var(--ink); font-weight: 600; }

/* pins over the main screen */
.pins { position: relative; }
.pin { position: absolute; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: 14px; font-weight: 700; display: grid; place-items: center;
  pointer-events: none; font-variant-numeric: tabular-nums; }
.pinlist { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 32px; counter-reset: pin; }
.pinlist li { position: relative; padding-left: 44px; font-size: 15px; line-height: 1.5; color: var(--ink); }
/* номер в подписи = тот же пин, что на скриншоте */
.pinlist li::before { counter-increment: pin; content: counter(pin); position: absolute; left: 3px; top: -2px;
  width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 13px; font-weight: 700; display: grid; place-items: center;
  font-variant-numeric: tabular-nums; }
.pinlist b { color: var(--ink); }

/* status strips */
.strips { display: grid; gap: 14px; margin: 28px 0; }
.strips figure { margin: 0; }
.strips .shot { border-radius: 10px; }
.strips figcaption { margin-top: 6px; font-size: 13.5px; display: block; }


/* signal → state → mode → UI */
.s2ui td { font-size: 14.5px; }
.s2ui code { font-family: inherit; font-size: 13.5px; background: #F1EEEA; border-radius: 6px; padding: 2px 6px; display: inline-block; margin: 0 0 4px; color: var(--ink-2); }
.s2ui th:nth-child(1) { width: 34%; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.badge--ok { background: #E3F2E6; color: #1E7A34; }
.badge--warn { background: #FBF0CF; color: #8A6400; }
.badge--alarm { background: var(--accent); color: #fff; }
.badge--info { background: #E3EAF7; color: #1F4FA8; }
.badge--off { background: #ECEAE8; color: var(--ink-2); }

/* system map */
.sysmap { margin: 40px 0 0; padding: 32px 32px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.sysmap svg { display: block; width: 100%; height: auto; font-family: inherit; }
.sysmap .n rect { fill: #fff; stroke: var(--ink); stroke-width: 2; }
.sysmap .n--byp rect { fill: #EEF3FD; stroke: #2F6FDE; }
.sysmap .n--acc rect { fill: var(--insight); stroke: var(--insight-ink); }
.sysmap .n--env rect { fill: var(--warn-soft); stroke: #C9A14A; }
.sysmap .n text { font-size: 19px; font-weight: 700; fill: var(--ink); text-anchor: middle; }
.sysmap .n text.s { font-size: 14px; font-weight: 500; fill: var(--ink-3); }
.sysmap .w { fill: none; stroke-width: 2.5; }
.sysmap .w--main { stroke: var(--ink); stroke-width: 3.5; }
.sysmap .w--byp { stroke: #2F6FDE; }
.sysmap .w--dc { stroke: var(--good); stroke-width: 3; }
.sysmap .w--rep { stroke: #9A918B; stroke-dasharray: 7 6; }
.sysmap .dot { fill: var(--good); stroke: #fff; stroke-width: 2; }
.sysmap .lbl { font-size: 14px; fill: var(--ink-3); font-weight: 600; }
.sysmap .lbl--byp { fill: #2F6FDE; }
.sysmap .lbl--dc { fill: var(--insight-ink); }
.sysmap__legend { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 10px 24px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }
.sysmap__br { flex-basis: 100%; height: 0; }
.sysmap__legend span:not(.sysmap__br) { display: inline-flex; align-items: center; gap: 8px; }
.sysmap__legend .sw { width: 16px; height: 12px; border-radius: 4px; border: 2px solid var(--ink); background: #fff; }
.sysmap__legend .sw--acc { border-color: var(--insight-ink); background: var(--insight); }
.sysmap__legend .sw--env { border-color: #C9A14A; background: var(--warn-soft); }
.sysmap__legend .ln { width: 24px; height: 0; border-top: 3px solid var(--ink); }
.sysmap__legend .ln--byp { border-top-color: #2F6FDE; }
.sysmap__legend .ln--dc { border-top-color: var(--good); }
.sysmap__legend .ln--rep { border-top: 2px dashed #9A918B; }
.grp { font-weight: 600; color: var(--ink); }
.grp--acc { color: var(--insight-ink); }
.grp--env { color: var(--warn); }

/* colour language */
.swatch { display: inline-block; width: 28px; height: 8px; border-radius: 4px; margin-bottom: 12px; }

@media (max-width: 900px) {
  .shots-3 { grid-template-columns: repeat(2, 1fr); }
  .pinlist { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .shots-2, .shots-3 { grid-template-columns: 1fr; }
  .pin { width: 20px; height: 20px; margin: -10px 0 0 -10px; font-size: 11px; box-shadow: 0 0 0 2px #fff; }
  .sysmap { padding: 12px; overflow-x: auto; }
  .sysmap svg { min-width: 860px; }
}

/* fix: grid rows had more children than columns (text node / h3 + p fell into the narrow column) */
.steps li { display: block; padding-left: 72px; }
.steps li::before { position: absolute; left: 0; top: 18px; }
.chain { display: grid; gap: 10px; }
.chain__card { grid-template-columns: 36px 1fr; row-gap: 4px; align-items: baseline; }
.chain__card > .chain__num { grid-row: span 2; }
.chain__card > :not(.chain__num) { grid-column: 2; }
.chain__card h3 { margin: 0; font-size: 18px; }
.chain__card .chain__why { padding: 0; }
.chain__card .chain__why::before, .chain__card .chain__why::after { content: none; }

/* ============ Transitions (06 Modes) ============ */
.mp { display: inline-flex; align-items: center; height: 34px; padding: 0 14px; border-radius: 8px; font-size: 14.5px; font-weight: 700; color: #fff; white-space: nowrap; letter-spacing: -.005em; }
.mp--work { background: #18803F; }
.mp--par  { background: #0E6E66; }
.mp--akb  { background: #9A5A0B; }
.mp--rbp  { background: #1E4F94; }
.mp--ao   { background: #A3161B; }
.mp--off  { background: var(--ink); }
.mp--boot { background: transparent; color: var(--ink-2); box-shadow: inset 0 0 0 1.5px var(--line); }
.trs { margin: 28px 0 40px; }
.trs__list { list-style: none; margin: 0; padding: 4px 28px; background: var(--surface); border-radius: var(--radius) var(--radius) 0 0; }
.tr { display: grid; grid-template-columns: 200px 40px 200px 1fr; align-items: center; gap: 0 14px; padding: 18px 0; border-top: 1px solid var(--line); }
.tr:first-child { border-top: 0; }
.tr[hidden] { display: none; }
.tr__from, .tr__to { display: flex; flex-direction: column; gap: 6px; }
.tr .mp { width: 200px; justify-content: center; }
.mp--any { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.tr__arr { width: 40px; height: 14px; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tr__t { margin: 0; padding-left: 18px; font-size: 15.5px; line-height: 1.5; color: var(--ink-2); }
.trs__more { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 18px; border: 0; border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); background: var(--surface); font: inherit; font-size: 15px; font-weight: 700; color: var(--ink); cursor: pointer; transition: background .15s; }
.trs__more::after { content: ""; width: 8px; height: 8px; border: solid currentColor; border-width: 0 2px 2px 0; transform: translateY(-3px) rotate(45deg); transition: transform .2s; }
.trs__more[aria-expanded="true"]::after { transform: translateY(2px) rotate(-135deg); }
.trs__more:hover { background: #FAF9F7; }
.trs__more:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.doclinks { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.doclink { font: inherit; text-align: left; cursor: zoom-in; display: grid; gap: 2px; padding: 16px 20px 16px 56px; border: 0; border-radius: var(--radius); background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23131112' stroke-width='1.8' stroke-linejoin='round'%3E%3Cpath d='M6 2.8h8l4.2 4.2v14.2H6z'/%3E%3Cpath d='M14 2.8V7h4.2M9 12h6M9 15.5h6'/%3E%3C/svg%3E") no-repeat 20px center / 24px; color: var(--ink); transition: box-shadow .15s; }
.doclink:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
.doclink:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.doclink b { font-size: 15.5px; }
.doclink span { font-size: 14px; color: var(--ink-3); }
@media (max-width: 1100px) { .tr { grid-template-columns: 200px 40px 200px; row-gap: 12px; } .tr__t { grid-column: 1 / -1; padding: 0; } }
@media (max-width: 720px) { .trs__list { padding: 4px 18px; } .tr { grid-template-columns: 1fr; justify-items: start; } .tr__arr { transform: rotate(90deg); width: 24px; margin-left: 8px; } .tr .mp { height: 30px; width: 190px; font-size: 13.5px; } }
#modes .card .mp { width: 200px; justify-content: center; margin-bottom: 12px; }
@media (max-width: 1024px) { .modes-grid, .insights--cards { grid-template-columns: 1fr; } .doclinks { display: grid; grid-template-columns: 1fr; } }

/* ============ Algorithm example (07) ============ */
.alg { margin: 28px 0 24px; background: var(--surface); border-radius: var(--radius); padding: 8px 28px 12px; }
.alg__head, .alg__step { display: grid; grid-template-columns: 44px minmax(0, 1fr) minmax(0, 1.15fr); gap: 0 28px; }
.alg__head { padding: 16px 0 12px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); border-bottom: 1px solid var(--line); }
.alg__list { list-style: none; margin: 0; padding: 0; }
.alg__step { position: relative; padding: 20px 0; align-items: start; }
.alg__step + .alg__step { border-top: 1px solid var(--line); }
.alg__step::before { content: ""; position: absolute; left: 21px; top: 0; bottom: 0; width: 2px; background: var(--line); }
.alg__step:first-child::before { top: 38px; }
.alg__step--end::before { bottom: auto; height: 38px; }
.alg__n { position: relative; z-index: 1; display: grid; place-items: center; width: 44px; height: 36px; border-radius: 18px; background: var(--ink); color: #fff; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.alg__step--end .alg__n { background: #18803F; }
.alg__do { display: grid; gap: 4px; padding-top: 6px; }
.alg__do b { font-size: 17px; line-height: 1.35; color: var(--ink); }
.alg__do span { font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.alg__wait { position: relative; padding: 12px 16px 14px; border-radius: var(--radius-s); background: #F4F8F5; }

.alg__lab { margin: 0 0 6px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #18803F; }
.alg__wait ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.alg__wait li { display: grid; grid-template-columns: 18px 1fr; gap: 8px; font-size: 15px; line-height: 1.45; color: var(--ink); }
.alg__wait svg { width: 16px; height: 16px; margin-top: 3px; fill: none; stroke: #18803F; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.alg__res { padding-top: 1px; }
.alg__res .mp { width: 200px; justify-content: center; }
.doclink--pdf { text-decoration: none; cursor: pointer; }
@media (max-width: 1024px) {
  .alg { padding: 4px 18px 8px; }
  .alg__head { display: none; }
  .alg__step { grid-template-columns: 44px 1fr; gap: 12px 16px; }
  .alg__wait, .alg__res { grid-column: 2; }
  .alg__wait::before { display: none; }
}
.alg-notes { margin-top: 0; }
.alg-notes .card { border: 0; }
.alg-notes .small { font-size: 15px; line-height: 1.55; }
@media (max-width: 1024px) { .pairs.alg-notes { grid-template-columns: 1fr; } }


/* ============ Algorithm example — phases variant (07) ============ */
.phases { margin: 28px 0 24px; }
.phases__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ph { position: relative; display: grid; grid-row: span 5; grid-template-rows: subgrid; row-gap: 0; align-content: start; background: var(--surface); border-radius: var(--radius); padding: 24px 24px 26px; }
.ph__eb { margin: 0 0 4px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.ph__t { margin: 0 0 14px; font-size: 18px; line-height: 1.3; letter-spacing: -.01em; }
.ph__pic { background: #F7F5F2; border-radius: var(--radius-s); padding: 16px 40px 12px; margin-bottom: 16px; }
.ph__svg { max-width: 420px; margin: 0 auto; }
.ph__svg { display: block; width: 100%; height: auto; font-family: inherit; }
.ph__node rect { fill: #fff; stroke: #D3CCC6; stroke-width: 1.5; }
.ph__node text { font-size: 14px; font-weight: 700; fill: #A39B95; text-anchor: middle; }
.ph__node--byp rect { fill: #EEF3FD; stroke: #2F6FDE; } .ph__node--byp text { fill: #1E4F94; }
.ph__node--inv rect { fill: #E6F3EA; stroke: #18803F; } .ph__node--inv text { fill: #12632F; }
.ph__node--wait rect { fill: #fff; stroke: #2F6FDE; stroke-dasharray: 4 3; } .ph__node--wait text { fill: #1E4F94; }
.ph__w { fill: none; stroke-width: 2.5; stroke-linejoin: round; }
.ph__w--off { stroke: #D3CCC6; stroke-dasharray: 3 4; }
.ph__node--off rect { stroke-dasharray: 4 3; }
.ph__w--byp { stroke: #2F6FDE; }
.ph__w--inv { stroke: #18803F; }
.ph__w--wait { stroke: #18803F; stroke-dasharray: 3 4; opacity: .6; }
.ph__lbl { font-size: 12px; font-weight: 600; fill: #A39B95; } .ph__lbl--byp { fill: #1E4F94; } .ph__lbl--inv { fill: #12632F; }
.ph__timer rect { fill: var(--ink); } .ph__timer text { font-size: 12px; font-weight: 700; fill: #fff; text-anchor: middle; }
.ph__state { margin: 6px 0 0; text-align: center; font-size: 13px; font-weight: 700; color: var(--ink-3); }
.ph__state--byp { color: #1E4F94; } .ph__state--inv { color: #12632F; }
.ph__d { margin: 0 0 16px; font-size: 15.5px; line-height: 1.55; color: var(--ink-2); }
.ph__steps { margin: 0; padding: 14px 0 0; border-top: 1px solid var(--line); }
.ph__lab { margin: 0 0 10px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.ph__steps ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ph__steps li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; font-size: 15px; line-height: 1.45; color: var(--ink); }
.ph__n { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 12px; font-weight: 700; }
.phases__end { display: flex; align-items: center; justify-content: flex-start; gap: 14px; margin-top: 12px; padding: 14px 24px; background: var(--surface); border-radius: var(--radius); font-size: 15px; font-weight: 600; color: var(--ink-2); }
.phases__end .mp { width: 200px; justify-content: center; }
@media (max-width: 720px) { .phases__list { grid-template-columns: 1fr; } .ph { padding: 20px 18px 22px; } .ph__pic { padding: 12px 10px 10px; } .phases__end { flex-direction: column; align-items: flex-start; } }

/* ---- alarms ---- */
.badge--ao { background: #A3161B; color: #fff; }
.alarm-grid { gap: 16px; margin-top: 36px; }
.alarm-grid .card { display: flex; flex-direction: column; align-items: flex-start; padding: 28px; }
.alarm-grid .card--ao { background: #FBEDEC; box-shadow: inset 0 0 0 1.5px #A3161B; }
.alarm-grid .card--ao .alarm-grid__cnt { color: #A3161B; }
.alarm-grid__cnt { margin: 24px 0 14px; font-size: 34px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.alarm-grid__cnt span { font-size: 15px; font-weight: 600; color: var(--ink-3); }
.thr { margin: 28px 0 0; border-top: 1px solid var(--line); }
.thr__row { display: grid; grid-template-columns: 240px 1fr; gap: 24px; align-items: center; padding: 22px 0; border-bottom: 1px solid var(--line); }
.thr__name b { display: block; font-size: 16px; }
.thr__name small { display: block; margin-top: 4px; font-size: 13.5px; color: var(--ink); }
.thr__steps { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.thr__steps .badge { padding: 6px 14px; font-size: 13.5px; }
.thr__steps i { font-style: normal; color: var(--ink-3); }
.alarm-notes { margin-top: 48px; }
@media (max-width: 720px) { .thr__row { grid-template-columns: 1fr; gap: 8px; } }

/* signals block */
.sig-nums { margin: 28px 0 40px; }
.sig-num { display: block; font-size: 44px; font-weight: 700; line-height: 1; letter-spacing: -.02em; color: var(--accent); margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.sig-nums .card h3 { margin: 12px 0 10px; font-size: 20px; white-space: nowrap; }
@media (max-width: 1100px) { .sig-nums .card h3 { white-space: normal; min-height: 2.5em; } }
.sig-list code { font-family: inherit; font-size: 13px; background: #F1EEEA; border-radius: 6px; padding: 1px 6px; display: inline-block; margin: 4px 2px 0 0; color: var(--ink-2); }
@media (min-width: 901px) { .sig-list { grid-auto-flow: column; grid-template-rows: repeat(4, auto); } }

/* Архитектура HMI: воздух между карточками и абзацем */
#ia .grid-3 { margin-top: 28px; }
.after-cards { margin-top: 40px; }

.figure.wide figcaption { display: block; }

/* Один экран — все режимы: список полосок со сворачиванием */
.ms-wrap { margin: 32px 0 40px; }
.ms__list { list-style: none; margin: 0; padding: 4px 28px; background: var(--surface); border-radius: var(--radius) var(--radius) 0 0; }
.ms { padding: 28px 0 32px; border-top: 1px solid var(--line); }
.ms:first-child { border-top: 0; }
.ms[hidden] { display: none; }
.ms__t { margin: 0 0 16px; font-size: 15.5px; line-height: 1.5; color: var(--ink-2); }
.ms__t b { color: var(--ink); }
.ms .shot { border-radius: 10px; }
@media (max-width: 700px) { .ms__list { padding: 4px 16px; } .ms { padding: 20px 0 24px; } }

/* Архитектура HMI: карта разделов */
.ia-map { margin: 40px 0 0; padding: 24px; background: var(--surface); border-radius: var(--radius); }
.ia-map__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 0 0 20px; border-bottom: 1px dashed var(--line); }
.ia-map__bar span { padding: 6px 12px; border-radius: 8px; background: #fff; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.ia-map__bar .ia-map__lbl { padding-left: 0; background: none; font-weight: 700; color: var(--ink); margin-right: 4px; }
.ia-map__cols { list-style: none; margin: 20px 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.ia-col { position: relative; }
.ia-col .shot { border-radius: 8px; box-shadow: 0 0 0 1px var(--line); }
.ia-col h3 { margin: 14px 0 6px; font-size: 16px; }
.ia-col p { margin: 0; line-height: 1.5; }

/* Переход «узел на схеме → модуль» */
.ia-flow { container-type: inline-size; display: grid; grid-template-columns: 1fr 48px 1fr; align-items: start; margin: 32px 0 0; }
.ia-flow figcaption { margin-top: 14px; }
.ia-flow__arr { align-self: start; margin-top: calc((100cqw - 48px) / 2 * 0.5622 / 2 - 1px); height: 2px; background: var(--accent); position: relative; margin-left: 8px; margin-right: 8px; }
.ia-flow__arr::after { content: ""; position: absolute; right: -1px; top: -5px; width: 10px; height: 10px; border: solid var(--accent); border-width: 2px 2px 0 0; transform: rotate(45deg); }
.ia-ring { position: absolute; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; border: 3px solid var(--accent); box-shadow: 0 0 0 4px rgba(255,255,255,.7); pointer-events: none; }
#ia h3 { margin-top: 88px; }
#ia .ia-map h3 { margin-top: 14px; }

@media (max-width: 900px) {
  .ia-map__cols { grid-template-columns: repeat(2, 1fr); }
  .ia-flow { grid-template-columns: 1fr; gap: 12px; }
  .ia-flow__arr { width: 2px; height: 28px; margin: 0 auto; }
  .ia-flow__arr::after { right: -5px; top: auto; bottom: -1px; transform: rotate(135deg); }
  .ia-ring { width: 32px; height: 32px; margin: -16px 0 0 -16px; border-width: 2px; }
}

/* Слайдер «Все экраны» */
.sl { margin: 0; overflow: hidden; }
.sl__track { list-style: none; margin: 0; padding: 0; display: flex; gap: 24px; outline: none; touch-action: pan-y; transition: transform .5s cubic-bezier(.25,.8,.25,1); will-change: transform; }
.sl__track.is-drag { transition: none; }
.sl__track:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.sl__slide { flex: 0 0 100%; min-width: 0; }
@media (prefers-reduced-motion: reduce) { .sl__track { transition: none; } }
.sl__slide figure { margin: 0; }
.sl__slide figcaption { display: block; margin-top: 14px; font-size: 15px; }
.test-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.test-grid__text > p:first-child { margin-top: 0; }
.test-grid .stats { margin-bottom: 0; }
.test-grid .stat { padding: 18px 18px 16px; }
.test-grid .stat__v { font-size: 34px; }
.test-grid__photo { margin: 0; }
.test-grid__photo figcaption { display: block; margin-top: 12px; }
.test-grid__photo .shot { border-radius: 14px; overflow: hidden; }
.test-grid__photo img { display: block; width: 100%; height: auto; }
@media (max-width: 1024px) { .test-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; } .test-grid__photo { max-width: 480px; } }
.sl-tabs .tabs__head { margin-bottom: 20px; }
.tabs__n { margin-left: 8px; font-size: 14px; opacity: .5; font-variant-numeric: tabular-nums; }
.sl__bar { display: flex; align-items: center; justify-content: center; gap: 20px; margin-top: 20px; }
.sl__count { min-width: 64px; text-align: center; font-size: 15px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.sl__count b { color: var(--ink); }
.sl__btn { width: 48px; height: 48px; border: 0; border-radius: 50%; background: var(--surface); cursor: pointer; position: relative; transition: background .15s; }
.sl__btn:hover { background: #EDEBE7; }
.sl__btn:disabled { opacity: .35; cursor: default; }
.sl__btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sl__btn::after { content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; border: solid var(--ink); border-width: 0 2px 2px 0; }
.sl__btn--prev::after { transform: translate(-30%, -50%) rotate(135deg); }
.sl__btn--next::after { transform: translate(-70%, -50%) rotate(-45deg); }
.sl .shot { box-shadow: 0 0 0 1px var(--line); border-radius: 10px; overflow: hidden; }

/* Архитектура HMI: табы разделов, скрин на всю ширину */
.ia-tabs { margin: 32px 0 0; }
.ia-tabs .tabs__head { margin-bottom: 20px; }
.ia-tabs .tabs__panel figure { margin: 0; }
.ia-tabs .shot { border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line); }
.ia-tabs figcaption { display: block; margin-top: 14px; font-size: 15px; line-height: 1.55; max-width: 820px; }

/* Состояния: компактные карточки цветов */
.states { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin: 28px 0 0; }
.states .card { padding: 18px 20px 20px; }
.states .swatch { width: 24px; height: 6px; margin-bottom: 10px; }
.states h3 { margin: 0 0 4px; font-size: 16px; }
.states p { margin: 0; font-size: 14px; line-height: 1.45; }
@media (max-width: 1024px) { .states { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .states { grid-template-columns: repeat(2, 1fr); } }

.sysmap__legend > span { white-space: nowrap; }

/* Живой прототип панели: iframe создаётся только по клику, до этого — скриншот */
.live { margin: 32px auto 40px; }
.live__frame { position: relative; aspect-ratio: 1366 / 768; border-radius: 14px; overflow: hidden; background: #fff;
  border: 1px solid var(--line); box-shadow: 0 24px 50px -24px rgba(22,18,20,.28), 0 4px 12px rgba(22,18,20,.05); }
.live__frame img, .live__frame iframe { display: block; width: 100%; height: 100%; border: 0; }
.live__play { position: absolute; inset: 0; margin: auto; width: max-content; height: max-content; padding: 16px 28px;
  border: 0; border-radius: 999px; background: var(--ink); color: #fff; font: inherit; font-size: 16px; font-weight: 700;
  cursor: pointer; box-shadow: 0 12px 30px -8px rgba(22,18,20,.5); transition: transform .15s; }
.live__play:hover { transform: scale(1.04); }
.live__frame:has(.live__play)::after { content: ""; position: absolute; inset: 0; background: rgba(22,18,20,.18); pointer-events: none; }
.live__play { z-index: 1; }
.live p { margin: 12px 0 0; }
.live a { color: inherit; }
/* На телефоне панель 1366×768 сжимается до нечитаемого, в PDF живого блока быть не может — там остаётся галерея ниже */
@media (max-width: 720px) { .live { display: none; } }
@media print { .live { display: none; } }
