/* Шрифт Onest лежит в проекте (public/fonts, лицензия OFL): без внешней загрузки, работает и без интернета.
   Один переменный файл на набор символов — все начертания 400–700. */
@font-face {
  font-family: Onest; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("/fonts/onest-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: Onest; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("/fonts/onest-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: Onest; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("/fonts/onest-latin.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;
}
/* Портал косметики — «пудреница»: матовое стекло над пудровым фоном в цветах OIRO beauty.
   Тёмный текст, красный акцент только для главного, критичного и фокуса.
   Размытие (дорогое) — только у шапки, липких панелей и окон: фон и так мягкий, панелям хватает прозрачности. */
:root {
  --page: #f4f0f2;
  --blush: #efc4d0; /* пудрово-розовый */
  --peach: #f5d6bf; /* персиковый */
  --lilac: #d8d6ef; /* холодный сиреневато-серый */
  --bg: #ffffff;
  --glass: rgba(255, 255, 255, 0.5); /* дорожки, разделы */
  --glass-strong: rgba(255, 255, 255, 0.82); /* таблицы, справка, окна */
  --glass-line: rgba(255, 255, 255, 0.8); /* светлая кромка стекла */
  --blur: blur(22px) saturate(160%);
  --solid: #fdfbfc; /* закреплённые ячейки таблиц: непрозрачный цвет «плотного» стекла */
  --field: rgba(33, 25, 34, 0.06);
  --field-hover: rgba(33, 25, 34, 0.1);
  --lane: var(--glass);
  --ink: #211922;
  --muted: #574f57; /* не ниже 4,5 и на самом розовом участке фона */
  --line: rgba(33, 25, 34, 0.13);
  --accent: #c8102e;
  --ok: #086b43; /* на светло-зелёном фоне плашек — контраст не ниже 4,5 */
  --ok-soft: #e4f2ec;
  --err: #b3001b;
  --r-field: 16px;
  --r-tile: 20px;
  --shadow: 0 1px 2px rgba(90, 40, 60, 0.06), 0 8px 24px rgba(90, 40, 60, 0.08); /* тень с оттенком сливы, не серая */
  --par: #e3a1ac; /* пунктир параллельных участков карты — оттенок акцента */
  --field-line: #8a8a8a; /* рамка белого поля на светло-сером фоне: контраст границы не ниже 3:1 */
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: #c9c4c9 transparent; }
body {
  margin: 0; background: var(--page); color: var(--ink); min-height: 100vh;
  font: 16px/1.5 Onest, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
/* Пудровый фон — отдельным неподвижным слоем: при прокрутке не перерисовывается */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(48vw 42vw at 4% -6%, var(--blush), transparent 70%),
    radial-gradient(44vw 40vw at 104% 18%, var(--lilac), transparent 70%),
    radial-gradient(52vw 40vw at 38% 108%, var(--peach), transparent 72%),
    var(--page);
}
a { color: inherit; }
h1 { font-size: 32px; line-height: 1.12; font-weight: 700; letter-spacing: -0.02em; margin: 0; }
h2 { font-size: 22px; line-height: 1.2; margin: 0 0 16px; letter-spacing: -0.01em; }
h3 { font-size: 18px; margin: 24px 0 10px; }
h4 { font-size: 14px; margin: 16px 0 8px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.muted { color: var(--muted); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
::selection { background: #f4d2d8; color: var(--ink); }
table, .num { font-variant-numeric: tabular-nums; }
/* Иконки — линия одной толщины, цвет от текста */
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.icon-star { fill: currentColor; stroke: none; width: 14px; height: 14px; vertical-align: -2px; }
button:disabled { cursor: progress; opacity: 0.6; }
input[type=checkbox]:disabled { cursor: not-allowed; }

/* Шапка */
.top {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 24px;
  padding: 10px 24px; background: rgba(255, 255, 255, 0.62); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--glass-line); box-shadow: 0 1px 0 var(--line); /* текст под шапкой размыт — не мешает читать меню */
}
/* Поиск и быстрые действия: кнопка в шапке и окно по Ctrl K */
.cmdk-btn {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; min-width: 210px; padding: 6px 8px 6px 14px; flex: none;
  font: inherit; font-size: 14px; color: var(--muted); background: rgba(255, 255, 255, 0.6); border: 1px solid var(--line);
  border-radius: 999px; cursor: pointer; transition: background-color 0.15s, color 0.15s;
}
.cmdk-btn:hover { background: var(--bg); color: var(--ink); }
.cmdk-btn kbd { margin-left: auto; }
kbd {
  font: inherit; font-size: 12px; font-weight: 600; line-height: 1.4; color: var(--muted); white-space: nowrap;
  padding: 1px 7px; border-radius: 6px; background: var(--field); border: 1px solid var(--line);
}
dialog.cmdk {
  width: min(640px, calc(100vw - 32px)); margin: 12vh auto auto; padding: 0; overflow: hidden; border-radius: 22px;
  background: var(--glass-strong); border: 1px solid var(--glass-line);
  opacity: 1; transform: none; transition: opacity 0.16s, transform 0.16s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@starting-style { dialog.cmdk[open] { opacity: 0; transform: translateY(-8px) scale(0.98); } }
.cmdk-input { display: flex; align-items: center; gap: 12px; padding: 0 20px; border-bottom: 1px solid var(--line); color: var(--muted); }
.cmdk-input input[type=search] { min-height: 60px; padding: 0; font-size: 18px; color: var(--ink); background: transparent; border: 0; border-radius: 0; }
.cmdk-input input[type=search]:focus-visible { background: transparent; }
.cmdk-input input[type=search]::-webkit-search-cancel-button { display: none; } /* очистка — Esc или выделить и стереть */
.cmdk-list { max-height: min(56vh, 460px); overflow-y: auto; padding: 6px 8px 8px; overscroll-behavior: contain; }
.cmdk-group { padding: 10px 12px 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.cmdk-item { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 8px 12px; border-radius: 12px; cursor: pointer; }
.cmdk-item[aria-selected="true"] { background: var(--ink); color: #fff; }
.cmdk-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmdk-hint { margin-left: auto; flex: none; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cmdk-item[aria-selected="true"] .cmdk-hint { color: rgba(255, 255, 255, 0.78); }
.cmdk-empty { margin: 16px 12px; color: var(--muted); }
.cmdk-note { margin: 8px 12px 0; font-size: 14px; color: var(--muted); }
.cmdk-input .icon-btn { margin-right: -8px; }
.cmdk-foot { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; padding: 10px 20px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.cmdk-foot kbd { margin-right: 4px; }
.brand { font-weight: 700; font-size: 18px; text-decoration: none; letter-spacing: -0.01em; white-space: nowrap; }
.brand small { font-weight: 500; font-size: 14px; color: var(--muted); margin-left: 6px; }
.nav { display: flex; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav a {
  text-decoration: none; font-weight: 500; padding: 10px 14px; border-radius: 999px; min-height: 44px;
  display: inline-flex; align-items: center; white-space: nowrap;
}
.nav a:hover { background: var(--field); }
.nav a[aria-current="page"] { background: var(--ink); color: #fff; }

/* Кнопки */
.btn {
  font: inherit; font-weight: 600; min-height: 44px; padding: 10px 20px; border-radius: 999px; border: 0;
  background: var(--field); color: var(--ink); cursor: pointer; transition: background-color 0.15s;
}
.btn:hover { background: var(--field-hover); }
.btn.primary { background: var(--ink); color: #fff; }
.btn.primary:hover { background: #3a2f3b; }
.btn.danger { background: transparent; color: var(--err); padding-left: 0; }
.btn.danger:hover { text-decoration: underline; }
.btn.danger-solid { background: var(--err); color: #fff; }
.btn.danger-solid:hover { background: #8f0016; }
.icon-btn {
  width: 44px; height: 44px; border: 0; border-radius: 12px; background: transparent; color: var(--muted);
  cursor: pointer; flex: none; display: inline-grid; place-items: center;
}
.icon-btn:hover { background: var(--field); color: var(--ink); }
.menu-btn { display: none; }
.link { font: inherit; font-weight: 600; background: none; border: 0; padding: 0; color: var(--ink); cursor: pointer; text-align: left; }
.link:hover { text-decoration: underline; }

main { padding: 24px 24px 80px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; justify-content: space-between; margin: 0 0 8px; }
.hint { color: var(--muted); font-size: 14px; margin: 0 0 16px; max-width: 80ch; }
.empty { color: var(--muted); font-size: 14px; margin: 8px 4px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.search input { width: min(340px, 100%); }
.search select { width: auto; max-width: 100%; }

/* Поля — как в форме инфографики */
input[type=text], input[type=search], input[type=month], input[type=date], select, textarea {
  width: 100%; font: inherit; color: inherit; background: var(--field);
  border: 2px solid transparent; border-radius: var(--r-field); padding: 10px 16px; min-height: 48px;
  transition: background-color 0.15s, border-color 0.15s;
}
textarea { resize: vertical; }
input:hover, select:hover, textarea:hover { background: var(--field-hover); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; border-color: var(--ink); background: var(--bg); }

/* Выпадающие списки в стиле портала. Chrome и Edge 135+ рисуют открытый список по этим правилам;
   в других браузерах остаётся системный список — работает так же, выглядит по-своему. */
@supports (appearance: base-select) {
  select, ::picker(select) { appearance: base-select; }
  select { display: flex; align-items: center; gap: 12px; cursor: pointer; text-align: start; }
  select::picker-icon {
    content: ""; width: 8px; height: 8px; margin-inline-start: auto; flex: none;
    border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
    transform: translateY(-2px) rotate(45deg); transition: transform 0.15s;
  }
  select:open::picker-icon { transform: translateY(2px) rotate(-135deg); }
  select:open { border-color: var(--ink); background: var(--bg); }
  select:disabled { cursor: not-allowed; opacity: 0.6; }
  ::picker(select) {
    border: 0; border-radius: var(--r-field); padding: 6px; margin-block: 6px;
    background: var(--bg); color: var(--ink); box-shadow: 0 12px 40px rgba(33, 25, 34, 0.18), 0 2px 6px rgba(33, 25, 34, 0.08);
    max-height: min(420px, 60vh); overflow-y: auto;
    opacity: 0; transition: opacity 0.12s, overlay 0.12s allow-discrete, display 0.12s allow-discrete;
  }
  ::picker(select):popover-open { opacity: 1; }
  @starting-style { ::picker(select):popover-open { opacity: 0; } }
  option { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 14px; border-radius: 12px; cursor: pointer; }
  option:hover, option:focus-visible { background: var(--field); outline: none; }
  option:checked { font-weight: 600; }
  option::checkmark { order: 1; margin-inline-start: auto; color: var(--accent); }
  option:disabled { color: var(--muted); cursor: default; }
  optgroup { padding-top: 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
  optgroup option { font-size: 16px; color: var(--ink); }
  optgroup option:checked { font-weight: 600; }
}

/* Карта процесса: 8 шагов. Первая строка сетки — подписи параллельных участков,
   параллельные стадии стоят друг под другом внутри пунктирной рамки */
.map-scroll { overflow-x: auto; padding: 4px 4px 8px; }
.map {
  display: grid; grid-template-columns: repeat(8, minmax(148px, 1fr)); grid-template-rows: auto; grid-auto-rows: minmax(96px, auto);
  gap: 8px; /* 8 × 148 + 7 × 8 = 1240 px — весь процесс помещается на ноутбуке 1366 px */
}
.st-plan { grid-column: 1; grid-row: 2 / 5; }
.st-sku { grid-column: 2; grid-row: 2 / 5; }
.st-dev { grid-column: 3; grid-row: 2; }
.st-samples { grid-column: 4; grid-row: 2; }
.st-search { grid-column: 3; grid-row: 3 / 5; }
.st-factories { grid-column: 4; grid-row: 3 / 5; }
.st-order { grid-column: 5; grid-row: 2; }
.st-payments { grid-column: 5; grid-row: 3; }
.st-declaration { grid-column: 5; grid-row: 4; }
.st-production { grid-column: 6; grid-row: 2 / 5; }
.st-shipping { grid-column: 7; grid-row: 2 / 5; }
.st-acceptance { grid-column: 8; grid-row: 2 / 5; }
.par-branches { grid-column: 3 / 5; }
.par-order { grid-column: 5; }
.par-frame { grid-row: 1 / 5; margin: -4px; border: 2px dashed var(--par); border-radius: calc(var(--r-tile) + 4px); }
.par-label { grid-row: 1; align-self: end; display: grid; gap: 2px; padding: 8px 10px 2px; font-size: 12px; line-height: 1.35; color: var(--muted); }
.par-label b { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink); }
.par-label .icon { width: 16px; height: 16px; color: var(--accent); }
.stage-title small.lane { font-weight: 600; color: var(--accent); white-space: normal; }

.stage { background: var(--lane); border: 1px solid var(--glass-line); border-radius: var(--r-tile); padding: 8px 6px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
/* Номер стадии и счётчик — столбиком слева: в узкой колонке название не налезает на счётчик */
/* Номер и счётчик — строкой сверху, название — во всю ширину колонки: слова не рвутся посередине */
.stage-head { display: grid; grid-template-columns: 28px minmax(0, 1fr); grid-template-rows: auto auto; gap: 2px 6px; align-items: center; margin: 0; }
.stage-head .stage-title { grid-row: 2; grid-column: 1 / -1; overflow-wrap: normal; hyphens: auto; }
.stage-head .count { grid-column: 2; grid-row: 1; padding: 0 4px 0 0; text-align: right; }
.step {
  flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ink); color: #fff; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.stage-title {
  flex: 1; min-width: 0; font: inherit; font-weight: 600; font-size: 14px; line-height: 1.25; text-align: left;
  background: none; border: 0; padding: 4px; min-height: 44px; border-radius: 10px; cursor: pointer; color: var(--ink);
}
/* подзаголовок — до двух строк; полностью — в подсказке и в регламенте */
.stage-title small { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  font-weight: 400; font-size: 12px; line-height: 1.3; color: var(--muted); margin-top: 2px; }
.stage-head .step { margin-top: 0; }
.more-cards { width: 100%; min-height: 40px; padding: 8px; font-size: 14px; background: var(--bg); display: flex; align-items: center; justify-content: center; text-align: center; text-decoration: none; }
.stage-title:hover { background: var(--field-hover); }
.count { flex: none; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; padding-right: 4px; }
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }

.card {
  display: grid; gap: 4px; padding: 10px; border-radius: var(--r-field); background: var(--bg);
  box-shadow: var(--shadow); text-decoration: none; transition: box-shadow 0.15s;
}
.card:hover { box-shadow: 0 0 0 2px var(--ink); }
.card.done { opacity: 0.75; }
.card .thumb { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; background: var(--field); }
.cards > li, .card { min-width: 0; }
.card-top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.card-top .cat { flex: 1; min-width: 0; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-name.strong { font-size: 14px; font-weight: 600; }
.art { font-variant-numeric: tabular-nums; font-weight: 700; }
.card-name { font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
.next { margin: 2px 0 0; font-size: 12px; line-height: 1.35; color: var(--muted); }
.next b { color: var(--ink); }
.next.ok { color: var(--ok); }
.chip {
  display: inline-flex; align-items: center; font-size: 12px; font-weight: 500; line-height: 1.2;
  background: var(--field); border-radius: 999px; padding: 4px 10px; white-space: nowrap;
}
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.meter { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
meter { flex: 1; height: 6px; min-width: 60px; }
.meter.wide { max-width: 420px; font-size: 14px; }

/* Окно: форма по центру, регламент стадии — панелью справа */
dialog {
  border: 1px solid var(--glass-line); padding: 24px; color: var(--ink); box-shadow: 0 24px 64px rgba(60, 25, 45, 0.24);
  background: rgba(253, 251, 252, 0.96); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
}
dialog::backdrop { background: rgba(48, 28, 40, 0.26); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
dialog.modal { width: min(640px, calc(100vw - 32px)); border-radius: var(--r-tile); }
dialog.drawer {
  margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(560px, 100vw);
  border-radius: var(--r-tile) 0 0 var(--r-tile); overflow-y: auto;
}
.dlg-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.dlg-head h2 { margin: 6px 0 4px; }
.form .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.q { margin: 0; border: 0; padding: 0; min-width: 0; }
.q.wide, fieldset.q { grid-column: 1 / -1; }
.q > label, .q > legend { display: block; font-weight: 600; font-size: 14px; margin: 0 0 6px; padding: 0; }
.req::after { content: " *"; color: var(--accent); }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { position: relative; }
.pill input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.pill span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 10px 18px; border-radius: 999px;
  background: var(--field); font-weight: 500; cursor: pointer; transition: background-color 0.15s, color 0.15s;
}
.pill:hover span { background: var(--field-hover); }
.pill input:checked + span { background: var(--ink); color: #fff; }
.pill input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.err-msg { color: var(--err); font-size: 14px; font-weight: 500; margin: 12px 0 0; }
.err-msg:empty { display: none; }
.preview { margin: 12px 0 0; font-weight: 600; }
/* кнопки окна всегда видны, даже если полей больше, чем помещается по высоте */
dialog.modal .actions {
  position: sticky; bottom: -24px; z-index: 1; padding: 12px 0; margin-bottom: -12px; background: rgba(253, 251, 252, 0.96);
}
.actions { display: flex; justify-content: flex-end; gap: 8px; margin: 20px 0 0; }

/* Регламент */
.reg { border-top: 1px solid var(--line); margin: 24px 0 0; }
.steps { padding-left: 20px; margin: 8px 0; }
.steps li { margin: 0 0 8px; }
.role {
  display: inline-block; min-width: 30px; text-align: center; font-size: 12px; font-weight: 700;
  background: var(--field); border-radius: 999px; padding: 1px 8px; margin-right: 8px;
}
.note { font-size: 14px; color: var(--muted); background: var(--lane); border-radius: 12px; padding: 10px 14px; }
.kts { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.kts li { line-height: 1.35; }
.kts small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.star { color: var(--accent); }
.kt-tag { white-space: nowrap; }
.docs { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 14px; }
.docs li { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 2px 8px; align-items: baseline; }
.docs a { grid-column: 2; overflow-wrap: anywhere; }
.doc-no { color: var(--muted); font-variant-numeric: tabular-nums; }

/* Карточка SKU */
.back { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; text-decoration: none; font-weight: 500; color: var(--muted); }
.back:hover { color: var(--ink); }
.sku-head { display: grid; gap: 8px; margin: 0 0 24px; }
.sku-head.with-cover { grid-template-columns: 112px minmax(0, 1fr); gap: 16px; align-items: start; }
/* место для фото модели: нажать или перетащить картинку */
.photo-slot { display: grid; gap: 4px; justify-items: center; border-radius: var(--r-field); }
.photo-slot.drag { outline: 3px dashed var(--accent); outline-offset: 2px; }
.cover-empty {
  display: grid; place-content: center; justify-items: center; gap: 6px; padding: 8px; border: 2px dashed var(--field-line); cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 600; color: var(--muted); text-align: center;
}
.cover-empty:hover { border-color: var(--ink); color: var(--ink); }
.cover-empty .icon { width: 28px; height: 28px; }
.cover-empty small { font-size: 12px; font-weight: 400; }
.photo-change { font-size: 14px; min-height: 32px; }
.sku-head-text { display: grid; gap: 8px; }
.cover { width: 112px; aspect-ratio: 3 / 4; object-fit: cover; border-radius: var(--r-field); background: var(--field); }
.sku-head .art { margin-right: 4px; }
.sku-head p { margin: 0; }
.now { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.panel { background: var(--lane); border: 1px solid var(--glass-line); border-radius: var(--r-tile); padding: 20px; width: 100%; }
.panel input, .panel select, .panel textarea, .panel .pill span { background: var(--bg); }
.process { display: grid; gap: 8px; }
.stage-row { border-radius: var(--r-field); background: var(--lane); border: 1px solid var(--glass-line); padding: 0 16px; }
.stage-row summary {
  display: flex; align-items: center; gap: 10px; min-height: 56px; cursor: pointer; list-style: none; font-weight: 600;
}
.stage-row summary::-webkit-details-marker { display: none; }
.stage-row.locked summary { color: var(--muted); }
.stage-row.locked .step { background: var(--line); color: var(--ink); }
.stage-row.done .step { background: var(--ok); }
.stage-name { flex: 1; }
.stage-name small { display: block; font-weight: 400; font-size: 12px; color: var(--muted); }
.badge { font-size: 12px; font-weight: 500; border-radius: 999px; padding: 3px 10px; background: var(--bg); color: var(--muted); }
.badge.active { background: var(--ink); color: #fff; }
.badge.done { background: var(--ok-soft); color: var(--ok); }
.stage-row .kts { padding: 0 0 8px; }
.kt { display: flex; gap: 10px; align-items: flex-start; }
.kt input { width: 22px; height: 22px; margin: 2px 0 0; flex: none; accent-color: var(--ink); cursor: pointer; }
.kt input:disabled { cursor: not-allowed; }
.kt label { cursor: pointer; }
.stage-docs { padding: 0 0 16px; }

/* Карточка: данные из таблицы и цены фабрик */

.sheet { background: var(--glass-strong); border: 1px solid var(--glass-line); border-radius: var(--r-tile); padding: 16px; box-shadow: var(--shadow); }
.sheet h2 { font-size: 18px; margin: 0 0 10px; }
.sheet p { margin: 8px 0 0; font-size: 14px; }
.sheet dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 16px; margin: 0; font-size: 14px; }
.sheet dt { color: var(--muted); }
.sheet dd { margin: 0; }
.quotes { font-size: 14px; margin-top: 8px; }
.quotes th, .quotes td { padding: 6px 8px; }
td.ok { color: var(--ok); font-weight: 600; }
td.bad { color: var(--err); font-weight: 600; }
.quotes th a { overflow-wrap: anywhere; }
.quotes tr.chosen th { font-weight: 700; }
.quotes .chip { margin-left: 8px; }
/* Раскрывающиеся блоки: стрелка поворачивается, когда блок открыт */
.more summary, .fold > summary, .checklist > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; list-style: none; }
.more summary::-webkit-details-marker, .fold > summary::-webkit-details-marker, .checklist > summary::-webkit-details-marker { display: none; }
.more summary::before, .checklist > summary::before, .fold > summary::after {
  content: ""; width: 7px; height: 7px; flex: none; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(-45deg); transition: transform 0.15s;
}
.more[open] > summary::before, .checklist[open] > summary::before { transform: rotate(45deg); }
.more { color: var(--muted); }
.more > :not(summary) { color: var(--ink); }
.more .hint { margin-top: 0; }
.fold > summary { min-height: 32px; }
.fold > summary h2 { flex: 1; margin: 0; }
.fold > summary::after { margin-right: 4px; transform: rotate(45deg); }
.fold[open] > summary { margin-bottom: 10px; }
.fold[open] > summary::after { transform: rotate(-135deg); }
.warn { color: var(--err); font-weight: 500; }

/* Разделы карточки */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 20px; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.tabs a {
  text-decoration: none; font-weight: 500; padding: 10px 16px; border-radius: 999px; min-height: 44px;
  display: inline-flex; align-items: center; gap: 6px;
}
.tabs a:hover { background: var(--field); }
.tabs a[aria-current="page"] { background: var(--ink); color: #fff; }
.tabs .count { font-size: 12px; font-variant-numeric: tabular-nums; }
.tabs a[aria-current="page"] .count { color: rgba(255, 255, 255, 0.85); }
/* Маркетплейсы: оттенок закреплён слева — цены WB и OZON видны рядом с ним при прокрутке вбок */
.mp tbody th, .mp thead th:first-child { position: sticky; left: 0; z-index: 1; background: var(--solid); }
@media (max-width: 760px) {
  /* вкладки карточки и поставки — одной строкой с прокруткой, а не в два ряда */
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent); padding-right: 32px; }
  .tabs a { flex: none; }
}
.brief-tab { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; max-width: 980px; justify-items: start; }
.brief-tab > * { width: 100%; min-width: 0; }
.brief-tab > .btn.danger { width: auto; }
fieldset.group { border: 1px solid var(--glass-line); padding: 20px; margin: 0 0 12px; background: var(--lane); border-radius: var(--r-tile); min-width: 0; }
fieldset.group > legend { float: left; width: 100%; font-size: 18px; font-weight: 700; margin: 0 0 14px; padding: 0; }
fieldset.group > .grid { clear: both; }
.brief input, .brief select, .brief textarea, .brief .pill span { background: var(--bg); }
.save-bar {
  position: sticky; bottom: 8px; padding: 10px 12px; border-radius: 999px; border: 1px solid var(--glass-line);
  background: rgba(255, 255, 255, 0.72); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); display: flex; justify-content: flex-end; align-items: center; gap: 12px; }
.unsaved { display: none; color: var(--err); font-weight: 500; font-size: 14px; }
form[data-dirty] .unsaved { display: inline; }
.art-big { font-size: 30px; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; margin: 0; }
.actions.start { justify-content: flex-start; flex-wrap: wrap; }
.tone-add { display: grid; grid-template-columns: minmax(0, 360px) auto; gap: 6px 8px; align-items: end; margin: 12px 0 0; }
.tone-add label { grid-column: 1 / -1; font-weight: 600; font-size: 14px; }
.panel .tone-add input { background: var(--bg); }
table.compact { font-size: 14px; }
table.compact th, table.compact td { padding: 8px; }
.chip.bad { background: #fbe4e7; color: var(--err); }
.checklists { display: grid; gap: 6px; margin: 4px 0 12px; }
.checklist { background: var(--bg); border-radius: 12px; padding: 0 12px; }
.checklist summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.checklist summary .count { margin-left: auto; }
.checklist .kts { padding: 0 0 12px; }
.checklist p { margin: 0 0 8px; font-size: 12px; }
.warn-box { background: #fbe4e7; color: var(--err); border-radius: 12px; padding: 10px 14px; font-weight: 500; margin: 0 0 12px; }
.upload { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; background: var(--lane); border: 1px solid var(--glass-line); border-radius: var(--r-tile); padding: 16px; margin: 0 0 16px; }
.upload .q > label { font-weight: 600; font-size: 14px; display: block; margin: 0 0 6px; }
.upload select { background: var(--bg); width: auto; max-width: 100%; }
.upload .q { min-width: 0; max-width: 100%; }
.history { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: 14px; }
.history li { padding: 8px 0; border-bottom: 1px solid var(--line); }

/* Поставки и фабрика */
input.cell { min-height: 40px; padding: 6px 10px; width: 92px; border-radius: 10px; font-variant-numeric: tabular-nums; }
.lines td { vertical-align: middle; }
.lines th small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }
.totals { font-weight: 600; margin: 8px 0 0; }
.links { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.list-section .toolbar h2 { margin: 0; }
.params { background: var(--lane); }
.params .form input { background: var(--bg); }

/* Маркетплейсы */
.mp { margin: 0 0 32px; }
.mp-head h2 { margin: 0 0 4px; }
.mp-head p { margin: 0 0 8px; }
.inci summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.inci p { font-size: 14px; color: var(--muted); max-width: 100ch; }

/* Фабрики */
.table-scroll { overflow-x: auto; position: relative; } /* скрытые поля выбора файла не вылезают из таблицы */
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { font-size: 12px; color: var(--muted); font-weight: 600; vertical-align: middle; }
tbody th small { display: block; color: var(--muted); font-weight: 400; }
.num { font-variant-numeric: tabular-nums; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: rgba(33, 25, 34, 0.9); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  color: #fff; border-radius: 999px; padding: 10px 12px 10px 20px; font-weight: 500;
  transition: opacity 0.2s, transform 0.2s; max-width: calc(100vw - 40px); display: flex; flex-wrap: wrap; align-items: center; gap: 12px; z-index: 30;
}
.toast-action {
  font: inherit; font-weight: 700; color: #fff; background: #453e45; border: 0; border-radius: 999px;
  min-height: 36px; padding: 6px 14px; cursor: pointer;
}
/* сплошной цвет — тот же, что белый 16 % / 28 % поверх фона всплывашки: контраст текста проверяется (S7924) */
.toast-action:hover { background: #5f595f; }
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* Средняя ширина: меню целиком второй строкой шапки, а не прячется за край */
@media (max-width: 1180px) {
  .top { flex-wrap: wrap; row-gap: 4px; }
  .brand { flex: 1; }
  .nav { order: 3; flex-basis: 100%; }
}

/* Телефон: шаги карты — списком сверху вниз, карточка SKU — в одну колонку */
@media (max-width: 760px) {
  /* шапка закреплена и в одну строку: название, поиск, меню; разделы — списком под кнопкой меню */
  .top { flex-wrap: wrap; gap: 4px 8px; padding: 8px 12px 8px 16px; }
  .menu-btn { display: inline-grid; color: var(--ink); }
  .top:not(.menu-open) .nav { display: none; }
  .brand small { display: none; }
  /* меню прокручивается вбок: правый край тает — видно, что пунктов больше */
  .nav { order: 3; flex-basis: 100%; flex-direction: column; gap: 2px; padding: 4px 0 8px; }
  .nav a { min-height: 44px; padding: 8px 14px; }
  .cmdk-btn { min-width: 0; }
  dialog.cmdk { margin-top: 8px; }
  /* окно поиска: название целиком, подпись — под ним */
  .cmdk-item { flex-wrap: wrap; row-gap: 0; }
  .cmdk-label { white-space: normal; }
  .cmdk-hint { margin-left: 0; flex-basis: 100%; font-size: 12px; }
  /* карта: без больших фото — экран не съедается */
  .card .thumb { display: none; }
  /* «Сохранить просчёт» — под таблицей, а не поверх строк */
  .lines .save-bar { position: static; }
  /* «Модели» таблицей: галочка, модель, стадия и прогресс — без прокрутки вбок */
  table.models:not(.ref) :is(th, td):is(:nth-child(2), :nth-child(4), :nth-child(6), :nth-child(7), :nth-child(8)) { display: none; }
  table.models:not(.ref) tbody th { left: 44px; }
  table.models:not(.ref) meter { display: none; }
  table.models:not(.ref) :is(th, td) { padding: 8px 4px; }
  table.models:not(.ref) .chip { white-space: normal; }
  .list-box .table-scroll:has(> table.models:not(.ref)) { padding: 4px; }
  /* окна-шторки на весь экран: поля прокручиваются, кнопки всегда видны внизу */
  dialog.modal { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; padding: 16px; }
  dialog.modal .actions { position: sticky; bottom: -16px; padding: 12px 0; margin-bottom: -16px; }
  main { padding: 16px 16px 64px; }
  .map-scroll { overflow: visible; }
  .map { display: flex; flex-direction: column; min-width: 0; }
  .par-frame { display: none; }
  .par-label { padding: 12px 4px 0; border-top: 2px dashed var(--par); margin-top: 8px; }
  .form .grid { grid-template-columns: 1fr; }
  .tone-add { grid-template-columns: 1fr; }
  dialog.drawer { width: 100vw; border-radius: 0; }
}

/* Карточка и фабрика: главное слева, справка справа; на узком экране — одна колонка */
.card-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 400px); gap: 24px; align-items: start; }
.facts { line-height: 1.5; }
.card-main, .card-aside { display: grid; gap: 12px; min-width: 0; }
.section-title { font-size: 18px; margin: 12px 0 0; }
.now-block { background: var(--glass-strong); box-shadow: var(--shadow); border: 2px solid var(--ink); border-radius: var(--r-tile); padding: 20px; display: grid; gap: 16px; }
.now-block h2 { margin: 0; }
.now-block.done { border-color: var(--ok); }
.now-stage { display: grid; gap: 8px; }
.now-stage + .now-stage { border-top: 1px solid var(--line); padding-top: 16px; }
.now-stage h3 { display: flex; align-items: center; gap: 10px; margin: 0; }
.hint-line { margin: 0; font-size: 14px; }
.reg-steps p { margin: 4px 0; }
td.ok .icon { margin-right: 4px; }
td small.warn { display: block; font-size: 12px; }
@media (max-width: 1100px) {
  .card-layout { grid-template-columns: minmax(0, 1fr); }
  /* на узком экране цены и связи фабрики — до формы данных */
  .factory-page .card-aside { order: -1; }
}
@media (max-width: 760px) {
  .sku-head.with-cover { grid-template-columns: 72px minmax(0, 1fr); }
  .cover { width: 72px; }
}

/* ---------- аудит UX: доступность, реестры, оттенки, файлы записей ---------- */
abbr[title] { text-decoration: underline dotted; text-underline-offset: 3px; cursor: help; }
.skip {
  position: absolute; left: 16px; top: -60px; z-index: 50; background: var(--ink); color: #fff; padding: 10px 16px;
  border-radius: 999px; text-decoration: none; font-weight: 600;
}
.skip:focus { top: 8px; }
main:focus { outline: none; }
dialog.ask { width: min(440px, calc(100vw - 32px)); border-radius: var(--r-tile); }
dialog.ask p { margin: 0 0 4px; font-size: 18px; line-height: 1.45; }
.list-filters { margin: 0 0 12px; }
.count-line { color: var(--muted); font-size: 14px; margin: 0 0 8px; }
th .sort {
  font: inherit; font-weight: inherit; color: inherit; background: none; border: 0; padding: 4px 0; min-height: 44px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px; text-align: left;
}
th .sort .sort-mark { opacity: 0.35; }
th .sort.active { color: var(--ink); }
th .sort.active .sort-mark { opacity: 1; }
th .sort:hover { color: var(--ink); text-decoration: underline; }
.bulk-bar {
  position: sticky; top: 72px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  background: var(--ink); color: #fff; border-radius: var(--r-field); padding: 10px 14px; margin: 0 0 12px;
}
.bulk-bar select { width: auto; max-width: min(520px, 100%); min-height: 40px; padding: 6px 12px; background: var(--bg); color: var(--ink); }
.bulk-bar .btn { min-height: 40px; }
.bulk-bar .btn.primary { background: var(--bg); color: var(--ink); }
.bulk-bar .link { color: #fff; }
table.models td, table.models th { vertical-align: middle; }
tr.picked { background: #f7eef0; }
.model-link { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.model-link:hover span { text-decoration: underline; }
img.mini, .mini-empty { width: 40px; height: 53px; object-fit: cover; border-radius: 6px; background: var(--field); flex: none; display: block; }
.mini-empty { display: grid; place-items: center; color: var(--field-line); }
.mini-empty .icon { width: 20px; height: 20px; }
.photo-cell { width: 56px; }
.next-cell { font-size: 14px; max-width: 320px; }
.order-body { display: grid; gap: 16px; min-width: 0; }
.order-body > * { min-width: 0; }
.kt-box summary { cursor: pointer; font-weight: 600; min-height: 32px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.kt-box summary small { font-weight: 400; color: var(--muted); font-size: 12px; }
.kt-box .kts { margin-top: 10px; }
.swatch {
  display: inline-block; width: 14px; height: 14px; border-radius: 50%; margin-right: 6px; vertical-align: -2px;
  background: var(--sw, #ccc); box-shadow: inset 0 0 0 1px rgba(33, 25, 34, 0.2);
}
.tone-strip { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 14px; }
.tone-tag { display: inline-flex; align-items: center; }
input.color { width: 44px; height: 32px; padding: 0; border: 0; background: none; cursor: pointer; }
.item-files { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 12px; }
.file-chip { display: inline-flex; align-items: center; background: var(--field); border-radius: 999px; padding-left: 10px; }
.file-chip a { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; }
.file-chip .icon-btn { width: 32px; height: 32px; }
.attach { display: inline-flex; align-items: center; gap: 4px; font-weight: 500; color: var(--muted); }
.brief-menu {
  position: sticky; top: 72px; z-index: 4; display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; border-radius: var(--r-field);
  background: rgba(255, 255, 255, 0.72); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border: 1px solid var(--glass-line);
}
.brief-menu a { text-decoration: none; font-size: 14px; font-weight: 500; padding: 8px 12px; border-radius: 999px; min-height: 36px; display: inline-flex; align-items: center; }
.brief-menu a:hover { background: var(--field); }
fieldset.group, #group-article, .brief-tab .warn-box { scroll-margin-top: 170px; }
/* Таблицы списков и поставки — на «плотном» стекле: цифры читаются на любом участке фона */
.list-box .table-scroll, .lines .table-scroll {
  background: var(--glass-strong); border: 1px solid var(--glass-line); border-radius: var(--r-tile); box-shadow: var(--shadow); padding: 4px 8px 8px;
}
@media (max-width: 1180px) {
  .bulk-bar, .brief-menu { top: 120px; }
}
.map-hint { margin-bottom: 4px; }
@media (max-width: 760px) {
  .brief-menu { position: static; }
  /* панель действий с выбранными — внизу экрана: «Отметить» под рукой, где бы в списке ни был */
  .bulk-bar { position: fixed; left: 8px; right: 8px; bottom: 8px; top: auto; z-index: 20; margin: 0; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25); }
  .bulk-bar select { width: 100%; max-width: 100%; }
  .bulk-bar .btn, .bulk-bar select, .bulk-bar .link { min-height: 44px; }
  .list-box:has(.bulk-bar) { padding-bottom: 220px; }
  .sticky-first tbody th, .sticky-first thead th:first-child { position: sticky; left: 0; z-index: 1; background: var(--solid); min-width: 120px; max-width: 160px; }
  .toolbar { margin-bottom: 4px; }
}
.filters > .search { min-width: 0; max-width: 100%; }
/* Кнопка выбора файла — как остальные кнопки портала */
input[type=file] { font: inherit; font-size: 14px; color: var(--muted); max-width: 100%; }
input[type=file]::file-selector-button {
  font: inherit; font-weight: 600; color: var(--ink); background: var(--field); border: 0; border-radius: 999px;
  min-height: 44px; padding: 0 18px; margin-right: 12px; cursor: pointer;
}
input[type=file]::file-selector-button:hover { background: var(--field-hover); }
/* Галочка выбора строки: нажимается вся ячейка */
.pick-hit { display: flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; margin: -8px; cursor: pointer; }
.pick-hit input { width: 18px; height: 18px; cursor: pointer; }
/* Фильтры на телефоне — под кнопкой */
.more-filters { flex: 0 0 auto; }
.extra-filters { flex-basis: 100%; }
@media (max-width: 760px) {
  .more-filters[open] { flex-basis: 100%; }
  .list-filters:has(.more-filters) > .search { flex: 1 1 100%; }
  .more-filters .search, .more-filters select { width: 100%; }
}
.more-filters > summary { list-style: none; display: inline-flex; min-height: 44px; }
.more-filters > summary::-webkit-details-marker { display: none; }
.more-filters > .filters { margin-top: 8px; }
/* Просчёт поставки: название SKU закреплено слева — маржа и прибыль видны рядом с ним при прокрутке вбок */
.lines tbody th, .lines thead th:first-child { position: sticky; left: 0; z-index: 1; background: var(--solid); }
.lines tbody th { max-width: 160px; }
.filters .search select { max-width: 100%; }

/* Белые поля на светло-сером фоне разделов — с рамкой: граница поля видна */
.panel :is(input:not([type=checkbox], [type=radio], [type=color]), select, textarea),
.brief :is(input:not([type=checkbox], [type=radio]), select, textarea) { border: 1px solid var(--field-line); padding: 11px 17px; }
.panel :is(input, select, textarea):focus-visible, .brief :is(input, select, textarea):focus-visible { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }

/* Ошибка ввода — у самого поля */
:is(input, select, textarea)[aria-invalid="true"] { border-color: var(--err); box-shadow: 0 0 0 1px var(--err); }
.field-err { margin: 4px 0 0; color: var(--err); font-size: 14px; font-weight: 500; line-height: 1.35; }
td .field-err { max-width: 160px; }

/* Сокращение: расшифровка при наведении (подсказка браузера) и при нажатии — на телефоне тоже */
abbr[title][tabindex] { cursor: help; }
abbr[title]:focus { position: relative; outline: none; }
abbr[title]:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 2px; }
abbr[title]:focus::after {
  content: attr(title); position: absolute; left: 0; top: calc(100% + 4px); z-index: 20; width: max-content; max-width: min(280px, 80vw);
  padding: 6px 10px; border-radius: 8px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 400; line-height: 1.4; white-space: normal;
}

/* Роли и сокращения в панели регламента */
.glossary { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 8px 0 0; font-size: 14px; }
.glossary dt { font-weight: 700; }
.glossary dd { margin: 0; }

.kt.locked label { color: var(--muted); }
.breakdown { margin-top: 8px; }
td.strong { font-weight: 600; }

/* Таблица моделей: шапка и колонка модели не уходят при прокрутке */
.list-box .table-scroll:has(> table.models) { max-height: calc(100vh - 140px); overflow: auto; }
table.models thead th { position: sticky; top: 0; z-index: 2; background: var(--solid); }
table.models td:first-child { position: sticky; left: 0; z-index: 1; background: var(--solid); width: 44px; }
table.models td.photo-cell { position: sticky; left: 44px; z-index: 1; background: var(--solid); }
table.models tbody th { position: sticky; left: 100px; z-index: 1; background: var(--solid); }
table.models thead th:first-child { left: 0; z-index: 3; }

.no-color { display: block; }

@media (max-width: 760px) {
  /* пустые стадии карты — одной строкой заголовка */
  .stage > .empty { display: none; }
  .stage:has(> .empty) { padding: 4px 6px; }
}

/* «Модели»: переключатель вида */
.list-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.seg-group { display: inline-flex; padding: 4px; gap: 4px; border-radius: 999px; background: var(--field); }
.seg { font: inherit; font-weight: 600; font-size: 14px; min-height: 44px; padding: 8px 16px; border: 0; border-radius: 999px; background: transparent; color: var(--ink); cursor: pointer; }
.seg:hover { background: var(--field-hover); }
.seg.on { background: var(--ink); color: #fff; }

/* Доска ассортимента: группы и плитки моделей */
.board { display: grid; gap: 24px; }
.board-group h2 { display: flex; align-items: baseline; gap: 8px; font-size: 18px; margin: 0 0 12px; }
.tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.tile { position: relative; display: grid; align-content: start; gap: 4px; padding: 8px; border-radius: var(--r-tile); background: var(--glass-strong); border: 1px solid var(--glass-line); box-shadow: var(--shadow); min-width: 0; }
.tile:hover { box-shadow: 0 0 0 2px var(--ink); }
.tile.picked { box-shadow: 0 0 0 2px var(--accent); }
.tile.drag { outline: 3px dashed var(--accent); outline-offset: 2px; }
.tile-pick { position: absolute; top: 14px; left: 14px; z-index: 1; width: 22px; height: 22px; }
.tile-link { display: grid; gap: 8px; color: inherit; text-decoration: none; }
.tile-img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: var(--r-field); background: var(--field); display: block; }
.tile-noimg { display: grid; place-content: center; justify-items: center; gap: 6px; color: var(--muted); font-size: 14px; }
.tile-noimg .icon { width: 32px; height: 32px; }
.tile-body { display: grid; gap: 4px; padding: 0 4px 4px; min-width: 0; }
.tile-name { font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.tile-link:hover .tile-name { text-decoration: underline; }
.tile-tones { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.tile-meta { font-size: 14px; color: var(--muted); }
.tile-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.tile-add { justify-self: start; padding: 4px; font-size: 14px; min-height: 32px; }

@media (max-width: 760px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tile { padding: 6px; }
}

/* Печать доски — лист ассортимента для совещания: альбомный A4, по 8 моделей в ряд, шапка с отбором и датой;
   модель без фото — низкая плашка вместо пустого места под фото */
@page { size: A4 landscape; margin: 10mm; }
/* План и справочник: показатель «Отработано SKU», итоги года, широкие таблицы цифр с закреплённым первым столбцом */
.kpi { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 44px; padding: 8px 16px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); font-weight: 600; text-decoration: none; }
.kpi b { font-variant-numeric: tabular-nums; }
.kpi:hover { text-decoration: underline; }
.toolbar .kpi { margin-right: auto; }
.kpi-note { font-weight: 500; font-size: 14px; }
.plan-sum { display: flex; flex-wrap: wrap; gap: 8px 32px; margin: 0 0 16px; }
.plan-sum dt { font-size: 14px; color: var(--muted); }
.plan-sum dd { margin: 0; font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.plan-table th, .plan-table td { padding: 8px 6px; }
.plan-table thead th:not(:first-child) { text-align: right; } /* подписи месяцев — над числами */
.plan-table td.num, .models.ref td.num { text-align: right; white-space: nowrap; }
.plan-table tbody th, .plan-table tfoot th, .plan-table thead th:first-child,
.models.ref tbody th, .models.ref thead th:first-child { position: sticky; left: 0; z-index: 1; background: var(--solid); min-width: 200px; }
.plan-table tfoot th, .plan-table tfoot td { font-weight: 700; border-top: 2px solid var(--ink); }
.plan-table .total { font-weight: 600; }
.models.ref td { white-space: nowrap; }
.plan-card .sheet { margin: 0 0 24px; }
@media (max-width: 760px) {
  .plan-table tbody th, .plan-table tfoot th, .plan-table thead th:first-child,
  .models.ref tbody th, .models.ref thead th:first-child { min-width: 132px; max-width: 132px; }
}

/* Сенсорный экран: подсказки клавиш не нужны */
@media (hover: none) {
  .cmdk-btn kbd, .cmdk-foot { display: none; }
}
