﻿/*
  VAG Mods — единая таблица стилей без фреймворка. Стиль «Приборная панель»: графит, тонкие линии вместо карточек,
  углы 2px, красный цвет логотипа (--action) только у главной кнопки и отметок текущего; ссылки цветом текста,
  справочные выноски — --info. Шрифты свои (wwwroot/fonts): Golos Text для текста, JetBrains Mono (--mono) для цен,
  кодов версий и подписей разделов. Тёмная тема по умолчанию, светлая — data-theme="light" на <html> (кнопка в шапке).
  Цвета — только семантические токены ниже (контраст текста ≥ 4.5:1 в обеих темах, рамки полей ≥ 3:1).
  Отступы — шкала 4/8: --s1 4px, --s2 8px, --s3 12px, --s4 16px, --s5 24px, --s6 32px, --s7 48px.

  Компоненты для всех страниц (заказ, админка, профиль):
    .btn                  основное действие (одно на экран); .btn-plain — вторичное; .btn-danger — разрушительное;
                          .btn-small — компактная; .btn-link — ссылка-кнопка; .btn-icon — квадратная с иконкой;
                          .btn-block — на всю ширину; [aria-busy=true] или .is-busy — ожидание (спиннер, без кликов);
                          [data-busy] на кнопке формы — site.js сам ставит aria-busy при отправке.
    .field                поле: label + input/select/textarea + small (подсказка); .form-grid — поля в ряд, .form-stack — столбцом.
    .panel                поверхность с рамкой; .panel-info/.panel-warn/.panel-ok/.panel-err — цветные выноски
                          (те же классы в содержимом редактора); .note/.note-err — прежние уведомления.
    .tag .tag-ok/-warn/-err/-info/-muted/-unit — метки состояния; .badge — счётчик.
    .list                 список строк в рамке (li: .grow — растягиваемая часть).
    .table-cards          таблица, на телефоне — карточки (td[data-label] показывает подпись).
    .timeline             история событий (li, time/.num первым).
    .chat > .msg          переписка: .msg-own (своё), .msg-other, .msg-system, .msg-private (внутренняя заметка);
                          внутри .msg-meta (автор/время) и текст.
    .steps                нумерованные шаги; li.step-current — текущий шаг; li.step-done — выполненный.
    .track                шкала шагов заказа (li.done/.now/.stop).
    .hint / .muted        второстепенный текст; .empty-hint — пустой список.
    .skeleton             заглушка загрузки.
    .icon                 SVG-иконка (Services/Content/Icons.cs, partial _Icon); размер 1.25em, цвет currentColor.
    .rich-content         вывод содержимого редактора (товар, FAQ, инструкции).
    .owner-bar            панель владельца над страницей; .seg — переключатель (языки).
    .sr-only              текст только для экранных дикторов.
*/

@font-face { font-family: "Golos Text"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/golos-text-cyrillic-400-normal.woff2") format("woff2"); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: "Golos Text"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/golos-text-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Golos Text"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/golos-text-cyrillic-500-normal.woff2") format("woff2"); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: "Golos Text"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/golos-text-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Golos Text"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/golos-text-cyrillic-600-normal.woff2") format("woff2"); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: "Golos Text"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/golos-text-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Golos Text"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/golos-text-cyrillic-700-normal.woff2") format("woff2"); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: "Golos Text"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/golos-text-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/jetbrains-mono-cyrillic-400-normal.woff2") format("woff2"); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/jetbrains-mono-cyrillic-500-normal.woff2") format("woff2"); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/jetbrains-mono-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

:root {
  color-scheme: dark;
  --bg: #15171a;
  --surface: #1b1e22;
  --top: #15171a;
  --surface-2: #23272c;
  --ink: #e8eaed;
  --muted: #9aa1a9;
  --line: #2c3137;
  --line-strong: #6b737c;
  --link: #e8eaed;
  --action: #d3171f;
  --action-hover: #e0242b;
  --action-ink: #ffffff;
  --focus: #e8eaed;
  --info: #93b4dc;
  --ok: #5cc28a;
  --warn: #e2b04a;
  --err: #ff8a7a;
  --info-bg: #1c2633;
  --ok-bg: #182c22;
  --warn-bg: #30291a;
  --err-bg: #3a2220;
  --media-bg: #23272c;
  --shadow: 0 8px 24px rgb(0 0 0 / .4);
  --font: "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --radius: 2px;
  --radius-small: 2px;
  --gap: var(--s5);
  --tap: 44px;
  /* Высота закреплённых шапки и нижней панели: 0 на компьютере, на телефоне задана ниже (.tabbar). */
  --sticky-top: 0px;
  --sticky-bottom: 0px;
  --ease: 180ms ease;

  /* Совместимость с прежними именами токенов. */
  --page: var(--bg);

  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f2f3f4;
  --surface: #ffffff;
  --top: #ffffff;
  --surface-2: #eceef0;
  --ink: #15171a;
  --muted: #5a626b;
  --line: #d8dbdf;
  --line-strong: #8b929a;
  --link: #15171a;
  --action: #c8141c;
  --action-hover: #a81017;
  --action-ink: #ffffff;
  --focus: #15171a;
  --info: #2c5a8f;
  --ok: #1b6e42;
  --warn: #8a5300;
  --err: #b42318;
  --info-bg: #eaf0f7;
  --ok-bg: #e7f4ec;
  --warn-bg: #fcf1df;
  --err-bg: #fdecea;
  --media-bg: #e4e7ea;
  --shadow: 0 8px 24px rgb(16 24 40 / .12);
}

/* ---------- основа ---------- */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); color: var(--ink); }
main { flex: 1; padding: var(--s6) 0 var(--s7); }
main:focus { outline: none; }
img, video { max-width: 100%; display: block; }
a { color: var(--link); text-decoration-color: var(--line-strong); text-underline-offset: .2em; transition: color var(--ease), text-decoration-color var(--ease); }
a:hover { color: var(--link); text-decoration-color: currentColor; }
h1, h2, h3, h4, h5 { line-height: 1.25; margin: 0 0 .5em; font-weight: 650; }
h1 { font-size: clamp(1.6rem, 3vw, 2.125rem); letter-spacing: -.02em; margin-bottom: var(--s4); }
h2 { font-size: 1.25rem; margin-top: var(--s6); }
.panel > h2:first-child { margin-top: 0; }
h3 { font-size: 1.0625rem; margin-top: var(--s5); }
h4, h5 { font-size: 1rem; margin-top: var(--s4); }
p { margin: 0 0 var(--s4); max-width: 72ch; }
ul, ol { padding-left: 1.25em; }
small, .muted { color: var(--muted); }
/* Мельче 14 px текста на сайте нет: браузерный <small> иначе 13 px. */
small { font-size: .875rem; }
.hint { color: var(--muted); font-size: .9375rem; display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.hint .icon { flex: none; }
.hint-err { color: var(--err); flex-wrap: nowrap; align-items: flex-start; margin-top: var(--s2); }
.lead { font-size: 1.0625rem; }
.num { font-variant-numeric: tabular-nums; }
/* Цены и коды версий — моноширинным, как цифры на табло. */
.price, .sum, .cart-total, .receipt-total, .line .num { font-variant-numeric: tabular-nums; }
.ver, .upd-ver { font-family: var(--mono); font-weight: 500; }
code, .mono { font-family: var(--mono); font-size: .875em; }
td code { white-space: nowrap; }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--s5) 0; }
::selection { background: var(--action); color: var(--action-ink); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
a, button, input, select, textarea, summary, label { touch-action: manipulation; }
[hidden] { display: none !important; }
.icon { width: 1.25em; height: 1.25em; flex: none; vertical-align: -.25em; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.wrap { max-width: 1600px; margin: 0 auto; padding: 0 var(--s5); }
/* Широкий экран: шапка, страница и подвал в одной колонке до 1600 px, таблицы админки без прокрутки; текст абзацев остаётся узким (72ch). */
@media (min-width: 1280px) { .wrap { padding: 0 var(--s6); } }
/* Путь покупки (машина, корзина, заказ, покупка): одна колонка 880px с общим левым краем. */
.row { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.grow { flex: 1; min-width: 0; }
.scroll { overflow-x: auto; max-width: 100%; }
.narrow { max-width: 440px; }
.upper { text-transform: uppercase; }
.warn { color: var(--warn); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---------- шапка и подвал ---------- */
.skip-link { position: absolute; top: -100px; left: var(--s4); z-index: 100; padding: var(--s3) var(--s4); background: var(--surface); color: var(--ink); border-radius: var(--radius-small); }
.skip-link:focus-visible { top: var(--s2); }
.top { background: var(--top); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s5); min-height: 64px; padding-top: var(--s2); padding-bottom: var(--s2); }
.brand { font-weight: 700; color: var(--ink); text-decoration: none; font-size: 1.0625rem; min-height: var(--tap); display: inline-flex; align-items: center; gap: var(--s2); white-space: nowrap; }
.brand-mark { display: block; width: 68px; height: 28px; object-fit: cover; flex: none; }
.brand-mark.on-light { display: none; }
:root[data-theme="light"] .brand-mark.on-dark { display: none; }
:root[data-theme="light"] .brand-mark.on-light { display: block; }
.brand:hover { color: var(--ink); }
.nav { display: flex; flex-wrap: wrap; gap: 0 var(--s1); }
.nav a { color: var(--ink); text-decoration: none; padding: 0 var(--s3); min-height: var(--tap); min-width: var(--tap); justify-content: center; display: inline-flex; align-items: center; border-radius: var(--radius-small); transition: background-color var(--ease), color var(--ease); }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current] { color: var(--ink); font-weight: 600; box-shadow: inset 0 -2px 0 var(--action); border-radius: 0; }
.top-tools { display: flex; align-items: center; gap: var(--s2); margin-left: auto; }
.lang { display: flex; gap: 2px; }
.lang button { border: 0; background: none; padding: 0 var(--s2); min-height: var(--tap); min-width: var(--tap); color: var(--muted); cursor: pointer; font: inherit; font-size: .875rem; border-radius: var(--radius-small); }
.lang button:hover { color: var(--ink); background: var(--surface-2); }
.lang button[aria-pressed="true"] { color: var(--ink); font-weight: 700; }
.icon-button { width: var(--tap); height: var(--tap); display: inline-grid; place-items: center; padding: 0; border: 1px solid transparent; border-radius: var(--radius-small); color: var(--ink); background: transparent; cursor: pointer; transition: border-color var(--ease); }
.icon-button:hover { background: var(--surface-2); color: var(--ink); }
.icon-button[aria-current] { box-shadow: inset 0 -2px 0 var(--action); }
.icon-button .icon, .icon-button svg { width: 22px; height: 22px; }
.icon-button:has(.icon-count) { position: relative; }
.icon-count { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: var(--radius-small); display: inline-grid; place-items: center; font-size: .75rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; background: var(--action); color: var(--action-ink); border: 2px solid var(--surface); }
/* Оранжевый: заказы ждут оплаты. Текст цветом фона карточки — контрастно в обеих темах. */
.icon-count-warn { background: var(--warn); color: var(--surface); }
.foot { border-top: 1px solid var(--line); padding: var(--s5) 0; color: var(--muted); font-size: .875rem; background: var(--top); }
.foot p { margin-bottom: var(--s2); }
.foot-links { gap: 0 var(--s4); }
.foot-links a { min-height: var(--tap); display: inline-flex; align-items: center; }
@media (max-width: 720px) {
  .brand { gap: 6px; font-size: 1rem; }
  .brand-mark { width: 48px; height: 24px; }
  .wrap { padding: 0 var(--s4); }
  /* Шапка телефона — одна строка 56 px, закреплена сверху: знак, другой язык, профиль. Разделы сайта — в нижней панели
     (.tabbar ниже), тема — в подвале. Название сайта остаётся для экранных дикторов. */
  .brand span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .lang button[aria-pressed="true"] { display: none; }
  .top-tools { gap: var(--s1); }
  .top .nav, .top-tools .theme, .top-tools .in-tabbar { display: none; }
  /* Высота шапки вместе с нижней линией ровно --sticky-top: от неё отсчитывают закреплённые панели под шапкой. */
  .top { position: sticky; top: 0; z-index: 50; height: var(--sticky-top); }
  .top .wrap { flex-wrap: nowrap; gap: 0 var(--s2); height: 100%; min-height: 0; padding-top: 0; padding-bottom: 0; }
  main { padding: var(--s5) 0 var(--s6); }
}

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: var(--tap); padding: var(--s2) var(--s4); border-radius: var(--radius-small);
  border: 1px solid var(--action); background: var(--action); color: var(--action-ink);
  font: inherit; font-weight: 600; line-height: 1.2; text-decoration: none; cursor: pointer; text-align: center;
  transition: background-color var(--ease), border-color var(--ease), color var(--ease), opacity var(--ease);
}
.btn:hover { background: var(--action-hover); border-color: var(--action-hover); color: var(--action-ink); }
.btn-plain { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn-plain:hover { background: var(--surface-2); border-color: var(--ink); color: var(--ink); }
.btn-danger { background: var(--surface); border-color: var(--err); color: var(--err); }
.btn-danger:hover { background: var(--err-bg); border-color: var(--err); color: var(--err); }
.btn-small { min-height: 36px; padding: var(--s1) var(--s3); font-size: .875rem; }
.btn-icon { padding: 0; width: var(--tap); }
.btn-small.btn-icon { width: 36px; }
.btn-block { width: 100%; }
.btn-link { border: 0; background: none; padding: 0 var(--s1); min-height: var(--tap); color: var(--muted); font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; display: inline-flex; align-items: center; }
.btn-link:hover { color: var(--ink); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; pointer-events: none; }
.btn[aria-busy="true"], .btn.is-busy { position: relative; color: transparent !important; pointer-events: none; }
.btn[aria-busy="true"]::after, .btn.is-busy::after {
  content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--action-ink); border-right-color: transparent; animation: spin .7s linear infinite;
}
.btn-plain[aria-busy="true"]::after, .btn-danger[aria-busy="true"]::after { border-color: var(--ink); border-right-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
/* Фоновая работа (сборка пакета, разбор файла): текст статуса со спиннером. */
.busy-note { display: inline-flex; align-items: center; gap: var(--s2); min-height: var(--tap); color: var(--muted); }
.busy-note::before { content: ""; flex: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@media (max-width: 480px) { .btn-small { min-height: var(--tap); } .btn-small.btn-icon { width: var(--tap); } }

/* ---------- поля ---------- */
input[type=text], input[type=email], input[type=tel], input[type=search], input[type=url], input[type=password],
input:not([type]), input[type=number], input[type=date], input[type=file], select, textarea {
  font: inherit; color: var(--ink); background: var(--surface); width: 100%; max-width: 420px;
  min-height: var(--tap); padding: var(--s2) var(--s3); border: 1px solid var(--line-strong); border-radius: var(--radius-small);
  transition: border-color var(--ease), box-shadow var(--ease);
}
input[type=file] { padding: var(--s2); }
textarea { max-width: 640px; resize: vertical; min-height: 88px; }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 35%, transparent); }
input[aria-invalid=true] { border-color: var(--err); }
input[disabled], select[disabled], textarea[disabled] { opacity: .55; cursor: not-allowed; }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; accent-color: var(--action); margin: 0; flex: none; }
label { display: block; margin-bottom: var(--s1); font-weight: 600; }
label.btn { margin-bottom: 0; }
label.inline { display: inline-flex; align-items: center; gap: var(--s2); margin: 0; font-weight: 400; min-height: var(--tap); }
.field { margin-bottom: var(--s4); min-width: 0; }
.field > .label { display: block; margin-bottom: var(--s1); font-weight: 600; }
/* Своя кнопка выбора файлов: поле скрыто, фокус виден на кнопке. */
.file-pick { align-items: center; gap: var(--s2) var(--s3); }
.file-pick label.btn:focus-within { box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 35%, transparent); }
.field small { display: block; margin-top: var(--s1); color: var(--muted); }
.form-grid { display: flex; flex-wrap: wrap; gap: 0 var(--s4); align-items: flex-end; }
.form-grid > .field { flex: 1 1 180px; }
.form-grid > .field-wide { flex-basis: 100%; }
.form-grid > label.inline { margin-bottom: var(--s4); }
.form-stack > * { margin-bottom: var(--s4); }
.field-actions { flex: 0 1 auto !important; max-width: 100%; display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }
.w-full { max-width: none !important; }
.w-auto { width: auto !important; }
.w-num { width: 160px !important; }
.w-pct { width: 110px !important; }
.w-date { width: 190px !important; }
.input-icon { position: relative; max-width: 420px; }
.input-icon .icon { position: absolute; left: var(--s3); top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon input { padding-left: 40px; max-width: none; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius-small); padding: var(--s3) var(--s4); margin: 0 0 var(--s4); min-width: 0; }
legend { font-weight: 600; padding: 0 var(--s1); }
details summary { cursor: pointer; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius-small); overflow: hidden; }
.seg a { min-height: var(--tap); min-width: var(--tap); display: inline-grid; place-items: center; padding: 0 var(--s3); color: var(--ink); text-decoration: none; font-weight: 600; font-size: .875rem; }
.seg a + a { border-left: 1px solid var(--line-strong); }
.seg a[aria-current] { background: var(--action); color: var(--action-ink); }

/* ---------- выноски, метки ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s5); margin-bottom: var(--s4); min-width: 0; }
.panel > :last-child { margin-bottom: 0; }
.panel-info, .panel-warn, .panel-ok, .panel-err, .note {
  display: block; border: 1px solid var(--line); border-left-width: 4px; border-radius: var(--radius-small);
  padding: var(--s3) var(--s4); margin: 0 0 var(--s4); background: var(--surface); color: var(--ink); max-width: 80ch;
}
.panel-info > :last-child, .panel-warn > :last-child, .panel-ok > :last-child, .panel-err > :last-child { margin-bottom: 0; }
.panel-info { border-color: var(--info); background: var(--info-bg); }
.panel-warn, .note-warn { border-color: var(--warn); background: var(--warn-bg); }
.panel-ok { border-color: var(--ok); background: var(--ok-bg); }
.panel-err, .note-err { border-color: var(--err); background: var(--err-bg); }
.note { display: flex; gap: var(--s2); align-items: flex-start; }
.note > .icon { margin-top: .125em; }
.note-err > .icon { color: var(--err); }
.panel-ok.note > .icon { color: var(--ok); }
.tag { display: inline-flex; align-items: center; gap: var(--s1); padding: 1px var(--s2); border-radius: var(--radius-small); font-size: .875rem; font-weight: 600; border: 1px solid currentColor; line-height: 1.5; white-space: nowrap; }
.tag-ok { color: var(--ok); }
.tag-warn { color: var(--warn); }
.tag-err { color: var(--err); }
.tag-info { color: var(--info); }
.tag-muted { color: var(--muted); }
.tag-unit { color: var(--ink); border-color: var(--line-strong); background: var(--surface-2); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 600; }
.tags { gap: var(--s1) var(--s2); margin-bottom: var(--s3); }
/* Состав комбо — список ссылок, а не метки: длинные названия переносятся, каждая строка нажимается целиком. */
.combo-parts { list-style: none; padding: 0; margin: 0 0 var(--s4); }
.combo-parts a { display: flex; align-items: center; gap: var(--s2); min-height: var(--tap); color: var(--ink); overflow-wrap: anywhere; }
.combo-parts .icon { color: var(--ok); flex: none; }
.badge { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: var(--radius-small); font-size: .75rem; font-weight: 700; background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); margin-left: var(--s1); }
.empty-hint { padding: var(--s5) 0; color: var(--muted); }
.skeleton { display: block; min-height: 1em; border-radius: var(--radius-small); background: linear-gradient(90deg, var(--surface-2) 25%, var(--line) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.2s ease-in-out infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- списки, таблицы, история ---------- */
.list { list-style: none; padding: 0; margin: 0 0 var(--s4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.list > li { padding: var(--s3) var(--s4); border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); align-items: center; min-height: 56px; }
.list > li:first-child { border-top: 0; }
.list .grow { flex: 1; min-width: 200px; }
table { border-collapse: collapse; width: 100%; background: var(--surface); font-size: .9375rem; }
th, td { text-align: left; padding: var(--s2) var(--s3); border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; color: var(--muted); font-size: .875rem; }
.table-cards { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: var(--s4); }
@media (max-width: 720px) {
  .table-cards, .table-cards tbody, .table-cards tr, .table-cards td { display: block; width: 100%; }
  .table-cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table-cards tr { border-bottom: 1px solid var(--line); padding: var(--s2) 0; }
  .table-cards tr:last-child { border-bottom: 0; }
  .table-cards td { border: 0; padding: var(--s1) var(--s4); display: grid; grid-template-columns: minmax(96px, 35%) 1fr; gap: var(--s3); justify-items: start; }
  .table-cards td::before { content: attr(data-label); color: var(--muted); font-size: .875rem; font-weight: 600; }
  .table-cards td:not([data-label])::before, .table-cards td[data-label=""]::before { content: none; }
  .table-cards td:not([data-label]), .table-cards td[data-label=""] { grid-template-columns: 1fr; }
}
.timeline, .history { list-style: none; padding: 0; margin: 0 0 var(--s4); color: var(--muted); font-size: .9375rem; }
.timeline > li { position: relative; padding: 0 0 var(--s3) var(--s5); border-left: 2px solid var(--line); margin-left: 6px; }
.timeline > li::before { content: ""; position: absolute; left: -7px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-strong); }
.timeline > li:last-child { border-left-color: transparent; }
.timeline > li > .num:first-child, .timeline > li > time:first-child { color: var(--ink); margin-right: var(--s2); }
.timeline > li.is-current::before { border-color: var(--action); background: var(--action); }
.checklist { list-style: none; padding: 0; margin: 0 0 var(--s4); }
.checklist li { display: flex; gap: var(--s2); align-items: center; padding: var(--s2) 0; border-bottom: 1px solid var(--line); }
.checklist li.done .icon { color: var(--ok); }
.checklist li.todo .icon { color: var(--warn); }

/* ---------- переписка ---------- */
.chat { display: flex; flex-direction: column; gap: var(--s3); margin: 0 0 var(--s4); padding: 0; list-style: none; }
.msg { max-width: min(78%, 640px); padding: var(--s3) var(--s4); border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); overflow-wrap: anywhere; }
.msg > :last-child { margin-bottom: 0; }
.msg-meta { display: flex; flex-wrap: wrap; gap: var(--s2); font-size: .875rem; color: var(--muted); margin-bottom: var(--s1); }
.msg-own { align-self: flex-end; background: var(--info-bg); border-color: color-mix(in srgb, var(--info) 45%, var(--line)); border-bottom-right-radius: var(--s1); }
.msg-other { align-self: flex-start; border-bottom-left-radius: var(--s1); }
.msg-system { align-self: center; max-width: 100%; background: none; border-style: dashed; color: var(--muted); font-size: .9375rem; text-align: center; }
.msg-private { align-self: stretch; max-width: 100%; background: var(--warn-bg); border-color: var(--warn); border-left-width: 4px; }
.msg img { max-height: 320px; border-radius: var(--radius-small); margin-top: var(--s2); }
@media (max-width: 520px) { .msg { max-width: 92%; } }

/* ---------- шаги ---------- */
ol.steps { padding-left: 1.5em; max-width: 72ch; }
ol.steps li { margin-bottom: var(--s2); padding-left: var(--s1); }
ol.steps li.step-done { color: var(--muted); }
ol.steps li.step-current, .step-current { font-weight: 650; color: var(--ink); }
ol.steps li.step-current::marker { color: var(--action); }
.track { list-style: none; padding: 0; margin: 0 0 var(--s5); display: grid; grid-template-columns: repeat(5, 1fr); counter-reset: s; }
.track li { counter-increment: s; position: relative; padding-top: 34px; font-size: .875rem; color: var(--muted); text-align: center; }
.track li::before {
  content: counter(s); position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface); border: 2px solid var(--line-strong); color: var(--muted); font-weight: 700; z-index: 1;
}
.track li::after { content: ""; position: absolute; top: 12px; left: -50%; width: 100%; height: 2px; background: var(--line); }
.track li:first-child::after { display: none; }
.track li.done { color: var(--ink); }
.track li.done::before { content: "✓"; background: var(--ok); border-color: var(--ok); color: var(--surface); }
.track li.done::after, .track li.now::after { background: var(--ok); }
.track li.now { color: var(--ink); font-weight: 650; }
.track li.now::before { border-color: var(--action); color: var(--action); }
.track li.stop::before { content: "!"; border-color: var(--err); color: var(--err); }
@media (max-width: 520px) { .track li { font-size: .875rem; } }

/* ---------- медиа ---------- */
figure { margin: 0; }
figcaption { color: var(--muted); font-size: .875rem; margin-top: var(--s2); }
.media { aspect-ratio: 16 / 9; background: var(--media-bg); border-radius: var(--radius); overflow: hidden; display: grid; place-items: center; color: var(--muted); font-size: .875rem; margin: 0; }
.media img, .media video { width: 100%; height: 100%; object-fit: cover; }
.media-empty { border: 1px dashed var(--line-strong); background: var(--surface); text-align: center; padding: var(--s2); }
.panel .media, .panel figure { max-width: 560px; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: var(--s2); margin-top: var(--s2); }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: var(--s4); margin-bottom: var(--s4); }
.media-card { margin: 0; min-width: 0; }
.media-card .hint, .media-card .muted { margin: var(--s2) 0; font-size: .875rem; }
.media-card h3, .media-card h4 { margin-top: 0; }
.help-media { max-width: 640px; margin: var(--s4) 0; }

/* ---------- каталог ---------- */
.page-head { display: flex; flex-wrap: wrap; gap: var(--s3) var(--s5); align-items: flex-end; justify-content: space-between; margin-bottom: var(--s4); }
.page-head h1 { margin-bottom: var(--s2); }
.page-head .lead { margin-bottom: 0; }
.add-product { flex-wrap: nowrap; }
.tabs, .subnav { display: flex; flex-wrap: wrap; gap: 0 var(--s1); margin: 0 0 var(--s5); border-bottom: 1px solid var(--line); }
.tabs a, .subnav a { color: var(--muted); text-decoration: none; min-height: var(--tap); padding: 0 var(--s3); display: inline-flex; align-items: center; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover, .subnav a:hover { color: var(--ink); }
.tabs a[aria-current], .subnav a[aria-current] { color: var(--ink); font-weight: 650; border-bottom-color: var(--action); }
.catalog-filter { display: grid; grid-template-columns: minmax(200px, 2fr) repeat(4, minmax(140px, 1fr)) auto; gap: 0 var(--s3); align-items: end; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s4) var(--s4) 0; margin: 0 0 var(--s2); }
.catalog-filter .field { margin-bottom: var(--s4); }
.catalog-filter input, .catalog-filter select, .catalog-filter .input-icon { max-width: none; }
.catalog-filter .field-actions { margin-bottom: var(--s4); }
@media (max-width: 1080px) { .catalog-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); } .catalog-filter .field-search { grid-column: 1 / -1; } }
@media (max-width: 480px) { .catalog-filter { grid-template-columns: 1fr; } }
.catalog { display: grid; gap: var(--s4); margin-top: var(--s5); }
.mod { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: var(--s5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s5); transition: border-color var(--ease); }
.mod:hover { border-color: var(--line-strong); }
.mod.no-cover { grid-template-columns: 1fr; }
.mod h2 { margin-top: 0; }
.mod h2 a { color: var(--ink); text-decoration: none; }
.mod h2 a:hover { color: var(--ink); text-decoration: underline; }
.mod > a { color: inherit; text-decoration: none; }
.mod-body { min-width: 0; display: flex; flex-direction: column; }
/* Машины и корзина: строки «название — метка — действие», выбор машины в каталоге. */
.car-list { display: flex; flex-direction: column; gap: var(--s3); }
.car-row { display: flex; flex-wrap: wrap; gap: var(--s3) var(--s4); align-items: center; margin: 0; }
.car-body { flex: 999 1 280px; min-width: 0; display: flex; flex-direction: column; gap: var(--s1); }
.car-body h2 { margin: 0; }
.car-body h2 a { color: var(--ink); text-decoration: none; }
.car-body .tags { margin: var(--s1) 0 0; }
.car-page { display: flex; flex-direction: column; gap: var(--s2); }
.car-page .back-link { min-height: var(--tap); display: inline-flex; align-items: center; align-self: start; }
.car-page .page-head h1 { margin-bottom: var(--s1); }
.car-page .panel h2 { margin-top: 0; }
.car-page .panel-head { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); align-items: center; justify-content: space-between; }
.car-page .panel-head h2 { margin: 0; }
.cart-sum .row { flex-wrap: nowrap; }
.cart-sum .row input { flex: 1 1 auto; min-width: 0; }
.pay-form { display: flex; flex-direction: column; gap: var(--s2); }
.car-item { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); align-items: center; padding: var(--s3) 0; border-top: 1px solid var(--line); }
.car-item:first-of-type, .panel-head + .car-item { border-top: 0; }
.car-item .grow { flex: 999 1 260px; min-width: 0; display: flex; flex-direction: column; }
.car-item form { margin: 0; }
.warn-text { color: var(--warn); }
.car-actions form { margin: 0; }
@media (max-width: 480px) { .car-actions, .car-actions form { width: 100%; } .car-actions .btn { width: 100%; } }
.car-manage { gap: 0 var(--s3); margin-left: calc(-1 * var(--s1)); }
.car-manage form { margin: 0; }
.rename summary { list-style: none; }
.rename summary::-webkit-details-marker { display: none; }
.car-select { margin: 0; min-width: min(300px, 100%); }
.car-banner { display: flex; flex-wrap: wrap; gap: var(--s3) var(--s5); align-items: center; justify-content: space-between; }
.mod-tag { align-self: flex-start; margin-bottom: var(--s2); }
.cart { display: flex; flex-wrap: wrap; gap: var(--s5); align-items: flex-start; }
.cart-items { flex: 999 1 520px; min-width: 0; margin: 0; padding-block: var(--s2); }
.cart-sum { flex: 1 1 300px; margin: 0; display: flex; flex-direction: column; gap: var(--s4); }
.cart-sum form, .cart-sum p { margin: 0; }
.cart-total { display: flex; justify-content: space-between; gap: var(--s4); font-size: 1.375rem; font-weight: 650; }
/* Скидка строки — под ценой; сумма скидок — над «Итого». На телефоне цена слева, «Убрать» справа. */
.cart-price { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.cart-save { color: var(--ok); font-size: .875rem; }
.cart-discount { display: flex; justify-content: space-between; gap: var(--s4); color: var(--ok); }
.cart-items .car-item > form { margin-left: auto; }
@media (max-width: 720px) { .cart-price { align-items: flex-start; } }
.bundle-form fieldset label.inline { display: flex; }
/* Заказы покупателя: группы «Ждут оплаты» и «Завершённые», строка — одна ссылка на заказ. */
.orders-group { margin: 0 0 var(--s2); font-size: 1rem; font-weight: 650; color: var(--muted); }
.panel.order-list { list-style: none; padding: 0; margin-bottom: var(--s5); }
.order-list li + li { border-top: 1px solid var(--line); }
.order-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: var(--s1) var(--s4); padding: var(--s4) var(--s5); color: var(--ink); text-decoration: none; min-height: var(--tap); }
.order-row:hover { background: var(--surface-2); color: var(--ink); }
.order-row .who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.order-row .who strong { font-size: 1.0625rem; }
.order-row .mods { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-row .meta { color: var(--muted); font-size: .875rem; }
.order-row .side { display: flex; flex-direction: column; align-items: flex-end; gap: var(--s1); }
.order-row .sum { font-weight: 650; font-size: 1.0625rem; }
.order-row .chev { color: var(--muted); display: inline-flex; }
.order-row .refunded { color: var(--muted); font-size: .875rem; }
/* Телефон: сумма и метка строкой под названием, чтобы длинная метка не сжимала название в узкую колонку. */
@media (max-width: 720px) { .order-row { grid-template-columns: minmax(0, 1fr); padding: var(--s3) var(--s4); } .order-row .chev { display: none; } .order-row .mods { white-space: normal; } .order-row .side { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: var(--s2) var(--s3); } }
/* Страница заказа: заголовок, блок состояния с главным действием, моды и итог. */
.placed-head h1 { margin-bottom: var(--s2); }
.placed-head .row { color: var(--muted); margin: 0 0 var(--s4); }
.order-state { display: flex; flex-wrap: wrap; gap: var(--s4) var(--s6); align-items: center; padding: var(--s5); margin-bottom: var(--s5); background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--warn); border-radius: var(--radius); }
.order-state-ok { border-left-color: var(--ok); }
.order-state-off { border-left-color: var(--line-strong); }
.order-state .txt { flex: 1 1 340px; min-width: 0; }
.order-state h2 { margin: 0 0 var(--s1); display: flex; gap: var(--s2); align-items: center; }
.order-state h2 .icon { color: var(--warn); }
.order-state-ok h2 .icon { color: var(--ok); }
.order-state-off h2 .icon { color: var(--muted); }
.order-state .txt p { margin: 0; }
.order-state .act { flex: 0 1 300px; display: flex; flex-direction: column; gap: var(--s2); }
.order-state .act form { margin: 0; }
.order-state .act .btn { width: 100%; }
.order-state .act .muted { font-size: .875rem; margin: 0; }
.panel.lines { padding: var(--s2) var(--s5); margin: 0; }
.line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s1) var(--s4); align-items: baseline; padding: var(--s3) 0; border-top: 1px solid var(--line); }
.line:first-child { border-top: 0; }
.line .sub { grid-column: 1; color: var(--muted); font-size: .875rem; }
.line .sub a { display: inline-flex; align-items: center; min-height: 32px; }
.line .num { grid-row: 1; grid-column: 2; }
.line .old { color: var(--muted); text-decoration: line-through; margin-right: var(--s2); }
.receipt { margin-bottom: var(--s3); }
.receipt-total { font-size: 1.375rem; font-weight: 650; border-top-color: var(--line-strong); }
.order-cancel { margin: 0; }
.order-cancel .btn-link { padding: 0; color: var(--err); }
.order-cancel .btn-link:hover { color: var(--err); }
@media (max-width: 720px) { .panel.lines { padding: var(--s1) var(--s4); } .order-state { padding: var(--s4); } }
.checkout-line { display: flex; justify-content: space-between; gap: var(--s4); }
.back-link { min-height: var(--tap); display: inline-flex; align-items: center; }
.cart-items .old { color: var(--muted); text-decoration: line-through; margin-right: var(--s2); }

.mod-foot { margin-top: auto; display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; justify-content: space-between; }
.mod-foot .price { margin: 0; }
.mod .price { font-size: 1.25rem; font-weight: 650; display: flex; gap: var(--s2); align-items: baseline; flex-wrap: wrap; }
@media (max-width: 720px) { .mod { grid-template-columns: 1fr; padding: var(--s4); gap: var(--s4); } }

/* ---------- страница товара ---------- */
.product { display: grid; grid-template-columns: minmax(0, 3fr) minmax(260px, 2fr); grid-template-areas: "media buy" "info buy"; gap: 0 var(--s6); align-items: start; }
.product-media { grid-area: media; min-width: 0; }
.gallery-stage { touch-action: pan-y; border-radius: var(--radius); }
.gallery-stage [hidden] { display: none; }
.gallery-controls { display: flex; gap: var(--s2); align-items: center; margin-top: var(--s2); flex-wrap: wrap; }
.gallery-controls[hidden], .gallery-controls [hidden], .gallery-thumbnails[hidden] { display: none; }
.gallery-open { margin-left: auto; }
.gallery-thumbnails { display: flex; gap: var(--s2); overflow-x: auto; padding: var(--s2) 2px; margin-top: var(--s1); }
.gallery-thumbnail { position: relative; padding: 0; flex: 0 0 88px; height: 56px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-small); background: var(--surface); color: var(--ink); cursor: pointer; }
.gallery-thumbnail img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-thumbnail[aria-pressed="true"] { border-color: var(--action); outline: 2px solid var(--action); outline-offset: 1px; }
.gallery-video-badge { position: absolute; right: 2px; bottom: 2px; padding: 2px; background: var(--surface); border-radius: 3px; line-height: 0; }
.product-info { grid-area: info; min-width: 0; margin-top: var(--s4); }
.buy { grid-area: buy; position: sticky; top: var(--s4); }
.buy .price { font-size: 1.75rem; font-weight: 700; margin-bottom: var(--s1); }
.buy input { max-width: none; }
.old { text-decoration: line-through; color: var(--muted); font-weight: 400; font-size: 1rem; margin-right: var(--s2); }
@media (max-width: 860px) {
  .product { grid-template-columns: 1fr; grid-template-areas: "media" "buy" "info"; }
  .buy { position: static; margin-top: var(--s4); }
}
.preview-banner { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s3); align-items: center; max-width: none; }
.preview-banner p { margin: 0; flex: 1 1 260px; }

/* Панель владельца: состояние, разделы рабочего места; на телефоне прокручивается по горизонтали внутри себя. */
.owner-bar { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); align-items: center; justify-content: space-between; padding: var(--s2) var(--s3); margin: 0 0 var(--s4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.owner-bar-state { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.owner-label { display: inline-flex; gap: var(--s2); align-items: center; font-weight: 650; color: var(--muted); font-size: .875rem; }
.owner-bar-links { display: flex; gap: var(--s1); overflow-x: auto; max-width: 100%; scrollbar-width: thin; }
.owner-link { display: inline-flex; align-items: center; gap: var(--s2); min-height: var(--tap); padding: 0 var(--s3); border-radius: var(--radius-small); color: var(--ink); text-decoration: none; white-space: nowrap; transition: background-color var(--ease); }
.owner-link:hover { background: var(--surface-2); color: var(--ink); }
.owner-link[aria-current] { background: none; color: var(--ink); font-weight: 600; box-shadow: inset 0 -2px 0 var(--action); }
/* Телефон: разделы товара сеткой 4 в ряд, у каждой иконки подпись (раньше подпись была только у текущей). */
@media (max-width: 720px) {
  .owner-bar-links { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; width: 100%; overflow: visible; }
  .owner-link { flex-direction: column; justify-content: center; gap: 2px; min-height: 56px; padding: var(--s1) 2px; font-size: .8125rem; line-height: 1.2; white-space: normal; text-align: center; }
  .owner-link span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
.workspace { margin-bottom: var(--s6); }
@media (max-width: 720px) { .panel { padding: var(--s4); } .workspace.panel { padding: var(--s3); } .variant.panel { padding: var(--s3); } }
.ws-description h1 { font-size: clamp(1.35rem, 2.4vw, 1.75rem); }
.ws-description .editor { max-width: 960px; }
.workspace > h2:first-child { margin-top: 0; display: flex; gap: var(--s2); align-items: center; }
.section-head { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); align-items: center; justify-content: space-between; margin-bottom: var(--s3); }
.section-head h1, .section-head h2, .section-head h3 { margin: 0; }
.actions-bar { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; margin: var(--s4) 0; }
.actions-bar form { margin: 0; }
.disclosure { border: 1px solid var(--line); border-radius: var(--radius-small); margin: var(--s3) 0; background: var(--surface); }
.disclosure > summary { min-height: var(--tap); padding: var(--s2) var(--s4); display: flex; align-items: center; gap: var(--s2); font-weight: 600; list-style: none; }
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform var(--ease); }
.disclosure[open] > summary::after { transform: rotate(-135deg); }
.disclosure > :not(summary) { margin-left: var(--s4); margin-right: var(--s4); }
.disclosure > :last-child { margin-bottom: var(--s4); }
.variant { background: var(--bg); }
.variant h3 { margin: 0; }
.variant h4 { margin-top: var(--s4); }
.clamp { display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }
.unit-picker .unit-row { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s3); align-items: center; padding: var(--s1) 0; }
.unit-picker .unit-row label.inline { flex: 0 0 auto; min-width: 200px; }
.unit-picker .unit-row input:not([type=checkbox]) { flex: 1 1 220px; }
.owner-section { margin-top: var(--s6); }
.ref-section { margin-bottom: var(--s6); scroll-margin-top: var(--s4); }
.ref-item > summary { min-height: var(--tap); display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.ref-item[open] > summary { margin-bottom: var(--s3); }
.list > li > .ref-item { flex: 1; min-width: 0; }

/* ---------- редактор ---------- */
.editor { border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); margin-bottom: var(--s4); position: relative; }
.editor:focus-within { border-color: var(--focus); }
.editor-toolbar { position: sticky; top: var(--sticky-top); z-index: 3; display: flex; flex-wrap: wrap; gap: var(--s1) var(--s2); align-items: center; padding: var(--s2); border-bottom: 1px solid var(--line); background: var(--surface); border-radius: var(--radius) var(--radius) 0 0; }
.tool-group { display: flex; gap: 2px; padding-right: var(--s2); border-right: 1px solid var(--line); }
.tool-group:last-of-type { border-right: 0; }
.tool { width: var(--tap); height: var(--tap); display: inline-grid; place-items: center; padding: 0; border: 1px solid transparent; border-radius: var(--radius-small); background: none; color: var(--ink); cursor: pointer; transition: background-color var(--ease), border-color var(--ease); }
.tool:hover { background: var(--surface-2); }
.tool[aria-pressed="true"] { background: var(--surface-2); border-color: var(--line-strong); color: var(--ink); }
.tool[disabled] { opacity: .35; cursor: not-allowed; }
.tool .icon { width: 20px; height: 20px; }
.editor-status { margin-left: auto; font-size: .875rem; color: var(--muted); padding: 0 var(--s2); display: inline-flex; align-items: center; gap: var(--s1); min-height: var(--tap); }
.editor-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.editor-status[data-state="dirty"]::before { background: var(--warn); }
.editor-status[data-state="saving"]::before { background: var(--info); }
.editor-status[data-state="error"] { color: var(--err); }
.editor-status[data-state="error"]::before { background: var(--err); }
.editor-canvas { min-height: 320px; padding: var(--s5); outline: none; cursor: text; }
.editor-canvas:focus-visible { outline: none; }
/* TipTap (wwwroot/lib/tiptap): базовые правила ProseMirror вместо встроенного стиля библиотеки (его не пускает CSP). */
.editor-prose { outline: none; white-space: pre-wrap; word-wrap: break-word; min-height: 280px; }
.editor-prose:focus-visible { outline: none; }
.editor-prose [contenteditable="false"] { white-space: normal; }
.editor-prose .is-empty::before { content: attr(data-placeholder); color: var(--muted); pointer-events: none; float: left; height: 0; }
.editor-prose .selectedCell { outline: 2px solid var(--info); outline-offset: -2px; }
.editor-prose .ProseMirror-selectednode { outline: 2px solid var(--focus); }
.editor-prose .ProseMirror-gapcursor { display: none; pointer-events: none; position: absolute; }
.editor-prose .ProseMirror-gapcursor::after { content: ""; display: block; position: absolute; top: -2px; width: 20px; border-top: 1px solid var(--ink); }
.editor-prose.ProseMirror-focused .ProseMirror-gapcursor { display: block; }
.editor-prose .tableWrapper { overflow-x: auto; }
/* Раскрывающийся блок в редакторе всегда открыт; в FAQ это карточка «вопрос и ответ». */
.ed-details { border: 1px dashed var(--line-strong); padding: var(--s2) var(--s3) var(--s3); margin: var(--s3) 0; }
.ed-details-bar { display: flex; align-items: center; gap: var(--s1); user-select: none; }
.ed-details-label { font: 500 .75rem/1.4 var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-right: auto; }
.ed-details-btn { min-width: 32px; min-height: 32px; }
.ed-summary { font-weight: 600; padding: var(--s1) 0; border-bottom: 1px solid var(--line); margin-bottom: var(--s2); }
.editor-prose.is-faq > .ed-details { border-style: solid; border-color: var(--line); }
.editor-prose.is-faq > .ed-details:focus-within { border-color: var(--focus); }
.editor-add-question { margin: 0 var(--s5) var(--s5); }
.editor-media { width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 64px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); padding: var(--s4); box-shadow: var(--shadow); }
.editor-media::backdrop { background: rgb(0 0 0 / .5); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); margin-bottom: var(--s3); }
.dialog-head h2 { margin: 0; }
.upload-button { position: relative; cursor: pointer; margin-bottom: var(--s2); }
.editor-media-library { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--s3); margin-top: var(--s3); }
.editor-media-item { display: flex; flex-direction: column; gap: var(--s2); padding: var(--s2); background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-small); color: var(--ink); cursor: pointer; font: inherit; font-size: .875rem; text-align: left; transition: border-color var(--ease); }
.editor-media-item:hover { border-color: var(--line-strong); }
.editor-media-item img, .editor-media-item video { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius-small); }
.editor-form .actions-bar { position: sticky; bottom: var(--sticky-bottom); z-index: 2; background: var(--bg); padding: var(--s3) 0; margin: 0; border-top: 1px solid var(--line); }
@media (max-width: 720px) {
  .editor-canvas { padding: var(--s4); min-height: 240px; }
  .tool-group { border-right: 0; padding-right: 0; }
  .editor-status { flex-basis: 100%; margin-left: 0; min-height: 28px; }
}

/* ---------- содержимое редактора: товар, FAQ, инструкции ---------- */
.rich-content { overflow-wrap: anywhere; max-width: 80ch; }
.rich-content > :first-child { margin-top: 0; }
.rich-content > :last-child { margin-bottom: 0; }
.rich-content h2 { margin-top: var(--s6); }
.rich-content h3 { margin-top: var(--s5); }
.rich-content ul, .rich-content ol { margin: 0 0 var(--s4); }
.rich-content li { margin-bottom: var(--s1); }
.rich-content li > p, .rich-content th > p, .rich-content td > p { margin: 0; }
.rich-content blockquote { margin: 0 0 var(--s4); padding: var(--s1) var(--s4); border-left: 4px solid var(--line-strong); color: var(--muted); }
.rich-content img, .rich-content video { max-width: 100%; height: auto; border-radius: var(--radius-small); }
.rich-content figure { margin: var(--s5) 0; }
.rich-content table { display: block; max-width: 100%; overflow-x: auto; margin: 0 0 var(--s4); border: 1px solid var(--line); border-radius: var(--radius-small); }
.rich-content th, .rich-content td { border: 1px solid var(--line); padding: var(--s2) var(--s3); min-width: 80px; }
.rich-content th { background: var(--surface-2); color: var(--ink); }
.rich-content pre { max-width: 100%; overflow-x: auto; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-small); padding: var(--s3) var(--s4); margin: 0 0 var(--s4); white-space: pre; }
.rich-content code { background: var(--surface-2); border-radius: 4px; padding: 1px 4px; }
.rich-content pre code { background: none; padding: 0; }
.rich-content details { border: 1px solid var(--line); border-radius: var(--radius-small); margin: 0 0 var(--s3); background: var(--surface); }
.rich-content details > summary { min-height: var(--tap); padding: var(--s2) var(--s4); display: flex; align-items: center; gap: var(--s2); font-weight: 600; list-style: none; }
.rich-content details > summary::-webkit-details-marker { display: none; }
.rich-content details > summary::before { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform var(--ease); flex: none; }
.rich-content details[open] > summary::before { transform: rotate(45deg); }
.rich-content details > :not(summary) { margin-left: var(--s4); margin-right: var(--s4); }
.rich-content details > :last-child { margin-bottom: var(--s3); }
.rich-content hr { margin: var(--s5) 0; }
.rich-content .panel-info, .rich-content .panel-warn, .rich-content .panel-ok, .rich-content .panel-err { max-width: none; }
.content-page { max-width: 80ch; }

/* ---------- прежние страницы (заказы, вход, оферта, админка) ---------- */
.legal-document { max-width: 72ch; }
.legal-document li { margin-bottom: .75em; }
.offer-consent label { display: flex; align-items: flex-start; gap: 10px; font-weight: 400; }
.offer-consent input[type=checkbox] { flex: none; margin-top: .2em; }
.qr { width: 220px; margin: 0 0 var(--s3); border-radius: var(--radius-small); overflow: hidden; background: #fff; }
.qr svg { display: block; width: 100%; height: auto; }
.secret { word-spacing: 4px; user-select: all; }
.external-login-form { display: inline-block; margin: 0 var(--s2) var(--s5) 0; }
.profile-signout { margin-top: var(--s6); }
.readiness-list { padding: 0; list-style: none; max-width: 680px; }
.readiness-list li { display: flex; justify-content: space-between; gap: var(--s4); padding: var(--s4) 0; border-bottom: 1px solid var(--line); }
.compatibility-table { margin: var(--s5) 0; }
.compatibility-table td { overflow-wrap: anywhere; }
.admin-shell { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: var(--s6); align-items: start; }
.admin-sidebar { position: sticky; top: var(--s5); }
.admin-navigation > summary { font-weight: 650; margin-bottom: var(--s4); min-height: var(--tap); display: flex; align-items: center; }
.admin-nav { display: flex; flex-direction: column; gap: 2px; }
.admin-nav a { display: flex; align-items: center; gap: var(--s2); min-height: var(--tap); padding: 0 var(--s3); text-decoration: none; color: var(--muted); border-radius: var(--radius-small); }
.admin-nav a:hover { color: var(--ink); background: var(--surface); }
.admin-nav a[aria-current] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: inset 2px 0 0 var(--action); }
.nav-group { font-size: .875rem; color: var(--muted); margin: var(--s5) var(--s3) var(--s1); }
.admin-nav .nav-group:first-child { margin-top: 0; }
.admin-here { display: none; }
.admin-workspace { min-width: 0; }
.admin-workspace > h1 { margin-top: 0; }
.admin-workspace .narrow { max-width: 560px; }
@media (max-width: 900px) {
  .admin-shell { grid-template-columns: 1fr; gap: var(--s5); }
  .admin-sidebar { position: static; }
  .admin-navigation { border-bottom: 1px solid var(--line); padding-bottom: var(--s3); }
  /* На телефоне разделы свёрнуты: в заголовке текущий раздел и стрелка, раскрытый список — в две колонки. */
  .admin-navigation > summary { margin: 0; gap: var(--s2); list-style: none; }
  .admin-navigation > summary::-webkit-details-marker { display: none; }
  .admin-navigation > summary::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform var(--ease); }
  .admin-navigation[open] > summary::after { transform: rotate(-135deg); }
  .admin-here { display: inline; color: var(--ink); font-weight: 600; }
  .admin-here::before { content: "·"; color: var(--muted); margin-right: var(--s2); }
  .admin-nav { padding-top: var(--s3); display: grid; grid-template-columns: 1fr 1fr; gap: 2px var(--s2); }
}

@media print {
  .top, .foot, .owner-bar, .legal-document button { display: none; }
  :root { --bg: white; --surface: white; --ink: black; --muted: #333; --action: black; color-scheme: light; }
  .legal-document { max-width: none; }
  .legal-document h2 { break-after: avoid; }
}

/* Галерея товара: фото открываются на весь экран, листание кнопками, клавишами и свайпом. */
[data-gallery] .media img { cursor: zoom-in; }
.lightbox { position: fixed; inset: 0; z-index: 1000; background: rgba(0, 0, 0, .92); display: grid; grid-template-columns: auto 1fr auto; align-items: center; touch-action: pan-y; }
.lightbox[hidden] { display: none; }
.lightbox:not([open]) { display: none; }
dialog.lightbox { width: 100%; height: 100dvh; max-width: none; max-height: none; padding: 0; border: 0; margin: 0; }
dialog.lightbox::backdrop { background: rgba(0, 0, 0, .92); }
.lightbox button svg { width: 24px; height: 24px; }
.lightbox figure { grid-column: 2; margin: 0; display: grid; place-items: center; gap: var(--s2); min-width: 0; height: 100vh; padding: var(--s4) 0; box-sizing: border-box; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 6rem); object-fit: contain; user-select: none; }
.lightbox figcaption { color: #e8e8e8; text-align: center; font-size: .95rem; padding: 0 var(--s3); }
.lightbox button { background: rgba(255, 255, 255, .12); color: #fff; border: 0; border-radius: var(--radius-small); width: 2.75rem; height: 2.75rem; font-size: 1.75rem; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.lightbox button:hover, .lightbox button:focus-visible { background: rgba(255, 255, 255, .28); outline: none; }
.lightbox .lb-prev, .lightbox .lb-next { margin: 0 var(--s3); }
.lightbox .lb-close { position: absolute; top: var(--s3); right: var(--s3); }
.lightbox .lb-counter { position: absolute; top: var(--s3); left: var(--s3); color: #ccc; font-size: .875rem; padding: .25rem .5rem; }
.lightbox[data-single] .lb-prev, .lightbox[data-single] .lb-next, .lightbox[data-single] .lb-counter { visibility: hidden; }
@media (max-width: 720px) {
  .lightbox { grid-template-columns: 1fr; }
  .lightbox figure { grid-column: 1; }
  .lightbox .lb-prev, .lightbox .lb-next { position: absolute; top: 50%; transform: translateY(-50%); }
  .lightbox .lb-prev { left: var(--s2); }
  .lightbox .lb-next { right: var(--s2); }
}

/* Вход: одна форма, привычная иерархия и общая поверхность для способов входа. */
.auth-shell { width: min(100%, 440px); margin: clamp(24px, 7vh, 80px) auto; }
.auth-card { padding: var(--s6); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.auth-heading { margin-bottom: var(--s6); }
.auth-heading h1 { margin: 0 0 var(--s2); font-size: 1.875rem; line-height: 1.2; }
.auth-heading p { margin: 0; }
.auth-contact .field { margin-bottom: var(--s5); }
.auth-contact small { display: block; margin-top: var(--s2); font-size: .875rem; }
.auth-divider { display: flex; gap: var(--s4); align-items: center; margin: var(--s5) 0; color: var(--muted); font-size: .875rem; }
.auth-divider::before, .auth-divider::after { content: ""; height: 1px; background: var(--line); flex: 1; }
.auth-providers { display: grid; gap: var(--s3); }
.auth-providers form { margin: 0; }
.auth-providers .btn { gap: var(--s3); }
.auth-letter { font-weight: 700; font-size: 1.25rem; line-height: 1; }
/* Запасной вход ссылкой: отступ от кнопок и зона нажатия 44 px. */
.auth-alt { margin: var(--s4) 0 0; text-align: center; }
.auth-alt a { min-height: var(--tap); display: inline-flex; align-items: center; }
.auth-back { display: block; width: fit-content; margin: var(--s5) auto 0; text-underline-offset: 4px; }
.auth-merge-actions { display: grid; gap: var(--s3); margin-top: var(--s5); }
/* Вход через Telegram: всё по центру карточки; шаги — список посередине, строки слева, чтобы номера стояли ровно. */
.auth-center { text-align: center; }
.auth-center ol.steps { display: inline-block; margin: 0 auto var(--s4); text-align: left; }
.auth-center .qr { margin-left: auto; margin-right: auto; }
@media (max-width: 480px) {
  .auth-shell { margin: var(--s5) auto; }
  .auth-card { padding: var(--s5); }
}

/* Profile settings: one reading column, separated account and delivery controls. */
/* Колонка профиля от общего левого края, как у остальных страниц. */
.account-profile { max-width: 900px; margin: var(--s6) 0 var(--s7); }
.profile-heading, .profile-identity, .profile-delivery, .profile-actions { display: flex; align-items: center; gap: var(--s4); }
.profile-heading { justify-content: space-between; align-items: flex-start; margin-bottom: var(--s6); }
.profile-heading h1 { margin: 0 0 var(--s2); }
.profile-heading p, .profile-identity p, .profile-connections p, .profile-delivery p { margin: var(--s1) 0 0; overflow-wrap: anywhere; }
.profile-identity { align-items: flex-start; padding-bottom: var(--s6); border-bottom: 1px solid var(--line); }
.profile-identity strong { font-size: 1.125rem; overflow-wrap: anywhere; }
.profile-name { margin: var(--s4) 0 0; }
.profile-name input { flex: 1 1 200px; width: auto; }
.profile-avatar { display: grid; place-items: center; width: 56px; height: 56px; flex-shrink: 0; border-radius: 14px; background: var(--surface-2); color: var(--ink); font-weight: 700; }
.profile-section { margin-top: var(--s6); }
.profile-section-heading { margin-bottom: var(--s5); }
.profile-section-heading h2 { font-size: 1.25rem; margin: 0 0 var(--s2); }
.profile-section-heading p { max-width: 65ch; margin: 0; }
.profile-connections { list-style: none; padding: 0; margin: 0; }
.profile-connections li { display: flex; align-items: center; gap: var(--s4); padding: var(--s4) 0; border-bottom: 1px solid var(--line); }
.profile-connections .grow { min-width: 0; }
.profile-provider { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; background: var(--surface-2); flex-shrink: 0; }
.profile-provider svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.provider-telegram { color: var(--info); }
.provider-letter { font-size: 1.5rem; color: var(--ink); }
.profile-help { font-size: .875rem; margin: var(--s4) 0 0; max-width: 70ch; }
.profile-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); padding: 0; border: 0; margin: 0 0 var(--s5); }
.profile-choice { display: flex; align-items: flex-start; gap: var(--s3); padding: var(--s4); border: 1px solid var(--line-strong); border-radius: 12px; cursor: pointer; margin: 0; }
.profile-choice:has(input:checked) { border-color: var(--ink); background: var(--surface-2); }
.profile-choice:has(input:disabled) { cursor: default; border-color: var(--line); }
.profile-choice input { width: 18px; height: 18px; margin: 3px 0 0; flex-shrink: 0; accent-color: var(--action); }
.profile-choice small { display: block; margin-top: var(--s1); font-size: .875rem; font-weight: 400; overflow-wrap: anywhere; }
.profile-actions > span { font-size: .875rem; }
.profile-delivery { margin-top: var(--s5); padding-top: var(--s5); border-top: 1px solid var(--line); justify-content: space-between; }
.profile-delivery p { font-size: .875rem; }
.profile-delivery form { flex-shrink: 0; }
@media (max-width: 640px) {
 .account-profile { margin-top: var(--s5); }
 .profile-choices { grid-template-columns: 1fr; }
 .profile-connections li { flex-wrap: wrap; }
 .profile-connections .grow { flex-basis: calc(100% - 56px); }
 .profile-connections .tag, .profile-connections form { margin-left: 56px; }
 .profile-actions, .profile-delivery { align-items: flex-start; flex-direction: column; }
 .profile-heading { gap: var(--s3); }
 .profile-heading .btn { padding-inline: var(--s3); }
}

/* Temporary success/error feedback, shared by every page. */
.toast-stack { position: fixed; z-index: 120; top: calc(64px + var(--s3)); right: var(--s5); width: min(420px, calc(100% - 32px)); display: grid; gap: var(--s3); pointer-events: none; max-height: calc(100dvh - 48px); overflow-y: auto; }
.toast { display: grid; grid-template-columns: 24px minmax(0, 1fr) 36px; align-items: start; gap: var(--s3); padding: var(--s4); border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); color: var(--ink); pointer-events: auto; animation: toast-enter 180ms cubic-bezier(.16, 1, .3, 1) both; }
.toast > .icon { width: 22px; height: 22px; margin-top: 2px; }
.toast > span { padding-top: 1px; overflow-wrap: anywhere; font-size: .9375rem; line-height: 1.5; }
.toast-success { background: var(--ok-bg); border-color: var(--ok); }
.toast-error { background: var(--err-bg); border-color: var(--err); }
.toast-success > .icon { color: var(--ok); }
.toast-error > .icon { color: var(--err); }
.toast-close { display: grid; place-items: center; width: 44px; height: 44px; margin: -8px -8px -8px 0; padding: 0; border: 0; border-radius: var(--radius-small); background: transparent; color: var(--ink); cursor: pointer; }
.toast-close:hover { background: var(--surface-2); }
.toast-close .icon { width: 18px; height: 18px; }
@keyframes toast-enter { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
/* Сообщения внизу справа: не закрывают шапку, вкладки админки и кнопки над списками. */
.toast-stack { top: auto; bottom: var(--s5); }
@media (max-width: 640px) { .toast-stack { bottom: var(--s4); right: var(--s4); } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }

/* Подтверждение на странице вместо window.confirm. */
.confirm-inline { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin-left: var(--s2); }
.upload-form { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin: 0; }

/* ---------- страница машины по этапам (макеты car-profile/design) ---------- */
.car-page { gap: var(--s5); }
.car-page h2, .car-page h3 { margin: 0; }
.car-head { display: flex; align-items: center; gap: var(--s4); }
.car-head .car-ico { width: 56px; height: 56px; flex: none; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); display: grid; place-items: center; color: var(--muted); }
.car-head h1 { margin: 0; }
.car-head .grow { flex: 1; min-width: 0; }

/* Этапы: сбор → проверка → выбор → оплата → установка. На телефоне — строка «Шаг N из 5» и полоски. */
.stages { display: flex; list-style: none; margin: 0; padding: var(--s4) var(--s5); gap: var(--s2); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.stages li { flex: 1; display: flex; align-items: center; gap: var(--s2); font-size: .875rem; color: var(--muted); white-space: nowrap; }
.stages li:last-child { flex: none; }
.stages li:not(:last-child)::after { content: ""; flex: 1; height: 2px; min-width: 12px; margin-left: var(--s2); background: var(--line); border-radius: 2px; }
.stages .dot { width: 28px; height: 28px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: .8125rem; font-weight: 600; border: 2px solid var(--line-strong); }
.stages .dot .icon { width: 16px; height: 16px; }
.stages .done .dot { background: var(--ok-bg); border-color: transparent; color: var(--ok); }
.stages .done::after { background: var(--ok) !important; opacity: .5; }
.stages .current { color: var(--ink); font-weight: 600; }
.stages .current .dot { background: var(--action); border-color: var(--action); color: var(--action-ink); }
.stages-mobile { display: none; }
.stages-mobile .bars { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin-top: var(--s2); }
.stages-mobile .bars i { height: 4px; border-radius: 2px; background: var(--line); }
.stages-mobile .bars .done { background: var(--ok); }
.stages-mobile .bars .current { background: var(--action); }
@media (max-width: 760px) { .stages { display: none; } .stages-mobile { display: block; } }

.car-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--s5); align-items: start; }
.car-layout.single { grid-template-columns: minmax(0, 760px); }
.car-layout > aside { position: sticky; top: var(--s5); }
@media (max-width: 760px) { .car-layout { grid-template-columns: minmax(0, 1fr); } .car-layout > aside { position: static; } }
.stack { display: flex; flex-direction: column; gap: var(--s4); }
.stack-lg { display: flex; flex-direction: column; gap: var(--s5); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s5); }
.card-title { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s4); }

/* Шаги инструкции карточками: номер в круге, текущий подсвечен, выполненный — галочка. */
.do-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s3); }
.op-cancel { margin-top: var(--s4); display: flex; justify-content: flex-end; }
@media (max-width: 720px) { .op-cancel .btn { width: 100%; justify-content: center; } }
.confirm-install-line { margin: var(--s3) 0 0; }
.do-step { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: var(--s4); padding: var(--s4) var(--s5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.do-step > .n { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--surface-2); color: var(--muted); }
.do-step.active { border-color: var(--line-strong); box-shadow: inset 2px 0 0 var(--action); }
.do-step.active > .n { background: var(--action); color: var(--action-ink); }
.do-step.done > .n { background: var(--ok-bg); color: var(--ok); }
.do-step .body { display: flex; flex-direction: column; gap: var(--s3); min-width: 0; }
.do-step .body p { margin: 0; }
.do-step .actions { display: flex; align-items: center; gap: var(--s3) var(--s4); flex-wrap: wrap; }
.do-step .actions form { margin: 0; }
@media (max-width: 760px) { .do-step { grid-template-columns: 32px minmax(0, 1fr); gap: var(--s3); padding: var(--s4); } .do-step > .n { width: 32px; height: 32px; } }
.note-hint { display: flex; gap: var(--s2); align-items: flex-start; padding: var(--s3) var(--s4); background: var(--surface-2); border-radius: var(--radius-small); font-size: .9375rem; color: var(--muted); }
.note-hint > .icon { flex: none; margin-top: 2px; }
.note-hint.warn { background: var(--warn-bg); color: var(--ink); }
.note-hint.warn > .icon { color: var(--warn); }
.note-hint.err { background: var(--err-bg); color: var(--ink); }
.note-hint.err > .icon { color: var(--err); }
.note-hint p { margin: 0; }
.note-hint > div { display: grid; gap: var(--s1); }
.install-failed { margin-bottom: var(--s4); }
.car-page code { background: var(--surface-2); padding: 1px 6px; border-radius: var(--radius-small); }

/* Зона загрузки файла с флешки: перетащить или выбрать. */
.drop { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s4); padding: var(--s5); border: 2px dashed var(--line-strong); border-radius: var(--radius); margin: 0; }
.drop > .ico { width: 56px; height: 56px; flex: none; border-radius: var(--radius); background: var(--surface-2); color: var(--muted); display: grid; place-items: center; }
.drop > .txt { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.drop > .txt strong { font-weight: 600; }
.drop .only-mobile { display: none; }
.drop.over { border-color: var(--ink); background: var(--surface-2); }
.drop.err { border-style: solid; border-color: var(--err); background: var(--err-bg); }
.drop.err > .ico { color: var(--err); }
.drop.busy { border-style: solid; }
.drop [data-upload-status]:empty { display: none; }
@media (max-width: 760px) { .drop .hide-mobile { display: none; } .drop .only-mobile { display: inline; } .drop label.btn { width: 100%; } }

/* Ярлык состояния мода: иконка и текст. */
.mark { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 10px 0 8px; border-radius: var(--radius-small); font-size: .8125rem; font-weight: 600; white-space: nowrap; }
.mark .icon { width: 16px; height: 16px; }
.mark-fit { background: var(--ok-bg); color: var(--ok); }
.mark-nofit { background: var(--surface-2); color: var(--muted); }
.mark-check { background: var(--warn-bg); color: var(--warn); }
.mark-bought { color: var(--info); }
.mark-installed { background: var(--ok); color: var(--bg); }

/* Плитка мода: значок мода (Icons.ForMod) в рамке, без цвета — цвет на странице только у состояний. */
.mod-ico { width: 48px; height: 48px; flex: none; border-radius: var(--radius-small); display: grid; place-items: center; border: 1px solid var(--line); color: var(--ink); }
.mod-ico .icon { width: 24px; height: 24px; }
.mod-ico.sm { width: 36px; height: 36px; }
.mod-ico.sm .icon { width: 20px; height: 20px; }

/* Мод машины: плитка | название, ярлык, описание | цена и действие. */
.car-mods { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s3); }
.car-mod { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: var(--s4); align-items: center; padding: var(--s4) var(--s5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.car-mod .info { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.car-mod .name { font-weight: 600; font-size: 1.0625rem; }
.car-mod .info p { margin: 0; }
.car-mod .reason { display: flex; gap: 6px; align-items: center; font-size: .875rem; color: var(--muted); }
.car-mod .reason .icon { width: 16px; height: 16px; flex: none; }
.car-mod .side { display: flex; align-items: center; gap: var(--s4); justify-content: flex-end; flex-wrap: wrap; }
.car-mod .side form { margin: 0; }
.car-mod .price { font-weight: 600; white-space: nowrap; }
.car-mod.selected { border-color: var(--action); }
.car-mod.is-off { background: transparent; }
.car-mod.is-off .mod-ico { filter: grayscale(1); opacity: .5; }
.car-mod.is-off .name { color: var(--muted); }
.car-mod .removal { grid-column: 2 / -1; }
@media (max-width: 760px) {
  .car-mod { grid-template-columns: 40px minmax(0, 1fr); padding: var(--s4); gap: var(--s3); }
  .car-mod .mod-ico { width: 40px; height: 40px; }
  .car-mod .side { grid-column: 1 / -1; justify-content: space-between; }
  .car-mod .removal { grid-column: 1 / -1; }
}
/* Купленные моды: версия на машине, новая версия, описание и «что нового» под спойлерами, галочки для обновления и удаления. */
.verline { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }
.newver { display: inline-flex; align-items: center; gap: 4px; min-height: 28px; padding: 0 10px 0 8px; border-radius: var(--radius-small); font-size: .8125rem; font-weight: 600; background: var(--info-bg); color: var(--action); }
.newver .icon { width: 16px; height: 16px; }
/* .section-fold — свёрнутые разделы описания мода на телефоне; стиль в разделе «телефон: главная и страница мода». */
.spoilers { display: flex; gap: var(--s4); flex-wrap: wrap; align-items: flex-start; }
.spoiler summary { cursor: pointer; font-size: .875rem; color: var(--link); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: .2em; list-style: none; display: inline-flex; gap: 4px; align-items: center; }
.spoiler summary::-webkit-details-marker { display: none; }
.spoiler summary::after { content: "▾"; font-size: .75rem; }
.spoiler[open] summary::after { content: "▴"; }
.spoiler[open] { flex-basis: 100%; }
.spoiler p, .spoiler ul { margin: var(--s1) 0 0; font-size: .875rem; color: var(--muted); }
.spoiler ul { padding-left: 20px; }
.spoiler li { white-space: pre-line; }
.spoiler .note-ver { font-weight: 600; color: var(--ink); }
.spoiler .note-ver + ul { margin-top: 2px; }
.car-mod.picked { border-color: var(--action); }
.tip { position: relative; }
.tip::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); right: 0; z-index: 5; white-space: nowrap; padding: 6px 10px; border-radius: var(--radius-small); background: var(--ink); color: var(--bg); font-size: .8125rem; font-weight: 600; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity var(--ease); }
.tip:hover::after, .tip:focus-visible::after { opacity: 1; }
.select-all { display: flex; align-items: center; gap: var(--s2); font-size: .875rem; color: var(--muted); margin: 0 0 0 var(--s5); }
.upd-ver { font-size: .875rem; }
.mini-mod { display: flex; align-items: center; gap: var(--s3); padding: var(--s2) 0; }
.mini-mod .grow { flex: 1; min-width: 0; }
.sum-row { display: flex; justify-content: space-between; gap: var(--s3); font-size: 1.125rem; font-weight: 700; padding-top: var(--s3); border-top: 1px solid var(--line); margin-top: var(--s2); }

/* Итог: успех, ожидание, ошибка. */
.banner { display: flex; gap: var(--s4); align-items: flex-start; padding: var(--s4) var(--s5); border-radius: var(--radius); border: 1px solid; }
.banner > .icon { width: 28px; height: 28px; flex: none; }
.banner .bt { font-weight: 700; font-size: 1.125rem; line-height: 1.35; }
.banner p { margin: var(--s1) 0 0; }
.banner.success { background: var(--ok-bg); border-color: var(--ok); }
.banner.success > .icon { color: var(--ok); }
.banner.info { background: var(--info-bg); border-color: var(--info); }
.banner.info > .icon { color: var(--info); }
.banner.error { background: var(--err-bg); border-color: var(--err); }
.banner.error > .icon { color: var(--err); }

/* Экран ожидания: проверка данных, сборка пакета. */
.status-hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--s4); padding: var(--s6) var(--s4); }
.status-hero p { margin: 0; max-width: 520px; color: var(--muted); }
.spinner-ring { width: 72px; height: 72px; border-radius: 50%; border: 4px solid var(--surface-2); border-top-color: var(--ink); animation: spin 1s linear infinite; }
.status-hero .mini-mod { width: 100%; max-width: 420px; text-align: left; }
@media (prefers-reduced-motion: reduce) { .spinner-ring { animation-duration: 3s; } }
.mini-actions { gap: 0 var(--s3); margin: calc(-1 * var(--s2)) 0 var(--s2) 48px; }
.mini-actions form { margin: 0; }
.car-mod .side .btn-link, .mini-actions .btn-link { gap: 6px; }
.car-head .car-ico .icon, .drop > .ico .icon { width: 28px; height: 28px; }
.mini-actions .btn-link { font-size: .9375rem; }
.drop, .drop label.btn { position: relative; }

/* ---------- страница машины v3: одна колонка одной ширины, один шаг отступов (car-page-states/v3) ---------- */
.car-page.v3 { gap: 40px; }
.car-page.v3 > section { display: flex; flex-direction: column; gap: var(--s4); }
.car-page.v3 h2 { font-size: 1.25rem; }
.car-page.v3 .car-head { align-items: flex-start; }
.car-page.v3 .car-head .sub { color: var(--muted); margin-top: var(--s1); }
.car-page.v3 .car-manage { margin: var(--s1) 0 0; gap: 0 var(--s4); flex-wrap: wrap; }
.car-page.v3 .car-manage .btn-link { padding: 0; min-height: 32px; white-space: nowrap; }
.car-head .car-ico.op { color: var(--ink); }
.car-head .car-ico.op-danger { background: var(--err-bg); border-color: transparent; color: var(--err); }
.car-page.v3 .car-mods { gap: var(--s3); }
.car-page.v3 .car-mod { grid-template-columns: 48px minmax(0, 1fr) auto; gap: var(--s4); padding: var(--s4) 20px; }
.car-page.v3 .car-mod .side { gap: var(--s3); }
.car-page.v3 .car-mod .side form { margin: 0; }
/* Карточка купленного мода целиком ведёт к покупке: ссылка-название растянута на карточку, кнопки и спойлеры поверх. */
.car-mod.link { position: relative; }
.car-mod.link:hover { border-color: var(--line-strong); }
.car-mod.link a.name { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: var(--s1); }
.car-mod.link a.name::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.car-mod.link a.name:focus-visible { outline: none; }
.car-mod.link:has(a.name:focus-visible) { outline: 2px solid var(--action); outline-offset: 2px; }
.car-mod.link a.name .icon { width: 18px; height: 18px; flex: none; color: var(--muted); }
.car-mod.link .side, .car-mod.link .spoilers { position: relative; z-index: 1; }
.car-unfit > summary { display: flex; align-items: center; gap: var(--s2); min-height: var(--tap); font-weight: 600; font-size: 1.125rem; cursor: pointer; list-style: none; }
.car-unfit > summary::-webkit-details-marker { display: none; }
.car-unfit > summary .icon { width: 20px; height: 20px; transition: transform .15s; }
.car-unfit[open] > summary .icon { transform: rotate(90deg); }
.car-unfit > .car-mods { margin-top: var(--s3); }
@media (prefers-reduced-motion: reduce) { .car-unfit > summary .icon { transition: none; } }
.car-page.v3 .car-mod .pick { width: var(--tap); height: var(--tap); display: grid; place-items: center; flex: none; cursor: pointer; margin: 0; }
.car-page.v3 .car-mod .pick input { width: 20px; height: 20px; margin: 0; }
/* Галочки купленных модов и строка «Отмечено: N» под списком: обновить и удалить отмеченные одним пакетом. */
.car-page.v3 .car-mods.selectable .car-mod { grid-template-columns: var(--tap) 48px minmax(0, 1fr); padding-left: var(--s2); }
.car-mod.link .pick { position: relative; z-index: 1; }
.select-bar { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s3) 20px; }
.select-bar:has(.pick-confirm:not([hidden])) { border-color: var(--err); }
.select-bar .pick-state, .select-bar .pick-confirm { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--s3) var(--s4); }
.select-bar .pick-confirm p { margin: 0; flex: 1 1 320px; }
.select-bar .acts { display: flex; gap: var(--s3); }
@media (max-width: 760px) {
  .car-page.v3 .car-mods.selectable .car-mod { grid-template-columns: 32px 40px minmax(0, 1fr); padding-left: var(--s2); }
  .car-page.v3 .car-mod .pick { width: 32px; }
  .select-bar { padding: var(--s3) var(--s4); }
  .select-bar .acts { width: 100%; }
  .select-bar .acts .btn { flex: 1; }
}
.now { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: var(--s4); align-items: center; padding: var(--s4) 20px;
  background: var(--surface); border: 1px solid var(--action); border-radius: var(--radius); }
.now.danger { border-color: var(--err); }
.now .ni { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: var(--info-bg); color: var(--action); }
.now.danger .ni { background: var(--err-bg); color: var(--err); }
.now .ni .icon { width: 24px; height: 24px; }
.now .t { font-weight: 600; font-size: 1.0625rem; }
.now .s { color: var(--muted); margin-top: 2px; }
.now-list { display: flex; flex-direction: column; gap: var(--s3); }
.car-empty { max-width: none; padding: var(--s4) 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--muted); margin: 0; }
.car-page.v3 .do-step { padding: 20px; }
.car-page.v3 .do-step .body > .btn, .car-page.v3 .do-step .body > form { align-self: flex-start; }
.car-page.v3 .do-step .body > form.drop { align-self: stretch; }
.car-page.v3 .drop { padding: var(--s4); flex-wrap: nowrap; }
.car-page.v3 .drop > .txt { gap: var(--s2); }
.drop .fname { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s1) var(--s3); }
.car-page .drop .fname code { font-size: 1rem; font-weight: 600; color: var(--ink); padding: 4px 8px; overflow-wrap: anywhere; }
.now.wait { border-color: var(--line); }
.wait-line { display: flex; align-items: center; gap: var(--s3); font-weight: 600; }
.wait-line .spin { width: 22px; height: 22px; flex: none; border-radius: 50%; border: 3px solid var(--surface-2); border-top-color: var(--ink); animation: spin 1s linear infinite; }
@media (prefers-reduced-motion: reduce) { .wait-line .spin { animation-duration: 3s; } }
.car-done .acts { display: flex; flex-wrap: wrap; gap: var(--s3); justify-content: center; }
.car-done { display: flex; flex-direction: column; align-items: center; gap: var(--s4); text-align: center; padding: var(--s7) 20px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.car-done .big { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-bg); color: var(--ok); }
.car-done .big .icon { width: 32px; height: 32px; }
.car-done p { margin: 0; color: var(--muted); }
@media (max-width: 760px) {
  .car-page.v3 { gap: var(--s6); }
  .car-page.v3 .car-head .car-ico { width: 48px; height: 48px; }
  .car-page.v3 .car-mod { grid-template-columns: 40px minmax(0, 1fr); padding: var(--s4); gap: var(--s3); }
  .car-page.v3 .car-mod .side { grid-column: 1 / -1; justify-content: space-between; }
  .car-page.v3 .car-mod .side:not(:has(*)) { display: none; }
  .car-page.v3 .car-mod .mod-ico { align-self: start; }
  .car-page.v3 .drop { flex-wrap: wrap; }
  .car-page.v3 .drop > .ico { display: none; }
  .car-page.v3 .drop > label { flex: 1 1 100%; }
  .car-done .acts { flex-direction: column; align-self: stretch; }
  .car-page.v3 .car-mod .side .btn, .car-page.v3 .car-mod .side form { flex: 1; }
  .car-page.v3 .car-mod .side form .btn { width: 100%; }
  .car-page.v3 .car-mod .price { min-width: 88px; }
  .now { grid-template-columns: 48px minmax(0, 1fr); padding: var(--s4); }
  .now > .btn { grid-column: 1 / -1; }
  .car-page.v3 .do-step { padding: var(--s4); }
  .car-page.v3 .do-step .body > .btn, .car-page.v3 .do-step .body > form, .car-page.v3 .do-step .body > form .btn { align-self: stretch; width: 100%; }
}

/* ---------- стиль «Приборная панель»: списки строками, разделы подписью, касания 44 px ---------- */
/* Разделы страницы машины и групп заказов: моноширинная подпись над линией, как надпись на приборке. */
.car-page.v3 > section > h2, .orders-group {
  font-family: var(--mono); font-size: .8125rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); padding-bottom: var(--s3); border-bottom: 1px solid var(--line); margin: 0;
}
.car-page.v3 > section { gap: 0; }
.car-page.v3 > section > :not(h2) + :not(h2) { margin-top: var(--s4); }
/* Строки модов и «Сейчас» — без карточек: линия между строками, значок в рамке слева. */
.car-mods, .car-page.v3 .car-mods, .now-list { gap: 0; }
.car-mod, .car-page.v3 .car-mod, .now { background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: var(--s4) 0; }
.car-page.v3 .car-mods.selectable .car-mod { padding-left: 0; }
.car-mod.selected, .car-mod.picked { border-color: var(--line); }
/* Метка выбранного мода — полоска в поле слева от строки: значки всех строк стоят ровно, полоска их не задевает (28.10). */
.car-mod.selected, .car-mod.picked { position: relative; }
.car-mod.selected::before, .car-mod.picked::before { content: ""; position: absolute; left: -10px; top: var(--s3); bottom: var(--s3); width: 2px; background: var(--action); }
.car-mod.link:hover { background: var(--surface); }
.now.danger { border-color: var(--line); }
.now .ni, .now.danger .ni { width: 48px; height: 48px; border-radius: var(--radius-small); background: none; border: 1px solid var(--line); color: var(--ink); }
.now.danger .ni { color: var(--err); }
.car-empty, .select-bar { background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: var(--s4) 0; }
.car-head .car-ico { border-radius: var(--radius-small); background: none; }
.car-unfit > summary { font-size: 1rem; }
/* Метки состояния: квадратная точка и текст цветом состояния, без заливки и рамки. */
.tag, .mark, .newver { border: 0; background: none; padding: 0; min-height: 0; border-radius: 0; gap: 6px; font-weight: 500; }
.tag::before, .mark:not(:has(.icon))::before { content: ""; width: 7px; height: 7px; background: currentColor; flex: none; }
.mark-installed { background: none; color: var(--ok); }
.mark-nofit { color: var(--muted); }
.tag-unit { border: 1px solid var(--line-strong); padding: 0 var(--s2); }
.tag-unit::before { content: none; }
.badge { border-radius: var(--radius-small); }
/* Каталог и список заказов: строки на фоне страницы, без рамки вокруг каждой. */
.catalog { gap: 0; border-top: 1px solid var(--line); }
.mod { background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: var(--s5) 0; }
.mod:hover { border-color: var(--line); }
/* Строка каталога: иконка мода слева, одного размера у всех; фото и видео только на странице мода. */
.mod { grid-template-columns: 48px minmax(0, 1fr); gap: var(--s4); }
.mod > .mod-ico { color: var(--ink); text-decoration: none; }
.mod .price { font-weight: 650; }
/* Скидка у цены: рамка вместо точки, чтобы читалась как метка. */
.price .tag-ok { border: 1px solid currentColor; padding: 0 6px; font-size: .875rem; align-self: center; }
.price .tag-ok::before { content: none; }
@media (max-width: 720px) { .mod { grid-template-columns: 40px minmax(0, 1fr); gap: var(--s3); padding: var(--s4) 0; } .mod > .mod-ico { width: 40px; height: 40px; } }
.panel.order-list { background: none; border: 0; border-top: 1px solid var(--line); border-radius: 0; }
.order-list li + li, .order-list li { border-bottom: 1px solid var(--line); }
.order-list li + li { border-top: 0; }
.order-row { padding: var(--s4) 0; }
.order-row:hover { background: var(--surface); }
@media (max-width: 720px) { .order-row { padding: var(--s3) 0; } }
/* Касания на телефоне не меньше 44 px: ссылки под названием машины, «FAQ» в шапке и подвале. */
.car-page.v3 .car-manage .btn-link { min-height: var(--tap); }
.foot-links { gap: 0; margin-left: calc(-1 * var(--s2)); }
.foot-links a { padding: 0 var(--s2); }
/* Поле переименования раскрывается отдельной строкой под ссылками, а не раздвигает их вбок. */
.car-manage .rename[open] { flex-basis: 100%; order: 3; }
.car-manage .rename[open] > summary { display: none; }
.car-manage .rename form { flex-wrap: nowrap; padding: var(--s2) 0; }
.car-manage .rename input { flex: 1 1 auto; min-width: 0; }
/* Рамки вместо заливки: блоки отделяются линией, фон страницы один. */
.panel { background: none; }
/* Корзина: строки через линию, без рамки вокруг списка. */
.cart-items { border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 0; }
.cart-items .car-item { border-top: 0; border-bottom: 1px solid var(--line); padding: var(--s4) 0; }
/* Названия-ссылки в строках: без подчёркивания, оно появляется при наведении. */
strong a, h2 a, h3 a, .car-item a { text-decoration: none; }
strong a:hover, h2 a:hover, h3 a:hover, .car-item a:hover { text-decoration: underline; }
/* Иконка мода прижата к верху строки, как заголовок. */
.car-mod .mod-ico, .mod > .mod-ico { align-self: start; }
/* Номера шагов квадратные, как все углы; текущий шаг тёмной заливкой, красный остаётся на кнопке. */
.do-step > .n, .stages .dot, .track li::before { border-radius: var(--radius-small); }
.do-step.active > .n { background: var(--ink); color: var(--bg); }
/* Метка с иконкой: иконка уже служит знаком, точка не нужна. */
.tag:has(.icon)::before, .mark:has(.icon)::before { content: none; }
/* Как в макете: иконка мода приглушённым цветом в рамке, значок машины без рамки на заливке. */
.mod-ico { color: var(--muted); }
.mod > .mod-ico { color: var(--muted); }
.car-head .car-ico { border-color: transparent; background: var(--surface); }
/* Цена у правого края карточки, рядом с кнопкой. */
.mod-foot { justify-content: flex-end; }
/* Короткая инструкция шага, видна сразу. */
.howto ol { margin: var(--s2) 0 0; padding-left: 1.25rem; display: grid; gap: var(--s2); color: var(--muted); }
.howto .help-media { margin-top: var(--s3); max-width: 480px; }

/* Правки 28.10 по сверке: вкладки обзора в одну строку (на узком экране — прокрутка вбок внутри полосы вкладок). */
.overview > .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.overview > .tabs a { white-space: nowrap; flex: none; }
/* Цены обычным шрифтом (решение 28.10). */
.mod .price { font-weight: 400; }
/* Карточка мода у админа: «Выше/Ниже» слева, цена и кнопка справа; на телефоне «Выше/Ниже» отдельной строкой у всех карточек. */
.mod-foot > form.row:first-child { margin-right: auto; }
@media (max-width: 720px) { .mod-foot > form.row:first-child { flex-basis: 100%; } }
/* Редактор FAQ: карточки вопросов во всю ширину холста. */
.editor-prose.is-faq { max-width: none; }
.editor-link { width: min(520px, calc(100vw - 32px)); border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: var(--s4); }
.editor-link::backdrop { background: rgb(0 0 0 / .5); }
.editor-link h2 { margin: 0 0 var(--s2); font-size: 1.125rem; }
.editor-link-form { display: flex; flex-direction: column; gap: var(--s2); }
/* Правки 28.10, 10:47. Строка каталога в одну линию: иконка, название с описанием, справа цена и кнопка по центру строки. */
.mod { grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; padding: var(--s4) 0; }
.mod > .mod-ico { align-self: center; }
.mod h2 { margin: 0 0 var(--s1); }
.mod-body > :last-child { margin-bottom: 0; }
.mod-body p { margin: 0; }
.mod-body > * + p, .mod-body > * + .tags { margin-top: var(--s1); }
.mod-foot { margin: 0; flex-wrap: nowrap; }
.mod-foot > form, .mod-foot > .price { margin: 0; }
.mod-foot > form.row:first-child { margin-right: 0; }
@media (max-width: 720px) {
  .mod { grid-template-columns: 40px minmax(0, 1fr); }
  .mod > .mod-ico { align-self: start; }
  .mod-foot { grid-column: 2; flex-wrap: wrap; justify-content: flex-end; }
  .mod-foot > form.row:first-child { margin-right: auto; }
}
/* Под вкладками каталога у админа одна линия, а не две. */
.tabs ~ .catalog { border-top: 0; margin-top: 0; }
/* Меню админки стоит наверху страницы и не едет вниз при прокрутке длинных страниц. */
.admin-sidebar { position: static; }
/* «Перейти к содержимому» в фокусе встаёт отдельной строкой над шапкой и ничего не закрывает. */
.skip-link:focus-visible { position: static; display: block; width: max-content; margin: var(--s2) var(--s4); }
/* Каталог на ПК: цены одной ширины, «Выше/Ниже» и цены встают ровными столбцами. */
@media (min-width: 721px) { .mod-foot > .price { min-width: 12rem; justify-content: flex-end; } }
/* Вкладки обзора на телефоне переносятся, как вкладки каталога, а не уходят вбок за край. */
@media (max-width: 720px) { .overview > .tabs { flex-wrap: wrap; overflow-x: visible; } }
/* Заголовок страницы со ссылкой «Править» для админа: ссылка справа, мелко, не спорит с заголовком. */
.title-row { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); align-items: baseline; justify-content: space-between; }
.title-row h1 { margin-bottom: var(--s2); }
.edit-link { display: inline-flex; gap: var(--s1); align-items: center; min-height: var(--tap); color: var(--muted); font-size: .875rem; }
.edit-link .icon { width: 16px; height: 16px; }
/* Цены обычным шрифтом и на странице мода, и в списке модов машины (решение 28.10). */
.buy .price, .car-mod .price { font-weight: 400; }
/* Карточка или строка таблицы целиком ведёт по своей главной ссылке (data-row-link): ссылка растянута на весь блок [data-row],
   остальные ссылки, кнопки и поля лежат поверх и нажимаются отдельно (решение 28.10: каталог, машины, корзина, админка). */
[data-row] { position: relative; }
[data-row] [data-row-link]::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
[data-row] :is(a:not([data-row-link]), button, input, select, textarea, label, summary, form) { position: relative; z-index: 1; }
[data-row]:hover { background: var(--surface-2); cursor: pointer; }
[data-row]:hover [data-row-link] { text-decoration: underline; }
[data-row] [data-row-link]:focus-visible { outline: none; }
[data-row]:has([data-row-link]:focus-visible) { outline: 2px solid var(--focus, var(--link)); outline-offset: -2px; }
.car-mod .name[data-row-link] { color: inherit; text-decoration: none; }
.howto li .note-hint { margin-top: var(--s2); color: var(--ink); }
/* Кнопка темы: видна иконка той темы, на которую переключит. Смена темы — плавное затухание и проявление (решение 28.10). */
.theme-to-dark, .theme-to-light { display: contents; }
[data-theme="dark"] .theme-to-dark, [data-theme="light"] .theme-to-light { display: none; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .35s; animation-timing-function: ease-in-out; }
.theme-fading, .theme-fading * { transition: background-color .35s ease, color .35s ease, border-color .35s ease, fill .35s ease, stroke .35s ease !important; }

.cancel-install { width: min(550px, calc(100% - 32px)); padding: 28px; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); }
.cancel-install::backdrop { background: rgba(0,0,0,.65); }
.cancel-install .actions { display:flex; justify-content:space-between; margin-top:24px; padding-top:24px; border-top:1px solid var(--line); }

.install-actions { display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:var(--s4); }
@media (max-width: 640px) { .now > .install-actions { grid-column:1 / -1; } .cancel-install { padding:20px; } }

/* Admin vehicle overview uses the existing mod list and report typography. */
.admin-mod-filters { display:flex; flex-wrap:wrap; gap:24px; border-bottom:1px solid var(--line); margin-bottom:12px; }
.admin-mod-filters a { padding:8px 0 12px; color:var(--muted); text-decoration:none; border-bottom:2px solid transparent; }
.admin-mod-filters a[aria-current="page"] { color:var(--ink); border-bottom-color:var(--action); }
.admin-car-mod { border-bottom:1px solid var(--line); }
.admin-car-mod > summary { display:flex; align-items:center; gap:16px; padding:16px 0; cursor:pointer; list-style:none; }
.admin-car-mod > summary::-webkit-details-marker { display:none; }
.admin-car-mod .mod-ico { display:grid; place-items:center; width:48px; height:48px; flex-shrink:0; border:1px solid var(--line); }
.admin-car-mod .mod-ico .icon { width:24px; height:24px; }
.admin-mod-info { display:grid; gap:8px; flex:1; min-width:0; }
.admin-mod-facts { display:flex; flex-wrap:wrap; gap:8px 20px; font-size:.875rem; }
.admin-mod-facts > span { display:inline-flex; align-items:center; flex-wrap:wrap; gap:5px; }
.admin-mod-facts .icon { width:16px; height:16px; }
.mod-fact-ok { color:var(--ok); }
.admin-mod-chevron { color:var(--muted); }
.admin-car-mod[open] .admin-mod-chevron { transform:rotate(90deg); }
.admin-mod-detail { padding:0 0 16px 64px; }
.admin-mod-detail p { margin:8px 0; }
@media (max-width:640px) { .admin-mod-filters { gap:12px 20px; } .admin-mod-detail { padding-left:0; } .admin-mod-facts { gap:8px 12px; } }

/* ---------- телефон: редактор описания ---------- */
/* Панель инструментов закреплена под шапкой, кнопки сохранения — над нижней панелью. На узком телефоне панель
   в 5 строк (~290 px) и кнопки столбиком не помещались вместе и перекрывали друг друга. Поэтому панель
   инструментов — одна строка с прокруткой вбок, как в мобильных редакторах. */
@media (max-width: 720px) {
  .editor-toolbar { flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; }
  .editor-toolbar::-webkit-scrollbar { display: none; }
  .editor-toolbar > * { flex: none; }
  /* Кнопки сохранения важнее панели: когда полосы на миг сходятся при прокрутке, кнопки сверху. */
  .editor-form .actions-bar { z-index: 4; }
}

/* ---------- телефон: нижняя панель разделов и тема в подвале ---------- */
/* На компьютере их нет: разделы в шапке, тема — кнопкой в шапке. */
.tabbar, .foot-theme { display: none; }
@media (max-width: 720px) {
  :root { --sticky-top: 56px; --sticky-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
  html { scroll-padding-top: var(--sticky-top); scroll-padding-bottom: var(--sticky-bottom); }
  body { padding-bottom: var(--sticky-bottom); }
  .tabbar {
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; height: var(--sticky-bottom);
    padding-bottom: env(safe-area-inset-bottom, 0px); background: var(--surface); border-top: 1px solid var(--line);
  }
  .tabbar a {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    min-width: 0; color: var(--muted); text-decoration: none; font-size: .875rem; line-height: 1.2;
  }
  .tabbar a > span:not(.icon-count) { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabbar a .icon { width: 22px; height: 22px; }
  .tabbar a:hover { color: var(--ink); }
  .tabbar a[aria-current] { color: var(--ink); font-weight: 600; }
  .tabbar a[aria-current]::before { content: ""; position: absolute; top: -1px; left: 22%; right: 22%; height: 2px; background: var(--action); }
  .tabbar .icon-count { top: 4px; right: auto; left: calc(50% + 4px); }
  .foot-theme { display: block; margin-top: var(--s3); }
  .toast-stack { bottom: calc(var(--sticky-bottom) + var(--s4)); }
}

/* ---------- телефон: главная и страница мода ---------- */
/* Блок «Как это работает»: на компьютере всегда раскрыт, заголовок-переключатель скрыт. */
.intro > summary { display: none; }
/* Фото мода в строке каталога и плашка покупки — только на телефоне. */
.mod-cover, .buy-bar { display: none; }
@media (max-width: 720px) {
  .intro { padding: 0; }
  .intro > summary {
    display: flex; align-items: center; justify-content: space-between; gap: var(--s2); min-height: 48px;
    padding: 0 var(--s4); font-weight: 600; cursor: pointer; list-style: none;
  }
  .intro > summary::-webkit-details-marker { display: none; }
  .intro > summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform var(--ease); flex: none; }
  .intro[open] > summary::after { transform: rotate(-135deg); }
  .intro[open] { padding: 0 var(--s4) var(--s4); }
  .intro[open] > summary { margin: 0 calc(-1 * var(--s4)); }

  /* Строка каталога: фото 76 px, название, описание в две строки, цена; нажимается вся строка. */
  .catalog .mod { position: relative; grid-template-columns: 76px minmax(0, 1fr); gap: var(--s1) var(--s3); align-items: start; }
  .catalog .mod > .mod-ico { grid-row: span 2; width: 76px; height: 76px; border: 0; background: var(--surface-2); overflow: hidden; }
  .catalog .mod > .mod-ico:has(.mod-cover) > .icon { display: none; }
  .catalog .mod-cover { display: block; width: 100%; height: 100%; object-fit: cover; }
  .catalog .mod h2 { font-size: 1.0625rem; }
  .catalog .mod h2 a::after { content: ""; position: absolute; inset: 0; }
  .catalog .mod-body > p:not(.tags) { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--muted); font-size: .9375rem; }
  .catalog .mod-body > .tags { display: none; }
  .catalog .mod-foot { justify-content: flex-start; }
  .catalog .mod-foot .price { font-size: 1rem; }
  .catalog .mod-foot form, .catalog .mod-foot .btn, .catalog .mod-tag { position: relative; z-index: 1; }

  /* Страница мода: фото во всю ширину, «Увеличить» — значок поверх фото, ссылка на сборщик только у кнопки покупки. */
  .product-media { margin-left: calc(-1 * var(--s4)); margin-right: calc(-1 * var(--s4)); position: relative; }
  .product-media .gallery-controls, .product-media .gallery-thumbnails, .product-media figcaption { padding: 0 var(--s4); }
  .product-media .gallery-open { position: absolute; top: var(--s2); right: var(--s2); width: var(--tap); padding: 0; font-size: 0; gap: 0; background: rgb(0 0 0 / .55); border-color: transparent; color: #fff; }
  .product-media .gallery-open .icon { width: 22px; height: 22px; }
  .collector-link { display: none; }
  /* Цена и главная кнопка — в плашке над нижней панелью; в карточке покупки остаются выбор машины и статус. */
  .buy > .price, .buy > .buy-discount, .buy .buy-action { display: none; }
  .buy:not(:has(> :not(.price, .buy-discount, .buy-action))) { display: none; }
  .buy-bar {
    display: flex; align-items: center; gap: var(--s3); position: fixed; left: 0; right: 0; bottom: var(--sticky-bottom); z-index: 49;
    min-height: 72px; padding: var(--s3) var(--s4); background: var(--surface); border-top: 1px solid var(--line);
  }
  .buy-bar .price { margin: 0; font-size: 1.25rem; white-space: nowrap; display: flex; gap: var(--s2); align-items: baseline; }
  .buy-bar .price .old { font-size: .875rem; }
  .buy-bar > .btn, .buy-bar > form { flex: 1; }
  .buy-bar > form .btn { width: 100%; }
  .buy-bar > .panel-warn { margin: 0; flex: 1; }
  body:has(.buy-bar) { padding-bottom: calc(var(--sticky-bottom) + 72px); }
  body:has(.buy-bar) .toast-stack { bottom: calc(var(--sticky-bottom) + 72px + var(--s4)); }

  /* Разделы описания мода свёрнуты так же, как вопросы FAQ: рамка и стрелка слева. */
  .section-fold, .rich-content details.section-fold { border: 1px solid var(--line); border-radius: var(--radius-small); margin: 0 0 var(--s3); background: var(--surface); padding: 0; }
  .section-fold > summary, .rich-content details.section-fold > summary {
    min-height: 48px; padding: var(--s2) var(--s4); display: flex; align-items: center; justify-content: flex-start; gap: var(--s2);
    font-size: 1rem; font-weight: 600; list-style: none; cursor: pointer;
  }
  .section-fold > summary::-webkit-details-marker { display: none; }
  .section-fold > summary::after { content: none; }
  .section-fold > summary::before, .rich-content details.section-fold > summary::before { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform var(--ease); flex: none; }
  .section-fold[open] > summary::before, .rich-content details.section-fold[open] > summary::before { transform: rotate(45deg); }
  .section-fold > :not(summary), .rich-content details.section-fold > :not(summary) { margin-left: var(--s4); margin-right: var(--s4); }
  .section-fold[open] { padding-bottom: var(--s3); }
}

/* ---------- телефон: страница машины ---------- */
/* Меню «⋯» действий с машиной: на компьютере всегда раскрыто строкой ссылок, кнопка-заголовок скрыта. */
.car-more > summary { display: none; }
@media (max-width: 720px) {
  .car-page.v3 .car-head { position: relative; padding-right: calc(var(--tap) + var(--s2)); }
  .car-head .car-ico { display: none; }
  .car-more > summary { display: inline-flex; position: absolute; top: 0; right: 0; list-style: none; cursor: pointer; }
  .car-more > summary::-webkit-details-marker { display: none; }
  .car-more[open] > summary { background: var(--surface-2); }
  /* Раскрытое меню — список под кнопкой, «Удалить машину» отдельно и красным. */
  .car-more[open] > .car-manage {
    position: absolute; top: calc(var(--tap) + var(--s1)); right: 0; z-index: 20; min-width: 260px; margin: 0;
    flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: 0; padding: var(--s1) 0;
    background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--shadow);
  }
  .car-page.v3 .car-more .car-manage .btn-link, .car-more .rename > summary { width: 100%; min-height: var(--tap); padding: 0 var(--s4); color: var(--ink); text-decoration: none; white-space: normal; }
  .car-more .rename > summary { display: flex; align-items: center; list-style: none; }
  .car-more .rename[open] form { padding: 0 var(--s4) var(--s3); }
  .car-more .car-manage > .muted { padding: var(--s2) var(--s4); }
  .car-more .car-delete { border-top: 1px solid var(--line); margin-top: var(--s1); padding-top: var(--s1); }
  .car-page.v3 .car-more .car-delete .btn-link { color: var(--err); }

  /* Моды для покупки: описание — на странице мода; «В корзину» — обычная кнопка, главная красная — в плашке корзины. */
  .car-mod .mod-summary { display: none; }
  .car-mod .side form .btn { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }

  /* Корзина машины — плашка над нижней панелью: что в корзине, сумма и «К оплате». */
  .now.now-cart {
    position: fixed; left: 0; right: 0; bottom: var(--sticky-bottom); z-index: 49; margin: 0;
    grid-template-columns: minmax(0, 1fr) auto; gap: var(--s3); min-height: 72px; padding: var(--s3) var(--s4);
    background: var(--surface); border: 0; border-top: 1px solid var(--line); border-radius: 0;
  }
  .now.now-cart .ni { display: none; }
  .now.now-cart > div { min-width: 0; }
  .now.now-cart > .btn { grid-column: auto; white-space: nowrap; }
  .now.now-cart .t { font-size: .9375rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .now.now-cart .s { color: var(--ink); font-size: 1.125rem; margin: 0; }
  body:has(.now-cart) { padding-bottom: calc(var(--sticky-bottom) + 72px); }
  body:has(.now-cart) .toast-stack { bottom: calc(var(--sticky-bottom) + 72px + var(--s4)); }
  #now:not(:has(.now:not(.now-cart))) > h2 { display: none; }
  #now:not(:has(.now:not(.now-cart))) { display: contents; }
}
