/* ============================================================================
   UI-kit портала подбора инструмента. Единственный источник правды по стилям:
   его подключает и приложение (web/index.html), и образец вёрстки (/ui-kit.html).

   Ограничения, из которых всё вырастает:
   • Chromium 49 (Windows XP): без CSS grid, без gap во flex, без переменных в
     calc() сложнее сложения, без :is()/:where(). Только flexbox и float.
   • Пользователь — станочник 40+: базовый кегль 16 px, контраст не ниже 4.5:1,
     кликабельная область не меньше 44 px, подписи словами, а не значками.
   ========================================================================== */

:root {
  /* цвет */
  /* Палитра по IBM Carbon: система сделана для промышленного и насыщенного данными
     софта — ровно наш случай. Берём её токены, но на своём CSS: React-библиотека
     Carbon на Chromium 49 (Windows XP) не работает. */
  --bg: #f4f4f4; --surface: #ffffff; --surface2: #f7f7f5;
  --ink: #161616; --ink2: #525252; --muted: #595959;
  --line: #e0e0e0; --axis: #a8a8a8;
  --accent: #0f62fe; --accent-soft: #d0e2ff; --accent-ink: #ffffff;
  --accent-dark: #002D9C;
  --good: #24A148; --good-soft: #E3F4E8;
  --warn: #B28600; --warn-soft: #FCF4D6;
  --bad: #DA1E28; --bad-soft: #FDE8E8;
  /* группы обрабатываемого материала ISO — один и тот же цвет во всей системе */
  --iso-p: #1f62b8; --iso-m: #c88a00; --iso-k: #b32020;
  --iso-n: #0a7d2c; --iso-s: #b35a00; --iso-h: #4a3aa7;
  /* размеры */
  --pad: 16px; --radius: 0px; --tap: 40px; --bar: 48px;
  /* Carbon spacing scale (spacing-01..13) */
  --sp-01: 2px; --sp-02: 4px; --sp-03: 8px; --sp-04: 12px; --sp-05: 16px;
  --sp-06: 24px; --sp-07: 32px; --sp-08: 40px; --sp-09: 48px; --sp-10: 64px;
  --sp-11: 80px; --sp-12: 96px; --sp-13: 160px;   /* кнопки и поля: 48 px попадаются мышью с первого раза */
  /* Шрифт для чисел и обозначений: в нём ноль с чертой и не путается с буквой О.
     Обычный Segoe UI этим грешит, а в обозначениях инструмента 0 и О рядом. */
  --mono: "IBM Plex Mono", Consolas, "DejaVu Sans Mono", "Liberation Mono", "Courier New", monospace;
  --font-sans: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161616; --surface: #262626; --surface2: #1f1f1f;
    --ink: #f4f4f4; --ink2: #c6c6c6; --muted: #a8a8a8;
    --line: #393939; --axis: #525252;
    --accent: #78a9ff; --accent-soft: #0043ce; --accent-ink: #ffffff;
    --accent-dark: #a6c8ff;
    --good: #4ec06f; --good-soft: #14351f; --warn: #e7b445; --warn-soft: #3a2e12;
    --bad: #f06a6a; --bad-soft: #3a1717;
  }
}
:root[data-theme="dark"] {
  --bg: #161616; --surface: #262626; --surface2: #1f1f1f;
  --ink: #f4f4f4; --ink2: #c6c6c6; --muted: #a8a8a8;
  --line: #393939; --axis: #525252;
  --accent: #78a9ff; --accent-soft: #0043ce; --accent-ink: #ffffff;
  --accent-dark: #a6c8ff;
  --good: #4ec06f; --good-soft: #14351f; --warn: #e7b445; --warn-soft: #3a2e12;
  --bad: #f06a6a; --bad-soft: #3a1717;
}

* { box-sizing: border-box; }
.part b, .stat b, table.list td.num, table.list th.num, .wsummary b, .gcell { font-variant-numeric: tabular-nums; }
html, body { margin: 0; background: var(--bg); color: var(--ink); letter-spacing: 0.0114em; font-family: var(--font-sans); }
  /* Базовый кегль 17 px: аудитория — станочники 40+ у монитора на вытянутой руке.
     Рекомендации по возрастной доступности начинаются с 18 px, но 17 px с просторной
     строкой сохраняет плотность таблиц и читается заметно легче прежних 16 px. */
  font: 17px/1.55 "Segoe UI", Tahoma, Arial, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
/* Ссылка внутри текста — тоже цель для мыши: не ниже 24 px по WCAG 2.2 */
p a, .hint a, .fieldhint a, .foot a, table.list a { display: inline-block; min-height: 24px; line-height: 24px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 2px; }

/* ── Типографика ─────────────────────────────────────────────────────────── */
h1 { font-size: 28px; line-height: 1.29; margin: 0 0 var(--sp-02); letter-spacing: 0; }
h2 { font-size: 20px; line-height: 1.4; margin: var(--sp-06) 0 var(--sp-04); letter-spacing: 0; }
h3 { font-size: 16px; line-height: 1.375; margin: 0 0 var(--sp-03); letter-spacing: 0; }
h4 { font-size: 14px; line-height: 1.29; margin: 0 0 var(--sp-03); color: var(--ink2); font-weight: 600; letter-spacing: 0.16px; }
p  { margin: 0 0 10px; }
.lead { font-size: 17px; color: var(--ink2); }
.hint { color: var(--muted); font-size: 14px; }
.nowrap { white-space: nowrap; }

/* ── Каркас страницы ─────────────────────────────────────────────────────── */
/* ── Верхняя панель (Carbon UI Shell) ───────────────────────────────────── */
/* Разделы разведены по смыслу, текущий отмечен полосой снизу, поиск под рукой,
   служебное — справа. На узком экране всё это превращается в одно меню. */
.appbar { position: -webkit-sticky; position: sticky; top: 0; z-index: 40;
  background: var(--surface); border-bottom: 1px solid var(--line); }
.appbar-in { display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-align-items: stretch; align-items: stretch; max-width: 1440px; margin: 0 auto;
  min-height: var(--bar); padding: 0 16px; }
.appbar-burger { display: none; -webkit-align-items: center; align-items: center;
  min-width: 48px; border: 0; background: none; color: var(--ink); cursor: pointer; }

.appbar-brand { display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-align-items: center; align-items: center; color: var(--ink); padding: 8px 20px 8px 0;
  -webkit-flex: 0 0 auto; flex: 0 0 auto; }
.appbar-brand:hover { text-decoration: none; }
.appbar-brand .mark { display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-align-items: center; align-items: center; -webkit-justify-content: center;
  justify-content: center; width: 36px; height: 36px; margin-right: 12px; border-radius: var(--radius);
  background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 15px;
  letter-spacing: .5px; }
.appbar-brand .name { display: block; font-size: 16px; font-weight: 600; line-height: 1.2; }
.appbar-brand .name small { display: block; color: var(--muted); font-size: 14px; font-weight: 400; }

.appbar-nav { display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-align-items: stretch; align-items: stretch; -webkit-flex: 1 1 auto; flex: 1 1 auto;
  min-width: 0; }
.appbar-nav > a, .appbar-drop > button { display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-align-items: center; align-items: center; height: 100%; padding: 0 16px; border: 0;
  background: none; color: var(--ink2); font: inherit; font-size: 16px; cursor: pointer;
  border-bottom: 3px solid transparent; white-space: nowrap; }
.appbar-nav > a:hover, .appbar-drop > button:hover { background: var(--surface2); color: var(--ink);
  text-decoration: none; }
.appbar-nav > a.on, .appbar-drop.on > button { color: var(--accent); font-weight: 600;
  border-bottom-color: var(--accent); }
.appbar-drop { position: relative; display: -webkit-box; display: -webkit-flex; display: flex; }
.appbar-drop > button svg { margin-left: 4px; }
.appbar-drop > button.open { background: var(--surface2); color: var(--ink); }
.appbar-menu { position: absolute; top: 100%; left: 0; min-width: 250px; z-index: 50;
  background: var(--surface); border: 1px solid var(--line); border-top: 0;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .10); padding: 4px 0; }
.appbar-menu a { display: block; padding: 12px 16px; color: var(--ink); font-size: 16px; }
.appbar-menu a:hover { background: var(--surface2); text-decoration: none; }
.appbar-menu a.on { color: var(--accent); font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }

.appbar-search { display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-align-items: center; align-items: center; -webkit-flex: 0 1 320px; flex: 0 1 320px;
  min-width: 0; -webkit-align-self: center; align-self: center; margin: 0 8px; padding: 0 12px;
  background: var(--surface2); border: 1px solid var(--line); border-radius: var(--radius); color: var(--muted); }
.appbar-search:focus-within { border-color: var(--accent); background: var(--surface); }
.appbar-search input { height: 40px; border: 0; background: none; padding: 0 0 0 10px;
  font-size: 15px; color: var(--ink); }
.appbar-search input:focus { outline: none; }

.appbar-right { display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-align-items: center; align-items: center; -webkit-flex: 0 0 auto; flex: 0 0 auto; }
.appbar-icon { display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-align-items: center; align-items: center; -webkit-justify-content: center;
  justify-content: center; width: 48px; height: 48px; color: var(--ink2); border-radius: var(--radius); }
.appbar-icon:hover { background: var(--surface2); color: var(--ink); }
.appbar-icon.on { color: var(--accent); }
.appbar-user { display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-align-items: center; align-items: center; height: 40px; margin-left: 4px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); font-size: 15px; }
.appbar-user svg { margin-right: 8px; color: var(--ink2); }
.appbar-user:hover { background: var(--surface2); text-decoration: none; }
.appbar-user.on { border-color: var(--accent); color: var(--accent); }
.appbar-login { display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-align-items: center; align-items: center; height: 40px; margin-left: 4px; padding: 0 20px;
  background: var(--accent); color: var(--accent-ink); border-radius: var(--radius); font-weight: 600; }
.appbar-login:hover { background: var(--accent-dark); text-decoration: none; }

.appbar-sheet { display: none; }
@media (max-width: 1280px) {
  .appbar-nav > a, .appbar-drop > button { padding: 0 10px; }
  .appbar-brand { padding-right: 10px; }
  .appbar-brand .name { display: none; }
  .appbar-search { -webkit-flex-basis: 200px; flex-basis: 200px; }
}
@media (max-width: 1100px) {
  .appbar-search { -webkit-flex-basis: 220px; flex-basis: 220px; }
  .appbar-brand .name small { display: none; }
}
@media (max-width: 1100px) {
  .appbar-burger { display: -webkit-box; display: -webkit-flex; display: flex; }
  .appbar-nav, .appbar-search { display: none; }
  .appbar-brand { -webkit-flex: 1 1 auto; flex: 1 1 auto; padding-left: 8px; }
  .appbar-sheet { display: block; border-top: 1px solid var(--line); padding: 8px 0 16px;
    background: var(--surface); }
  .appbar-sheet a { display: block; min-height: 48px; line-height: 48px; padding: 0 20px;
    color: var(--ink); font-size: 17px; }
  .appbar-sheet a.on { color: var(--accent); font-weight: 600;
    box-shadow: inset 3px 0 0 var(--accent); background: var(--surface2); }
  .sheet-title { padding: 14px 20px 4px; color: var(--muted); font-size: 14px;
    text-transform: uppercase; letter-spacing: .06em; }
}
@media (max-width: 560px) {
  /* На телефоне название не должно разворачиваться в три строки и раздувать панель */
  .appbar-brand .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

.wrap { max-width: 1200px; margin: 0 auto; padding: 20px 16px 72px; }

/* Заголовок страницы: что это за страница и что тут делать. */
.pagehead { margin: 4px 0 16px; }
.pagehead .sub { color: var(--ink2); font-size: 16px; }

/* ── Карточка: единственный контейнер для любого блока ───────────────────── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--pad); margin-bottom: 16px; }
.card > h3:first-child { margin-top: 0; }
.card.plain { background: var(--surface2); }

/* ── Ряды и поля ─────────────────────────────────────────────────────────── */
/* Поля в одном ряду выстраиваются по одной линии, даже если подписи разной длины:
   подпись занимает две строки по высоте и прижата к низу, подсказка под полем —
   фиксированной высоты. Иначе соседние поля «пляшут» по вертикали. */
.row { display: -webkit-flex; display: flex; -webkit-flex-wrap: wrap; flex-wrap: wrap;
  -webkit-align-items: flex-end; align-items: flex-end; gap: var(--sp-05); margin: 0 0 var(--sp-05); }
.row > * { margin: 0; }
/* Одинокое поле в ряду не растягивается на всю карточку: читать строку длиной
   в экран неудобно, да и выглядит небрежно. */
.col { -webkit-flex: 1 1 240px; flex: 1 1 240px; min-width: 0;
  display: -webkit-flex; display: flex; -webkit-flex-direction: column; flex-direction: column;
  -webkit-justify-content: flex-end; justify-content: flex-end; }
.col.wide { -webkit-flex: 1 1 100%; flex: 1 1 100%; }
.col.wide { -webkit-flex: 2 1 480px; flex: 2 1 480px; max-width: 760px; }
label { display: -webkit-flex; display: flex; -webkit-align-items: flex-end; align-items: flex-end;
  min-height: 42px; font-size: 15px; line-height: 1.3; color: var(--ink2);
  margin: 0 0 8px; font-weight: 600; }
input, select, textarea { display: block; width: 100%; height: var(--tap); padding: 10px 12px;
  border: 1px solid var(--axis); border-radius: var(--radius); background: var(--surface); color: var(--ink);
  font: inherit; }
textarea { height: auto; min-height: 96px; }
input:focus, select:focus { border-color: var(--accent); }
.fieldhint { color: var(--muted); font-size: 14px; line-height: 1.35; margin-top: 6px; min-height: 18px; }
/* Ряд без подписей (кнопки, сегменты) не должен резервировать место под них */
.row.plainrow label { min-height: 0; }

/* Заполненное поле подсвечиваем: видно, что выбор сделан именно здесь */
input.filled { border-color: var(--accent); border-width: 2px; background: var(--accent-soft);
  font-weight: 600; }
/* Опознанная марка: что именно подобрано и по какой группе пойдёт подбор */
.matfound { margin-top: 10px; padding: 12px 14px; border: 1px solid var(--accent);
  border-radius: var(--radius); background: var(--accent-soft); }
.matfound b { font-family: var(--mono); font-size: 17px; }

/* ── Кнопки ──────────────────────────────────────────────────────────────── */
.btn { display: inline-block; min-height: var(--tap); padding: 10px 22px; border-radius: var(--radius);
  border: 1px solid var(--axis); background: var(--surface); color: var(--ink); font: inherit;
  font-weight: 600; cursor: pointer; }
.btn:hover { background: var(--surface2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: #0353E9; border-color: #0353E9; }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #FFFFFF; }
.btn.danger:hover { background: #BA1B23; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--accent); }
.btn.ghost:hover { background: var(--accent-soft); }
.btn.xl { min-height: 64px; padding: 20px 28px; font-size: 16px; }
.btn.small { min-height: 32px; padding: 5px 12px; font-size: 14px; font-weight: 400; }
.seg { display: -webkit-flex; display: flex; -webkit-flex-wrap: wrap; flex-wrap: wrap; }
.seg button { height: var(--tap); margin: 0 8px 8px 0; }
.seg button.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-dark); }

/* ── Метки ───────────────────────────────────────────────────────────────── */
.badge { display: inline-block; height: 24px; line-height: 18px; padding: 3px 8px; margin: 0 4px 4px 0; border-radius: var(--radius);
  background: var(--surface2); border: 1px solid var(--line); color: var(--ink2);
  font-size: 14px; font-weight: 600; }
.badge.accent { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-dark); }
.badge.good { background: var(--good-soft); border-color: var(--good); color: var(--good); }
.badge.warn { background: var(--warn-soft); border-color: var(--warn); color: var(--warn); }
.badge.bad  { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
.badge.iso-P { background: var(--iso-p); border-color: var(--iso-p); color: #fff; }
.badge.iso-M { background: var(--iso-m); border-color: var(--iso-m); color: #161616; }
.badge.iso-K { background: var(--iso-k); border-color: var(--iso-k); color: #fff; }
.badge.iso-N { background: var(--iso-n); border-color: var(--iso-n); color: #fff; }
.badge.iso-S { background: var(--iso-s); border-color: var(--iso-s); color: #fff; }
.badge.iso-H { background: var(--iso-h); border-color: var(--iso-h); color: #fff; }

/* ── Плитки значений: «главное перед глазами» ────────────────────────────── */
.specs { display: -webkit-flex; display: flex; -webkit-flex-wrap: wrap; flex-wrap: wrap; margin: 0 -6px; }
.spec { -webkit-flex: 0 0 auto; flex: 0 0 auto; margin: 0 6px 10px; padding: 10px 14px;
  background: var(--surface2); border: 1px solid var(--line); border-radius: var(--radius); min-width: 104px; }
.spec b { display: block; font-size: 20px; line-height: 1.2; font-family: var(--mono); }
.spec small { display: block; color: var(--muted); font-size: 14px; margin-top: 2px; }
.spec.key { background: var(--accent-soft); border-color: var(--accent); }
.spec.key b { color: var(--accent-dark); }

/* ── Таблицы ─────────────────────────────────────────────────────────────── */
table.list { width: 100%; min-width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th { text-align: left; font-size: 14px; color: var(--ink2); font-weight: 600; padding: var(--sp-05) var(--sp-03); letter-spacing: 0.32px; }
  border-bottom: 2px solid var(--line); padding: 10px 10px; white-space: nowrap; }
table.list td { border-bottom: 1px solid var(--line); padding: var(--sp-05) var(--sp-03); vertical-align: top; font-size: 14px; }
table.list tr:nth-child(even) td { background: var(--surface2); }
/* По ссылке в таблице надо попасть мышью с первого раза: 24 px по высоте —
   минимум для указательной цели по WCAG 2.2. */
table.list a { font-weight: 600; display: inline-block; min-height: 24px; line-height: 24px; }

/* ── Картинка с увеличением ──────────────────────────────────────────────── */
.photo { width: 168px; height: 128px; margin-right: 18px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--surface2); overflow: hidden; text-align: center;
  color: var(--muted); font-size: 14px; }
.photo img { max-width: 100%; max-height: 100%; cursor: zoom-in; }
.zoomable { cursor: zoom-in; }
.lightbox { position: fixed; left: 0; top: 0; right: 0; bottom: 0; z-index: 50;
  background: rgba(0,0,0,.72); text-align: center; }
.lightbox .inner { display: inline-block; margin-top: 3vh; max-width: 94%; max-height: 88vh;
  background: var(--surface); border-radius: var(--radius); padding: 12px; }
.lightbox img { max-width: 88vw; max-height: 74vh; }
.lightbox .cap { color: var(--ink2); font-size: 15px; margin-top: 8px; }
.lightbox .close { position: absolute; right: 16px; top: 12px; }

/* ── Обозначение по знакам: код крупно, под каждым знаком его смысл ───────── */
.codeline { display: -webkit-flex; display: flex; -webkit-flex-wrap: wrap; flex-wrap: wrap;
  margin: 0 -4px; }
.codepart { -webkit-flex: 0 0 auto; flex: 0 0 auto; margin: 0 4px 8px; padding: 8px 12px;
  background: var(--surface2); border: 1px solid var(--line); border-radius: var(--radius); text-align: center;
  min-width: 78px; max-width: 200px; }
.codepart b { display: block; font-family: var(--mono); font-size: 20px; line-height: 1.2; color: var(--accent); }
.codepart small { display: block; color: var(--muted); font-size: 14px; margin-top: 3px; }

/* ── График ──────────────────────────────────────────────────────────────── */
/* Ширина SVG равна ширине контейнера в пикселях, поэтому кегль подписей фиксированный
   и не уменьшается на узком экране. Числа — моноширинным шрифтом. */
.chart { margin-bottom: 4px; overflow-x: auto; }
.chart h4 { font-size: 17px; color: var(--ink); margin-bottom: 10px; }
.chart svg { display: block; max-width: 100%; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .ax { fill: var(--ink2); font-size: 14px; font-family: var(--mono); }
.chart .ax.small { font-size: 14px; fill: var(--muted); font-family: inherit; }
.chart .ax.hl { fill: var(--accent); font-weight: 700; }
.chart .lbl { fill: var(--ink); font-size: 14px; font-weight: 600; font-family: var(--mono); }
.chart .hlcol { fill: var(--accent-soft); }

.legend { margin-top: 10px; color: var(--ink2); font-size: 14px; }
.legend span { display: inline-block; margin: 0 14px 6px 0; }
.legend i { display: inline-block; width: 13px; height: 13px; border-radius: var(--radius);
  margin-right: 6px; vertical-align: -2px; }
/* Кнопка-выключатель ряда: клик оставляет на графике только его */
.legend button.legitem { display: inline-block; margin: 0 8px 8px 0; padding: 5px 12px;
  min-height: 34px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface2);
  color: var(--ink); font: inherit; font-family: var(--mono); font-size: 14px; cursor: pointer; }
.legend button.legitem:hover { border-color: var(--accent); }
.legend button.legitem.off { opacity: .45; }
.legend .btn.small { margin-left: 4px; }
/* Подсказка графика: поверх страницы, в координатах окна. Внутри карточки она бы
   растягивала прокручиваемую область и включала полосы прокрутки. */
.tip { position: fixed; z-index: 60; padding: 7px 11px; border-radius: var(--radius); pointer-events: none;
  background: var(--ink); color: var(--bg); font-size: 14px; line-height: 1.35;
  box-shadow: 0 6px 20px rgba(0,0,0,.28); }

/* ── Состояния ───────────────────────────────────────────────────────────── */
.empty { padding: 22px; text-align: center; color: var(--muted); }
.err { background: var(--bad-soft); border: 1px solid var(--bad); color: var(--bad);
  border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px; }
.ok { background: var(--good-soft); border: 1px solid var(--good); color: var(--good);
  border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px; }

/* ── Телефон ─────────────────────────────────────────────────────────────── */
@media (max-width: 720px) {
  .wrap { padding: 14px 12px 48px; }
  .card { padding: 14px; }
  h1 { font-size: 22px; }
  .photo { width: 100%; height: 160px; margin: 0 0 12px; }
  table.list { display: block; overflow-x: auto; }
}
/* ── Печать результата подбора: ровно одна страница A4 ─────────────────── */
.print-sheet { display: none; }
@media print {
  @page { size: A4 portrait; margin: 12mm; }
  html, body { background: #fff; }
  /* виден только лист результата, всё остальное — скрыто */
  body * { visibility: hidden; }
  .print-sheet, .print-sheet * { visibility: visible; }
  .print-sheet { display: block; position: absolute; left: 0; top: 0; width: 100%;
    font-size: 11pt; line-height: 1.35; color: #000; }
  .print-sheet .ps-brand { font-size: 8pt; color: #555; border-bottom: 1px solid #000; padding-bottom: 2mm; margin-bottom: 3mm; }
  .print-sheet .ps-title { font-size: 22pt; line-height: 1.15; margin: 0 0 1mm; }
  .print-sheet .ps-sub { font-size: 10pt; color: #333; margin-bottom: 4mm; }
  .print-sheet .ps-body { display: flex; gap: 6mm; align-items: flex-start; }
  .print-sheet .ps-photo { flex: 0 0 62mm; height: 62mm; border: 1px solid #999;
    display: flex; align-items: center; justify-content: center; font-size: 9pt; color: #777; }
  .print-sheet .ps-photo img { max-width: 100%; max-height: 100%; }
  .print-sheet .ps-crit { flex: 1; min-width: 0; }
  .print-sheet h2 { font-size: 12pt; margin: 0 0 2mm; }
  .print-sheet ul { margin: 0 0 2mm; padding-left: 5mm; }
  .print-sheet li { margin-bottom: 0.8mm; }
  .print-sheet .ps-meta { font-size: 9pt; color: #555; margin: 2mm 0 0; }
  .print-sheet .ps-dec { margin-top: 4mm; }
  .print-sheet .ps-table { width: 100%; border-collapse: collapse; }
  .print-sheet .ps-table td { border-bottom: 1px solid #ddd; padding: 1mm 1.5mm; vertical-align: top; font-size: 10pt; }
  .print-sheet .ps-code { width: 18mm; font-weight: 700; font-family: "IBM Plex Mono", monospace; }
  .print-sheet .ps-name { width: 55mm; color: #444; font-size: 9pt; }
  .print-sheet .ps-foot { margin-top: 4mm; border-top: 1px solid #000; padding-top: 1.5mm; font-size: 8pt; color: #555; }
}

/* ── Плитка сплава: код завода плюс то же самое в другой системе ─────────── */
.spec.grade { min-width: 220px; max-width: 340px; text-align: left; }
.spec.grade .gtr { font-size: 14px; line-height: 1.35; margin-top: 6px; color: var(--ink2);
  border-top: 1px solid var(--line); padding-top: 6px; }
.spec.grade .gtr b { display: inline; font-size: 14px; font-family: inherit; color: var(--ink2); }
.spec.grade .gtr.dim { color: var(--muted); border-top: 0; padding-top: 2px; }
.spec.grade .gtr.dim b { color: var(--muted); }
.cardbar { display: -webkit-box; display: -webkit-flex; display: flex; -webkit-align-items: center;
  align-items: center; -webkit-flex-wrap: wrap; flex-wrap: wrap; margin: 0 0 12px; }
.cardbar .hint { margin-right: 10px; }

/* ── Обратная связь ──────────────────────────────────────────────────────── */
/* Кнопка отправки крупнее обычной: это главное действие страницы, и по ней
   попадают мышью с первого раза даже на маленьком мониторе станка. */
.btn.big { min-height: 48px; padding: 12px 28px; font-size: 16px; }
.btn[disabled] { opacity: .6; cursor: default; }
.rules { margin: 0; padding-left: 24px; font-size: 16px; line-height: 1.6; }
.rules li { margin-bottom: 8px; }
.askfix { margin-top: 18px; padding: 16px 18px; border: 1px dashed var(--axis); border-radius: var(--radius);
  background: var(--surface2); }
.askfix p { margin: 0 0 12px; }
.foot { max-width: 1180px; margin: 28px auto 34px; padding: 18px 20px 0; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 15px; line-height: 1.6; }
.foot a { color: var(--accent); display: inline-block; min-height: 24px; line-height: 24px; }

/* ── Широкие таблицы ─────────────────────────────────────────────────────── */
/* Таблица прокручивается внутри своей рамки, а не растягивает карточку.
   Подпись о прокрутке — словами: тонкую тень у края на мониторе станка не видят. */
.tablebox { max-width: 100%; }
.tablescroll { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch;
  max-width: 100%; }
.tablehint { font-size: 14px; line-height: 1.4; color: var(--ink2); background: var(--accent-soft);
  border: 1px solid var(--accent); border-radius: var(--radius); padding: 8px 12px; margin: 0 0 10px; }
/* Первая колонка остаётся на месте при прокрутке вбок: иначе непонятно,
   к какой позиции относится строка. Chromium 49 sticky не умеет — там обычная ячейка. */
.tablescroll table.list th:first-child, .tablescroll table.list td:first-child {
  position: -webkit-sticky; position: sticky; left: 0; background: var(--surface); z-index: 1; }
.tablescroll table.list tr:nth-child(even) td:first-child { background: var(--surface2); }

/* Узкий экран: строка разворачивается в карточку, где у каждого значения своя подпись.
   Так ни одна колонка не теряется, даже если их восемь. */
.tablescroll.aslist table.list, .tablescroll.aslist table.list tbody,
.tablescroll.aslist table.list tr, .tablescroll.aslist table.list td { display: block; width: auto; }
.tablescroll.aslist table.list thead { display: none; }
.tablescroll.aslist table.list tr { border: 1px solid var(--line); border-radius: var(--radius);
  padding: 6px 10px; margin-bottom: 10px; background: var(--surface); }
.tablescroll.aslist table.list tr:nth-child(even) td { background: transparent; }
.tablescroll.aslist table.list td { border: 0; border-bottom: 1px solid var(--line); padding: 8px 0; }
.tablescroll.aslist table.list td:last-child { border-bottom: 0; }
.tablescroll.aslist table.list td:empty { display: none; }
.tablescroll.aslist table.list td:before { content: attr(data-label); display: block;
  font-size: 14px; color: var(--muted); margin-bottom: 2px; }
.tablescroll.aslist table.list td:first-child { position: static; background: transparent; }

@media (max-width: 900px) {
  .tablescroll table.list, .tablescroll table.list tbody, .tablescroll table.list tr,
  .tablescroll table.list td { display: block; width: auto; }
  .tablescroll table.list thead { display: none; }
  .tablescroll table.list tr { border: 1px solid var(--line); border-radius: var(--radius);
    padding: 6px 10px; margin-bottom: 10px; background: var(--surface); }
  .tablescroll table.list tr:nth-child(even) td { background: transparent; }
  .tablescroll table.list td { border: 0; border-bottom: 1px solid var(--line); padding: 8px 0; }
  .tablescroll table.list td:last-child { border-bottom: 0; }
  .tablescroll table.list td:empty { display: none; }
  .tablescroll table.list td:before { content: attr(data-label); display: block;
    font-size: 14px; color: var(--muted); margin-bottom: 2px; }
  .tablescroll table.list td:first-child { position: static; background: transparent; }
}

/* ── Длинный текст не вылезает за карточку ───────────────────────────────── */
/* Обозначения, коды заказа и строки из «прочего» бывают длиннее колонки,
   а переносить их по словам не получается: пробелов в них нет. */
.card, .col, .spec, table.list td, .kv dd { min-width: 0; }
.spec, .spec b, .spec small, table.list td, table.list th, .kv dd, .kv dt,
.desig, .lead, .hint, .fieldhint, .empty, .gtr, .askfix, .foot, p, li {
  word-wrap: break-word; overflow-wrap: break-word; }
.spec { max-width: 100%; }
.desig { word-break: break-word; }

/* Подсказка о восстановленном запросе подбора */
.restored { background: var(--surface2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 14px; margin: 0 0 16px; font-size: 15px; color: var(--ink2); }
.restored .btn.small { margin-left: 4px; }

/* Кнопка «показать остальные поля строки» и сами поля */
table.list th.expander, table.list td.expander { width: 52px; padding: 6px 8px; }
table.list td.expander .btn.small { min-width: 36px; font-size: 16px; line-height: 1; padding: 6px 8px; }
tr.morerow td { background: var(--surface2) !important; padding: 12px 14px; }
.morefields { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 6px 16px; margin: 0; }
.morefield { min-width: 0; }
.morefield small { display: block; color: var(--muted); font-size: 14px; margin-bottom: 2px; }

/* ── Справочник: отклонения и сетка классов ──────────────────────────────── */
.devhead { margin: 18px 0 10px; font-size: 16px; }
.devbox { display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-flex-wrap: wrap; flex-wrap: wrap; margin: 0 -6px 10px; }
.dev { -webkit-flex: 1 1 200px; flex: 1 1 200px; min-width: 0; margin: 0 6px 10px;
  padding: 12px 16px; background: var(--accent-soft); border: 1px solid var(--accent); border-radius: var(--radius); }
.dev small { display: block; color: var(--ink2); font-size: 14px; }
.dev b { display: block; font-family: var(--mono); font-size: 26px; line-height: 1.2; color: var(--accent-dark); }
.dev span { color: var(--muted); font-size: 14px; font-family: var(--mono); }

table.grid { border-collapse: collapse; }
table.grid th { font-size: 15px; color: var(--ink2); padding: 4px 8px; font-family: var(--mono); }
table.grid td { padding: 2px; }
.gcell { min-width: 56px; min-height: 36px; padding: 6px 8px; font-size: 15px; font-family: var(--mono);
  background: var(--surface2); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; color: var(--ink); }
.gcell.pref { background: var(--surface); border-color: var(--axis); font-weight: 600; }
.gcell:hover { border-color: var(--accent); }
.gcell.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }

/* Тег <small> по умолчанию даёт 12,5 px — мельче нашего минимума. Задаём явно:
   в системе нет текста мельче 14 px, иначе его не прочитать на мониторе станка. */
small { font-size: 14px; }

/* Знак допуска формы: картинка из справочника, крупнее оригинала — на чертеже
   его ищут глазами, поэтому мелкая иконка тут бесполезна. */
.signimg { display: block; width: 72px; height: auto; image-rendering: -webkit-optimize-contrast;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 4px; }

/* ── Сортировка, выравнивание чисел, шапка таблицы ───────────────────────── */
/* Числа выравниваем вправо: разряды встают друг под другом, и величины видно
   взглядом, без чтения каждой цифры. */
table.list td.num, table.list th.num { text-align: right; font-family: var(--mono); }
table.list th.num .sortbtn { -webkit-justify-content: flex-end; justify-content: flex-end; }
.sortbtn { display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-align-items: center; align-items: center; width: 100%; background: none; border: 0;
  padding: 0; margin: 0; cursor: pointer; font: inherit; font-weight: 700; color: var(--ink2);
  text-align: left; min-height: 32px; }
.sortbtn:hover { color: var(--accent); }
.sortbtn .arrow { margin-left: 6px; font-size: 14px; color: var(--ink2); }
table.list th.sorted .sortbtn, table.list th.sorted .arrow { color: var(--accent); }
/* Шапка остаётся на месте при прокрутке длинной таблицы: иначе к середине уже
   не помнишь, что в какой колонке. */
table.list thead th { position: -webkit-sticky; position: sticky; top: 0; z-index: 2;
  background: var(--surface); }
table.list caption { text-align: left; color: var(--ink2); font-size: 15px; padding: 0 0 8px; }

/* Скелетон загрузки: те же высоты, что у строк таблицы, — экран не прыгает */
.skeleton { padding: 4px 0; }
.skrow { display: -webkit-box; display: -webkit-flex; display: flex; padding: 12px 10px;
  border-bottom: 1px solid var(--line); }
.skcell { height: 16px; margin-right: 18px; border-radius: var(--radius); background: var(--surface2);
  -webkit-animation: pulse 1.4s ease-in-out infinite; animation: pulse 1.4s ease-in-out infinite; }
@-webkit-keyframes pulse { 0%, 100% { opacity: .55 } 50% { opacity: 1 } }
@keyframes pulse { 0%, 100% { opacity: .55 } 50% { opacity: 1 } }

/* Текст только для читалки экрана */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0; padding: 0; margin: -1px; }

/* Кому мешает движение — у того его не будет: берём системную настройку. */
@media (prefers-reduced-motion: reduce) {
  .fade, .enter, .skcell { -webkit-animation: none !important; animation: none !important;
    -webkit-transition: none !important; transition: none !important; }
}

/* Чипы активных фильтров: что именно сейчас отфильтровано и как это снять */
.chips { display: -webkit-box; display: -webkit-flex; display: flex; -webkit-flex-wrap: wrap;
  flex-wrap: wrap; -webkit-align-items: center; align-items: center; margin: 0 0 14px; }
.chips .hint { margin-right: 8px; }
.chip { display: inline-block; min-height: 36px; padding: 6px 12px; margin: 0 8px 6px 0;
  border: 1px solid var(--accent); border-radius: var(--radius); background: var(--accent-soft);
  color: var(--ink); font: inherit; font-size: 15px; cursor: pointer; }
.chip span { color: var(--accent-dark); font-weight: 700; margin-left: 6px; }
.chip:hover { background: var(--accent); color: var(--accent-ink); }
.chip:hover span { color: var(--accent-ink); }

/* Шаги на главной: три карточки «что будет дальше». Раньше они ехали на браузерных
   умолчаниях, отсюда и мелкий бледный номер шага. */
.steps { display: -webkit-box; display: -webkit-flex; display: flex; -webkit-flex-wrap: wrap;
  flex-wrap: wrap; margin: 0 -8px; }
.step { -webkit-flex: 1 1 260px; flex: 1 1 260px; min-width: 0; margin: 0 8px 12px;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface2); font-size: 16px; line-height: 1.45; }
.step.on { border-color: var(--accent); background: var(--accent-soft); }
.step .n { font-size: 15px; font-weight: 700; color: var(--ink2); margin-bottom: 6px; }
.step.on .n { color: var(--accent-dark); }

/* ── Просмотр модели и чертежа ───────────────────────────────────────────── */
/* Рабочая область: холст во всю ширину, панель инструментов поверх него,
   список деталей сбоку. Всё, чем человек пользуется, — на расстоянии одного
   движения мыши, а не под моделью, куда ещё надо доскроллить. */
.stagewrap { display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-flex-wrap: wrap; flex-wrap: wrap; margin: 0 -8px; }
.stage { position: relative; -webkit-flex: 1 1 520px; flex: 1 1 520px; min-width: 0;
  height: 520px; margin: 0 8px 12px; background: var(--surface2);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  /* одним пальцем страница прокручивается, двумя — крутится модель */
  -ms-touch-action: pan-y; touch-action: pan-y; }
.stage canvas { display: block; width: 100%; height: 100%; }
.stage.frames img { display: block; width: 100%; height: 100%; object-fit: contain; cursor: grab;
  -webkit-user-select: none; user-select: none; }
.stage.drawing { background: #fff; cursor: grab; }
.stage.drawing .drawinner { width: 100%; height: 100%; transform-origin: center center; }
.stage.drawing svg { width: 100%; height: 100%; }
.stagewrap:fullscreen .stage, .stagewrap:-webkit-full-screen .stage { height: 100vh; margin: 0; border-radius: 0; }

/* Панель инструментов — плавающая, как в редакторах: не отнимает место у модели */
.toolbar { position: absolute; top: 12px; left: 12px; display: -webkit-box; display: -webkit-flex;
  display: flex; -webkit-flex-wrap: wrap; flex-wrap: wrap; }
.toolgroup { display: -webkit-box; display: -webkit-flex; display: flex; margin: 0 8px 8px 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .08); overflow: hidden; position: relative; }
.tool { min-width: 46px; min-height: 46px; padding: 8px 10px; border: 0; background: none;
  color: var(--ink2); font: inherit; font-size: 17px; line-height: 1; cursor: pointer;
  display: -webkit-box; display: -webkit-flex; display: flex; -webkit-align-items: center;
  align-items: center; -webkit-justify-content: center; justify-content: center; }
.tool + .tool { border-left: 1px solid var(--line); }
.tool:hover { background: var(--surface2); }
.tool.on { background: var(--accent-soft); color: var(--accent-dark); }
.tool.wide { font-size: 16px; padding: 8px 10px 8px 14px; }
.tool.wide svg { width: 18px; height: 18px; margin-left: 2px; }
.viewmenu { position: absolute; top: 46px; left: 0; z-index: 5; min-width: 170px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .12); padding: 6px; }
.viewmenu button { display: block; width: 100%; min-height: 40px; padding: 8px 12px; border: 0;
  background: none; text-align: left; font: inherit; color: var(--ink); cursor: pointer; border-radius: var(--radius); }
.viewmenu button:hover { background: var(--accent-soft); color: var(--accent-dark); }

/* Строка состояния: куда повёрнута деталь и какой масштаб — как в CAD внизу экрана */
.statusbar { position: absolute; left: 12px; bottom: 12px; display: -webkit-box; display: -webkit-flex;
  display: flex; -webkit-flex-wrap: wrap; flex-wrap: wrap; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .08); font-family: var(--mono); font-size: 14px; color: var(--ink2); }
.statusbar span { padding: 2px 10px; }
.statusbar span + span { border-left: 1px solid var(--line); }
.statusbar .stagetitle { font-family: inherit; color: var(--ink); font-weight: 600; }
.stagehint { position: absolute; right: 12px; bottom: 60px; max-width: 42%; text-align: right;
  color: var(--muted); font-size: 14px; line-height: 1.35; pointer-events: none;
  background: var(--surface); border-radius: var(--radius); padding: 6px 10px; }
.stage.frames .stagehint { position: static; text-align: center; max-width: none; padding: 8px 0 0; }
.framebar { position: absolute; left: 50%; bottom: 14px; -webkit-transform: translateX(-50%);
  transform: translateX(-50%); display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-align-items: center; align-items: center; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 2px 8px rgba(0, 0, 0, .08); }
.framebar span { padding: 0 12px; font-family: var(--mono); font-size: 14px; color: var(--ink2); }
.stagehint.mobile { display: none; }
/* На телефоне панель уезжает вниз одной строкой: кнопки поверх модели съедали
   половину и без того маленького экрана. Строка состояния — наверх, подсказка
   показывается один раз и сама исчезает. */
@media (max-width: 760px) {
  .stagehint.desktop { display: none; }
  .stagehint.mobile { display: block; left: 10px; right: 10px; bottom: auto; top: 54px;
    max-width: none; text-align: center; }
  .stage { height: 420px; }
  .toolbar { top: auto; bottom: 10px; left: 10px; right: 10px; -webkit-flex-wrap: nowrap;
    flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
  .toolgroup { margin: 0 6px 0 0; -webkit-flex: 0 0 auto; flex: 0 0 auto; }
  .tool { min-width: 44px; min-height: 44px; }
  .statusbar { top: 10px; left: 10px; right: 10px; bottom: auto; font-size: 13px;
    -webkit-justify-content: center; justify-content: center; }
  .statusbar .stagetitle { display: none; }
  .viewmenu { top: auto; bottom: 52px; }
  .partlist { max-height: 300px; }
}

/* Список деталей сборки: видно, из чего собрано, и каждую можно погасить */
.partpanel { -webkit-flex: 0 1 280px; flex: 0 1 280px; min-width: 0; margin: 0 8px 12px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.partheader { display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-justify-content: space-between; justify-content: space-between;
  -webkit-align-items: baseline; align-items: baseline; padding: 12px 14px;
  border-bottom: 1px solid var(--line); }
.partactions { display: -webkit-box; display: -webkit-flex; display: flex; padding: 10px 14px 4px; }
.partactions .btn { margin: 0 8px 8px 0; }
.partlist { max-height: 404px; overflow-y: auto; }
.partrow { display: -webkit-box; display: -webkit-flex; display: flex; -webkit-align-items: center;
  align-items: center; width: 100%; min-height: 44px; padding: 8px 14px; border: 0;
  border-top: 1px solid var(--line); background: none; font: inherit; color: var(--ink);
  text-align: left; cursor: pointer; }
.partrow:hover { background: var(--accent-soft); }
.partrow.off { color: var(--muted); }
.partrow .dot { width: 14px; height: 14px; border-radius: var(--radius); margin-right: 10px;
  border: 1px solid rgba(0, 0, 0, .15); -webkit-flex: 0 0 auto; flex: 0 0 auto; }
.partrow.off .dot { opacity: .3; }
.partrow .pname { -webkit-flex: 1 1 auto; flex: 1 1 auto; min-width: 0; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.partrow .eye { color: var(--muted); font-size: 14px; margin-left: 8px; }

.dropzone { border: 2px dashed var(--axis); border-radius: var(--radius); padding: 28px 20px; text-align: center;
  background: var(--surface2); }
.dropzone p { margin: 0 0 12px; font-size: 18px; }

/* Примеры моделей: карточка с видом детали, по ней и нажимают */
.samples { display: -webkit-box; display: -webkit-flex; display: flex; -webkit-flex-wrap: wrap;
  flex-wrap: wrap; margin: 0 -8px; }
.sample { -webkit-flex: 1 1 240px; flex: 1 1 240px; min-width: 0; margin: 0 8px 12px; padding: 12px;
  background: var(--surface2); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer;
  font: inherit; color: var(--ink); text-align: left; }
.sample:hover { border-color: var(--accent); background: var(--accent-soft); }
.sample img { display: block; width: 100%; height: 150px; object-fit: contain; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; }
.sample b { display: block; font-size: 17px; margin-bottom: 4px; }
.sample small { display: block; color: var(--muted); font-size: 14px; line-height: 1.4; }

/* Сведения о графике: вызываются из строки состояния, когда что-то пошло не так */
.statbtn { min-width: 30px; min-height: 26px; margin-left: 4px; border: 0; background: none;
  color: var(--accent); font: inherit; font-weight: 700; cursor: pointer; }
.diagbox { position: absolute; left: 12px; bottom: 60px; max-width: 420px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .12); font-size: 15px; }
.diagbox dl { margin: 10px 0 12px; }
.diagbox dl > div { display: -webkit-box; display: -webkit-flex; display: flex;
  border-top: 1px solid var(--line); padding: 5px 0; }
.diagbox dt { -webkit-flex: 0 0 46%; flex: 0 0 46%; color: var(--ink2); }
.diagbox dd { margin: 0; -webkit-flex: 1 1 auto; flex: 1 1 auto; min-width: 0;
  font-family: var(--mono); font-size: 14px; word-wrap: break-word; overflow-wrap: break-word; }

/* ── Лендинг (/#/landing) ────────────────────────────────────────────────── */
/* Отдельная страница для показа продукта: шире обычного, с воздухом и движением
   при прокрутке. Движение здесь — украшение: там, где браузер его не умеет или
   человек попросил «поменьше анимации», всё просто видно сразу. */
.wrap.full { max-width: none; padding: 0; }
.landing { background: var(--surface); }
.lnd-in { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.landing h1 { font-size: 46px; line-height: 1.1; letter-spacing: -.5px; margin: 0 0 18px; }
.lnd-h2 { font-size: 32px; line-height: 1.2; margin: 0 0 28px; }
.landing h3 { font-size: 20px; margin: 0 0 8px; }
.landing p { font-size: 18px; line-height: 1.6; color: var(--ink2); }

.reveal { opacity: 0; -webkit-transform: translateY(22px); transform: translateY(22px);
  -webkit-transition: opacity .55s ease, -webkit-transform .55s ease;
  transition: opacity .55s ease, transform .55s ease; }
.reveal.in { opacity: 1; -webkit-transform: none; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; -webkit-transform: none; transform: none; -webkit-transition: none; transition: none; }
}

.lnd-hero { padding: 72px 0 84px; background: var(--surface2); border-bottom: 1px solid var(--line); }
.lnd-hero .lnd-in { display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-flex-wrap: wrap; flex-wrap: wrap; -webkit-align-items: center; align-items: center; }
.lnd-hero-text { -webkit-flex: 1 1 520px; flex: 1 1 520px; min-width: 0; padding-right: 32px; }
.lnd-badge { display: inline-block; padding: 6px 14px; margin-bottom: 20px; border-radius: var(--radius);
  background: var(--accent-soft); color: var(--accent-dark); font-size: 15px; font-weight: 600; }
.lnd-lead { font-size: 20px; max-width: 620px; }
.lnd-cta { margin: 28px 0 14px; }
.lnd-btn { display: inline-block; min-height: 52px; line-height: 52px; padding: 0 28px;
  margin: 0 12px 12px 0; border: 1px solid var(--axis); border-radius: var(--radius); background: var(--surface);
  color: var(--ink); font-size: 17px; font-weight: 600; }
.lnd-btn:hover { background: var(--surface2); text-decoration: none; }
.lnd-btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.lnd-btn.primary:hover { background: var(--accent-dark); }
.lnd-note { color: var(--muted); font-size: 15px; }

/* Карточки в первом экране: показывают ровно то, что человек увидит внутри */
.lnd-hero-art { -webkit-flex: 1 1 380px; flex: 1 1 380px; min-width: 0; position: relative;
  min-height: 320px; }
.art-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: 0 10px 30px rgba(0, 0, 0, .08); margin-bottom: 14px; }
.art-card b { display: block; font-family: var(--mono); font-size: 22px; }
.art-card span { display: block; color: var(--ink2); font-size: 15px; margin-top: 2px; }
.art-card span.small { font-size: 14px; color: var(--muted); }
.art-card .bar { display: block; height: 8px; margin: 12px 0 8px; border-radius: var(--radius);
  background: var(--surface2); overflow: hidden; }
.art-card .bar u { display: block; height: 100%; background: var(--accent); }
.art-2 { margin-left: 36px; }
.art-3 { margin-left: 12px; }

.lnd-stats { padding: 44px 0; border-bottom: 1px solid var(--line); }
.lnd-stats .lnd-in { display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-flex-wrap: wrap; flex-wrap: wrap; }
.lnd-stats .reveal { -webkit-flex: 1 1 220px; flex: 1 1 220px; min-width: 0; }
.stat { padding: 8px 16px 8px 0; }
.stat b { display: block; font-size: 40px; line-height: 1.1; font-family: var(--mono); color: var(--accent); }
.stat > span { display: block; color: var(--ink2); font-size: 16px; margin-top: 6px; }

.lnd-pain { padding: 64px 0; background: var(--surface2); }
.lnd-pain .lnd-in { display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-flex-wrap: wrap; flex-wrap: wrap; margin: 0 -12px; }
.lnd-pain .reveal { -webkit-flex: 1 1 420px; flex: 1 1 420px; min-width: 0; padding: 0 12px; }
.pain-col { height: 100%; padding: 26px 28px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); }
.pain-col.good { border-color: var(--accent); }
.pain-col h2 { font-size: 22px; margin: 0 0 14px; }
ul.pain { margin: 0; padding-left: 22px; }
ul.pain li { font-size: 17px; line-height: 1.55; color: var(--ink2); margin-bottom: 10px; }
.pain-col.good ul.pain li { color: var(--ink); }

.lnd-features { padding: 72px 0; }
.feat-grid, .steps-grid, .who-grid { display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-flex-wrap: wrap; flex-wrap: wrap; margin: 0 -12px; }
.feat-grid .reveal { -webkit-flex: 1 1 320px; flex: 1 1 320px; min-width: 0; padding: 0 12px 24px; }
.feat { height: 100%; padding: 24px 26px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); }
.feat:hover { border-color: var(--accent); }
.feat-ico { width: 52px; height: 52px; margin-bottom: 14px; border-radius: var(--radius);
  background: var(--accent-soft); color: var(--accent-dark); display: -webkit-box; display: -webkit-flex;
  display: flex; -webkit-align-items: center; align-items: center;
  -webkit-justify-content: center; justify-content: center; }
.feat p { font-size: 16px; margin: 0; }

.lnd-steps { padding: 64px 0; background: var(--surface2); }
.steps-grid .reveal { -webkit-flex: 1 1 300px; flex: 1 1 300px; min-width: 0; padding: 0 12px 20px; }
.lstep { height: 100%; padding: 24px 26px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); }
.lstep .num { width: 40px; height: 40px; line-height: 40px; text-align: center; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 18px; margin-bottom: 14px; }
.lstep p { font-size: 16px; margin: 0; }

.lnd-who { padding: 64px 0; }
.who-grid .reveal { -webkit-flex: 1 1 300px; flex: 1 1 300px; min-width: 0; padding: 0 12px 20px; }
.who { height: 100%; padding: 22px 24px; border-left: 3px solid var(--accent); background: var(--surface2); }
.who p { font-size: 16px; margin: 0; }

.lnd-trust { padding: 64px 0; background: var(--surface2); }
.trust ul { margin: 0; padding-left: 22px; }
.trust li { font-size: 17px; line-height: 1.6; color: var(--ink2); margin-bottom: 12px; }
.trust li b { color: var(--ink); }

.lnd-final { padding: 80px 0 96px; text-align: center; }
.final h2 { font-size: 34px; margin: 0 0 14px; }
.final p { max-width: 620px; margin: 0 auto; }

@media (max-width: 900px) {
  .landing h1 { font-size: 34px; }
  .lnd-h2 { font-size: 26px; }
  .lnd-hero { padding: 48px 0 56px; }
  .lnd-hero-text { padding-right: 0; }
  .art-2, .art-3 { margin-left: 0; }
  .stat b { font-size: 32px; }
}

/* Палитра кита на странице /#/ui: показывает, какими токенами собран интерфейс */
.swatches { display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-flex-wrap: wrap; flex-wrap: wrap; margin: 0 -6px; }
.swatch { -webkit-flex: 1 1 180px; flex: 1 1 180px; min-width: 0; margin: 0 6px 12px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); }
.swatch i { display: block; height: 34px; margin-bottom: 8px; border-radius: var(--radius);
  border: 1px solid var(--line); }
.swatch b { display: block; font-size: 15px; }
.swatch small { display: block; color: var(--ink2); font-size: 14px; margin-top: 2px; }

/* ── Мультивыбор фильтра с галочками и счётчиками ───────────────────────── */
.chk { position: relative; -webkit-flex: 0 0 auto; flex: 0 0 auto; }
.chk-btn { display: -webkit-box; display: -webkit-flex; display: flex; width: 100%; -webkit-box-sizing: border-box; box-sizing: border-box;
  -webkit-align-items: center; align-items: center; height: var(--tap); padding: 0 12px;
  background: var(--surface2); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--ink); font: inherit; font-size: 13px; cursor: pointer; gap: 8px;
  box-sizing: border-box; white-space: nowrap; }
.chk-btn:hover { border-color: var(--accent); background: var(--surface); }
.chk-btn.on { border-color: var(--accent); color: var(--accent); }
.chk-label { color: inherit; }
.chk-count { background: var(--accent); color: #fff; font-size: 12px; font-weight: 600;
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--radius);
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-align-items: center; align-items: center; -webkit-justify-content: center; justify-content: center;
  box-sizing: border-box; }
.chk-caret { color: var(--muted); font-size: 11px; }
.chk-menu { position: absolute; top: calc(100% + 4px); left: 0; z-index: 50;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .14); min-width: 260px; max-width: 320px; }
.chk-search { display: block; width: 100%; height: 36px; padding: 0 12px; margin: 0;
  border: 0; border-bottom: 1px solid var(--line); border-radius: var(--radius) 4px 0 0;
  font: inherit; font-size: 13px; background: var(--surface); color: var(--ink); box-sizing: border-box; }
.chk-search:focus { outline: none; box-shadow: inset 0 0 0 1px var(--accent); }
.chk-list { max-height: 280px; overflow: auto; padding: 4px; }
.chk-item { display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-align-items: center; align-items: center; gap: var(--sp-03); padding: var(--sp-03);
  font-size: 14px; line-height: 1.29; cursor: pointer; border-radius: var(--radius); }
.chk-item:hover { background: var(--surface2); }
.chk-item input { position: absolute; opacity: 0; width: 0; height: 0; }
.chk-box { -webkit-flex: 0 0 auto; flex: 0 0 auto; width: 16px; height: 16px;
  border: 1px solid var(--line); border-radius: var(--radius);
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-align-items: center; align-items: center; -webkit-justify-content: center; justify-content: center;
  color: transparent; font-size: 11px; box-sizing: border-box; }
.chk-item input:checked + .chk-box { background: var(--accent); border-color: var(--accent); color: #fff; }
.chk-name { -webkit-flex: 1 1 auto; flex: 1 1 auto; }
.chk-item em { margin-left: auto; color: var(--muted); font-style: normal; font-size: 12px; }
.chk-empty { padding: 10px 12px; color: var(--muted); font-size: 13px; }
.chk-opt { display: block; width: 100%; padding: 8px 12px; border: 0; background: none;
  font: inherit; font-size: 13px; text-align: left; color: var(--ink); cursor: pointer;
  border-radius: var(--radius); box-sizing: border-box; }
.chk-opt:hover { background: var(--surface2); }
.chk-opt.on { color: var(--accent); font-weight: 600; }
/* Диапазон «от–до» в фильтре */
.range { display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; gap: 6px; }
.range input { -webkit-flex: 1 1 auto; flex: 1 1 auto; min-width: 0; }
.range span { color: var(--muted); }


/* ── Панель фильтров каталога: ровная сетка (Carbon) ───────────────────── */
.card.filters { padding: 14px 16px; }
.card.filters .row { display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-flex-wrap: wrap; flex-wrap: wrap; gap: 8px; margin: 0;
  -webkit-align-items: center; align-items: center; }
.card.filters .row > * { margin: 0; }
.card.filters .row .col { -webkit-flex: 0 0 auto; flex: 0 0 auto; }
.card.filters .row .col.wide { -webkit-flex: 1 1 100%; flex: 1 1 100%; }

/* выравнивание подписи и контролов (переопределяет старый label 42px) */
label, .chk-title { min-height: 22px; font-size: 14px; margin: 0 0 5px; font-weight: 600; color: var(--ink2); }


/* ── Компактные поля в ряду чипов (каталог) ─────────────────────────────── */
.searchbox { -webkit-flex: 0 0 auto; flex: 0 0 auto; width: 220px; height: 36px;
  padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius);
  font: inherit; font-size: 13px; background: var(--surface); color: var(--ink);
  box-sizing: border-box; }
.searchbox:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.rangebox { -webkit-flex: 0 0 auto; flex: 0 0 auto; display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-align-items: center; align-items: center; gap: 4px; height: 36px;
  padding: 0 8px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); box-sizing: border-box; }
.rangebox input { height: 34px; width: 52px; padding: 0 4px; font-size: 13px; color: var(--ink);
  border: 0; background: none; border-radius: 0; box-sizing: border-box; }
.rangebox span { color: var(--muted); font-size: 13px; }


/* ── Боковая панель слева (dashboard layout) ──────────────────────────────── */
/* Цвета — только существующие переменные темы (--surface/--ink/--accent/--line),
   никаких жёстких #hex: иначе в ночном режиме панель белая, а текст невидим. */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 264px; flex: 0 0 264px; background: var(--surface2);
  border-right: 1px solid var(--line); padding: 16px 12px;
  display: flex; flex-direction: column; gap: 14px; position: sticky; top: 0;
  height: 100vh; overflow-y: auto; box-sizing: border-box; }
.side-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.side-brand .mark { width: 34px; height: 34px; border-radius: var(--radius); background: var(--accent);
  color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }
.side-brand .name { font-weight: 600; font-size: 14px; line-height: 1.15; color: var(--ink); }
.side-brand .name small { display: block; font-weight: 400; font-size: 11px; color: var(--muted); }
.side-search { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 7px 10px; background: var(--surface); color: var(--muted); }
.side-search input { border: 0; background: none; flex: 1; min-width: 0; outline: none; font-size: 14px; color: var(--ink); }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-group { margin-bottom: 14px; }
.side-group-title { font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); padding: 0 10px; margin-bottom: 4px;
  display: flex; justify-content: space-between; align-items: center; }
.side-paid { font-size: 10px; color: var(--muted); text-transform: none; letter-spacing: 0; }
.side-nav a { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 10px; border-radius: var(--radius); text-decoration: none; color: var(--ink); font-size: 14px; }
.side-nav a:hover { background: var(--surface); }
.side-nav a.on { background: var(--accent); color: #fff; }
.side-nav a.on svg { stroke: #fff; }
.side-theme { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 10px; border-radius: var(--radius); color: var(--ink); font-size: 14px;
  background: none; border: 0; cursor: pointer; width: 100%; font-family: inherit; text-align: left; box-sizing: border-box; }
.side-theme:hover { background: var(--surface); }
.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content { flex: 1; min-width: 0; padding: 20px 24px; box-sizing: border-box; max-width: 1280px; width: 100%; margin: 0 auto; }
.content.full { padding: 0; }
@media (max-width: 900px) {
  .sidebar { position: static; height: auto; width: 100%; flex: none; border-right: 0; border-bottom: 1px solid var(--surface-line, #e4e6fd); }
  .shell { flex-direction: column; }
}



/* ── Схемы операций подбора (SVG, лёгкие для Chromium 49) ─────────────────── */
.opviz { margin: 14px 0; padding: 12px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); text-align: center; }
.opdiagram { width: 100%; max-width: 520px; height: auto; display: inline-block; }
.opdiagram text { font-family: Arial, sans-serif; font-weight: normal; font-size: 14px; }
.opdiagram .stock { fill: var(--surface2); stroke: var(--ink); stroke-width: 2.5; }
.opdiagram .bore { stroke: var(--accent); stroke-width: 2; }
.opdiagram .tool { fill: var(--ink); }
.opdiagram .insert { fill: var(--accent); }
.opdiagram .shank { fill: var(--ink); }
.opdiagram .axis { stroke: var(--ink); stroke-width: 1; opacity: .35; }
.opdiagram .dim { fill: var(--ink); font-size: 14px; }
.opdiagram .dim.clickable { cursor: pointer; }
.opdiagram .dim line { stroke: var(--ink); stroke-width: 1.5; }
.opdiagram .dim.hot { fill: var(--accent-dark); }
.opdiagram .dim.hot line { stroke: var(--accent); stroke-width: 2; }
.opdiagram .arr { fill: currentColor; stroke: none; }
.opdiagram .dim text { stroke: none; fill: inherit; font-size: 14px; font-weight: normal; font-family: Arial, sans-serif; text-anchor: middle; }


/* ── Степ-визард подбора ─────────────────────────────────────────────────── */
.wizard .row { gap: 10px 14px; }
.wizard h3 { margin: 0 0 10px; }
.wsteps { display: flex; gap: 8px; margin: 14px 0 18px; }
.wsteps span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px;
  border-radius: var(--radius); border: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.wsteps span b { width: 20px; height: 20px; border-radius: 50%; background: var(--surface2);
  display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }
.wsteps span.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.wsteps span.on b { background: var(--accent); color: #fff; }
.wsteps span.done { color: var(--ink); border-color: var(--axis); }
.wsteps span.done b { background: var(--good); color: #fff; }
.wpage { min-height: 120px; }
.wsummary { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px 14px;
  margin: 6px 0 4px; }
.wsummary div { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface2); }
.wsummary span { font-size: 12px; color: var(--muted); }
.wsummary b { font-size: 14px; font-weight: 600; color: var(--ink); }
.wizard-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; padding-top: 14px;
  border-top: 1px solid var(--line); }
.wizard-nav .btn { min-width: 120px; }


/* Легенда схемы операции: все фильтры чипами, клик фокусирует поле */
.oplegend { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; justify-content: center; }
.opchip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface2); color: var(--ink2); font-size: 13px;
  cursor: pointer; font-family: inherit; }
.opchip b { font-weight: 600; color: var(--muted); }
.opchip span { font-weight: 400; }
.opchip.hot { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.opchip.hot b { color: var(--accent); }


/* Шкала безопасности пароля */
.pwmeter { display: flex; align-items: center; gap: 4px; }
.pwmeter span { flex: 1; height: 6px; border-radius: var(--radius); background: var(--line); transition: background .2s; }
.pwmeter span.on { background: var(--bad); }
.pwmeter span.on.s2 { background: var(--warn); }
.pwmeter span.on.s3 { background: var(--good); }
.pwmeter span.on.s4 { background: var(--good); }
.pwmeter small { color: var(--muted); font-size: 12px; white-space: nowrap; }


/* Кабинет оператора: отдельный дашборд */
.admin-shell { display: flex; gap: 0; min-height: calc(100vh - var(--bar, 64px)); }
.admin-side { width: 240px; flex: 0 0 240px; background: var(--surface2); border-right: 1px solid var(--line);
  padding: 20px 12px; box-sizing: border-box; }
.admin-brand { font-size: 16px; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.admin-user { font-size: 13px; color: var(--muted); margin-bottom: 16px; word-break: break-all; }
.admin-nav { display: flex; flex-direction: column; gap: 4px; }
.admin-nav a { display: block; padding: 9px 12px; border-radius: var(--radius); color: var(--ink); text-decoration: none;
  font-size: 14px; }
.admin-nav a:hover { background: var(--surface); }
.admin-nav a.on { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.admin-main { flex: 1; min-width: 0; padding: 20px 24px; box-sizing: border-box; }


/* Панель-«книжка» (drawer) справа для редактирования записи */
.drawer { position: fixed; inset: 0; z-index: 100; }
.drawer-mask { position: absolute; inset: 0; background: rgba(22,22,22,.5); }
.drawer-panel { position: absolute; top: 0; right: 0; bottom: 0; width: 440px; max-width: 92vw;
  background: var(--bg); border-left: 1px solid var(--line); display: flex; flex-direction: column; }
.drawer-head { display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.drawer-body { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.drawer-body label { margin-bottom: 2px; }
.drawer-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 16px;
  border-top: 1px solid var(--line); background: var(--surface); }


/* Carbon Toggle: label + switch + state, зазор 8px */
.toggle { display: inline-flex; align-items: center; gap: var(--sp-03); cursor: pointer; }
.toggle-label { font-size: 14px; color: var(--ink); }
.toggle-state { font-size: 14px; color: var(--ink2); }
.switch { position: relative; width: 40px; height: 24px; background: var(--ink2);
  transition: background .1s; flex: 0 0 auto; }
.switch .knob { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
  background: #FFFFFF; transition: left .1s; }
.switch.on { background: var(--accent); }
.switch.on .knob { left: 19px; }
.toggle:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }


.side-legal { margin-top: auto; padding: 12px 10px 4px; font-size: 11px; line-height: 1.35;
  color: var(--muted); border-top: 1px solid var(--line); letter-spacing: 0; }

.lnd-legal { padding: 24px 0 32px; border-top: 1px solid var(--line); color: var(--muted);
  font-size: 13px; letter-spacing: 0; }

.btn.icon { padding: 5px 8px; display: inline-flex; align-items: center; justify-content: center; }
.btn.icon svg { display: block; }

.drawer-sect { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 4px; }
.drawer-sect .kv { display: grid; gap: 4px; margin-top: 6px; }
.drawer-sect .kv div { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.drawer-sect .kv span { color: var(--muted); }

/* Шапка карточки: заголовок и действие на одной строке, на узком экране переносятся. */
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-03);
  flex-wrap: wrap; margin-bottom: var(--sp-03); }
.card-head h3 { margin: 0; }

/* Адаптив: поля и кнопки не выходят за контейнер */
.btn { max-width: 100%; }
.badge.warn { border-color: var(--warn); color: var(--warn); }
@media (max-width: 640px) {
  .row { gap: var(--sp-03); }
  .row > .col { -webkit-flex: 1 1 100%; flex: 1 1 100%; }
  .card { padding: 14px; }
  .card-head { flex-direction: column; align-items: stretch; }
  .card-head .btn { width: 100%; }
  .admin-shell { flex-direction: column; }
  .admin-side { width: 100%; flex: 0 0 auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 12px; }
  .admin-nav { flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .admin-nav a { padding: 7px 10px; font-size: 13px; }
  .admin-main { padding: 14px; }
  .drawer-panel { width: 100%; max-width: 100%; }
}

/* Внутри ячейки таблицы «ошибка» — это текст, а не блок сообщения: не раздуваем строку. */
table.list td .err, table.list td.err { background: transparent; border: 0; color: var(--bad);
  padding: 0; margin: 0; }
