/* Макет: одна колонка «инженерной памятки», полоса светодиодных точек в шапке, сравнение в две колонки, схемы на всю ширину */
:root {
  --bg: #f6f7f8;
  --paper: #ffffff;
  --ink: #15191d;
  --muted: #5a6470;
  --line: #d9dee3;
  --wf4: #0b8fb0;          /* голубой: HD-WF4 */
  --c16: #7a4fd6;          /* фиолетовый: HD-C16L */
  --good: #1f8a4c;
  --warn: #b26a00;
  --bad: #c0392b;
  --panel: #101418;        /* корпус модуля */
  --led-off: #2b3238;
  --soft-wf4: color-mix(in srgb, var(--wf4) 10%, var(--paper));
  --soft-c16: color-mix(in srgb, var(--c16) 10%, var(--paper));
  --soft-warn: color-mix(in srgb, var(--warn) 12%, var(--paper));
  --f-display: "Unbounded", "Golos Text", system-ui, sans-serif;
  --f-body: "Golos Text", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1215; --paper: #161b20; --ink: #e7ecf0; --muted: #98a3ad; --line: #2a323a;
    --wf4: #3cc3e3; --c16: #a98bff; --good: #4cc27f; --warn: #f0a63a; --bad: #ff6b5b;
    --panel: #05080a; --led-off: #232a30; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1215; --paper: #161b20; --ink: #e7ecf0; --muted: #98a3ad; --line: #2a323a;
  --wf4: #3cc3e3; --c16: #a98bff; --good: #4cc27f; --warn: #f0a63a; --bad: #ff6b5b;
  --panel: #05080a; --led-off: #232a30; color-scheme: dark;
}
* { box-sizing: border-box; }
body {
  background: var(--bg); color: var(--ink);
  font: 16px/1.6 var(--f-body);
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 0 48px;
}
.wrap { max-width: 980px; margin: 0 auto; display: grid; gap: 40px; }
h1, h2, h3 { font-family: var(--f-display); text-wrap: balance; line-height: 1.2; margin: 0; }
h1 { font-size: clamp(1.6rem, 4.2vw, 2.5rem); font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.2rem, 2.6vw, 1.55rem); font-weight: 700; }
h3 { font-size: 1.02rem; font-weight: 500; }
p { margin: 0; max-width: 68ch; }
.eyebrow { font: 600 0.72rem/1 var(--f-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.mono { font-family: var(--f-mono); font-size: 0.9em; }
code { font-family: var(--f-mono); font-size: 0.88em; background: color-mix(in srgb, var(--ink) 7%, transparent); padding: 1px 5px; border-radius: 4px; overflow-wrap: anywhere; }
section { display: grid; gap: 16px; }
.lead { color: var(--muted); font-size: 1.05rem; }

/* шапка: полоса «светодиодов» */
header { display: grid; gap: 14px; padding-top: 28px; }
.ledstrip { width: 100%; height: auto; display: block; border-radius: 8px; background: var(--panel); }
.meta { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--muted); font-size: 0.9rem; }

/* сводка */
.duo { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 20px; display: grid; gap: 12px; align-content: start; min-width: 0; }
.card.wf4 { border-top: 4px solid var(--wf4); }
.card.c16 { border-top: 4px solid var(--c16); }
.card .price { font: 700 1.6rem/1 var(--f-display); }
.card.wf4 .price { color: var(--wf4); }
.card.c16 .price { color: var(--c16); }
.verdict { font-size: 0.95rem; }
.pc { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: 0.95rem; }
.pc li { display: grid; grid-template-columns: 18px 1fr; gap: 8px; align-items: start; }
.pc li::before { font: 700 0.95rem/1.55 var(--f-mono); }
.pc li.plus::before { content: "+"; color: var(--good); }
.pc li.minus::before { content: "−"; color: var(--bad); }

/* таблица */
.tablebox { overflow-x: auto; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; min-width: 620px; font-size: 0.93rem; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { font: 600 0.75rem/1.3 var(--f-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); background: color-mix(in srgb, var(--ink) 3%, var(--paper)); }
thead th.wf4 { color: var(--wf4); } thead th.c16 { color: var(--c16); }
tbody th { font-weight: 600; width: 24%; }
tr:last-child th, tr:last-child td { border-bottom: 0; }
td.win { background: color-mix(in srgb, var(--good) 9%, transparent); }
td.bad { color: var(--bad); font-weight: 600; }
.tag { display: inline-block; font: 600 0.68rem/1 var(--f-mono); letter-spacing: 0.06em; padding: 3px 6px; border-radius: 4px; vertical-align: 1px; margin-left: 4px; white-space: nowrap; }
.tag.ok { color: var(--good); border: 1px solid color-mix(in srgb, var(--good) 50%, transparent); }
.tag.vendor { color: var(--muted); border: 1px solid var(--line); }

/* график */
.figure { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 18px; display: grid; gap: 10px; min-width: 0; }
.figure svg { width: 100%; height: auto; display: block; }
.caption { color: var(--muted); font-size: 0.88rem; }
.svgbox { overflow-x: auto; }
.svgbox svg { min-width: 640px; }

/* шаги */
ol.steps { counter-reset: s; list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
ol.steps > li { counter-increment: s; display: grid; grid-template-columns: 36px 1fr; gap: 12px; align-items: start; }
ol.steps > li::before { content: counter(s); font: 700 0.95rem/36px var(--f-display); width: 36px; height: 36px; text-align: center; border-radius: 50%; border: 2px solid currentColor; }
ol.steps.wf4 > li::before { color: var(--wf4); }
ol.steps.c16 > li::before { color: var(--c16); }
ol.steps > li > div { display: grid; gap: 4px; min-width: 0; }
ol.steps b { font-weight: 600; }
.note { background: var(--soft-warn); border-left: 3px solid var(--warn); padding: 12px 14px; border-radius: 0 8px 8px 0; font-size: 0.93rem; display: grid; gap: 4px; }
.note strong { color: var(--warn); }
.formula { font-family: var(--f-mono); background: var(--paper); border: 1px dashed var(--line); padding: 10px 12px; border-radius: 8px; font-size: 0.88rem; overflow-x: auto; white-space: nowrap; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.85rem; color: var(--muted); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 2px; vertical-align: -1px; margin-right: 6px; }
footer { color: var(--muted); font-size: 0.85rem; display: grid; gap: 6px; border-top: 1px solid var(--line); padding-top: 16px; }
footer a { color: inherit; }
a { color: var(--wf4); }
a:focus-visible { outline: 2px solid var(--wf4); outline-offset: 2px; }

/* svg-токены */
.t-ink { fill: var(--ink); } .t-muted { fill: var(--muted); }
.s-line { stroke: var(--line); } .s-ink { stroke: var(--ink); }
.f-paper { fill: var(--paper); } .f-panel { fill: var(--panel); } .f-ledoff { fill: var(--led-off); }
.f-wf4 { fill: var(--wf4); } .f-c16 { fill: var(--c16); } .s-wf4 { stroke: var(--wf4); } .s-c16 { stroke: var(--c16); }
.f-warn { fill: var(--warn); } .s-warn { stroke: var(--warn); } .s-bad { stroke: var(--bad); } .f-bad { fill: var(--bad); }
@media (prefers-reduced-motion: no-preference) {
  .blink { animation: blink 2.4s steps(1) infinite; }
  @keyframes blink { 50% { opacity: 0.35; } }
}

/* ===== сайт: навигация и LED-матрица ===== */
:root { --seam: rgba(255,255,255,0.07); }
.topbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; padding-block: 18px 0; }
.brand { font: 700 0.95rem/1 var(--f-display); color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: 10px; }
.brand i { width: 10px; height: 10px; border-radius: 50%; background: var(--wf4); box-shadow: 14px 0 0 var(--c16), 28px 0 0 var(--warn); margin-right: 28px; }
nav.menu { display: flex; flex-wrap: wrap; gap: 4px; }
nav.menu a { font: 500 0.9rem/1 var(--f-body); color: var(--muted); text-decoration: none; padding: 8px 12px; border-radius: 6px; }
nav.menu a:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); }
nav.menu a[aria-current="page"] { color: var(--ink); background: color-mix(in srgb, var(--wf4) 16%, transparent); }
.matrix { position: relative; border-radius: 10px; overflow: hidden; background: var(--panel); display: grid; }
.matrix canvas { width: 100%; height: auto; display: block; aspect-ratio: 4 / 1; }
.matrix video { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.matrix-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; font: 0.82rem/1.3 var(--f-mono); color: var(--muted); }
.matrix-bar button { font: 600 0.82rem/1 var(--f-mono); color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; cursor: pointer; }
.matrix-bar button:hover { border-color: var(--wf4); }
.matrix-bar button:focus-visible { outline: 2px solid var(--wf4); outline-offset: 2px; }
.next { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.next a { display: grid; gap: 6px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); text-decoration: none; color: var(--ink); }
.next a:hover { border-color: var(--wf4); }
.next a span { color: var(--muted); font-size: 0.9rem; }
.next a b { font: 500 1rem/1.3 var(--f-display); }

/* ===== раздел «Скачать» ===== */
.dl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 14px; }
.dl { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; display: grid; grid-template-rows: auto 1fr; min-width: 0; }
.dl-prev { background: var(--panel); max-width: 100%; }
.dl-prev img, .dl-prev video { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; display: block; }
.dl-body { padding: 14px 16px 16px; display: grid; gap: 8px; align-content: start; min-width: 0; }
.dl-body h3 { font: 600 0.92rem/1.35 var(--f-body); overflow-wrap: anywhere; }
.dl-body p { font-size: 0.9rem; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips span { font: 0.75rem/1 var(--f-mono); padding: 5px 7px; border-radius: 4px; background: color-mix(in srgb, var(--ink) 6%, transparent); font-variant-numeric: tabular-nums; }
.wf4est { font: 0.78rem/1.3 var(--f-mono); }
.wf4est.ok { color: var(--good); }
.wf4est.no { color: var(--bad); }
.badge { font: 600 0.68rem/1 var(--f-mono); letter-spacing: .05em; padding: 3px 6px; border-radius: 4px; vertical-align: 2px; margin-left: 6px; white-space: nowrap; border: 1px solid currentColor; }
.b-rec { color: var(--c16); } .b-wf { color: var(--wf4); } .b-ok { color: var(--good); } .b-no { color: var(--bad); }
.dl-btn { justify-self: start; margin-top: 4px; font: 600 0.85rem/1 var(--f-body); color: var(--paper); background: var(--ink); text-decoration: none; padding: 10px 14px; border-radius: 6px; }
.dl-btn:hover { background: var(--wf4); }
.dl-btn:focus-visible { outline: 2px solid var(--wf4); outline-offset: 2px; }
.xhds-prev { height: 100%; display: grid; place-content: center; gap: 6px; text-align: center; color: #e7ecf0; font-family: var(--f-mono);
  background: radial-gradient(circle, #2b3238 1.1px, transparent 1.3px) 0 0 / 6px 6px, var(--panel); }
.xhds-prev b { font: 700 1.6rem/1 var(--f-display); color: #20e8ff; }
.xhds-prev span { font-size: 0.8rem; }
.xhds-prev .sw { display: inline-flex; gap: 6px; align-items: center; justify-content: center; }
.xhds-prev .sw i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }

/* ===== инструкция со скриншотами ===== */
.toc { display: flex; flex-wrap: wrap; gap: 6px; }
.toc a { font-size: 0.85rem; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); text-decoration: none; background: var(--paper); }
.toc a:hover { border-color: var(--wf4); }
section[id] { scroll-margin-top: 16px; }
.shot-row { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.shot-row.two { grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); }
@media (max-width: 760px) { .shot-row { grid-template-columns: minmax(0, 1fr); } }
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(170px, 100%), 1fr)); gap: 12px; align-items: start; min-width: 0; }
.shots .shot { width: 100%; max-width: 100%; }
.shots:has(.shot.wide) { grid-template-columns: minmax(0, 1fr); }
.shot { margin: 0; display: grid; gap: 6px; min-width: 0; }
.shot img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.shot figcaption { font-size: 0.82rem; color: var(--muted); line-height: 1.4; }
.shot.phone { width: min(200px, 100%); }
.shot.phone img { max-height: 420px; object-fit: contain; object-position: top; }
.shot.pc { width: min(360px, 100%); }
.shot.wide { width: 100%; max-width: 560px; }
.shot.small { max-width: 380px; }
.wizard { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(180px, 100%), 1fr)); gap: 16px; }
.wizard .shot.phone { width: 100%; }
.wizard.pc { grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); }
.wizard.pc .shot.pc { width: 100%; }
.prose { display: grid; gap: 12px; min-width: 0; }
ul.check { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
.c-red { color: #e0302b; font-weight: 600; } .c-green { color: var(--good); font-weight: 600; } .c-blue { color: #2f6bff; font-weight: 600; } .c-yellow { color: var(--warn); font-weight: 600; }

.b-wait { color: var(--warn); }

/* ===== главная: третья карточка и статус проекта ===== */
:root { --nova: #c2410c; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --nova: #fb923c; } }
:root[data-theme="dark"] { --nova: #fb923c; }
.card.nova { border-top: 4px solid var(--nova); }
.card.nova .price { color: var(--nova); }
.card > a { font-weight: 600; color: var(--nova); text-decoration: none; }
.card > a:hover { text-decoration: underline; }
.status { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 14px; }
.st { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; display: grid; gap: 8px; align-content: start; min-width: 0; }
.st h3 { font: 600 0.95rem/1.3 var(--f-body); }
.st ul, .st ol { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; font-size: 0.92rem; }
.st-ok { border-left: 4px solid var(--good); }
.st-open { border-left: 4px solid var(--warn); }
.st-next { border-left: 4px solid var(--wf4); }

/* ===== телефон (iPhone и др.): читаемость ===== */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
.nw { white-space: nowrap; }
.brand { padding-block: 8px; }
@media (max-width: 640px) {
  body { font-size: 17px; }
  .wrap { gap: 32px; }
  /* меню — одна строка с прокруткой */
  .topbar { flex-direction: column; align-items: stretch; gap: 6px; }
  nav.menu { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
    margin-inline: calc(-1 * max(16px, env(safe-area-inset-left, 0px))); padding-inline: max(16px, env(safe-area-inset-left, 0px));
    mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 24px), transparent 100%); }
  nav.menu::-webkit-scrollbar { display: none; }
  nav.menu a { white-space: nowrap; padding: 10px 12px; }
  /* мелкие подписи крупнее */
  .eyebrow { font-size: 0.78rem; }
  .tag, .badge { font-size: 0.74rem; padding: 4px 7px; }
  .caption, .shot figcaption, .dl-body p { font-size: 0.92rem; }
  .chips span { font-size: 0.8rem; }
  .meta { font-size: 0.95rem; }
  .matrix-bar { font-size: 0.85rem; }
  /* таблицы — карточками: строка = блок, над значением подпись колонки */
  .tablebox { overflow: visible; background: none; border: 0; border-radius: 0; }
  .tablebox table { min-width: 0; font-size: 1rem; }
  .tablebox thead { display: none; }
  .tablebox table, .tablebox tbody, .tablebox tr, .tablebox th, .tablebox td { display: block; width: auto; }
  .tablebox tr { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
  .tablebox tbody th { padding: 0 0 6px; border: 0; font-size: 1.02rem; }
  .tablebox td { padding: 8px 0 6px; border: 0; border-top: 1px dashed var(--line); }
  .tablebox td.win { background: none; }
  .tablebox td.win::before { color: var(--good); }
  .tablebox td[data-label]::before { content: attr(data-label); display: block; font: 600 0.74rem/1.35 var(--f-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
  /* схемы: шире и с подсказкой про прокрутку */
  .svgbox svg { min-width: 760px; }
  .figure:has(> .svgbox)::after, .figure:has(.svgbox)::after { content: "Схема прокручивается вбок →"; font-size: 0.82rem; color: var(--muted); }
  .formula { white-space: normal; }
  .shot.phone { width: min(260px, 100%); }
}
/* блоки сетки не должны распирать страницу (меню в одну строку и т. п.) */
.wrap > *, .topbar > * { min-width: 0; }
@media (max-width: 640px) { nav.menu { max-width: 100vw; } }
@media (max-width: 640px) { nav.menu { margin-inline: 0; padding-inline: 0; max-width: 100%; } }

/* страница TB3 и HD-A3: цвет NovaStar в таблицах, шагах и схемах */
thead th.nova { color: var(--nova); }
ol.steps.nova > li::before { color: var(--nova); }
.s-nova { stroke: var(--nova); } .f-nova { fill: var(--nova); }

/* строки «плюс/минус»: не сетка, чтобы ссылки и <b> внутри текста не рвали строку */
.pc li { display: block; position: relative; padding-left: 26px; }
.pc li::before { position: absolute; left: 0; top: 0; }
.card.c16 > a { color: var(--c16); }

/* карточка HD-A3 и списки объявлений с ценами */
:root { --a3: #0f766e; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --a3: #2dd4bf; } }
:root[data-theme="dark"] { --a3: #2dd4bf; }
.card.a3 { border-top: 4px solid var(--a3); }
.card.a3 .price { color: var(--a3); }
.card.a3 > a { color: var(--a3); }
thead th.a3 { color: var(--a3); }
.offers { margin: 0; padding: 10px 0 0; list-style: none; display: grid; gap: 4px; font-size: 0.85rem; border-top: 1px dashed var(--line); }
.offers li { display: flex; flex-wrap: wrap; gap: 2px 8px; }
.offers b { font-family: var(--f-mono); font-weight: 600; min-width: 5.5em; }
.offers .src { color: var(--muted); }
.price small { display: block; font: 500 0.78rem/1.4 var(--f-body); color: var(--muted); margin-top: 6px; }
.duo.four { grid-template-columns: repeat(auto-fit, minmax(min(400px, 100%), 1fr)); }
