/* ЦЕХ.pro — дизайн-система площадки. Без внешних зависимостей. */
:root {
  --accent: #ff6b1a;
  --accent-2: #ff9445;
  --green: #2fbf71;
  --blue: #3b9bff;
  --amber: #f0b429;
  --red: #ef4d5a;
  --violet: #9b7bff;
  --gold: #e0b24a;
  --r-sm: 8px; --r: 14px; --r-lg: 20px;
  --maxw: 1240px;
  --shadow: 0 1px 2px rgba(0,0,0,.16), 0 12px 32px -18px rgba(0,0,0,.5);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
}
html[data-theme="dark"] {
  --bg: #0a0d12; --bg-2: #0d1218; --surface: #121821; --surface-2: #18212c; --surface-3: #1e2937;
  --line: #232e3c; --line-2: #2e3b4d;
  --text: #e8eef6; --text-2: #c3cfdd; --muted: #94a3b8;
  --grid: rgba(255,255,255,.035);
  color-scheme: dark;
}
/* Светлая тема — промышленная палитра: глубокий флотский синий на тексте,
   морской акцент на действиях, холодный светло-серый фон. Тёмная тема
   остаётся оранжевой, поэтому акцент задаётся здесь, а не в :root. */
html[data-theme="light"] {
  --accent: #0e6ba8; --accent-2: #1583c7;
  --bg: #f2f5f8; --bg-2: #e9eef4; --surface: #ffffff; --surface-2: #eff3f7; --surface-3: #e4eaf1;
  --line: #dde4ec; --line-2: #c3d0de;
  /* --muted светлее #5f7085 не берём: на белой карточке контраст падает
     ниже 4.5 и мелкие подписи перестают проходить норму AA. */
  --text: #0d1b2a; --text-2: #40536a; --muted: #59697d;
  --grid: rgba(13,27,42,.07);
  --shadow: 0 1px 2px rgba(13,27,42,.05), 0 14px 30px -20px rgba(13,27,42,.3);
  color-scheme: light;
}
/* На светлом фоне градиентная кнопка выглядит мыльно — делаем заливку сплошной.
   Текст обязательно белый: базовый #14100c подбирался под оранжевый акцент
   тёмной темы и на синем не читается. */
html[data-theme="light"] .btn-primary { background: var(--accent); color: #fff; }
html[data-theme="light"] .btn-primary:hover { background: #0b5d93; color: #fff; }
html[data-theme="light"] .pager a.is-active,
html[data-theme="light"] .wizard-nav span.is-active,
html[data-theme="light"] .chip.is-active,
html[data-theme="light"] .icon-btn .dot,
html[data-theme="light"] .skip:focus { color: #fff; }
html[data-theme="light"] .btn-ghost { background: var(--surface); border-color: var(--line-2); }
html[data-theme="light"] .kicker { color: var(--accent); }
/* Клетка-подложка та же, что в тёмной теме; линии заданы чуть заметнее
   в --grid выше — на светлом фоне при прежней прозрачности сетка пропадала. */
html[data-theme="light"] .hero::before { opacity: .5; }
html[data-theme="light"] .card { border-color: var(--line); }
/* Цвета бейджей подбирались под тёмный фон: на светлом та же насыщенность
   выцветает до 1.7–2.8 при норме 4.5. Оттенок сохраняем, светлоту убираем. */
html[data-theme="light"] {
  --green: #17794a; --blue: #0b5fa8; --amber: #8a5a00;
  --red: #b3202c; --violet: #5b3fd1; --gold: #7d5b00;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: 15.5px; line-height: 1.55; -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { line-height: 1.18; margin: 0 0 .5em; letter-spacing: -.02em; font-weight: 650; }
h1 { font-size: clamp(28px, 4.2vw, 46px); }
h2 { font-size: clamp(22px, 2.8vw, 32px); }
h3 { font-size: 19px; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.grow { flex: 1; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; z-index: 99; background: var(--accent); color: #111; padding: 10px 16px; border-radius: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---------- Header ---------- */
.hdr { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.hdr-in { max-width: var(--maxw); margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 18px; }
/* flex-shrink:0 обязателен: меню теперь не сжимается, и без этого флексбокс
   отбирал ширину у логотипа — иконка схлопывалась в полоску. */
.logo { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; font-size: 19px; letter-spacing: -.03em; flex: 0 0 auto; }
.logo svg { flex: 0 0 auto; }
.logo-text { white-space: nowrap; }
.logo-text i { font-style: normal; color: var(--muted); font-weight: 600; font-size: 14px; }
.nav { display: flex; gap: 4px; margin-left: 10px; flex-wrap: nowrap; }
/* Без nowrap «Цеха и производства» ломается на две строки и распирает шапку */
.nav a { padding: 8px 12px; border-radius: 9px; color: var(--text-2); font-size: 14.5px; font-weight: 500; transition: .15s; white-space: nowrap; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.is-active { color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.hdr-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.hdr-auth { display: flex; align-items: center; gap: 8px; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn .dot { position: absolute; top: -5px; right: -5px; background: var(--accent); color: #10141b; font-size: 10px; font-weight: 800; min-width: 17px; height: 17px; border-radius: 9px; display: grid; place-items: center; padding: 0 4px; }
html[data-theme="dark"] .i-sun { display: none; }
html[data-theme="light"] .i-moon { display: none; }
.burger { display: none; }
.nav-mobile { display: none; flex-direction: column; padding: 8px 16px 16px; border-top: 1px solid var(--line); }
.nav-mobile a { padding: 11px 6px; border-bottom: 1px solid var(--line); font-weight: 500; }

.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-body { position: absolute; right: 0; top: calc(100% + 10px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); min-width: 240px; box-shadow: var(--shadow); overflow: hidden; z-index: 60; }
.menu-body a, .menu-body button { display: block; width: 100%; text-align: left; padding: 10px 16px; font-size: 14.5px; color: var(--text-2); background: none; border: 0; font: inherit; cursor: pointer; }
.menu-body a:hover, .menu-body button:hover { background: var(--surface-2); color: var(--text); }
.menu-head { padding: 12px 16px; border-bottom: 1px solid var(--line); display: grid; }
.menu-head span { font-size: 12.5px; color: var(--muted); }
.avatar { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; font-weight: 700; font-size: 13px; color: #fff;
  background: linear-gradient(145deg, hsl(var(--h,22) 70% 52%), hsl(var(--h,22) 70% 38%)); }

/* ---------- Layout ---------- */
main { max-width: var(--maxw); margin: 0 auto; padding: 28px 20px 64px; }
main.wide { max-width: 1440px; }
section { margin-bottom: 44px; }
.row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.split { display: grid; grid-template-columns: 1fr 340px; gap: 26px; align-items: start; }
.split-l { display: grid; grid-template-columns: 300px 1fr; gap: 26px; align-items: start; }
/* Гридовые дети по умолчанию не сжимаются ниже min-content: длинный <option>
   в фильтрах или широкая карточка распирали колонку шире экрана и обрезали
   правый край на телефоне. min-width:0 разрешает колонке сжаться. */
.split > *, .split-l > *,
.grid-2 > *, .grid-3 > *, .grid-4 > *, .stack > *,
/* .field-row — сетка форм мастера заказа и ставки: там те же длинные <option>
   («Фрезерная обработка ЧПУ, 5 осей», «Нержавеющая сталь 12Х18Н10Т»), что и в
   фильтрах, и без этого они распирают колонку на узком экране. */
.field-row > * { min-width: 0; }
.filters select, .filters input { max-width: 100%; }
/* Ни один select/input в формах не должен вылезать за свою колонку. */
.field select, .field input, .field textarea, .field-row select, .field-row input { max-width: 100%; }
.card { min-width: 0; overflow-wrap: anywhere; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stack { display: grid; gap: 14px; }
.sticky { position: sticky; top: 84px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 11px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font: inherit; font-weight: 570; font-size: 14.5px;
  cursor: pointer; transition: .15s; white-space: nowrap; }
.btn:hover { background: var(--surface-2); border-color: var(--muted); }
.btn-primary { background: linear-gradient(135deg, var(--accent-2), var(--accent)); border-color: transparent; color: #14100c; font-weight: 650;
  box-shadow: 0 6px 20px -10px var(--accent); }
.btn-primary:hover { filter: brightness(1.07); background: linear-gradient(135deg, var(--accent-2), var(--accent)); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, transparent); background: color-mix(in srgb, var(--red) 8%, transparent); }
.btn-green { background: var(--green); border-color: transparent; color: #04180d; font-weight: 650; }
.btn-sm { padding: 7px 13px; font-size: 13.5px; border-radius: 9px; }
.btn-lg { padding: 14px 26px; font-size: 16px; border-radius: 13px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* Кнопка выбора файла: <label> поверх скрытого input[type=file] — нативный
   контрол не стилизуется и выглядит инородно. Раньше правило жило только
   в CSS страницы /kanban, из-за чего те же метки в кабинете были без стилей. */
.file-btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 15px; border-radius: 10px;
  border: 1px dashed var(--line-2); background: var(--surface); color: var(--text-2);
  font: inherit; font-size: 13.8px; font-weight: 600; cursor: pointer; transition: .15s; white-space: nowrap; }
.file-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--surface-2); }

/* ---------- Cards & badges ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.card-pad-lg { padding: 26px; }
.card-hover { transition: .18s; }
.card-hover:hover { border-color: var(--line-2); transform: translateY(-2px); box-shadow: var(--shadow); }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; line-height: 1.6;
  background: var(--surface-3); color: var(--text-2); border: 1px solid var(--line); }
.badge-sm { font-size: 11.5px; padding: 2px 8px; }
.badge-green { color: var(--green); background: color-mix(in srgb, var(--green) 12%, transparent); border-color: color-mix(in srgb, var(--green) 28%, transparent); }
.badge-blue { color: var(--blue); background: color-mix(in srgb, var(--blue) 12%, transparent); border-color: color-mix(in srgb, var(--blue) 28%, transparent); }
.badge-amber { color: var(--amber); background: color-mix(in srgb, var(--amber) 13%, transparent); border-color: color-mix(in srgb, var(--amber) 30%, transparent); }
.badge-red { color: var(--red); background: color-mix(in srgb, var(--red) 12%, transparent); border-color: color-mix(in srgb, var(--red) 28%, transparent); }
.badge-violet { color: var(--violet); background: color-mix(in srgb, var(--violet) 13%, transparent); border-color: color-mix(in srgb, var(--violet) 30%, transparent); }
.badge-gold { color: var(--gold); background: color-mix(in srgb, var(--gold) 13%, transparent); border-color: color-mix(in srgb, var(--gold) 32%, transparent); }
/* На --surface-3 приглушённый цвет не дотягивал до 4.5 — берём основной текст */
.badge-grey { color: var(--text-2); }
/* Красный бейдж на 12-процентной красной подложке в тёмной теме давал 4.42 —
   осветляем текст, подложку не трогаем, чтобы тревожность не потерялась. */
html[data-theme="dark"] .badge-red { color: #ff8089; }
.chip { display: inline-block; padding: 4px 11px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12.5px; color: var(--text-2); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }
.tag { font-size: 11.5px; color: var(--muted); border: 1px dashed var(--line-2); padding: 2px 8px; border-radius: 6px; }
.stars { color: var(--gold); letter-spacing: 1px; font-size: 13px; }
.stars .star { opacity: .28; }
.stars .star.on { opacity: 1; }
.stars .star.half { opacity: .6; }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 38px 0 26px; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: -40% -20% auto; height: 620px; z-index: -1;
  background: radial-gradient(60% 60% at 50% 0%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%); }
.hero-grid { position: absolute; inset: 0; z-index: -1;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 46px 46px; mask-image: linear-gradient(180deg, #000, transparent 78%); }
.hero h1 { max-width: 26ch; font-size: clamp(27px, 3.4vw, 40px); }
.hero h1 em { font-style: normal; background: linear-gradient(120deg, var(--accent-2), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-lead { font-size: 16.5px; color: var(--text-2); max-width: 52ch; }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; margin: 20px 0 16px; }
/* Показатели в одну строку: перенос делал вторую строку ради одного элемента */
.hero-trust { display: grid; grid-template-columns: repeat(4, auto); justify-content: start;
  gap: 8px 20px; color: var(--muted); font-size: 12.5px; line-height: 1.3; }
.hero-trust b { color: var(--text); font-size: 19px; display: block; letter-spacing: -.02em; }
.hero-wrap { display: grid; grid-template-columns: 1.02fr .98fr; gap: 32px; align-items: center; }
.hero-wrap > * { min-width: 0; }   /* иначе виджет расчёта распирает колонку на узком экране */

/* ---------- Quote widget ---------- */
.quote { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; box-shadow: var(--shadow); }
.quote-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.quote h3 { display: flex; align-items: center; gap: 7px; margin: 0; font-size: 17px; }
.quote-live { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; white-space: nowrap; }

/* Плотная сетка полей: два-три поля в ряд вместо колонки на всю высоту */
.q-form { display: grid; gap: 9px; }
.q-form .field { margin-bottom: 0; }
.q-form label { font-size: 11.5px; margin-bottom: 3px; }
.q-form input, .q-form select { padding: 7px 11px; font-size: 13.5px; border-radius: 8px; }
.q-form select { padding-right: 28px; background-position: right 9px center; }
.q-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.q-grid-3 { grid-template-columns: repeat(3, 1fr); }
/* Без min-width:0 длинный <option> («Фрезерная обработка ЧПУ, 5 осей») распирает
   колонку шире её доли грида, и селект вылезает за карточку расчёта. */
.q-grid > * { min-width: 0; }

.qty-presets { display: flex; gap: 3px; margin-top: 5px; }
.qty-presets button { flex: 1; padding: 3px 0; font: inherit; font-size: 11.5px; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; color: var(--muted); }
.qty-presets button:hover { border-color: var(--line-2); color: var(--text); }
.qty-presets button.is-active { background: color-mix(in srgb, var(--accent) 16%, transparent);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent); color: var(--accent); font-weight: 650; }

.quote-res { margin-top: 12px; border-top: 1px dashed var(--line-2); padding-top: 12px; }
.quote-total { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.quote-price { font-size: 24px; font-weight: 720; letter-spacing: -.03em; line-height: 1.15; }
.quote-price small { font-size: 13px; font-weight: 500; color: var(--muted); }
.quote-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.quote-days { text-align: right; white-space: nowrap; }
.quote-days b { font-size: 24px; font-weight: 720; letter-spacing: -.03em; }
.quote-days span { font-size: 12.5px; color: var(--muted); margin-left: 3px; }

/* Кривая цены от партии — главное, что отличает расчёт от «прайса» */
.ladder-wrap { margin-top: 12px; }
.ladder-title { font-size: 11.5px; color: var(--muted); margin-bottom: 5px; }
.ladder-title em { font-style: normal; opacity: .75; }
.ladder { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; }
.ladder-cell { display: grid; gap: 1px; padding: 6px 4px; text-align: center; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--line); }
.ladder-cell b { font-size: 12.5px; font-weight: 650; letter-spacing: -.02em; }
.ladder-cell span { font-size: 10.5px; color: var(--muted); }
.ladder-cell i { font-style: normal; font-size: 10px; color: var(--green); }
.ladder-cell.is-current { background: color-mix(in srgb, var(--accent) 13%, transparent);
  border-color: color-mix(in srgb, var(--accent) 42%, transparent); }
.ladder-cell.is-current b { color: var(--accent); }

.quote-bd { margin-top: 10px; }
.quote-bd > summary { cursor: pointer; list-style: none; font-size: 12.5px; color: var(--muted);
  display: flex; align-items: center; gap: 6px; padding: 5px 0; }
.quote-bd > summary::-webkit-details-marker { display: none; }
.quote-bd > summary::before { content: "▸"; color: var(--accent); font-size: 11px; transition: transform .15s; }
.quote-bd[open] > summary::before { content: "▾"; }
.quote-bd > summary:hover { color: var(--text); }
.bd-flag { background: color-mix(in srgb, var(--amber) 18%, transparent); color: var(--amber);
  border-radius: 999px; font-size: 10.5px; padding: 0 6px; font-weight: 700; }
.bd { display: grid; gap: 4px; margin-top: 6px; font-size: 12.5px; }
.bd-row { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.bd-row span { color: var(--muted); }
.bd-row b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.bd-hint { font-size: 11px; color: var(--muted); }
.bd-warn { font-size: 11.5px; color: var(--amber); margin: 8px 0 0; line-height: 1.4; }

/* ---------- Forms ---------- */
label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=tel], input[type=search], input[type=date], select, textarea {
  width: 100%; padding: 10px 13px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text);
  font: inherit; font-size: 14.5px; transition: .15s; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238b9bb0' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.field { margin-bottom: 15px; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--text-2); font-weight: 500; margin-bottom: 10px; cursor: pointer; line-height: 1.45; }
/* Голый текст и ссылки внутри flex становятся отдельными элементами и разъезжаются
   по колонкам. Галочку фиксируем, всё остальное сливаем в один растягивающийся блок. */
.check input { margin-top: 2px; accent-color: var(--accent); width: 16px; height: 16px; flex: 0 0 auto; }
.check > span { flex: 1 1 auto; min-width: 0; }
.check > a { flex: 0 0 auto; }
fieldset { border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin: 0 0 16px; }
legend { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 0 6px; }

/* ---------- Filters ---------- */
.filters { display: grid; gap: 14px; }
.filters .card { padding: 16px; }
/* Горизонтальный ряд чипов — не путать с .filters, там вертикальный сайдбар */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip { display: inline-flex; align-items: center; border: 1px solid var(--line); background: var(--surface-2);
  color: var(--text-2); border-radius: 8px; padding: 7px 13px; font-size: 13.2px; font-weight: 600; white-space: nowrap; }
.chip:hover { background: var(--surface); color: var(--text); }
/* Белый по оранжевому даёт всего 2.85 — на акценте тёмной темы текст тёмный,
   как у остальных активных элементов; в светлой теме он переопределён на белый. */
.chip.is-active { background: var(--accent); border-color: transparent; color: #14100c; }
.filter-title { font-size: 12.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; margin-bottom: 10px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar .search { flex: 1; min-width: 220px; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg a { flex: 0 0 auto; white-space: nowrap; }
.seg a { padding: 6px 13px; border-radius: 8px; font-size: 13.5px; color: var(--muted); font-weight: 550; }
.seg a.is-active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.2); }

/* ---------- Order card ---------- */
.order-card { display: grid; gap: 10px; }
.oc-top { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-size: 12.5px; }
.oc-title { font-size: 17.5px; margin: 0; }
.oc-title a:hover { color: var(--accent); }
.oc-params { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13.5px; color: var(--text-2); }
.oc-params i { font-style: normal; color: var(--muted); margin-right: 6px; }
.oc-foot { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 12px; }
.oc-price span, .oc-bids span { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; }
.oc-price b { font-size: 16px; }
.oc-bids b { font-size: 16px; }
.oc-bids .best { display: inline; font-size: 12px; color: var(--green); text-transform: none; letter-spacing: 0; }
.oc-foot .btn { margin-left: auto; }

/* ---------- Company card ---------- */
.company-card { display: grid; gap: 12px; }
.cc-head { display: flex; align-items: center; gap: 12px; }
.cc-name { font-weight: 650; font-size: 16.5px; }
.cc-name:hover { color: var(--accent); }
.cc-sub { font-size: 13px; color: var(--muted); }
.cc-title { flex: 1; min-width: 0; }
.cc-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.cc-metrics > div { display: grid; }
.cc-metrics b { font-size: 14.5px; font-weight: 650; }
.cc-metrics span { font-size: 11px; color: var(--muted); }
.cc-foot { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.load { font-size: 11.5px; color: var(--muted); display: grid; gap: 4px; min-width: 96px; }
.load i { display: block; height: 4px; border-radius: 3px; background: var(--surface-3); position: relative; }
.load i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); border-radius: 3px; background: linear-gradient(90deg, var(--green), var(--amber)); }

/* ---------- Tables / lists ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); font-weight: 700; }
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:hover td { background: var(--surface-2); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); min-width: 0; max-width: 100%; }
.dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 20px; font-size: 14.2px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; font-weight: 550; text-align: right; }

/* ---------- Specific blocks ---------- */
.metric { display: grid; gap: 2px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.metric b { font-size: 24px; font-weight: 700; letter-spacing: -.03em; }
.metric span { font-size: 12.5px; color: var(--muted); }
.empty { text-align: center; padding: 56px 20px; color: var(--muted); border: 1px dashed var(--line-2); border-radius: var(--r-lg); }
.empty h3 { color: var(--text); margin-top: 12px; }
.crumbs { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); margin-bottom: 14px; flex-wrap: wrap; }
.crumbs a:hover { color: var(--accent); }
.crumbs i { font-style: normal; opacity: .5; }
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 26px; }
.pager a { padding: 8px 13px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; }
.pager a.is-active { background: var(--accent); color: #14100c; border-color: transparent; font-weight: 650; }
.pager .gap { color: var(--muted); padding: 8px 4px; }
.alert { padding: 13px 16px; border-radius: var(--r); font-size: 14px; margin-bottom: 16px; border: 1px solid; }
.alert-info { background: color-mix(in srgb, var(--blue) 9%, transparent); border-color: color-mix(in srgb, var(--blue) 26%, transparent); }
.alert-ok { background: color-mix(in srgb, var(--green) 9%, transparent); border-color: color-mix(in srgb, var(--green) 26%, transparent); }
.alert-warn { background: color-mix(in srgb, var(--amber) 10%, transparent); border-color: color-mix(in srgb, var(--amber) 28%, transparent); }
.alert-err { background: color-mix(in srgb, var(--red) 9%, transparent); border-color: color-mix(in srgb, var(--red) 28%, transparent); }

.timeline { display: flex; list-style: none; padding: 0; margin: 18px 0; gap: 4px; overflow-x: auto; }
.timeline li { flex: 1; min-width: 92px; display: grid; justify-items: center; gap: 7px; position: relative; text-align: center; }
.timeline li::before { content: ""; position: absolute; top: 13px; left: -50%; width: 100%; height: 2px; background: var(--line); }
.timeline li:first-child::before { display: none; }
.timeline li.done::before, .timeline li.current::before { background: var(--green); }
.tl-dot { width: 27px; height: 27px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); border: 2px solid var(--line); font-size: 12px; font-weight: 700; position: relative; z-index: 1; }
.timeline li.done .tl-dot { background: var(--green); border-color: var(--green); color: #04180d; }
.timeline li.current .tl-dot { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.tl-label { font-size: 12px; color: var(--muted); }
.timeline li.current .tl-label { color: var(--text); font-weight: 650; }

.events { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.events li { display: grid; grid-template-columns: 12px 1fr; gap: 14px; padding: 12px 0 12px 4px; border-left: 2px solid var(--line); margin-left: 5px; padding-left: 20px; position: relative; }
.events li::before { content: ""; position: absolute; left: -6px; top: 17px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.events li { grid-template-columns: 1fr; }
.events b { font-size: 14.5px; }
.events time { display: block; font-size: 12px; color: var(--muted); }

.chat { display: grid; gap: 10px; max-height: 460px; overflow-y: auto; padding: 4px; }
.msg { display: grid; gap: 4px; max-width: 78%; }
.msg .bubble { background: var(--surface-2); border: 1px solid var(--line); padding: 10px 14px; border-radius: 14px 14px 14px 4px; font-size: 14.3px; white-space: pre-wrap; }
.msg time { font-size: 11.5px; color: var(--muted); }
.msg.own { margin-left: auto; }
.msg.own .bubble { background: color-mix(in srgb, var(--accent) 14%, var(--surface-2)); border-color: color-mix(in srgb, var(--accent) 30%, transparent); border-radius: 14px 14px 4px 14px; }
.msg .who { font-size: 12px; color: var(--muted); font-weight: 600; }

.bid { border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: grid; gap: 10px; background: var(--surface); }
.bid.is-best { border-color: color-mix(in srgb, var(--green) 45%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--green) 22%, transparent); }
.bid-head { display: flex; align-items: center; gap: 10px; }
.bid-price { margin-left: auto; text-align: right; }
.bid-price b { font-size: 19px; letter-spacing: -.02em; display: block; }
.bid-price span { font-size: 12.5px; color: var(--muted); }

.steps { counter-reset: s; display: grid; gap: 18px; }
.step { display: grid; grid-template-columns: 44px 1fr; gap: 16px; align-items: start; }
.step-n { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 750; background: color-mix(in srgb, var(--accent) 14%, var(--surface)); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent); }
.feature { display: grid; gap: 8px; }
.feature .ico { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); color: var(--accent); }
.kicker { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: var(--accent); margin-bottom: 12px; }
.kicker::before { content: ""; width: 22px; height: 2px; background: var(--accent); border-radius: 2px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 20px; flex-wrap: wrap; }
.section-head p { color: var(--muted); margin: 0; max-width: 62ch; }

.compare { width: 100%; border-collapse: collapse; font-size: 14px; }
.compare th, .compare td { padding: 11px 14px; border-bottom: 1px solid var(--line); text-align: left; }
.compare th { font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.compare td.yes { color: var(--green); font-weight: 650; }
.compare td.no { color: var(--red); }
.compare tbody tr:hover td { background: var(--surface-2); }
.compare .us { background: color-mix(in srgb, var(--accent) 7%, transparent); }

/* Аббревиатура с расшифровкой в подсказке. Пунктир намекает, что можно навести.
   Это подстраховка, а не замена тексту: на телефоне наведения нет, поэтому в
   заголовках и первом упоминании аббревиатуры всё равно раскрыты словами. */
abbr.ab { text-decoration: none; border-bottom: 1px dotted var(--muted); cursor: help; }
/* Полная матрица способов найти производство в ширину экрана не влезает —
   держим колонки читаемыми и листаем таблицу вбок внутри .table-wrap. */
.compare.is-wide { min-width: 1150px; }
.compare.is-wide th, .compare.is-wide td { padding: 10px 12px; font-size: 13.5px; }

.price-card { display: grid; gap: 14px; padding: 24px; border-radius: var(--r-lg); }
.price-card.is-hl { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 20px 50px -30px var(--accent); position: relative; }
.price-card .amount { font-size: 34px; font-weight: 730; letter-spacing: -.03em; }
.price-card ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 9px; font-size: 14.2px; }
.price-card li { display: grid; grid-template-columns: 18px 1fr; gap: 9px; color: var(--text-2); }
.price-card li::before { content: "✓"; color: var(--green); font-weight: 700; }
.price-card li.off { color: var(--muted); }
.price-card li.off::before { content: "—"; color: var(--muted); }

.faq details { border: 1px solid var(--line); border-radius: var(--r); padding: 14px 18px; background: var(--surface); margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 20px; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq p { margin: 12px 0 0; color: var(--text-2); font-size: 14.4px; }

.uploader { border: 1.5px dashed var(--line-2); border-radius: var(--r); padding: 24px; text-align: center; cursor: pointer; background: var(--surface-2); transition: .15s; }
.uploader:hover, .uploader.drag { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--surface-2)); }
.file-list { display: grid; gap: 8px; margin-top: 12px; }
.file-item { display: flex; align-items: center; gap: 10px; font-size: 13.5px; padding: 8px 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; }
.file-item .rm { margin-left: auto; color: var(--muted); cursor: pointer; background: none; border: 0; font-size: 16px; }

.wizard-nav { display: flex; gap: 6px; margin-bottom: 22px; flex-wrap: wrap; }
.wizard-nav span { font-size: 13px; padding: 7px 14px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); }
.wizard-nav span.is-active { background: var(--accent); color: #14100c; border-color: transparent; font-weight: 650; }
.wizard-nav span.done { color: var(--green); border-color: color-mix(in srgb, var(--green) 35%, transparent); }
.wstep { display: none; }
.wstep.is-active { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.logos { display: flex; gap: 26px; flex-wrap: wrap; align-items: center; opacity: .75; font-weight: 650; color: var(--muted); font-size: 14px; letter-spacing: .02em; }

.prose { max-width: 76ch; }
.prose h2 { margin-top: 1.8em; }
.prose h3 { margin-top: 1.4em; }
.prose ul, .prose ol { padding-left: 22px; color: var(--text-2); }
.prose li { margin-bottom: 7px; }
.prose code { font-family: var(--mono); font-size: 13px; background: var(--surface-2); padding: 2px 6px; border-radius: 5px; border: 1px solid var(--line); }
.prose pre { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; overflow-x: auto; font-size: 13px; }
.prose blockquote { border-left: 3px solid var(--accent); margin: 0; padding: 4px 0 4px 16px; color: var(--text-2); }
.prose table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 16px 0; }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: 9px 12px; text-align: left; }

/* ---------- Руководство пользователя ---------- */
/* Оглавление слева. scroll-margin нужен якорям: шапка залипающая и без него
   заголовок раздела уезжает под неё при переходе по ссылке. */
.guide-toc nav { display: grid; gap: 1px; }
.guide-toc nav a { padding: 7px 11px; border-radius: 8px; font-size: 14px; color: var(--text-2); border-left: 2px solid transparent; }
.guide-toc nav a:hover { background: var(--surface-2); color: var(--text); border-left-color: var(--accent); }
.guide-body section { scroll-margin-top: 80px; margin-bottom: 52px; }
.guide-body h2 { padding-bottom: 10px; border-bottom: 1px solid var(--line); }

.gstep { display: grid; grid-template-columns: 34px 1fr; gap: 14px; align-items: start; margin: 22px 0; }
.gstep-n { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-weight: 750; font-size: 14px;
  background: color-mix(in srgb, var(--accent) 14%, var(--surface)); color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent); }
.gstep-b { min-width: 0; }
.gstep-b h3 { font-size: 17px; margin-bottom: 8px; }
.gstep-b p { font-size: 14.6px; color: var(--text-2); }

/* Путь по интерфейсу: «где лежит → что нажать» */
.where { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 10px 0 12px;
  padding: 10px 13px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); }
.wh-t { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); flex: 0 0 auto; }
.wh-p { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.wh-i { font-size: 13.6px; color: var(--text-2); }
.wh-i.is-act { font-weight: 620; color: var(--text); background: var(--surface); padding: 3px 9px; border-radius: 7px;
  border: 1px solid var(--line-2); box-shadow: 0 1px 0 var(--line-2); }
.wh-a { color: var(--muted); font-size: 13px; }

/* Таблицы «поле → пример» шире обычных: пример заполнения бывает длинным */
.gtab td code { font-family: var(--mono); font-size: 12.6px; background: var(--surface-2);
  padding: 2px 6px; border-radius: 5px; border: 1px solid var(--line); overflow-wrap: anywhere; }
.gtab td { vertical-align: top; font-size: 14px; }
.gtab td:first-child { white-space: nowrap; }
/* Без явных долей браузер отдаёт почти всю ширину последней колонке,
   и пример заполнения переносится по слогам. Доли разные: у таблицы полей
   три колонки, у таблицы этапов сделки — четыре. */
.gtab-fields th:nth-child(2), .gtab-fields td:nth-child(2) { width: 32%; }
.gtab-fields th:nth-child(3), .gtab-fields td:nth-child(3) { width: 40%; }
.gtab-deal th:nth-child(2), .gtab-deal td:nth-child(2) { width: 12%; }
.gtab-deal th:nth-child(3), .gtab-deal td:nth-child(3) { width: 30%; }
.gtab-deal th:nth-child(4), .gtab-deal td:nth-child(4) { width: 34%; }

.gnote { font-size: 14px; color: var(--text-2); margin: 12px 0; padding: 11px 14px; border-radius: var(--r-sm);
  border: 1px solid var(--line); border-left: 3px solid var(--blue); background: var(--surface-2); }
.gnote.is-warn { border-left-color: var(--amber); }
.gnote a { color: var(--accent); }

@media (max-width: 900px) {
  .guide-toc { border-bottom: 1px solid var(--line); padding-bottom: 14px; margin-bottom: 8px; }
  .guide-toc nav { grid-template-columns: 1fr 1fr; }
  .gtab td:first-child { white-space: normal; }
  /* Ужатые доли колонок на телефоне дают по одному слову в строке.
     Держим таблицу шире экрана и листаем её вбок внутри .table-wrap. */
  .gtab { min-width: 580px; }
  .gtab-deal { min-width: 660px; }
}

.ftr { border-top: 1px solid var(--line); background: var(--bg-2); padding: 44px 0 20px; margin-top: 40px; }
.ftr-in { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; display: grid; grid-template-columns: 1.6fr repeat(4, 1fr); gap: 34px; }
.ftr-brand p { color: var(--muted); font-size: 13.5px; margin: 14px 0; max-width: 42ch; }
.ftr-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.ftr-col h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.ftr-col a { display: block; padding: 5px 0; font-size: 14px; color: var(--text-2); }
.ftr-col a:hover { color: var(--accent); }
.ftr-btm { max-width: var(--maxw); margin: 30px auto 0; padding: 18px 20px 0; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }

.auth-wrap { max-width: 460px; margin: 40px auto; }
.demo-users { display: grid; gap: 8px; margin-top: 16px; }
.demo-user { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); font-size: 13.5px; cursor: pointer; width: 100%; text-align: left; color: inherit; font-family: inherit; }
.demo-user:hover { border-color: var(--accent); }
.demo-user b { font-weight: 650; }
.demo-user span { color: var(--muted); margin-left: auto; font-size: 12.5px; }

@media (max-width: 1420px) {
  .nav { gap: 2px; margin-left: 4px; }
  .nav a { padding: 8px 9px; font-size: 14px; }
}
@media (max-width: 1300px) {
  .nav a { padding: 7px 7px; font-size: 13.4px; }
  .hdr-in { gap: 12px; }
}
@media (max-width: 1300px) {
  /* Восемь пунктов меню перестают помещаться задолго до мобильной точки —
     сворачиваем в бургер, иначе они наезжают на кнопки справа.
     Точка поднята с 1180px, когда в меню добавилось «Руководство». */
  .nav { display: none; }
  .burger { display: grid; }
  .nav-mobile { display: flex; }
  .nav-mobile[hidden] { display: none; }
  .ftr-in { grid-template-columns: 1fr 1fr 1fr; }
  .hero-wrap { grid-template-columns: 1fr; gap: 30px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .nav { display: none; }
  .burger { display: grid; }
  .nav-mobile[hidden] { display: none; }
  .nav-mobile { display: flex; }
  .split, .split-l { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .sticky { position: static; }
}
@media (max-width: 640px) {
  body { font-size: 15px; }
  main { padding: 20px 14px 48px; }
  .hdr-in { padding: 9px 14px; gap: 10px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .cc-metrics { grid-template-columns: repeat(2, 1fr); }
  .ftr-in { grid-template-columns: 1fr 1fr; }
  .hdr-auth .btn { display: none; }
  .oc-foot { gap: 12px; }
  .dl { grid-template-columns: 1fr; }
  .dl dd { text-align: left; margin-bottom: 6px; }
  /* Четыре показателя в ряд не помещаются в 360 px — ставим 2×2 */
  .hero-trust { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
  .hero-cta { flex-direction: column; align-items: stretch; }
  .hero-cta .btn { width: 100%; text-align: center; }
  /* Форма расчёта: на телефоне три селекта в ряд («Точность», «Шероховатость»,
     «Покрытие / ТО») сжимались до ~90 px, и подписи с вариантами не читались.
     Раскладываем в одну колонку — кроме габаритов: там три коротких числа,
     и Д×Ш×В нагляднее оставить в строку. */
  .q-grid { grid-template-columns: 1fr; }
  .q-grid.q-dims { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media print { .hdr, .ftr, .btn { display: none; } }

/* Кто сколько получает: комиссия не в цене, а вычитается из выплаты цеху */
.bd-fee { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line-2); }
.bd-fee .bd-row:last-child b { color: var(--accent); }
