/* ИжМСК — приводная техника. Две темы: тёмная «Пульт» (по умолчанию, выбор директора) и светлая «Чертёж».
   Тема — атрибут data-theme на <html> (ставит скрипт в base.html до отрисовки; выбор клиента — в localStorage).
   Цвета — только через переменные ниже, прямые #… в правилах не писать: сломается одна из тем.
   Один файл стилей без сборки: правится напрямую. Шрифты — static/css/fonts.css (свои файлы). */
:root {
  --red: #c8102e;          /* акцент: ссылки при наведении, рамки выбранного, надписи-метки */
  --red-dark: #9e0c24;
  --btn: #c8102e;          /* заливка главной кнопки */
  --btn-hover: #9e0c24;
  --on-btn: #ffffff;
  --solid: #1d2733;        /* тёмная плашка (кнопка «Запрос КП») */
  --solid-hover: #000000;
  --on-solid: #ffffff;
  --ink: #1d2733;
  --ink-2: #4a5866;
  --muted: #5b6876;
  --line: #dde3e9;
  --line-2: #c6ced6;
  --bg: #f5f7f9;
  --card: #ffffff;
  --bg-2: #eef1f4;
  --grid: #e3e8ee;
  --input: #ffffff;
  --focus: #f3b6c0;
  --row-hover: #fafbfc;
  --tint: #fff1f3;         /* выделенная строка, выбранный вариант */
  --tint-2: #fff6f7;
  --note-bg: #fdf3f5;
  --ok: #1f7a46;
  --ok-bg: #eaf6ef;
  --err: #9e0c24;
  --err-bg: #fdf0f2;
  --warn: #8a5800;
  --warn-bg: #fff6e5;
  --warn-line: #f0d49b;
  --paper: #fbfcfd;        /* лист под чертежом — в обеих темах светлый, чертёж читается как на бумаге */
  --axis: #9aa6b2;
  --paper-muted: #4a5866;
  --logo-bg: transparent;
  --top-bg: rgba(255, 255, 255, .92);   /* строка-команда поверх прокрутки — полупрозрачная */
  --side-on: #e3e9ef;                   /* пункт меню: наведение и текущий раздел */
  --link-line: #9aa6b2;                 /* подчёркивание ссылок в тексте — заметное, иначе ссылку не находят */
  --glow: transparent;                  /* подсветка первого экрана — только в тёмной */
  --shadow: 0 1px 2px rgba(29, 39, 51, .06);
  --radius: 10px;
  color-scheme: light;
  --wrap: 1280px;
  --sans: "IBM Plex Sans", "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "IBM Plex Mono", Consolas, "Courier New", monospace;
  font-size: 16px;
}
/* тёмная тема «Пульт»: графит, светлый текст, акцент светлее фирменного красного — иначе мелкий текст не читается */
:root[data-theme="dark"] {
  --red: #ff6b7c;
  --red-dark: #ff9aa6;
  --btn: #d6243f;
  --btn-hover: #e8455d;
  --on-btn: #ffffff;
  --solid: #e8edf2;
  --solid-hover: #ffffff;
  --on-solid: #0e1318;
  --ink: #e8edf2;
  --ink-2: #b5c0cb;
  --muted: #a0adba;
  --line: #243040;
  --line-2: #33445a;
  --bg: #0e1318;
  --card: #151c23;
  --bg-2: #121920;
  --grid: #18212a;
  --input: #0f151b;
  --focus: #7a2a35;
  --row-hover: #1a232c;
  --tint: #2a1d24;
  --tint-2: #241a20;
  --note-bg: #22161b;
  --ok: #4fd18b;
  --ok-bg: #12261c;
  --err: #ff8a97;
  --err-bg: #2a1519;
  --warn: #f2b84b;
  --warn-bg: #2a2214;
  --warn-line: #5a4620;
  --paper: #f5f7f9;
  --axis: #6b7a8a;
  --logo-bg: #ffffff;
  --top-bg: rgba(14, 19, 24, .86);
  --side-on: #1c2630;
  --link-line: #7d8c9c;
  --glow: rgba(214, 36, 63, .13);
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset;
  color-scheme: dark;
}
/* «Пульт»: метки как строки консоли */
:root[data-theme="dark"] .overline::before { content: "> "; }
::selection { background: var(--btn); color: var(--on-btn); }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1rem/1.55 var(--sans); }
a { color: var(--ink); text-decoration-color: var(--link-line); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--red); text-decoration-color: var(--red); }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .6em; font-weight: 700; }
h1 { font-size: 2.2rem; }
h2 { font-size: 1.6rem; margin-top: 1.6em; }
h3 { font-size: 1.15rem; }
img { max-width: 100%; height: auto; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 32px; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.nowrap { white-space: nowrap; }
.mono { font-family: var(--mono); }
.overline { font-family: var(--mono); font-size: .875rem; letter-spacing: 1px; color: var(--red); text-transform: uppercase;
            margin: 0 0 .8em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* каркас «Пульт» (макет D, выбор директора): меню слева, справа строка-команда и страница */
.shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--bg-2); border-right: 1px solid var(--line);
        padding: 20px 14px; display: flex; flex-direction: column; gap: 26px; }
.side-top { display: flex; align-items: center; gap: 10px; }
.logo { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); padding: 0 4px; }
.logo:hover { color: var(--ink); }
.logo img { display: block; flex: none; width: 52px; height: 53px; background: var(--logo-bg); border-radius: 10px; }   /* логотип B2B от директора (foto/brand/logo-b2b.png); на тёмном — белая плашка */
.logo b { display: block; font-size: 1.25rem; line-height: 1.2; }
.logo > span > span { font: .78rem var(--mono); color: var(--muted); }
.kp-mini, .side-toggle { display: none; }
.side-nav { flex: 1; display: flex; flex-direction: column; gap: 22px; }
.side-nav nav { display: flex; flex-direction: column; gap: 2px; }
.side-h { margin: 0 0 6px; padding: 0 10px; font: 600 .8rem var(--mono); letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.side-h a { color: inherit; text-decoration: none; }
.side-h a:hover { color: var(--red); }
.side-nav nav a { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 9px 10px; border-radius: 6px;
                  color: var(--ink); text-decoration: none; font-size: .95rem; }
.side-nav nav a em { font: normal .82rem var(--mono); color: var(--muted); }
.side-nav nav a:hover { background: var(--side-on); color: var(--ink); }
.side-nav nav a.on { background: var(--side-on); box-shadow: inset 2px 0 0 var(--red); font-weight: 500; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.side-foot .phone { padding: 0 10px; font: 600 1rem var(--mono); color: var(--ink); text-decoration: none; white-space: nowrap; }
.side-foot .phone:hover { color: var(--red); }
.kp-link { display: flex; align-items: center; justify-content: center; padding: 12px; border-radius: 6px; background: var(--btn);
           color: var(--on-btn); text-decoration: none; font-weight: 600; white-space: nowrap; }
.kp-link:hover { background: var(--btn-hover); color: var(--on-btn); }
.main { min-width: 0; display: flex; flex-direction: column; }
.main > main { flex: 1; width: 100%; }
/* тестовый режим после запуска (settings.TEST_MODE) */
.test-note { margin: 0; padding: 6px 32px; font-size: 13px; line-height: 1.4; color: var(--warn); background: var(--warn-bg);
             border-bottom: 1px solid var(--warn-line); }
.test-note a { color: inherit; font-weight: 600; overflow-wrap: anywhere; }
.main .wrap { margin: 0; }      /* страница — от меню, как в макете, а не по центру экрана */
.cmd { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px; padding: 10px 32px;
       border-bottom: 1px solid var(--line); background: var(--top-bg); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.cmd-form { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; }
.cmd-form label { margin: 0; font: 600 1rem var(--mono); color: var(--red); }
.cmd-form kbd { font: .74rem var(--mono); color: var(--muted); border: 1px solid var(--line-2); border-radius: 4px; padding: 3px 7px; }
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0;
                border: 1px solid var(--line-2); border-radius: 8px; background: transparent; color: var(--ink); cursor: pointer; }
.theme-toggle:hover { border-color: var(--red); color: var(--red); }
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }

/* кнопки и формы */
.btn { display: inline-block; padding: 12px 20px; border-radius: 6px; border: 1px solid var(--btn); background: var(--btn);
       color: var(--on-btn); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--btn-hover); border-color: var(--btn-hover); color: var(--on-btn); }
.btn.ghost { background: var(--card); color: var(--ink); border-color: var(--line-2); }
.btn.ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn.small { padding: 7px 14px; font-size: .9rem; }
form p { margin: 0 0 12px; }
label { display: block; font-weight: 500; margin-bottom: 4px; }
input[type=text], input[type=email], input[type=number], input[type=tel], input:not([type]), select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 6px; font: inherit; background: var(--input);
  color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); border-color: var(--red); }
.cmd-form input { flex: 1; min-width: 0; border: 0; border-radius: 0; background: transparent; padding: 10px 0; font: .95rem var(--mono); }
.cmd-form input:focus { outline: none; }
.check label { display: inline; font-weight: 400; }
.errorlist { color: var(--red-dark); margin: 4px 0; padding-left: 18px; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 4px 18px; }
.inline-form { display: flex; gap: 8px; }
.inline-form input { flex: 1; }

/* первый экран главной: миллиметровка и передача */
.hero { background-color: var(--bg); border-bottom: 1px solid var(--line);
        background-image: radial-gradient(ellipse 50% 70% at 78% 45%, var(--glow), transparent 70%),
                          linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
        background-size: auto, 32px 32px, 32px 32px; }
.hero .wrap { display: flex; flex-wrap: wrap; gap: 48px; align-items: center; padding-top: 64px; padding-bottom: 72px; }
.hero-text { flex: 1 1 540px; min-width: 0; }
.hero h1 { font-size: 3.2rem; line-height: 1.08; max-width: 720px; }
.hero p.lead { font-size: 1.2rem; color: var(--ink-2); max-width: 620px; margin: 0 0 24px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
/* одно поле подбора: задача словами, код с таблички или типоразмер */
.ai-box { display: flex; gap: 8px; flex-wrap: wrap; align-items: stretch; background: var(--card); border: 1px solid var(--line-2);
          border-radius: var(--radius); padding: 8px; max-width: 640px; margin-bottom: 12px; }
.ai-box:focus-within { border-color: var(--red); box-shadow: 0 0 0 2px var(--focus); }
.ai-box input, .ai-box textarea { flex: 1 1 260px; border: 0; padding: 12px; font-size: 1.05rem; min-width: 0; resize: vertical; }
.ai-box input:focus, .ai-box textarea:focus { outline: none; }
.ai-box-lg { max-width: none; }
.ai-box-lg label { flex: 1 0 100%; margin: 4px 4px 0; }
.ai-examples a { white-space: normal; }
/* «Расчёт · пример» справа от первого экрана — как в макете D */
.calc { flex: 1 1 340px; max-width: 460px; min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
        padding: 20px 22px; font: .92rem/1.4 var(--mono); box-shadow: var(--shadow); }
.calc-h { margin: 0 0 12px; font-size: .82rem; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.calc dl { margin: 0; display: flex; flex-direction: column; }
.calc dl div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 0;
               border-bottom: 1px dashed var(--line-2); }
.calc dt { color: var(--muted); }
.calc dd { margin: 0; text-align: right; white-space: nowrap; }
.calc .calc-res { border-bottom: 0; padding-top: 14px; }
.calc .calc-res dd { font-size: 1.15rem; font-weight: 600; }
.calc .calc-res a { color: var(--red); text-decoration: none; }
.calc-note { margin: 4px 0 0; font-size: .86rem; color: var(--muted); }
.calc-note a { color: var(--ink-2); }
.ai-try { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; max-width: 640px; }
.ai-try a { font: .84rem var(--mono); padding: 7px 11px; border: 1px solid var(--line-2); border-radius: 4px; color: var(--ink-2);
            text-decoration: none; background: var(--card); }
.ai-try a:hover { border-color: var(--red); color: var(--red); }
/* «С чего начать?» — четыре входа по тому, что человек знает */
.routes { margin-top: 40px; }
.routes h2 { margin: 0 0 16px; font-size: 1.6rem; }
.routes-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.route { display: flex; flex-direction: column; gap: 8px; padding: 20px; text-align: left; font: inherit; color: var(--ink);
         background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; cursor: pointer;
         transition: border-color .15s ease, transform .15s ease; }
.route:hover { border-color: var(--red); color: var(--ink); transform: translateY(-2px); }
.route b { font-size: 1.12rem; line-height: 1.3; }
.route > span:not(.route-n) { color: var(--ink-2); font-size: .95rem; }
.route em { margin-top: auto; padding-top: 6px; font: normal 600 .95rem var(--sans); color: var(--red); }
.route-n { width: 32px; height: 32px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center;
           font: 600 1rem var(--mono); color: var(--red); background: var(--tint); }
.route-help { border-style: dashed; border-color: var(--line-2); }
/* шаги на странице: «1 Отметьте…», «2 Найдите…» */
.step-h { display: flex; align-items: center; gap: 10px; margin: 8px 0 14px; font-size: 1.2rem; }
.step-h span { flex: none; width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
               background: var(--btn); color: var(--on-btn); font: 600 .9rem var(--mono); }
.chips-block + p + .step-h { margin-top: 28px; }
.hint { margin: 0 0 14px; padding: 10px 14px; border-left: 3px solid var(--red); background: var(--note-bg); border-radius: 0 6px 6px 0; }
.link-btn { padding: 0; border: 0; background: none; font: inherit; color: var(--red); text-decoration: underline;
            text-underline-offset: 3px; cursor: pointer; }
/* путь покупки: выбор → запрос КП → ответ с ценой */
.flow { list-style: none; margin: 8px 0 24px; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.flow li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
           background: var(--card); color: var(--muted); font-size: .92rem; line-height: 1.3; }
.flow b { flex: none; width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
          font: 600 .85rem var(--mono); border: 1px solid var(--line-2); }
.flow li.done { color: var(--ink-2); }
.flow li.done b { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
.flow li.on { border-color: var(--red); color: var(--ink); font-weight: 500; }
.flow li.on b { background: var(--btn); border-color: var(--btn); color: var(--on-btn); }
/* «что дальше» — следующий шаг крупно, а не мелкой ссылкой */
.next { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.next a, .next span { display: flex; align-items: baseline; gap: 8px; font-size: .95rem; }
.next a { color: var(--ink); text-decoration: none; }
.next a::after { content: "→"; color: var(--red); margin-left: auto; }
.next a:hover { color: var(--red); }
.next .muted { font-size: .9rem; }
/* каталог в цифрах — ячейки через 1px линию сетки */
.kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1px; margin-top: 40px; background: var(--line);
       border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.kpi div { background: var(--card); padding: 20px 22px; display: flex; flex-direction: column; gap: 4px; }
.kpi b { font: 600 1.9rem/1.1 var(--mono); }
.kpi span { color: var(--muted); font-size: .92rem; }
/* помощник «Спросите — найду решение»: кнопка в углу и окно разговора */
.as { position: fixed; right: 20px; bottom: 20px; z-index: 50; display: flex; flex-direction: column-reverse; align-items: flex-end; gap: 12px; }
.as-open { display: inline-flex; align-items: center; gap: 10px; padding: 14px 20px; border: 0; border-radius: 999px; cursor: pointer;
           background: var(--btn); color: var(--on-btn); font: 600 1rem var(--sans); box-shadow: 0 8px 24px rgba(0, 0, 0, .3); }
.as-open:hover { background: var(--btn-hover); }
.as-open svg { width: 20px; height: 20px; }
.as.on .as-open span { display: none; }
.as-tip { display: flex; align-items: flex-start; gap: 4px; max-width: 280px; padding: 12px 8px 12px 14px; border-radius: 12px;
          background: var(--card); border: 1px solid var(--red); box-shadow: 0 10px 30px rgba(0, 0, 0, .3); }
.as-tip-text { flex: 1; padding: 0; border: 0; background: none; color: var(--ink); font: 500 .95rem/1.4 var(--sans); text-align: left;
               cursor: pointer; }
.as-tip-x { flex: none; width: 28px; height: 28px; border: 0; background: none; color: var(--muted); font-size: 1.3rem; cursor: pointer; }
.as-panel { width: min(420px, calc(100vw - 32px)); height: min(640px, calc(100vh - 120px)); display: flex; flex-direction: column;
            background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
            box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.as-panel[hidden] { display: none; }
.as-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.as-ava { width: 36px; height: 36px; border-radius: 50%; background: var(--tint); color: var(--red); display: inline-flex;
          align-items: center; justify-content: center; font-weight: 700; flex: none; }
.as-who { flex: 1; display: flex; flex-direction: column; line-height: 1.25; }
.as-who span { font-size: .8rem; color: var(--muted); }
.as-close { width: 36px; height: 36px; border: 0; background: transparent; color: var(--muted); font-size: 1.6rem; cursor: pointer; }
.as-close:hover { color: var(--red); }
.as-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--bg-2); }
.as-msg { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.as-msg.me { align-items: flex-end; }
.as-bubble { max-width: 88%; padding: 9px 12px; border-radius: 12px; line-height: 1.45; font-size: .95rem; white-space: pre-line;
             background: var(--card); border: 1px solid var(--line); }
.as-msg.me .as-bubble { background: var(--solid); color: var(--on-solid); border-color: var(--solid); }
.as-wait .as-bubble { color: var(--muted); font-style: italic; }
.as-chips { display: flex; flex-wrap: wrap; gap: 6px; max-width: 96%; }
.as-chip { font: inherit; font-size: .88rem; padding: 7px 11px; border-radius: 999px; border: 1px solid var(--red); color: var(--red);
           background: transparent; cursor: pointer; text-decoration: none; }
.as-chip:hover { background: var(--tint); color: var(--red); }
.as-card { width: 100%; box-sizing: border-box; padding: 12px; border: 1px solid var(--red); border-radius: 12px; background: var(--card);
           display: flex; flex-direction: column; gap: 6px; }
.as-card p { margin: 0; font-size: .9rem; line-height: 1.45; }
.as-card form { margin: 4px 0 0; }
.as-card-tag { font: 500 .72rem var(--mono); letter-spacing: 1px; color: var(--red); text-transform: uppercase; }
.as-parts { margin: 0; padding-left: 18px; font-size: .88rem; }
.as-price { font-weight: 600; }
.as-note { font-size: .85rem; color: var(--muted); }
.as-note p { margin: 0; }
.as-consent { padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); }
.as-consent input { width: auto; margin: 0 4px 0 0; vertical-align: -2px; }
.as-consent label { display: inline; font-weight: 400; }
.as-consent.as-need { border-color: var(--red); background: var(--tint); }
/* уведомление о cookie: один раз, слева внизу (справа — помощник) */
.cookie { position: fixed; left: 284px; bottom: 20px; z-index: 40; max-width: min(440px, calc(100vw - 600px)); display: flex;
          align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
          background: var(--card); color: var(--ink); font-size: .88rem; line-height: 1.4; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.cookie[hidden] { display: none; }
.cookie p { margin: 0; }
.cookie .btn { flex: none; }
@media (max-width: 900px) { .cookie { left: 16px; max-width: min(440px, calc(100vw - 110px)); } }   /* меню сверху */
@media (max-width: 560px) { .cookie { left: 12px; bottom: 12px; max-width: calc(100vw - 92px); } }
.as-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.as-form input[type=text], .as-form input:not([type]) { flex: 1; min-width: 0; }
.as-send { width: 44px; flex: none; border: 0; border-radius: 8px; background: var(--btn); color: var(--on-btn); cursor: pointer;
           display: inline-flex; align-items: center; justify-content: center; }
.as-send svg { width: 20px; height: 20px; }
@media (max-width: 560px) {
  .as { right: 12px; bottom: 12px; }
  .as-open span { display: none; }
  .as-open { padding: 14px; }
  /* телефон: разговор на весь экран — ничего не перекрывает наполовину, крестик всегда виден */
  .as-panel { position: fixed; inset: 0; width: 100%; height: 100%; height: 100dvh; border-radius: 0; border: 0; z-index: 60; }
  .as.on .as-open { display: none; }
  .as-tip { max-width: calc(100vw - 90px); }
}
/* готовые решения */
.ready-head { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-end; justify-content: space-between; margin-bottom: 24px; }
.ready-head > div { flex: 1 1 520px; min-width: 0; }
.ready-head h1 { margin-bottom: .3em; }
.lead-sm { font-size: 1.1rem; color: var(--ink-2); max-width: 680px; margin: 0; }
.have-form { flex: 0 1 420px; min-width: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.have-form label { font-weight: 600; margin: 0; }
.have-row { display: flex; gap: 8px; }
.have-row input { flex: 1; min-width: 0; }
.ready-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin: 8px 0 20px; }
.ready-card { display: flex; flex-direction: column; gap: 8px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius);
              background: var(--card); text-decoration: none; color: var(--ink); }
.ready-card:hover { border-color: var(--red); color: var(--ink); }
.ready-card b { font-size: 1.15rem; }
.ready-layout { display: grid; grid-template-columns: 250px 1fr; gap: 24px; align-items: start; }
.ready-layout > * { min-width: 0; }
.ready-nav { margin: 0; padding: 8px; display: flex; flex-direction: column; position: sticky; top: 84px; }
.ready-nav a { padding: 10px 12px; border-radius: 6px; text-decoration: none; color: var(--ink); }
.ready-nav a.on { background: var(--tint); color: var(--red); font-weight: 600; }
.chips-block { display: flex; flex-wrap: wrap; gap: 16px 28px; margin-bottom: 10px; }
.chip-group { display: flex; flex-direction: column; gap: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font: 500 .92rem var(--mono); padding: 8px 12px; border: 1px solid var(--line-2); border-radius: 6px; color: var(--ink-2);
        text-decoration: none; }
.chip:hover { border-color: var(--red); color: var(--red); }
.chip.on { border-color: var(--red); color: var(--red); background: var(--tint); }
.ready-row { display: flex; flex-wrap: wrap; gap: 12px 22px; align-items: center; padding: 16px 18px; margin-bottom: 10px;
             border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.ready-row.first { border-color: var(--line-2); }
.ready-kw { flex: 0 0 110px; font: 600 1.25rem var(--mono); }
.ready-body { flex: 1 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ready-buy { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.ready-price { font-weight: 600; }
.ready-actions { display: flex; gap: 8px; }
.ready-actions form { margin: 0; }
@media (max-width: 900px) {
  .ready-layout { grid-template-columns: 1fr; }
  .ready-nav { position: static; flex-direction: row; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .ready-nav a { white-space: nowrap; }
  .ready-buy { align-items: flex-start; }
}
.understood h2 { margin-top: 0; }
.understood-list { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; }
.understood .fact-k { color: var(--muted); }
.tag { display: inline-block; font: 500 .82rem var(--mono); border: 1px solid var(--line-2); border-radius: 4px; padding: 1px 6px; color: var(--muted); }
.params summary { cursor: pointer; font-weight: 600; margin-bottom: 12px; }
.podbor > * { min-width: 0; }   /* длинные названия машин в списке не распирают колонку на телефоне */
.podbor select { max-width: 100%; }
.result-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
/* подбор в одном окне (podbor_okno.html, js/okno.js) */
.okno-head p { max-width: 760px; }
.okno-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.okno-tab { font: 500 .95rem var(--sans); padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--card);
            color: var(--ink); cursor: pointer; }
.okno-tab em { font: .78rem var(--mono); font-style: normal; color: var(--muted); margin-left: 4px; }
.okno-tab:hover { border-color: var(--red); }
.okno-tab.on { background: var(--solid); border-color: var(--solid); color: var(--on-solid); }
.okno-tab.on em { color: inherit; opacity: .75; }
.okno-filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px 14px; align-items: end; }
.okno-seg { grid-column: span 2; display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; align-self: end; }
.okno-seg label { flex: 1; margin: 0; padding: 8px 10px; text-align: center; font-size: .88rem; cursor: pointer; font-weight: 400;
                  border-right: 1px solid var(--line); white-space: nowrap; }
.okno-seg label:last-child { border-right: 0; }
.okno-seg input { position: absolute; opacity: 0; pointer-events: none; }
.okno-seg label:has(input:checked) { background: var(--tint); color: var(--red); font-weight: 600; }
.okno-f { display: flex; flex-direction: column; gap: 4px; margin: 0; font-size: .82rem; color: var(--muted); font-weight: 400; }
.okno-f input, .okno-f select { width: 100%; min-width: 0; }
.okno-series { grid-column: span 2; }
.okno-actions { grid-column: 1 / -1; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.okno-check { display: inline-flex; gap: 6px; align-items: center; margin: 0; font-weight: 400; font-size: .88rem; }
.okno-check input { width: auto; }
.okno-status { margin: 14px 0 8px; font-weight: 500; }
.okno-wrap { max-height: none; }
.okno-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.okno-table th { text-align: left; font-size: .78rem; color: var(--muted); font-weight: 500; padding: 8px; border-bottom: 1px solid var(--line);
                 white-space: nowrap; position: sticky; top: 0; background: var(--card); }
.okno-table td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.okno-table tbody tr:not(.okno-det) { cursor: pointer; }
.okno-table tbody tr:not(.okno-det):hover { background: var(--row-hover); }
.okno-table .n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.okno-table td input[type=checkbox] { width: auto; }
.okno-table .okno-ser { font: 600 .85rem var(--mono); }
.okno-table .okno-code { white-space: nowrap; }
.okno-table .okno-code b, .okno-table .okno-code a { font-size: .88rem; }
.okno-table .okno-real { display: block; font-size: .78rem; }
.okno-table .tag { margin-left: 6px; font-size: .72rem; }
.okno-table tr.bad td { color: var(--muted); }
.okno-table tr.bad .okno-fit { color: var(--err); }
.okno-fit { font-weight: 600; color: var(--ok); }
.okno-det td { background: var(--bg); padding: 14px 16px; cursor: default; }
.okno-det-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 4px 18px; font-size: .9rem; }
.okno-det-act { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 0; }
.okno-dims { margin-top: 10px; }
.okno-dims .drawing-box { max-width: 900px; }
.okno-more { text-align: center; }
.okno-bar { position: sticky; bottom: 12px; z-index: 20; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 12px 0;
            padding: 10px 14px; border: 1px solid var(--red); border-radius: 12px; background: var(--card);
            box-shadow: 0 10px 30px rgba(0, 0, 0, .25); max-width: 560px; }
.okno-bar[hidden] { display: none; }
.okno-import { margin-top: 28px; }
.okno-import-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; max-width: 880px; }
.okno-import-form > p:has(textarea), .okno-import-form > p.check, .okno-import-form > p:last-child,
.okno-import-form > ul { grid-column: 1 / -1; }
@media (max-width: 700px) { .okno-import-form { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 700px) { .okno-seg, .okno-series { grid-column: 1 / -1; } }

/* контакты в шапке: телефон и почта на каждой странице */
.cmd-contacts { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; line-height: 1.2; white-space: nowrap; }
.cmd-phone { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: .95rem; }
.cmd-phone svg { width: 16px; height: 16px; color: var(--red); flex: none; }
.cmd-mail { color: var(--muted); font-size: .8rem; text-decoration: none; }
.cmd-phone:hover, .cmd-mail:hover { color: var(--red); }
@media (max-width: 1100px) { .cmd-mail { display: none; } }
@media (max-width: 560px) {
  .cmd-phone span { display: none; }          /* телефон — значком: звонок одним нажатием */
  .cmd-phone { width: 40px; height: 40px; justify-content: center; border: 1px solid var(--line); border-radius: 8px; }
  .cmd-phone svg { width: 20px; height: 20px; }
}
.login-link { color: var(--ink); text-decoration: none; font-weight: 500; white-space: nowrap; }
.login-link:hover { color: var(--red); }
.auth { max-width: 520px; }
.hero-gear { flex: 1 1 380px; margin: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.hero-gear svg { width: 100%; max-width: 440px; height: auto; }
.hero-gear figcaption { font: .82rem var(--mono); color: var(--muted); }
.planetary .gw { fill: var(--card); fill-rule: evenodd; stroke: var(--ink); stroke-width: 1.4; }
.planetary .gs { fill: var(--card); fill-rule: evenodd; stroke: var(--red); stroke-width: 1.6; }
.planetary .ga { fill: none; stroke: var(--axis); stroke-width: .8; stroke-dasharray: 14 3 2 3; }
.planetary .gc { fill: none; stroke: var(--axis); stroke-width: 1; stroke-dasharray: 6 3; }

/* блоки */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin: 16px 0; }
.card { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; background: var(--card);
        display: flex; flex-direction: column; gap: 6px; }
.card h3 { margin: 0; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a:hover { color: var(--red); }
.card .meta { color: var(--ink-2); font-size: .92rem; }
.card .bottom { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.card-img { display: block; margin: -18px -18px 8px; border-radius: var(--radius) var(--radius) 0 0; overflow: hidden;
            background: var(--bg-2); }
.card-img img { display: block; width: 100%; height: auto; aspect-ratio: 5 / 4; object-fit: cover; transition: transform .25s ease; }
.card:hover .card-img img { transform: scale(1.04); }
.card:hover { border-color: var(--line-2); }
.card, .cat-card, .ready-card, .step, .panel, .kit, .buy, .cfg-result, .cfg-field, .ready-row, .table-wrap {
  box-shadow: var(--shadow); transition: border-color .15s ease; }
.cat-card:hover, .ready-card:hover, .card:hover { border-color: var(--red); }
.section-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 12px; margin-top: 64px; }
.section-head h2 { margin: 0; font-size: 2rem; }
.section-head p { margin: 0; font-family: var(--mono); color: var(--muted); font-size: .92rem; }
.cat-card { text-decoration: none; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
            overflow: hidden; display: flex; flex-direction: column; color: var(--ink); }
.cat-card img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--bg-2);
                transition: transform .25s ease; }
.cat-card:hover img { transform: scale(1.04); }
.cat-card span { padding: 16px 18px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.cat-card b { font-size: 1.2rem; }
.cat-card em { font: normal .9rem var(--mono); color: var(--muted); }
.cat-card:hover { color: var(--ink); }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin: 20px 0; }
.step { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px;
        display: flex; flex-direction: column; gap: 8px; }
.step .overline { margin: 0; }
.step b { font-size: 1.2rem; }
.step span { color: var(--ink-2); }
.eng { display: flex; flex-wrap: wrap; gap: 40px; align-items: center; margin-top: 64px; }
.eng img { flex: 1 1 360px; max-width: 480px; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: var(--radius); }
.eng div { flex: 1 1 400px; min-width: 0; }
.eng h2 { margin-top: 0; font-size: 2rem; }
.eng p { color: var(--ink-2); font-size: 1.05rem; }

/* фото серии */
.series-head.with-photo { display: grid; grid-template-columns: 1fr 360px; gap: 28px; align-items: start; }
.photo { margin: 18px 0 0; }
.photo img { display: block; width: 100%; height: auto; border-radius: var(--radius); background: var(--bg-2);
             border: 1px solid var(--line); }
.photo figcaption { color: var(--muted); font-size: .82rem; margin-top: 6px; }
.buy-img img { display: block; width: 100%; height: auto; border-radius: 6px; background: var(--bg-2); }
.buy-img + p { margin: 4px 0 12px; }
.model3d { margin: 14px 0 0; border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-direction: column;
           gap: 8px; align-items: flex-start; }
.model3d p { margin: 0; }
.model3d-h { display: flex; width: 100%; justify-content: space-between; align-items: baseline; gap: 12px; }
.model3d-price { font: 600 1.1rem var(--mono); }
.model3d details { width: 100%; }
.model3d summary { cursor: pointer; font-weight: 500; font-size: .95rem; }
/* заказ 3D-модели */
.order3d { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 28px; align-items: start; }
.order3d-card { display: flex; flex-direction: column; gap: 10px; }
.order3d-card .price { margin: 4px 0; }
@media (max-width: 900px) { .order3d { grid-template-columns: 1fr; } .order3d-card { order: -1; } }   /* цена и форма — первыми */
.model3d form { margin-top: 10px; }
.model3d select { max-width: 100%; }

/* чертежи */
.drawing-box { margin: 12px 0 16px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius);
               background: var(--paper); color-scheme: light; }
.drawing-box svg { display: block; max-width: 100%; height: auto; margin: 0 auto; }
.drawing-box svg + svg { max-width: 460px; margin-top: 8px; }
.drawing-box svg.user-drawing { width: 100%; max-width: 720px; }   /* чертёж инженера из КОМПАС — компактный, крупнее */
.drawing-box img.sheet { display: block; width: 100%; height: auto; }   /* лист отдельным файлом: фланцы NMRV */
.drawing-box img.user-drawing { max-width: 720px; margin: 0 auto; }   /* лист инженера — файлом, как раньше вставкой */
.shaft-fig img.user-drawing { max-height: 440px; width: auto; max-width: 100%; }
.drawing-box figcaption { color: var(--paper-muted); font-size: .82rem; margin-top: 6px; }   /* на светлом листе — тёмная в обеих темах */
.drawings { display: grid; grid-template-columns: repeat(auto-fill, minmax(440px, 1fr)); gap: 12px; }
.drawings .drawing-box { margin: 0; }
@media (max-width: 700px) {
  .drawing-box:not(.small) { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .drawing-box:not(.small) > svg:first-of-type { min-width: 860px; }
  .drawing-box:not(.small) > svg.user-drawing { min-width: 560px; }
  .drawing-box > img.sheet { min-width: 860px; }
  .drawing-box > img.user-drawing { min-width: 560px; }
  .shaft-fig > img.user-drawing { min-width: 0; }
  .drawings { grid-template-columns: 1fr; }
}
.tag { display: inline-block; font-size: .82rem; padding: 1px 8px; border-radius: 999px; background: var(--bg-2);
       color: var(--ink-2); border: 1px solid var(--line); }
.tag.req { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin: 16px 0; }
.note { border-left: 3px solid var(--red); padding: 10px 14px; background: var(--note-bg); margin: 12px 0; }
.ok { color: var(--ok); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.chips a { padding: 6px 14px; border: 1px solid var(--line-2); border-radius: 999px; text-decoration: none; color: var(--ink);
           background: var(--card); }
.chips a.on, .chips a:hover { border-color: var(--red); color: var(--red); }
.crumbs { font-size: .88rem; color: var(--muted); margin: 20px 0 10px; }
.crumbs a { color: var(--muted); }
.messages { list-style: none; padding: 0; margin: 12px 0; }
.messages li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 12px 16px;
               border-radius: 8px; background: var(--ok-bg); color: var(--ok); border-left: 3px solid var(--ok); font-weight: 500; }
.messages li.error { background: var(--err-bg); color: var(--err); }

/* карточка типоразмера */
.size-head { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; }
.buy { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; position: sticky; top: 80px;
       background: var(--card); }
.price { font-size: 1.6rem; font-weight: 700; font-family: var(--mono); }
.status { font-weight: 600; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 16px 0; }
.fact { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.fact b { display: block; font-size: 1.15rem; font-family: var(--mono); font-weight: 500; }
.fact span { color: var(--muted); font-size: .85rem; }

/* таблицы */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--radius);
              background: var(--card); }
table { border-collapse: collapse; width: 100%; font-size: .93rem; }
th, td { padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: var(--bg-2); font-weight: 500; white-space: nowrap; color: var(--ink-2); font-size: .86rem; }
td.n, th.n { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
td.n { font-family: var(--mono); font-size: .9rem; }
tbody tr:hover { background: var(--row-hover); }
.scroll-y { max-height: 520px; overflow-y: auto; }

/* подбор */
.podbor { display: grid; grid-template-columns: 380px 1fr; gap: 28px; align-items: start; }
.kit { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; background: var(--card); }
.kit.best { border-color: var(--red); box-shadow: 0 0 0 1px var(--red) inset; }
.kit h3 { margin-bottom: 6px; }
.kit-badge { display: inline-block; margin: 0 0 8px; padding: 3px 10px; border-radius: 999px; background: var(--btn); color: var(--on-btn);
             font: 600 .82rem var(--mono); letter-spacing: .5px; text-transform: uppercase; }
.kit-why { margin: 0 0 8px; color: var(--ink); }
.kit form { margin-top: 12px; }
#result { scroll-margin-top: 80px; }
details summary { cursor: pointer; font-weight: 600; margin: 8px 0; }

/* исполнения валов — как в каталогах поставщиков: чертёж и таблица по серии */
.shaft-sec { margin: 18px 0 28px; }
.shaft-sec h3 { margin: 0 0 10px; font-weight: 600; }
.shaft-fig { max-width: 820px; }
.shaft-fig svg { max-height: 360px; }
.shaft-fig svg.user-drawing { max-height: 440px; }
.shaft-note { margin: 4px 0 0; font-weight: 600; }
.shaft-table th, .shaft-table td { text-align: center; }
.shaft-table tr.cur td { background: var(--tint); font-weight: 600; }

/* конфигуратор заказа */
.cfg { display: grid; grid-template-columns: 1fr 380px; gap: 28px; align-items: start; margin-top: 20px; }
.cfg-form { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.cfg-field { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); padding: 16px 18px; margin: 0;
             min-width: 0; }
.cfg-field legend { font-weight: 600; padding: 0 6px; }
.cfg-field select, .cfg-field input[type=number] { max-width: 520px; }
.asm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; }
.asm, .seg label { cursor: pointer; border: 1px solid var(--line-2); border-radius: 8px; background: var(--card); }
.asm { display: flex; flex-direction: column; align-items: center; padding: 6px 4px 8px; font: 500 .9rem var(--mono); }
.asm svg { width: 100%; max-width: 110px; height: auto; background: var(--paper); border-radius: 4px; }   /* схема ГОСТ — на светлом */
.asm input, .seg input { position: absolute; opacity: 0; pointer-events: none; }
.asm.off { opacity: .35; }
.asm.on, .seg label.on { border-color: var(--red); box-shadow: 0 0 0 1px var(--red) inset; background: var(--tint-2); }
.asm:focus-within, .seg label:focus-within { outline: 2px solid var(--focus); }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg label { display: inline-block; margin: 0; padding: 9px 14px; font-weight: 500; }
.cfg-result { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); padding: 20px;
              position: sticky; top: 80px; }
.cfg-result .overline { margin-bottom: 6px; }
.cfg-code { font: 500 1.15rem/1.4 var(--mono); word-break: break-word; padding: 12px 14px; background: var(--bg-2);
            border-radius: 6px; margin-bottom: 12px; }
.cfg-sum { margin: 10px 0; font-size: .9rem; }
.cfg-sum th { background: none; white-space: normal; font-weight: 500; color: var(--ink-2); width: 45%; }
.cfg-sum th, .cfg-sum td { padding: 6px 4px; }
.cfg-result .btn[disabled] { opacity: .5; cursor: not-allowed; }
.kp-config { margin: 4px 0 0; padding-left: 18px; color: var(--ink-2); }
@media (max-width: 900px) { .cfg { grid-template-columns: 1fr; } .cfg-result { position: static; } }

/* подвал */
.foot { margin-top: 72px; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; padding: 20px 0 88px; }   /* снизу — место под кнопку помощника */
.foot-row { display: flex; flex-wrap: wrap; gap: 10px 32px; justify-content: space-between; }
.foot a { color: var(--ink-2); text-decoration: none; }
.foot a:hover { color: var(--red); }
.foot ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.foot-note { margin: 10px 0 0; font-size: .86rem; }

/* статьи */
.prose { max-width: 820px; }
.edit-fab { position: fixed; right: 20px; bottom: 84px; z-index: 45; padding: 9px 14px; border-radius: 999px;
            background: var(--btn); color: var(--on-btn); font: 600 .88rem var(--sans); text-decoration: none;
            box-shadow: 0 6px 20px rgba(0, 0, 0, .25); }
.edit-fab:hover { color: var(--on-btn); filter: brightness(1.1); }
.doc-link a { display: inline-flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--line);
              border-radius: var(--radius); background: var(--card); text-decoration: none; color: var(--ink); }
.doc-link a:hover { border-color: var(--red); color: var(--red); }
.doc-ext { font: 600 .75rem var(--mono); padding: 2px 6px; border-radius: 4px; background: var(--red); color: #fff; }
.prose figure { margin: 16px 0; }
.prose figcaption { color: var(--muted); font-size: .88rem; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; margin: 20px 0; }
.gallery a { display: block; border-radius: 8px; overflow: hidden; background: var(--bg-2); }
.gallery img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .25s ease; }
.gallery a:hover img { transform: scale(1.04); }

/* новости: список, карточки, страница новости */
.news-intro { margin-bottom: 8px; color: var(--ink-2); }
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; margin: 20px 0; }
.news-card { position: relative; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line);
             border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: border-color .2s, transform .2s; }
.news-card:hover { border-color: var(--red); transform: translateY(-2px); }
.news-img { display: block; aspect-ratio: 16 / 10; background: var(--bg-2); overflow: hidden; }
.news-img img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.news-card:hover .news-img img { transform: scale(1.04); }
.news-ph { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%;
           background: radial-gradient(circle at 30% 20%, var(--tint), transparent 60%),
                       repeating-linear-gradient(135deg, transparent 0 14px, var(--line) 14px 15px), var(--bg-2); }
.news-ph img { width: 64px; height: auto; object-fit: contain; opacity: .9; border-radius: 12px; }
.news-text { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px 20px; flex: 1; }
.news-date { font: 500 .8rem var(--mono); letter-spacing: .5px; color: var(--red); text-transform: uppercase; }
.news-title { margin: 0; font-size: 1.12rem; line-height: 1.3; }
.news-title a { color: var(--ink); text-decoration: none; }
.news-title a::after { content: ""; position: absolute; inset: 0; }      /* вся карточка — ссылка */
.news-card:hover .news-title a { color: var(--red); }
.news-excerpt { margin: 0; color: var(--ink-2); font-size: .95rem; line-height: 1.5;
                display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.news-more { margin-top: auto; padding-top: 6px; font: 600 .92rem var(--mono); color: var(--red); text-decoration: none; }
.news-lead { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); margin: 20px 0 4px; max-width: 1100px; }
.news-lead .news-img { aspect-ratio: auto; min-height: 300px; height: 100%; }
.news-lead .news-text { justify-content: center; gap: 12px; padding: 28px 32px; }
.news-lead .news-title { font-size: 1.6rem; line-height: 1.2; }
.news-lead .news-excerpt { font-size: 1.02rem; -webkit-line-clamp: 5; }
.news-plain .news-text { padding-top: 20px; }
.pager { display: flex; align-items: center; gap: 14px; margin: 8px 0 24px; }

.post { max-width: 860px; }
.post-head { margin: 8px 0 24px; }
.post-head h1 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); line-height: 1.15; margin: 6px 0 14px; }
.post-lead { margin: 0; font-size: 1.15rem; line-height: 1.55; color: var(--ink-2); }
.post-cover { margin: 0 0 28px; border-radius: var(--radius); overflow: hidden; background: var(--bg-2); }
.post-cover img { display: block; width: 100%; height: auto; max-height: 560px; object-fit: cover; }
.post-body { font-size: 1.05rem; line-height: 1.7; }
.post-body p { margin: 0 0 1.1em; }
.post-body h2 { font-size: 1.45rem; margin: 1.6em 0 .6em; }
.post-body h3 { font-size: 1.18rem; margin: 1.4em 0 .5em; }
.post-body figure { margin: 24px 0; }
.post-body figure img { display: block; width: auto; max-width: 100%; height: auto; max-height: 78vh; margin: 0 auto;
                        border-radius: var(--radius); }   /* вертикальные фото — не выше экрана */
.post-body figcaption { text-align: center; }
.post-body figcaption { margin-top: 8px; }
.post-body blockquote { margin: 1.4em 0; padding: 4px 0 4px 18px; border-left: 3px solid var(--red); color: var(--ink-2); }
.post-body a.zoom { display: block; cursor: zoom-in; }
.video { position: relative; margin: 24px 0; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #000; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.post-foot { margin: 32px 0 0; padding-top: 20px; border-top: 1px solid var(--line); }
.post-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; max-width: 860px;
            margin: 40px 0 0; padding: 24px 28px; background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--red);
            border-radius: var(--radius); }
.post-cta > div:first-child { display: flex; flex-direction: column; gap: 6px; flex: 1 1 320px; }
.post-cta .overline { margin: 0; }
.post-cta b { font-size: 1.15rem; }
.post-cta span { color: var(--ink-2); }
.post-cta-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.post-more .section-head { margin-top: 48px; }
.lightbox { max-width: min(96vw, 1600px); max-height: 94vh; padding: 0; border: 0; border-radius: var(--radius); background: transparent;
            overflow: visible; cursor: zoom-out; }
.lightbox::backdrop { background: rgba(8, 12, 16, .88); }
.lightbox img { display: block; max-width: 96vw; max-height: 94vh; width: auto; height: auto; border-radius: var(--radius); }
.lightbox-close { position: fixed; top: 14px; right: 18px; width: 44px; height: 44px; border: 0; border-radius: 50%;
                  background: rgba(255, 255, 255, .14); color: #fff; font-size: 28px; line-height: 1; cursor: pointer; }
@media (max-width: 800px) {
  .news-lead { grid-template-columns: 1fr; }
  .news-lead .news-img { min-height: 0; aspect-ratio: 16 / 10; }
  .news-lead .news-text { padding: 18px 20px 22px; }
  .news-lead .news-title { font-size: 1.3rem; }
  .post-cta { padding: 20px; }
}

@media (max-width: 900px) {
  .podbor .has-result { order: -1; }      /* на телефоне результат — сразу, параметры — под ним */
  .buy-img, .buy-img + p { order: 9; margin-top: 12px; }   /* сначала цена и «в запрос КП», фото — ниже */
}
@media (max-width: 700px) {
  .hero .calc { display: none; }          /* пример расчёта на телефоне отодвигал «с чего начать» на третий экран */
  .kpi { grid-template-columns: 1fr 1fr; margin-top: 28px; }
  .kpi div { padding: 14px 16px; }
  .kpi b { font-size: 1.4rem; }
  .kpi span { font-size: .86rem; }
  .routes { margin-top: 28px; }
  .route { padding: 16px; }
  .flow { display: flex; gap: 6px; }       /* на телефоне — номера шагов, подпись только у текущего */
  .flow li { flex: none; padding: 8px; }
  .flow li:not(.on) span { display: none; }
  .flow li.on { flex: 1; }
  /* комплект подбора: таблица — карточкой «название: значение», узкие колонки не читались */
  .kit-table { border: 0; background: none; box-shadow: none; overflow: visible; }
  .kit-table thead { display: none; }
  .kit-table table, .kit-table tbody, .kit-table tr, .kit-table td { display: block; width: 100%; }
  .kit-table tr { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin-bottom: 8px; background: var(--bg-2); }
  .kit-table td { border: 0; padding: 3px 0; text-align: left; display: flex; gap: 12px; justify-content: space-between; }
  .kit-table td::before { content: attr(data-k); color: var(--muted); font: .86rem var(--sans); flex: none; }
  .kit-table td[data-k="Позиция"] { display: block; font-weight: 600; padding-bottom: 6px; }
  .kit-table td[data-k="Позиция"]::before { content: none; }
  .kit-table td.n { font-family: var(--mono); }
  .messages li .btn { width: 100%; text-align: center; }
}
@media (max-width: 900px) {
  .size-head, .podbor, .series-head.with-photo { grid-template-columns: 1fr; }
  .series-head .photo { max-width: 420px; }
  .buy { position: static; }
  h1 { font-size: 1.7rem; }
  .hero h1 { font-size: 2.2rem; }
  .wrap { padding: 0 16px; }
  /* телефон: меню — шапка с логотипом, КП и кнопкой «меню»; разделы — шторкой */
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { height: auto; z-index: 30; padding: 8px 16px; gap: 0; overflow: visible; border-right: 0; border-bottom: 1px solid var(--line); }
  .logo img { width: 40px; height: 41px; border-radius: 8px; }
  .logo b { font-size: 1.1rem; }
  .kp-mini { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 6px; background: var(--btn);
             color: var(--on-btn); text-decoration: none; font-weight: 600; font-size: .9rem; }
  .kp-mini:hover { color: var(--on-btn); }
  .kp-mini b { background: var(--on-btn); color: var(--btn); border-radius: 999px; padding: 0 6px; font-size: .78rem; }
  .side-toggle { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0;
                 border: 1px solid var(--line-2); border-radius: 8px; background: transparent; color: var(--ink); cursor: pointer; }
  .side-toggle svg { width: 22px; height: 22px; }
  .side-nav { display: none; padding: 16px 0 8px; max-height: calc(100vh - 60px); overflow-y: auto; }
  .side.open .side-nav { display: flex; }
  .cmd { position: static; padding: 6px 16px; }
  .test-note { padding: 6px 16px; }
  .cmd-form kbd { display: none; }
}

/* таблицы с фильтрами (static/js/dtable.js): шапка на месте при прокрутке, сортировка, фильтр под заголовком */
.dtable thead { position: sticky; top: 0; z-index: 2; }
.dtable thead th { background: var(--bg-2); }
.dtable th.dt-sort { cursor: pointer; user-select: none; }
.dtable th.dt-sort:hover { color: var(--ink); }
.dtable th.dt-sort::after { content: "↕"; margin-left: 4px; color: var(--muted); font-size: .8em; }
.dtable th[aria-sort=ascending]::after { content: "▲"; color: var(--red); }
.dtable th[aria-sort=descending]::after { content: "▼"; color: var(--red); }
.dtable .dt-filters th { padding: 4px 6px 6px; }
.dtable .dt-filters input, .dtable .dt-filters select { width: 100%; min-width: 64px; padding: 4px 6px; font: .82rem var(--mono);
  border: 1px solid var(--line-2); border-radius: 6px; background: var(--input); color: var(--ink); }
.dt-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 8px 0; }
.dt-bar .dt-search { flex: 1 1 220px; max-width: 360px; padding: 7px 10px; border: 1px solid var(--line-2); border-radius: 8px;
  background: var(--input); color: var(--ink); }
.dtable tr.dt-link, .dtable[data-pick] tbody tr { cursor: pointer; }
.dtable .dt-go { white-space: nowrap; font-size: .86rem; }
.dtable tr.on { background: var(--tint); box-shadow: inset 3px 0 0 var(--red); }
.dtable .pick { display: inline-flex; align-items: center; gap: 8px; margin: 0; cursor: pointer; }
.dtable .pick input { accent-color: var(--red); }
.cfg-motor { max-height: 420px; }
.pic-grid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
.pic-grid .asm svg { max-width: 118px; }
.pic-hint { display: block; margin-top: 2px; font: .74rem/1.25 var(--sans, inherit); color: var(--muted); text-align: center; }
.asm.on .pic-hint { color: var(--ink-2); }

/* распознавание таблички (аналог импорта) */
.plate-head { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.plate-photo { width: 280px; max-width: 100%; border-radius: var(--radius); border: 1px solid var(--line); }
.plate-head > div { flex: 1 1 320px; min-width: 0; }
.plate-head h2 { margin-top: 0; font-family: var(--mono, monospace); }
.plate-result .warn, .warn { color: var(--red); }
.plate-podbor { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 4px 16px; align-items: end; }
.plate-podbor > p.muted, .plate-podbor > .btn { grid-column: 1 / -1; justify-self: start; }
.plate-podbor label { display: block; }
.plate-text { white-space: pre-wrap; font-size: 13px; max-height: 260px; overflow: auto; }