/* happ.systems — тема «технический чертёж».

   Идея темы. Сайт объясняет устройство системы, поэтому его язык — язык
   конструкторской документации: светлая калька с миллиметровой сеткой, тонкие
   линии в один пиксель, прямые углы, подписи моноширинным, один цвет выноски.
   Ничего мягкого и ничего лишнего: каждая линия либо ограничивает блок, либо
   ведёт от одной части системы к другой.

   Основная тема светлая -- намеренно. Вся сеть ушла в тёмные интерфейсы, а
   чертёж читается на бумаге; тёмный вариант сделан как «синька» — тот же
   чертёж, снятый в негативе, а не механическая инверсия.

   Дизайн-система
   --------------
   Цвет: бумага, поверхность, две ступени чернил, две линейки, одна выноска.
   Шрифт: Jost (заголовки и метки, геометрия), Noto Sans (текст),
          Fira Mono (данные, коды, подписи на чертеже).
   Размеры: 11 12 13 15 17 20 24 30 38 52.
   Отступы: 4 8 12 16 24 32 48 64 96.
   Радиусы: 0 и 2. Тени: нет — глубину держат линии.
*/

@import url('/fonts/faces.css');

:root {
  --paper:     #ECEEE9;
  --surface:   #FFFFFF;
  --surface-2: #F4F6F1;
  --ink:       #13181A;
  --ink-2:     #39423F;
  --muted:     #79837F;
  --rule:      #CBD2CC;
  --rule-2:    #A7B0AA;
  --acc:       #0B6B5E;
  --acc-2:     #08544A;
  --acc-soft:  #E0EDE9;
  --acc-ink:   #FFFFFF;
  --grid:      #D9DDD6;

  --ok:    #17724F;  --ok-soft:   #E1EFE7;
  --warn:  #8A5B08;  --warn-soft: #F6EDDC;
  --down:  #99342A;  --down-soft: #F6E4E1;

  --fd: 'Jost', system-ui, -apple-system, sans-serif;
  --fb: 'NotoSans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --fm: 'FiraMono', ui-monospace, Menlo, Consolas, monospace;

  --wrap: 1240px;
  --sd: 268px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:     #0F1413;
    --surface:   #151B19;
    --surface-2: #1B2321;
    --ink:       #E8EEEA;
    --ink-2:     #BBC5BF;
    --muted:     #7F8A85;
    --rule:      #2A3330;
    --rule-2:    #3E4A46;
    --acc:       #4FBCA9;
    --acc-2:     #74D2C1;
    --acc-soft:  #102A25;
    --acc-ink:   #06211C;
    --grid:      #19211F;

    --ok:    #4CC08D;  --ok-soft:   #10241C;
    --warn:  #D3A03F;  --warn-soft: #241D0E;
    --down:  #E0705F;  --down-soft: #2A1512;
  }
}

/* --- сброс и основа --------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 400 17px/1.62 var(--fb);
  color: var(--ink);
  background-color: var(--paper);
  /* Миллиметровка. Через background-image на обычном блоке, а не отдельным
     слоем: фиксированные слои с масками ломают захват экрана. */
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 28px 28px, 28px 28px;
  background-position: -1px -1px;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--acc); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--acc-2); }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
code, kbd, pre { font-family: var(--fm); }
code {
  font-size: .88em; background: var(--surface-2); border: 1px solid var(--rule);
  padding: 1px 5px; border-radius: 2px; word-break: break-word;
}
mark { background: var(--acc-soft); color: inherit; padding: 0 2px; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 32px 0; }

.skip {
  position: absolute; left: -9999px; top: 8px; background: var(--ink); color: var(--paper);
  padding: 8px 14px; z-index: 60;
}
.skip:focus { left: 8px; }

.page { min-height: 100vh; display: flex; flex-direction: column; }

/* --- кнопки ----------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 500 14px/1 var(--fd); letter-spacing: .02em;
  padding: 12px 18px; border: 1px solid transparent; border-radius: 2px;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background .12s, color .12s, border-color .12s;
}
.btn--go { background: var(--acc); color: var(--acc-ink); border-color: var(--acc); }
.btn--go:hover { background: var(--acc-2); border-color: var(--acc-2); color: var(--acc-ink); }
.btn--go:active { transform: translateY(1px); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--rule-2); }
.btn--ghost:hover { border-color: var(--ink); color: var(--ink); }

/* --- шапка ------------------------------------------------------------------ */
.hdr {
  position: sticky; top: 0; z-index: 40;
  background: var(--surface); border-bottom: 1px solid var(--rule);
}
.hdr__in {
  max-width: var(--wrap); margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; gap: 20px; min-height: 62px;
}
.brand { display: flex; align-items: baseline; gap: 1px; text-decoration: none; color: var(--ink); flex-shrink: 0; }
/* Знак: два растра, светлый и тёмный вариант линий. */
.brand__logo { width: 25px; height: 25px; flex-shrink: 0; align-self: center; margin-right: 10px; }
.brand__logo--l { display: none; }
@media (prefers-color-scheme: dark) {
  .brand__logo--d { display: none; }
  .brand__logo--l { display: block; }
}
.brand__mark { font: 600 21px/1 var(--fd); letter-spacing: .04em; }
.brand__sub { font: 500 21px/1 var(--fd); letter-spacing: .04em; color: var(--acc); }
.brand__tag {
  font: 400 10px/1 var(--fm); letter-spacing: .12em; color: var(--muted);
  margin-left: 10px; padding-left: 10px; border-left: 1px solid var(--rule);
  align-self: center;
}
.hdr__nav { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.hdr__links { display: flex; gap: 16px; }
.hdr__links a {
  font: 400 14px/1 var(--fb); color: var(--ink-2); text-decoration: none;
  padding: 6px 0; border-bottom: 2px solid transparent;
}
.hdr__links a:hover { color: var(--ink); border-bottom-color: var(--rule-2); }
.hdr__links a[aria-current] { color: var(--ink); border-bottom-color: var(--acc); }
.searchbtn {
  display: inline-flex; align-items: center; gap: 7px; background: var(--surface-2);
  border: 1px solid var(--rule); border-radius: 2px; padding: 7px 10px;
  font: 400 13px/1 var(--fb); color: var(--muted); cursor: pointer;
}
.searchbtn:hover { border-color: var(--rule-2); color: var(--ink-2); }
.searchbtn kbd {
  font-size: 11px; border: 1px solid var(--rule); border-radius: 2px;
  padding: 1px 5px; background: var(--surface); color: var(--muted);
}
.hdr__go { padding: 10px 16px; }
.hdr__go-s { display: none; }
.burger {
  display: none; background: var(--surface-2); border: 1px solid var(--rule); border-radius: 2px;
  font: 500 12px/1 var(--fd); letter-spacing: .08em; color: var(--ink-2); padding: 9px 11px; cursor: pointer;
}
.mnav { display: none; border-top: 1px solid var(--rule); background: var(--surface); }
.mnav.is-open { display: block; }
.mnav ul { list-style: none; margin: 0; padding: 8px 24px 16px; }
.mnav a { display: block; padding: 10px 0; color: var(--ink-2); text-decoration: none; border-bottom: 1px solid var(--rule); }

/* --- каркас ----------------------------------------------------------------- */
.layout {
  max-width: var(--wrap); margin: 0 auto; padding: 0 24px 64px;
  display: grid; grid-template-columns: var(--sd) minmax(0, 1fr); gap: 40px; align-items: start;
  flex: 1;
}
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px 64px; flex: 1; }
main { min-width: 0; padding-top: 28px; }

/* --- сайдбар ---------------------------------------------------------------- */
.side { position: sticky; top: 78px; padding-top: 28px; max-height: calc(100vh - 90px); overflow-y: auto; }
.side__grp { margin-bottom: 26px; }
.side__ttl {
  display: block; font: 500 11px/1 var(--fd); letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); padding-bottom: 8px; border-bottom: 1px solid var(--rule); margin-bottom: 10px;
}
.side__list, .side__flat { list-style: none; margin: 0; padding: 0; }
.side__list a {
  display: flex; gap: 9px; align-items: baseline; padding: 6px 0;
  font-size: 14px; line-height: 1.42; color: var(--ink-2); text-decoration: none;
}
.side__list a:hover { color: var(--acc); }
.side__list a[aria-current] { color: var(--ink); font-weight: 600; }
.side__list a[aria-current] .side__i { background: var(--acc); color: var(--acc-ink); border-color: var(--acc); }
.side__i {
  flex-shrink: 0; font: 400 10px/1 var(--fm); letter-spacing: .04em; color: var(--muted);
  border: 1px solid var(--rule); border-radius: 2px; padding: 3px 4px; min-width: 30px; text-align: center;
}
.side__flat { display: flex; flex-wrap: wrap; gap: 6px; }
.side__flat a {
  display: inline-block; font-size: 12.5px; color: var(--ink-2); text-decoration: none;
  border: 1px solid var(--rule); border-radius: 2px; padding: 4px 8px; background: var(--surface);
}
.side__flat a:hover { border-color: var(--acc); color: var(--acc); }
.side__cta { border: 1px solid var(--rule); border-top: 2px solid var(--acc); background: var(--surface); padding: 16px; }
.side__cta-tag { font: 400 10px/1 var(--fm); letter-spacing: .1em; color: var(--acc); }
.side__cta-ttl { font: 500 16px/1.3 var(--fd); margin: 8px 0 6px; }
.side__cta-txt { font-size: 13px; line-height: 1.55; color: var(--ink-2); margin: 0 0 12px; }
.side__cta .btn { width: 100%; }

/* --- статья ----------------------------------------------------------------- */
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font: 400 12px/1 var(--fm); color: var(--muted); padding-top: 24px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--acc); }
.crumbs i { font-style: normal; color: var(--rule-2); }

.art { max-width: 820px; }
.art h1 { font: 500 clamp(28px, 3.6vw, 38px)/1.16 var(--fd); letter-spacing: -.01em; margin: 14px 0 12px; }
.art__meta { display: flex; flex-wrap: wrap; gap: 14px; font: 400 11px/1 var(--fm); letter-spacing: .06em; color: var(--muted); text-transform: uppercase; margin-bottom: 22px; }
.art__lead { font-size: 19px; line-height: 1.58; color: var(--ink-2); border-left: 2px solid var(--acc); padding-left: 16px; margin: 22px 0 28px; }
.art h2 { font: 500 25px/1.24 var(--fd); margin: 44px 0 14px; padding-top: 18px; border-top: 1px solid var(--rule); }
.art h3 { font: 600 18px/1.34 var(--fb); margin: 30px 0 10px; }
.art p { margin: 0 0 16px; }
.art ul:not([class]), .art ol:not([class]) { margin: 0 0 18px; padding-left: 0; list-style: none; }
.art ul:not([class]) > li { position: relative; padding-left: 22px; margin-bottom: 8px; }
.art ul:not([class]) > li::before {
  content: ''; position: absolute; left: 4px; top: 11px; width: 8px; height: 1px; background: var(--acc);
}
.art ol:not([class]) { counter-reset: n; }
.art ol:not([class]) > li { position: relative; padding-left: 30px; margin-bottom: 8px; counter-increment: n; }
.art ol:not([class]) > li::before {
  content: counter(n, decimal-leading-zero); position: absolute; left: 0; top: 3px;
  font: 400 11px/1 var(--fm); color: var(--acc);
}
.art pre {
  background: var(--surface-2); border: 1px solid var(--rule); border-left: 2px solid var(--rule-2);
  padding: 14px 16px; overflow-x: auto; font-size: 13px; line-height: 1.6; border-radius: 2px;
}

/* ===========================================================================
   SIGNATURE: блок-схема системы
   =========================================================================== */
.dg {
  margin: 0 0 32px; padding: 14px 18px 16px; background: var(--surface);
  border: 1px solid var(--rule-2); border-radius: 2px;
  /* Уголки рамки чертежа: только линии, никаких теней. */
  background-image:
    linear-gradient(var(--rule) 1px, transparent 1px),
    linear-gradient(90deg, var(--rule) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%;
  background-repeat: no-repeat;
}
.dg__cap { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.dg__capttl { font: 400 11px/1 var(--fm); letter-spacing: .16em; color: var(--ink); }
.dg__caphint { font: 400 12px/1.3 var(--fb); color: var(--muted); }
.dg__svg { display: block; width: 100%; max-width: 780px; height: auto; margin: 0 auto; }
.dg__grid { stroke: var(--grid); fill: none; }
.dg__grid path { stroke: var(--grid); }
#grid path { stroke: var(--grid); }

.dg__svg marker path { fill: var(--rule-2); stroke: none; }

/* Узел: прямоугольник, код, название, назначение. */
.dg__node rect { fill: var(--surface); stroke: var(--ink); stroke-width: 1.5; }
.dg__node text { fill: var(--ink); }
.dg__node .dg__code { font: 500 13px/1 var(--fm); fill: var(--acc); }
.dg__node .dg__ttl { font: 500 21px/1 var(--fd); }
.dg__node .dg__sub { font: 400 13px/1 var(--fb); fill: var(--muted); }
.dg__node .dg__go { font: 400 10px/1 var(--fm); letter-spacing: .06em; fill: var(--muted); opacity: 0; transition: opacity .12s; }
.dg__node:hover rect, .dg__node:focus-visible rect { fill: var(--acc-soft); stroke: var(--acc); }
.dg__node:hover .dg__go, .dg__node:focus-visible .dg__go { opacity: 1; fill: var(--acc); }
.dg__node:hover .dg__ttl { fill: var(--acc-2); }

/* Ребро: линия с разрывом под подпись. Широкая невидимая линия — зона клика. */
.dg__edge .dg__ln { stroke: var(--rule-2); stroke-width: 1.5; fill: none; }
.dg__edge .dg__hit { stroke: transparent; stroke-width: 26; }
.dg__edge .dg__elb { font: 400 12px/1 var(--fm); fill: var(--ink-2); letter-spacing: .02em; }
.dg__edge:hover .dg__ln, .dg__edge:focus-visible .dg__ln { stroke: var(--acc); }
.dg__edge:hover .dg__elb, .dg__edge:focus-visible .dg__elb { fill: var(--acc); }

/* Выноска наблюдателя: пунктир и рамка тоньше — он вне системы. */
.dg__watch rect { fill: var(--surface-2); stroke: var(--rule-2); stroke-width: 1.2; stroke-dasharray: 5 4; }
.dg__watch .dg__wttl { font: 500 16px/1 var(--fd); fill: var(--ink-2); }
.dg__watch .dg__wln { stroke: var(--rule-2); stroke-width: 1.2; }
.dg__watch .dg__go { font: 400 10px/1 var(--fm); fill: var(--muted); opacity: 0; transition: opacity .12s; }
.dg__watch:hover rect, .dg__watch:focus-visible rect { stroke: var(--acc); fill: var(--acc-soft); }
.dg__watch:hover .dg__wttl { fill: var(--acc); }
.dg__watch:hover .dg__wln { stroke: var(--acc); }
.dg__watch:hover .dg__go { opacity: 1; fill: var(--acc); }

.dg__io text { font: 400 11px/1 var(--fm); letter-spacing: .1em; fill: var(--muted); }
.dg__io line { stroke: var(--rule-2); stroke-width: 1.2; }

/* Пояснение под чертежом: меняется при наведении. */
.dg__hint {
  margin: 14px 0 0; padding: 12px 14px; border: 1px solid var(--rule); border-left: 2px solid var(--rule-2);
  background: var(--surface-2); min-height: 74px; transition: border-color .12s;
}
.dg__hint.is-on { border-left-color: var(--acc); }
.dg__hint-n { display: block; font: 500 12px/1.3 var(--fm); letter-spacing: .06em; color: var(--acc); margin-bottom: 5px; }
.dg__hint-t { display: block; font-size: 14px; line-height: 1.55; color: var(--ink-2); }

/* Тот же чертёж списком — для узкого экрана. */
.dg__list { display: none; list-style: none; margin: 0; padding: 0; }
.dg__li + .dg__li { margin-top: 8px; }
.dg__li a {
  display: flex; gap: 12px; align-items: flex-start; text-decoration: none;
  border: 1px solid var(--rule); background: var(--surface); padding: 12px 14px; border-radius: 2px;
}
.dg__li--edge a { border-style: dashed; }
.dg__li--watch a { background: var(--surface-2); border-style: dashed; }
.dg__li-code {
  flex-shrink: 0; font: 500 12px/1 var(--fm); color: var(--acc);
  border: 1px solid var(--rule); border-radius: 2px; padding: 5px 6px; min-width: 34px; text-align: center;
}
.dg__li-mid { display: block; min-width: 0; }
.dg__li-mid b { display: block; font: 500 17px/1.25 var(--fd); color: var(--ink); }
.dg__li-mid i { display: block; font-style: normal; font: 400 11px/1.4 var(--fm); color: var(--muted); margin: 2px 0 5px; }
.dg__li-mid span { display: block; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }

/* --- компактный чертёж в шапке статьи --------------------------------------- */
.mn {
  display: flex; gap: 18px; align-items: center; margin: 0 0 24px;
  border: 1px solid var(--rule); border-left: 2px solid var(--acc);
  background: var(--surface); padding: 12px 16px; border-radius: 2px;
}
.mn__svg { flex-shrink: 0; width: 208px; height: auto; }
.mn__n rect { fill: var(--surface-2); stroke: var(--rule-2); stroke-width: 1.2; }
.mn__n text { font: 400 9px/1 var(--fm); fill: var(--muted); }
.mn__n .mn__t { font: 500 11px/1 var(--fd); fill: var(--ink-2); }
.mn__n.is-here rect { fill: var(--acc-soft); stroke: var(--acc); stroke-width: 2; }
.mn__n.is-here text, .mn__n.is-here .mn__t { fill: var(--acc); }
.mn__n:hover rect { stroke: var(--acc); }
.mn__e line { stroke: var(--rule-2); stroke-width: 1.2; }
.mn__e.is-here line { stroke: var(--acc); stroke-width: 2.4; }
.mn__e:hover line { stroke: var(--acc); }
.mn__svg marker path { fill: var(--rule-2); }
.mn__txt { margin: 0; font-size: 14.5px; line-height: 1.5; color: var(--ink-2); }
.mn__cap { display: block; font: 400 10px/1 var(--fm); letter-spacing: .14em; color: var(--muted); margin-bottom: 5px; }
.mn__all { display: inline-block; margin-left: 8px; font: 400 12px/1 var(--fm); white-space: nowrap; }
.mn--watch { border-left-style: dashed; }

/* --- лента разделов --------------------------------------------------------- */
.track { margin: 0 0 26px; }
.track__row { display: flex; flex-wrap: wrap; gap: 0; list-style: none; margin: 0; padding: 0; border: 1px solid var(--rule); border-radius: 2px; overflow: hidden; background: var(--surface); }
.track__c { flex: 1 1 auto; border-right: 1px solid var(--rule); }
.track__c:last-child { border-right: 0; }
.track__c a { display: flex; align-items: baseline; gap: 8px; padding: 10px 12px; text-decoration: none; color: var(--ink-2); }
.track__c a:hover { background: var(--surface-2); color: var(--ink); }
.track__i { font: 400 11px/1 var(--fm); color: var(--acc); }
.track__n { font: 400 13px/1 var(--fb); }
.track__c.is-here { background: var(--acc-soft); }
.track__c.is-here a { color: var(--acc-2); font-weight: 600; }

/* --- каталог разделов ------------------------------------------------------- */
.cat { display: grid; gap: 0; border: 1px solid var(--rule-2); border-radius: 2px; overflow: hidden; margin: 0 0 32px; background: var(--surface); }
.cat__i { display: flex; gap: 16px; align-items: center; padding: 16px 18px; text-decoration: none; color: inherit; border-bottom: 1px solid var(--rule); }
.cat__i:last-child { border-bottom: 0; }
.cat__i:hover { background: var(--surface-2); }
.cat__code {
  flex-shrink: 0; width: 38px; height: 38px; display: grid; place-items: center;
  font: 500 16px/1 var(--fm); color: var(--acc); border: 1px solid var(--rule-2); border-radius: 2px;
}
.cat__i:hover .cat__code { border-color: var(--acc); background: var(--acc-soft); }
.cat__mid { flex: 1; min-width: 0; }
.cat__ttl { display: block; font: 500 19px/1.25 var(--fd); color: var(--ink); }
.cat__sub { display: block; font-size: 13.5px; line-height: 1.5; color: var(--muted); margin-top: 3px; }
.cat__n { flex-shrink: 0; font: 400 20px/1 var(--fm); color: var(--ink-2); text-align: right; }
.cat__n small { display: block; font: 400 10px/1 var(--fm); color: var(--muted); margin-top: 4px; letter-spacing: .08em; }

/* --- понятие: аналогия + точное определение --------------------------------- */
.defn { margin: 0 0 26px; border: 1px solid var(--rule-2); border-radius: 2px; background: var(--surface); }
.defn__term {
  font: 500 12px/1 var(--fm); letter-spacing: .1em; text-transform: uppercase; color: var(--acc);
  padding: 11px 16px; border-bottom: 1px solid var(--rule);
}
.defn__grid { display: grid; grid-template-columns: 1fr 1fr; }
.defn__col { padding: 14px 16px; }
.defn__col--like { border-right: 1px solid var(--rule); background: var(--surface-2); }
.defn__cap { display: block; font: 400 10px/1 var(--fm); letter-spacing: .12em; color: var(--muted); margin-bottom: 7px; }
.defn__col p { margin: 0; font-size: 15px; line-height: 1.55; }
.defn__col--exact p { color: var(--ink); }
.defn__col--like p { color: var(--ink-2); }
.defn__note { margin: 0; padding: 10px 16px; border-top: 1px dashed var(--rule); font-size: 13px; line-height: 1.5; color: var(--muted); }

/* --- последовательность событий --------------------------------------------- */
.flow { list-style: none; margin: 0 0 26px; padding: 0; position: relative; }
.flow::before { content: ''; position: absolute; left: 15px; top: 10px; bottom: 10px; width: 1px; background: var(--rule); }
.flow__i { display: flex; gap: 14px; position: relative; padding-bottom: 16px; }
.flow__n {
  flex-shrink: 0; width: 31px; height: 31px; display: grid; place-items: center; position: relative; z-index: 1;
  font: 400 12px/1 var(--fm); color: var(--acc); background: var(--surface);
  border: 1px solid var(--rule-2); border-radius: 2px;
}
.flow__b { min-width: 0; padding-top: 3px; }
.flow__ttl { display: block; font: 600 16px/1.35 var(--fb); margin-bottom: 5px; }
.flow__at { font: 400 11px/1 var(--fm); font-style: normal; color: var(--muted); margin-left: 9px; white-space: nowrap; }
.flow__b p { margin: 0 0 8px; font-size: 15px; line-height: 1.58; color: var(--ink-2); }
.flow__who { display: inline-block; font: 400 10px/1 var(--fm); letter-spacing: .08em; color: var(--muted); border: 1px solid var(--rule); border-radius: 2px; padding: 4px 7px; }

/* --- кто что видит ---------------------------------------------------------- */
.sides { display: grid; gap: 14px; margin: 0 0 26px; }
.side-c { border: 1px solid var(--rule-2); border-radius: 2px; background: var(--surface); }
.side-c__who { font: 500 17px/1.3 var(--fd); margin: 0; padding: 12px 16px; border-bottom: 1px solid var(--rule); }
.side-c__what { margin: 0; padding: 10px 16px 0; font-size: 14px; line-height: 1.5; color: var(--muted); }
.side-c__cols { display: grid; grid-template-columns: 1fr 1fr; }
.side-c__col { padding: 12px 16px 14px; }
.side-c__col--yes { border-right: 1px solid var(--rule); }
.side-c__cap { display: block; font: 400 10px/1 var(--fm); letter-spacing: .12em; margin-bottom: 8px; }
.side-c__col--yes .side-c__cap { color: var(--down); }
.side-c__col--no .side-c__cap { color: var(--ok); }
.side-c__col ul { list-style: none; margin: 0; padding: 0; }
.side-c__col li { position: relative; padding-left: 16px; margin-bottom: 6px; font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.side-c__col--yes li::before { content: '•'; position: absolute; left: 2px; color: var(--down); }
.side-c__col--no li::before { content: '—'; position: absolute; left: 0; color: var(--ok); }

/* --- шаги ------------------------------------------------------------------- */
.steps { list-style: none; margin: 0 0 26px; padding: 0; counter-reset: s; }
.steps > li {
  counter-increment: s; position: relative; padding: 0 0 18px 44px; margin-bottom: 4px;
  border-left: 1px solid var(--rule); margin-left: 15px;
}
.steps > li::before {
  content: counter(s, decimal-leading-zero); position: absolute; left: -15px; top: 0;
  width: 30px; height: 30px; display: grid; place-items: center;
  font: 400 12px/1 var(--fm); color: var(--acc); background: var(--surface);
  border: 1px solid var(--rule-2); border-radius: 2px;
}
.steps > li:last-child { border-left-color: transparent; }
.step__ttl { display: block; font: 600 16px/1.35 var(--fb); margin: 4px 0 6px; }
.steps p { margin: 0 0 8px; font-size: 15px; line-height: 1.58; color: var(--ink-2); }
.steps ul { list-style: none; margin: 0 0 8px; padding: 0; }
.steps ul li { position: relative; padding-left: 18px; margin-bottom: 5px; font-size: 14.5px; color: var(--ink-2); }
.steps ul li::before { content: ''; position: absolute; left: 2px; top: 11px; width: 7px; height: 1px; background: var(--acc); }

/* --- таблица ---------------------------------------------------------------- */
.tw { overflow-x: auto; margin: 0 0 26px; border: 1px solid var(--rule-2); border-radius: 2px; background: var(--surface); }
.tw__cap { display: block; font: 400 10px/1 var(--fm); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 11px 14px 0; }
.tw table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
.tw th, .tw td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.tw th { font: 500 11px/1.3 var(--fm); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); white-space: nowrap; }
.tw tr:last-child td { border-bottom: 0; }
.tw td:first-child { font-weight: 600; }

/* --- врезки ----------------------------------------------------------------- */
.note { margin: 0 0 24px; padding: 13px 16px; border: 1px solid var(--rule); border-left: 2px solid var(--rule-2); border-radius: 2px; background: var(--surface); }
.note__ttl { display: block; font: 600 15px/1.35 var(--fb); margin-bottom: 6px; }
.note p { margin: 0 0 8px; font-size: 14.5px; line-height: 1.56; color: var(--ink-2); }
.note p:last-child { margin-bottom: 0; }
.note ul { list-style: none; margin: 6px 0 0; padding: 0; }
.note li { position: relative; padding-left: 16px; margin-bottom: 5px; font-size: 14.5px; color: var(--ink-2); }
.note li::before { content: ''; position: absolute; left: 2px; top: 10px; width: 7px; height: 1px; background: currentColor; opacity: .5; }
.note--ok { border-left-color: var(--ok); background: var(--ok-soft); }
.note--warn { border-left-color: var(--warn); background: var(--warn-soft); }
.note--down { border-left-color: var(--down); background: var(--down-soft); }
.note--info { border-left-color: var(--acc); background: var(--acc-soft); }

/* Граница точности: там, где мы не знаем реализацию дословно. */
.approx {
  margin: 0 0 24px; padding: 12px 16px; border: 1px dashed var(--rule-2); border-radius: 2px;
  background: var(--surface-2);
}
.approx__cap { display: block; font: 400 10px/1 var(--fm); letter-spacing: .14em; color: var(--muted); margin-bottom: 6px; }
.approx p { margin: 0 0 6px; font-size: 14px; line-height: 1.55; color: var(--ink-2); }
.approx p:last-child { margin-bottom: 0; }

/* --- FAQ -------------------------------------------------------------------- */
.faq { margin: 0 0 26px; border-top: 1px solid var(--rule); }
.faq h3 { font: 600 16px/1.4 var(--fb); margin: 0; padding: 16px 0 6px; }
.faq p { margin: 0 0 14px; font-size: 15px; line-height: 1.58; color: var(--ink-2); }

/* --- строки-ссылки ---------------------------------------------------------- */
.rows { list-style: none; margin: 0 0 26px; padding: 0; border: 1px solid var(--rule-2); border-radius: 2px; overflow: hidden; background: var(--surface); }
.rows li + li .row { border-top: 1px solid var(--rule); }
.row { display: flex; gap: 14px; align-items: center; padding: 13px 16px; text-decoration: none; color: inherit; }
.row:hover { background: var(--surface-2); }
.row__idx { flex-shrink: 0; font: 400 11px/1 var(--fm); color: var(--acc); min-width: 30px; }
.row__mid { flex: 1; min-width: 0; }
.row__ttl { display: block; font: 500 16.5px/1.3 var(--fd); color: var(--ink); }
.row__sub { display: block; font-size: 13.5px; line-height: 1.5; color: var(--muted); margin-top: 2px; }
.row__go { flex-shrink: 0; font: 400 11px/1 var(--fm); color: var(--muted); opacity: 0; }
.row:hover .row__go { opacity: 1; color: var(--acc); }

/* --- CTA -------------------------------------------------------------------- */
.cta { margin: 32px 0; padding: 20px 22px; border: 1px solid var(--rule-2); border-top: 2px solid var(--acc); border-radius: 2px; background: var(--surface); }
.cta--diag { border-top-color: var(--rule-2); border-style: dashed; }
.cta__tag { display: inline-block; font: 400 10px/1 var(--fm); letter-spacing: .12em; color: var(--acc); border: 1px solid var(--acc); border-radius: 2px; padding: 5px 7px; }
.cta__ttl { font: 500 21px/1.28 var(--fd); margin: 12px 0 8px; }
.cta__txt { margin: 0 0 12px; font-size: 15px; line-height: 1.6; color: var(--ink-2); }
.cta__pts { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.cta__pts li { position: relative; padding-left: 16px; font: 400 12.5px/1.4 var(--fm); color: var(--muted); }
.cta__pts li::before { content: ''; position: absolute; left: 0; top: 8px; width: 9px; height: 1px; background: var(--acc); }
.cta__row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.cta__fine { font: 400 12px/1.4 var(--fm); color: var(--muted); }

.spark { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin: 0 0 26px; padding: 14px 16px; border: 1px solid var(--rule); border-left: 2px solid var(--acc); background: var(--surface-2); border-radius: 2px; }
.spark__tag { font: 400 10px/1 var(--fm); letter-spacing: .1em; color: var(--acc); }
.spark__txt { flex: 1 1 320px; margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--ink-2); }

.foot-go { margin: 34px 0 26px; padding: 20px 22px; border: 1px solid var(--rule-2); border-top: 2px solid var(--acc); border-radius: 2px; background: var(--surface); }
.foot-go__tag { display: inline-block; font: 400 10px/1 var(--fm); letter-spacing: .12em; color: var(--acc); }
.foot-go__txt { margin: 10px 0 14px; font-size: 15px; line-height: 1.6; color: var(--ink-2); }

/* --- смотрите также / оценка ------------------------------------------------ */
.also { margin: 26px 0; }
.also__cap { display: block; font: 400 10px/1 var(--fm); letter-spacing: .14em; color: var(--muted); padding-bottom: 8px; border-bottom: 1px solid var(--rule); }
.also__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0; }
.also__list li { border-bottom: 1px solid var(--rule); padding: 10px 0; }
.also__list a { font-size: 14.5px; text-decoration: none; }
.also__list a:hover { text-decoration: underline; }
.also__site { display: block; font: 400 10px/1 var(--fm); color: var(--muted); margin-top: 3px; letter-spacing: .06em; }

.helpful { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 24px 0 0; padding: 14px 16px; border: 1px solid var(--rule); border-radius: 2px; background: var(--surface); }
.helpful__q { font: 500 14px/1 var(--fd); letter-spacing: .02em; }
.helpful__thanks { font-size: 13.5px; color: var(--ok); }
.helpful__btns { margin-left: auto; display: flex; gap: 8px; }
.helpful button { font: 400 11px/1 var(--fm); letter-spacing: .08em; background: var(--surface-2); border: 1px solid var(--rule); border-radius: 2px; padding: 8px 14px; cursor: pointer; color: var(--ink-2); }
.helpful button:hover { border-color: var(--acc); color: var(--acc); }
.helpful[data-done] .helpful__btns { display: none; }

/* --- скриншоты -------------------------------------------------------------- */
.shot { margin: 0 0 24px; }
.shot__frame { border: 1px dashed var(--rule-2); border-radius: 2px; background: var(--surface-2); min-height: 132px; display: grid; place-items: center; }
.shot__code { font: 400 12px/1 var(--fm); letter-spacing: .12em; color: var(--muted); }
.shot__link { display: block; position: relative; border: 1px solid var(--rule); border-radius: 2px; overflow: hidden; }
.shot__link img { width: 100%; max-height: 520px; object-fit: contain; background: var(--surface-2); }
.shot__zoom { position: absolute; right: 8px; bottom: 8px; font: 400 10px/1 var(--fm); background: var(--surface); border: 1px solid var(--rule); padding: 4px 6px; color: var(--muted); opacity: 0; transition: opacity .12s; }
.shot__link:hover .shot__zoom { opacity: 1; }
.shot__cap { font-size: 13px; line-height: 1.5; color: var(--muted); margin-top: 7px; }
.shot__pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.shot__part { position: relative; }
.shot__part img { border: 1px solid var(--rule); max-height: 400px; object-fit: contain; background: var(--surface-2); width: 100%; }
.shot__mark { position: absolute; left: 6px; top: 6px; font: 400 10px/1 var(--fm); background: var(--surface); border: 1px solid var(--rule); padding: 3px 5px; }
.shot__partcap { display: block; font-size: 12px; color: var(--muted); margin-top: 5px; }

/* --- поиск ------------------------------------------------------------------ */
.sdlg { position: fixed; inset: 0; z-index: 80; display: none; }
.sdlg.is-open { display: block; }
.sdlg__bd { position: absolute; inset: 0; background: rgba(12, 18, 16, .5); }
.sdlg__box { position: relative; max-width: 640px; margin: 8vh auto 0; background: var(--surface); border: 1px solid var(--rule-2); border-radius: 2px; overflow: hidden; }
.sdlg input { width: 100%; border: 0; border-bottom: 1px solid var(--rule); padding: 16px 18px; font: 400 16px/1.3 var(--fb); background: var(--surface); color: var(--ink); }
.sdlg input:focus { outline: none; border-bottom-color: var(--acc); }
.sres { list-style: none; margin: 0; padding: 0; max-height: 56vh; overflow-y: auto; }
.sres a { display: block; padding: 11px 18px; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--rule); }
.sres a.is-sel, .sres a:hover { background: var(--acc-soft); }
.sres__t { display: block; font-size: 15px; line-height: 1.35; }
.sres__p { display: block; font: 400 10px/1 var(--fm); letter-spacing: .1em; color: var(--muted); margin-top: 4px; }
.sres__none { color: var(--muted); }
.sdlg__foot { padding: 9px 18px; font: 400 10px/1 var(--fm); letter-spacing: .06em; color: var(--muted); background: var(--surface-2); border-top: 1px solid var(--rule); }

/* --- нижняя панель ---------------------------------------------------------- */
.gobar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; transform: translateY(100%); transition: transform .2s; background: var(--surface); border-top: 1px solid var(--rule-2); }
.gobar.is-on { transform: none; }
.gobar__in { display: flex; align-items: center; gap: 12px; padding: 10px 14px; }
.gobar__txt { flex: 1; min-width: 0; }
.gobar__txt b { display: block; font: 500 14px/1.3 var(--fd); }
.gobar__txt span { display: block; font-size: 12px; color: var(--muted); }
.gobar__x { background: none; border: 0; font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 4px; }
body.has-gobar { padding-bottom: 64px; }

/* --- подвал ----------------------------------------------------------------- */
.ftr { border-top: 1px solid var(--rule); background: var(--surface); margin-top: auto; }
.ftr__in { max-width: var(--wrap); margin: 0 auto; padding: 34px 24px 28px; }
.ftr__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 26px; }
.ftr__ttl { display: block; font: 500 11px/1 var(--fd); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.ftr__grid ul { list-style: none; margin: 0; padding: 0; }
.ftr__grid li { margin-bottom: 6px; }
.ftr__grid a { font-size: 13.5px; color: var(--ink-2); text-decoration: none; }
.ftr__grid a:hover { color: var(--acc); }
.ftr__disc { margin: 26px 0 18px; padding-top: 18px; border-top: 1px solid var(--rule); font-size: 12.5px; line-height: 1.62; color: var(--muted); max-width: 900px; }
.ftr__bar { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; font: 400 10px/1 var(--fm); letter-spacing: .1em; }
.ftr__bar a { color: var(--muted); text-decoration: none; }
.ftr__bar a:hover { color: var(--acc); }
.ftr__cp { margin-left: auto; color: var(--rule-2); }

/* --- главная ---------------------------------------------------------------- */
.hero { padding: 24px 0 6px; }
.hero__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
.hero__ttl { font: 500 clamp(28px, 3.8vw, 40px)/1.1 var(--fd); letter-spacing: -.015em; margin: 0 0 10px; max-width: 20ch; }
.hero__sub { font-size: 16.5px; line-height: 1.55; color: var(--ink-2); max-width: 92ch; margin: 0 0 16px; }
.hero__row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 6px; }
.hero__fine { font: 400 12px/1.4 var(--fm); color: var(--muted); }
.home h2 { font: 500 24px/1.24 var(--fd); margin: 44px 0 14px; padding-top: 18px; border-top: 1px solid var(--rule); }
.home__lede { font-size: 16px; line-height: 1.62; color: var(--ink-2); max-width: 78ch; margin: 0 0 20px; }
.qa { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0; border: 1px solid var(--rule-2); border-radius: 2px; overflow: hidden; background: var(--surface); margin-bottom: 30px; }
.qa__i { padding: 16px 18px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); text-decoration: none; color: inherit; }
.qa__i:hover { background: var(--surface-2); }
.qa__q { display: block; font: 500 16.5px/1.35 var(--fd); color: var(--ink); margin-bottom: 6px; }
.qa__a { display: block; font-size: 14px; line-height: 1.55; color: var(--muted); }

/* ===========================================================================
   Адаптив
   =========================================================================== */
@media (max-width: 1080px) {
  .layout { grid-template-columns: 1fr; gap: 0; }
  .side {
    display: none; position: static; max-height: none; padding-top: 16px;
    border-bottom: 1px solid var(--rule); margin-bottom: 8px;
  }
  .side.is-open { display: block; }
  .burger { display: inline-block; }
  .hdr__links { display: none; }
}

@media (max-width: 860px) {
  body { font-size: 16px; }
  .hdr__in { padding: 0 12px; gap: 8px; min-height: 54px; }
  .brand__tag { display: none; }
  .brand__mark, .brand__sub { font-size: 17px; }
  .brand__logo { width: 21px; height: 21px; margin-right: 8px; }
  .hdr__nav { gap: 8px; }
  .burger { padding: 8px 9px; font-size: 11px; }
  .hdr__go-l { display: none; }
  .hdr__go-s { display: inline; }
  .hdr__go { padding: 9px 11px; font-size: 12.5px; }
  .searchbtn { padding: 7px 8px; }
  .searchbtn span:nth-child(2), .searchbtn kbd { display: none; }
  .layout, .wrap { padding: 0 16px 48px; }
  .art h2 { font-size: 22px; margin-top: 34px; }
  .art__lead { font-size: 17px; }

  /* Чертёж на телефоне нечитаем: те же узлы и связи показываем списком. */
  .dg { padding: 14px; }
  .dg__svg, .dg__hint { display: none; }
  .dg__list { display: block; }
  .mn { flex-direction: column; align-items: flex-start; gap: 12px; }
  .mn__svg { width: 100%; max-width: 300px; }

  .defn__grid, .side-c__cols { grid-template-columns: 1fr; }
  .defn__col--like, .side-c__col--yes { border-right: 0; border-bottom: 1px solid var(--rule); }
  .track__row { flex-direction: column; }
  .track__c { border-right: 0; border-bottom: 1px solid var(--rule); }
  .track__c:last-child { border-bottom: 0; }
  .shot__pair { grid-template-columns: 1fr; }
  .shot__link img, .shot__part img { max-height: none; }
  .cat__i { gap: 12px; padding: 14px; }
  .cat__ttl { font-size: 17px; }
  .qa__i { border-right: 0; }
  .sdlg__box { margin: 0; max-width: none; height: 100%; border: 0; }
  .sres { max-height: calc(100vh - 120px); }
}

@media (max-width: 520px) {
  .row__go { display: none; }
  .cta, .foot-go { padding: 16px; }
  .cta__ttl { font-size: 19px; }
  .helpful__btns { margin-left: 0; }
}

@media print {
  .hdr, .side, .gobar, .cta, .spark, .foot-go, .helpful, .sdlg { display: none; }
  body { background: #fff; }
}
