/* Оформление wb_app.
   Фиолетовая гамма Wildberries: глубокий #481173 и малиновый #CB11AB на
   знаке, рабочий акцент — #7A1FA2 (белый текст на нём даёт 8,25:1).
   Светлая тема описана на голом :root, тёмная только переопределяет
   токены — так ни один цвет не остаётся определённым лишь внутри
   медиазапроса, и переключатель работает в обе стороны.
   Шрифты локальные: подключать Google Fonts нельзя, у владельца
   fonts.googleapis.com не открывается вовсе и страница ждёт таймаута. */

:root {
  color-scheme: light;

  --bg:        #f6f7f9;
  --surface:   #ffffff;
  --surface-2: #f1f1f5;
  --line:      #dedee6;
  --line-soft: #e9e8ee;
  --ink:       #211e27;
  --ink-2:     #585361;
  --ink-3:     #6c6874;
  --accent:    #7a1fa2;
  --accent-2:  #f3e6fa;
  --btn-ink:   #ffffff;
  --brand-1:   #481173;
  --brand-2:   #cb11ab;
  --good:      #1a7f52;
  --warn:      #8a5a00;
  --bad:       #b3261e;
  --good-bg:   #e6f4ec;
  --warn-bg:   #fdf3e0;
  --bad-bg:    #fdeceb;
  --radius:    7px;
  --radius-lg: 8px;
  /* Выбранный владельцем «Мягкий контраст» (01.11.2026): глубину даёт
     тёмное меню, а рабочие плоскости разделены тонкой линией, без теней. */
  --shadow:    none;
  --side-w:    258px;
  --nav-bg:    #29252f;
  --nav-ink:   #f7f5f9;
  --nav-muted: #cbc6d2;
  --nav-active:#483952;
  --nav-hover: #37313f;
  --nav-line:  #514959;
  /* Шрифты лежат у нас в assets/fonts: Google Fonts из браузера владельца
     не открывается вовсе, страница ждала бы его до таймаута. Системный
     набор оставлен запасным — если woff2 не доехал, вёрстка не поедет. */
  --font:      "Golos Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono:      "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

/* Тёмные значения объявлены дважды нарочно: под prefers-color-scheme —
   для тех, кто ничего не выбирал, и под [data-theme="dark"] — чтобы
   ручной выбор побеждал системный в обе стороны. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg:        #141118;
    --surface:   #1c1822;
    --surface-2: #262030;
    --line:      #342c40;
    --line-soft: #2a2434;
    --ink:       #ece8f2;
    --ink-2:     #aca4b8;
    --ink-3:     #939dab;
    --accent:    #c08cff;
    --accent-2:  #33234a;
    --btn-ink:   #1b1027;
    --brand-1:   #8b53c9;
    --brand-2:   #e46bd0;
    --good:      #63c99a;
    --warn:      #e0b155;
    --bad:       #f28b82;
    --good-bg:   #1b2f26;
    --warn-bg:   #33290f;
    --bad-bg:    #34201e;
    --shadow:    none;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg:        #141118;
  --surface:   #1c1822;
  --surface-2: #262030;
  --line:      #342c40;
  --line-soft: #2a2434;
  --ink:       #ece8f2;
  --ink-2:     #aca4b8;
  --ink-3:     #939dab;
  --accent:    #c08cff;
  --accent-2:  #33234a;
  --btn-ink:   #1b1027;
  --brand-1:   #8b53c9;
  --brand-2:   #e46bd0;
  --good:      #63c99a;
  --warn:      #e0b155;
  --bad:       #f28b82;
  --good-bg:   #1b2f26;
  --warn-bg:   #33290f;
  --bad-bg:    #34201e;
  --shadow:    none;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }
::selection { background: var(--accent-2); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0;
  margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

.skip { position: absolute; left: -9999px; }
.skip:focus {
  left: 12px; top: 12px; z-index: 10;
  background: var(--surface); padding: 8px 12px; border-radius: var(--radius);
}

/* ОБОЛОЧКА: БОКОВОЕ МЕНЮ И КОЛОНКА СОДЕРЖИМОГО.
   Пятнадцать разделов в горизонтальной строке помещались только за счёт
   выпадающих списков: чтобы попасть в «Честный знак», нужно было навести
   на «Продажи» и не промахнуться мимо всплывшего меню. Сбоку они видны
   разом, а активная группа показывает свои страницы сразу под собой.
   Меню тёмное во всех темах: его собственные токены не наследуют цвет
   рабочей области. Высота ограничена окном, длинная группа прокручивается. */
.shell { display: flex; align-items: flex-start; }
.side {
  position: sticky; top: 0;
  flex: 0 0 var(--side-w); width: var(--side-w);
  margin: 0; padding: 22px 12px 16px;
  background: var(--nav-bg); color: var(--nav-ink); border: 0;
  border-radius: 0; box-shadow: none;
  height: 100dvh; overflow-y: auto;
  display: flex; flex-direction: column;
  scrollbar-width: thin; scrollbar-color: var(--nav-line) var(--nav-bg);
  transition: none;
}
.side-head { display: flex; align-items: center; gap: 6px; padding: 0 2px 24px 16px; flex: none; }
.side .brand { flex: 1 1 auto; min-width: 0; overflow: hidden; }
.side .brand { font-size: 21px; gap: 5px; color: var(--nav-ink); letter-spacing: 0; }
.side .brand .mark { background: none; color: inherit; padding: 0; font-size: inherit; letter-spacing: inherit; }
.side-cabinet { margin: 0 4px 22px; flex: none; }
.side-cabinet .pick { display: block; margin: 0; }
.side-cabinet select, .side-project {
  display: block; width: 100%; padding: 9px 11px; font: inherit;
  background: var(--nav-bg); color: var(--nav-ink); border: 1px solid var(--nav-line);
  border-radius: var(--radius);
}
.side-cabinet option { background: var(--nav-bg); color: var(--nav-ink); }
.side :focus-visible { outline-color: #d5b4e9; }
.side-settings { margin-top: auto; padding-top: 24px; flex: none; }
.side-settings > summary { list-style: none; cursor: pointer; }
.side-settings > summary::-webkit-details-marker { display: none; }
.side-settings > summary::after { content: ''; width: 6px; height: 6px; border: solid currentColor; border-width: 0 1px 1px 0; transform: rotate(45deg); margin: 0 2px 3px auto; }
.side-settings[open] > summary::after { transform: rotate(225deg); margin-bottom: -3px; }
.side-settings > a { font-size: 13px; }
.mobile-cabinet { display: none; }
:root[data-side="mini"] .mobile-cabinet { display: inline; font-weight: 600; }
.side-close { display: none; }

/* Кнопка сворачивания: две полоски со стрелкой внутрь. Рисуем рамкой,
   а не значком, — на неё нужно всего два состояния, и лишний svg тут
   дороже трёх строк CSS. */
.sfold {
  flex: none; width: 28px; height: 28px; padding: 0; cursor: pointer;
  background: none; border: 0; border-radius: var(--radius); color: var(--nav-muted);
  display: inline-flex; align-items: center; justify-content: center;
}
.sfold:hover { background: var(--nav-hover); color: var(--nav-ink); }
.sfold span {
  width: 7px; height: 7px; display: block;
  border-left: 1.8px solid currentColor; border-bottom: 1.8px solid currentColor;
  transform: rotate(45deg) translate(1px, -1px);
  transition: transform .18s ease;
}

/* СВЁРНУТОЕ МЕНЮ — ТОЛЬКО ЗНАЧКИ.
   Ширина по значку с полями, подписи убраны из потока (display:none, а
   не прозрачность: невидимый текст всё равно растягивал бы пункт).
   Название раздела не пропадает совсем — оно осталось в title, и
   наведение подсказывает. */
:root[data-side="mini"] .side {
  flex-basis: 64px; width: 64px; padding-left: 8px; padding-right: 8px;
}
:root[data-side="mini"] .side .bname,
:root[data-side="mini"] .side-cabinet,
:root[data-side="mini"] .nv span,
:root[data-side="mini"] .nvsub { display: none; }
/* Подпись «Настройки» в узком меню не помещается, но граница между
   разделами и служебным нужна — иначе значки идут одним нечитаемым
   столбиком. Подпись превращается в черту. */
:root[data-side="mini"] .side-sec {
  height: 1px; padding: 0; margin: 10px 6px; overflow: hidden;
  text-indent: -999em; background: var(--nav-line);
}
:root[data-side="mini"] .side-head { padding: 2px 0 12px; justify-content: center; }
:root[data-side="mini"] .brand { flex: none; }
/* Кнопка переезжает под знак: рядом с ним в 48 пикселях они толкаются. */
:root[data-side="mini"] .side-head { flex-direction: column; gap: 8px; }
:root[data-side="mini"] .sfold span { transform: rotate(-135deg) translate(-1px, 1px); }
:root[data-side="mini"] .nv { justify-content: center; padding: 10px 0; }
:root[data-side="mini"] .side-settings > summary::after { display: none; }
/* Служебные пункты рисовались подписью без значка — в узком меню от них
   осталась бы пустая полоска. Значки им добавлены, а этот запрет ловит
   любой будущий пункт, про значок которого забыли. */
:root[data-side="mini"] .nv:not(:has(svg)) { display: none; }
.col { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }

/* Разделитель между блоками меню — подпись, а не линия: линия делит,
   подпись объясняет. */
.side-sec {
  padding: 14px 10px 5px; font-size: 11px; font-weight: 600;
  letter-spacing: .7px; text-transform: uppercase; color: var(--ink-3);
}
.nv {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 10px; margin-bottom: 3px; border-radius: var(--radius); flex: none;
  color: var(--nav-muted); text-decoration: none; font-size: 15px; font-weight: 500;
}
.nv:hover { background: var(--nav-hover); color: var(--nav-ink); }
.nv.on { background: var(--nav-active); color: var(--nav-ink); font-weight: 600; }
.nv svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none;
  stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
/* Страницы активной группы. Отступ слева выравнивает их по подписи
   группы, а не по иконке: так видно, что это её продолжение. */
.nvsub { margin: 2px 0 6px; }
.nvsub a {
  display: block; padding: 7px 10px 7px 38px; border-radius: var(--radius);
  color: var(--nav-muted); text-decoration: none; font-size: 13px;
}
.nvsub a:hover { background: var(--nav-hover); color: var(--nav-ink); }
.nvsub a.cur { background: var(--nav-active); color: var(--nav-ink); font-weight: 550; }

/* Шапка стала полосой над содержимым: имя приложения и разделы ушли
   в меню, здесь остались только переключатели — период, кабинет,
   настройки, тема. Светлая полоса отделяет инструменты от содержимого. */
.top {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  padding: 12px 24px; min-height: 62px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 650; letter-spacing: .2px; display: flex; align-items: center; gap: 8px; }
.brand .mark {
  display: inline-block; padding: 3px 7px;
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
  color: #fff; border-radius: 6px;
  font-size: 12px; font-weight: 700; letter-spacing: .3px;
}
/* НАВИГАЦИЯ ГРУППАМИ.
   Название группы — ссылка, стрелка рядом — кнопка: наведением список
   раскрывает CSS, пальцем — кнопка. Одно без другого не работает:
   наведения нет на телефоне, кнопки мало на мыши. */
.nav { display: flex; gap: 2px; align-items: center; }
.grp { position: relative; display: flex; align-items: center; }
.grp > .gbtn {
  padding: 6px 11px; border-radius: 8px;
  color: var(--ink-2); text-decoration: none; white-space: nowrap;
  background: none; border: 0; font: inherit; cursor: pointer;
}
.grp:hover > .gbtn { background: var(--surface-2); color: var(--ink); }
.grp.on > .gbtn { background: var(--accent-2); color: var(--accent); font-weight: 550; }

.gcar {
  width: 20px; height: 26px; padding: 0; margin-left: -6px;
  background: none; border: 0; cursor: pointer; color: var(--ink-3);
  display: inline-flex; align-items: center; justify-content: center;
}
.gcar::before {
  content: ''; width: 6px; height: 6px;
  border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor;
  transform: rotate(45deg) translate(-1px, -1px);
  transition: transform .18s ease;
}
.grp.on .gcar { color: var(--accent); }
.grp:hover .gcar::before,
.grp.open .gcar::before { transform: rotate(225deg) translate(-2px, -2px); }

.gmenu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 40;
  min-width: 210px; padding: 5px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 10px 30px -12px rgba(0,0,0,.35);
  opacity: 0; visibility: hidden; transform: translateY(-5px);
  transition: opacity .15s ease, transform .15s ease, visibility .15s;
}
.gmenu.right { left: auto; right: 0; }
.grp:hover > .gmenu,
.grp:focus-within > .gmenu,
.grp.open > .gmenu { opacity: 1; visibility: visible; transform: none; }
.gmenu a {
  display: block; padding: 7px 10px; border-radius: 7px;
  color: var(--ink); text-decoration: none; white-space: nowrap;
}
.gmenu a:hover { background: var(--surface-2); }
.gmenu a.cur { color: var(--accent); font-weight: 550; }

/* Шестерёнка: тот же механизм, но открывается только щелчком —
   наведение здесь мешало бы, кнопка стоит вплотную к теме. */
.grp.gear > .gbtn { font-size: 15px; line-height: 1; padding: 7px 10px; }

.burger {
  display: none; width: 34px; height: 30px; padding: 7px 6px;
  background: none; border: 0; cursor: pointer;
  flex-direction: column; justify-content: space-between;
}
.burger span { display: block; height: 2px; border-radius: 2px; background: var(--ink-2); }

.who { margin-left: auto; display: flex; align-items: center; flex-wrap: wrap; min-width: 0; max-width: 100%; gap: 10px; font-size: 14px; }
.who .usr { color: var(--ink-2); }
.who .cab { font-weight: 550; }
.pick { display: flex; align-items: center; gap: 6px; }
.pick .lbl { color: var(--ink-3); font-size: 13px; }

/* Переключатель темы. Три состояния: как в системе, светлая, тёмная —
   поэтому это кнопка с подписью, а не выключатель: выключатель врёт,
   когда положений три. */
.theme {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; font: inherit; font-size: 13px;
  color: var(--ink-2); background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px; cursor: pointer;
}
.theme:hover { background: var(--surface-2); color: var(--ink); }
.theme .ico { font-size: 14px; line-height: 1; }
.theme .ico svg { display: block; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.wrap { max-width: 1600px; width: 100%; margin: 0 auto; padding: 24px 24px 56px; }
.bot { padding: 16px 20px 30px; color: var(--ink-3); font-size: 13px; text-align: center; }

h1 { font-size: 22px; margin: 0 0 4px; font-weight: 640; }
h2 { font-size: 17px; margin: 26px 0 10px; font-weight: 600; }
.sub { color: var(--ink-2); margin: 0 0 18px; }

/* Карточки и плитки */
.card {
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 18px; }

/* Плашки под КРУПНЫЕ суммы — по три в ряд.
   Ширина содержимого 1140 (wrap 1180 минус отступы), и шесть обычных
   плашек в неё не влезают: получалось пять и одна сирота во втором ряду.
   Сузить порог до 176 я пробовал — тогда «−2 296 467 ₽» перестаёт
   помещаться в 26 пикселей шрифта и разрывается, отделяя рубль от
   числа. Шесть семизначных сумм в ряд на такой ширине просто не живут,
   поэтому здесь два честных ряда по три, а не попытка ужать. */
.tiles.wide { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.tile {
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg); padding: 16px 18px; box-shadow: var(--shadow);
}
.tile .k { color: var(--ink-3); font-size: 13px; }
/* Иконка плитки: квадрат со скруглением и подложкой в цвет смысла.
   Цвет здесь не украшение — он повторяет тот же словарь, что и плашки:
   зелёное хорошо, жёлтое требует внимания, красное плохо. */
.tile .i {
  width: 34px; height: 34px; border-radius: 10px; margin-bottom: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-2); color: var(--accent);
}
.tile .i svg { width: 18px; height: 18px; stroke: currentColor; fill: none;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tile .i.ok { background: var(--good-bg); color: var(--good); }
.tile .i.warn { background: var(--warn-bg); color: var(--warn); }
.tile .i.bad { background: var(--bad-bg); color: var(--bad); }
/* Прирост рядом со значением. Стрелка обязательна: цветом одним
   направление не читается ни в печати, ни при дальтонизме. */
.tile .d { font-size: 13px; font-weight: 600; margin-left: 8px; white-space: nowrap; }
.tile .d.up { color: var(--good); }
.tile .d.down { color: var(--bad); }
/* Крупные одиночные числа — пропорциональными цифрами: они читаются
   как текст. tabular-nums только там, где числа стоят столбиком. */
.tile .v { font-size: 26px; font-weight: 620; margin-top: 4px; }
.tile .n { color: var(--ink-2); font-size: 13px; margin-top: 2px; }
/* Плитка с работой. Ноль в ней — это «делать нечего», и она ничем не
   выделяется; как только число не ноль, плитка становится заметной.
   Класс ставился на странице Честного знака и раньше, но правила под
   него не было: разметка обещала подсветку, а её не существовало. */
.tile.warn { border-color: var(--warn); background: var(--warn-bg); }
.tile.warn .k, .tile.warn .n { color: var(--warn); opacity: .85; }
.tile.warn .v { color: var(--warn); }

/* Таблицы.
   Шапка на подложке, а не на белом: в таблице на десять колонок глазу
   нужна опора сверху. Последняя строка без линии — иначе она рисует
   черту вплотную к краю карточки. */
.tscroll { overflow-x: auto; }
/* Сводка: все размеры в строке товара, длинный список и статьи расходов
   прокручиваются внутри таблицы. Товар остаётся виден при прокрутке. */
.expense-section { margin: 30px 0; }
.expense-section .dsec { margin-bottom: 8px; }
.expense-filters .fbox:not(.fbtn) { flex: 1 1 220px; max-width: 360px; }
.expense-filters input[type=search] { width: 100%; min-width: 0; }
.expense-scroll { max-height: 620px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.expense-scroll:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
table.expense-table { font-size: 13px; }
table.expense-table thead th { position: sticky; top: 0; z-index: 2; }
table.rows.expense-table th.num { white-space: normal; min-width: 110px; max-width: 150px; }
table.rows.expense-table th.sortable a { white-space: normal; padding: 10px 12px; min-height: 44px; box-sizing: border-box; }
table.rows.expense-table th.sortable a:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }
table.expense-table td:first-child:not([colspan]), table.expense-table th:first-child {
  position: sticky; left: 0; min-width: 230px; max-width: 280px; background: var(--surface); z-index: 1;
  overflow-wrap: anywhere; box-shadow: inset -1px 0 var(--line-soft);
}
table.expense-table thead th:first-child { z-index: 3; background: var(--surface-2); }
table.expense-table tfoot td:first-child { background: var(--surface-2); }
.expense-name { font-weight: 600; margin-bottom: 4px; }
.expense-sizes { min-width: 100px; max-width: 150px; }
table.expense-table .expense-common td { background: var(--surface-2); }
table.expense-table .expense-empty { white-space: normal; padding: 24px 16px; }
@media (max-width: 640px) {
  .expense-filters .fbox:not(.fbtn) { max-width: none; }
  .expense-filters .fbtn { margin-left: 0; }
  table.expense-table td:first-child:not([colspan]), table.expense-table th:first-child { position: static; min-width: 190px; }
  table.expense-table thead th:first-child { position: sticky; top: 0; }
}
table.rows { width: 100%; border-collapse: collapse; min-width: 640px; }
table.rows th, table.rows td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line-soft); }
table.rows th { color: var(--ink-3); font-weight: 550; font-size: 13px; white-space: nowrap;
  background: var(--surface-2); }
table.rows thead tr:first-child th:first-child { border-top-left-radius: var(--radius); }
table.rows thead tr:first-child th:last-child { border-top-right-radius: var(--radius); }
table.rows tbody tr:last-child td { border-bottom: 0; }
/* Строка «Итого». Отбита сверху линией потемнее и лежит на подложке шапки:
   в таблице на пятнадцать колонок сумма обязана читаться как отдельный
   ярус, а не как ещё одна строка товара — иначе её складывают глазами
   вместе с остальными. */
table.rows tfoot td { background: var(--surface-2); font-weight: 600;
  border-top: 2px solid var(--line); border-bottom: 0; }
table.rows tfoot td .muted { font-weight: 400; }

/* ДЛИННЫЕ ТАБЛИЦЫ С ЗАДАННЫМИ ШИРИНАМИ.
   Автоматическая раскладка измеряет каждую клетку и пересчитывает ширины
   колонок при любом изменении — на пятистах строках это секунды. С
   table-layout: fixed ширины берутся из <colgroup>, строки считаются
   независимо, а скрытие строки фильтром не трогает остальные. */
table.rows.fixed { table-layout: fixed; }
table.rows.fixed td, table.rows.fixed th { overflow: hidden; }
/* Клетка в одну строку с многоточием: текст остаётся целиком — фильтр и
   подсказка читают его, — а глазу показывается начало. */
table.rows .clip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Название товара — не длиннее двух строк: третья строка у каждого из
   пятисот товаров — это лишний экран высоты на ровном месте. */
table.rows.fixed .pcell > div { min-width: 0; }
table.rows.fixed .pcell > div > :first-child {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; line-height: 1.3;
}
table.rows.fixed .pill { white-space: nowrap; }
table.rows td.num, table.rows th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Подсветка строки под курсором — во ВСЕХ таблицах, а не только в
   раскрывающихся. В таблице на десять колонок глаз теряет строку на
   середине пути, и «Иркутская область» читается со значениями из
   соседнего ряда. Раньше правило стояло только на tr[data-row], то есть
   работало ровно там, где строку и так можно раскрыть щелчком. */
table.rows tbody tr:hover { background: var(--surface-2); }
table.rows tr.detail td { background: var(--surface-2); }
.exp {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  width: 24px; height: 24px; border-radius: 6px; cursor: pointer; line-height: 1;
}
.exp[aria-expanded="true"] { background: var(--accent-2); color: var(--accent); }

/* Формы */
label.f { display: block; margin-bottom: 12px; }
label.f > span { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], select, textarea {
  width: 100%; padding: 9px 11px; font: inherit; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
}
input:focus, select:focus, textarea:focus, .btn:focus-visible, .theme:focus-visible, .exp:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px;
}
textarea { min-height: 90px; }
.btn {
  display: inline-block; padding: 9px 16px; font: inherit; font-weight: 550;
  color: var(--btn-ink); background: var(--accent); border: 0; border-radius: 8px; cursor: pointer;
  text-decoration: none;
}
.btn:hover { filter: brightness(1.08); }

/* Галочка с пояснением: подпись в две строки, поэтому не inline-flex по
   центру, а сетка — иначе квадратик уезжает к середине текста. */
.chk {
  display: grid; grid-template-columns: auto 1fr; gap: 9px;
  align-items: start; margin: 2px 0 16px; cursor: pointer;
}
.chk input[type="checkbox"] { width: 16px; height: 16px; margin-top: 3px; accent-color: var(--accent); }
.chk > span { font-size: 14px; line-height: 1.4; }
.btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--line); }
.btn.danger { background: var(--bad); color: #fff; }
/* Кнопка в строке таблицы: та же кнопка, но не выше строки. */
.btn.sm { padding: 4px 10px; font-size: 12px; border-radius: 6px; }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Состояния — цвет всегда вместе со значком и подписью,
   потому что один цвет не читается ни в чёрно-белой печати, ни при дальтонизме */
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 550; }
.pill.ok { background: var(--good-bg); color: var(--good); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.mute { background: var(--surface-2); color: var(--ink-3); }

.flash { padding: 10px 14px; border-radius: var(--radius); margin: 0 0 16px; }
.flash-ok { background: var(--good-bg); color: var(--good); }
.flash-err { background: var(--bad-bg); color: var(--bad); }

.muted { color: var(--ink-3); }
.mono { font-family: var(--mono); font-size: 13px; }
.err { color: var(--bad); font-size: 13px; margin: -6px 0 12px; }

/* Формы настроек */
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 16px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 16px; }
.grid3[hidden] { display: none; }
.radio { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 14px; }
.radio input { width: auto; margin: 0; }

/* Товар в таблице: миниатюра + название */
.pcell { display: flex; align-items: center; gap: 10px; }
.pcell > div { min-width: 0; }
.th {
  flex: 0 0 auto; display: block; border-radius: 6px; overflow: hidden;
  background: var(--surface-2); border: 1px solid var(--line-soft);
}
.th img { width: 100%; height: 100%; object-fit: cover; display: block; }
a.th:hover { border-color: var(--accent); }

/* ВЫБОР ПЕРИОДА — кнопка с выпадающим списком.
   Собран на <details>: открывается без скрипта и работает с клавиатуры.
   Скрипт в подвале только закрывает список по клику мимо и по Escape. */
/* Шапка страницы: заголовок слева, выбор периода — в правом углу.
   flex-wrap не для красоты: на узком экране длинный подзаголовок и
   кнопка не помещаются в строку, и кнопка уезжает под текст, а не
   наползает на него. */
.phead {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 18px;
}
.ptext { flex: 1 1 420px; min-width: 0; }
.ptext .sub { margin-bottom: 0; }
.phead .period { flex: none; }
/* Кнопка чуть ниже верха строки — так она встаёт вровень с заголовком,
   а не с его верхним отступом. */
.period { margin: 2px 0 0; }

.pdrop { position: relative; display: inline-block; }

.pdrop > summary {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: var(--radius); cursor: pointer;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  font-size: 14px; font-weight: 550; line-height: 1.2;
  user-select: none; list-style: none;
}
/* Стандартный треугольник убираем в обоих движках — свой ниже */
.pdrop > summary::-webkit-details-marker { display: none; }
.pdrop > summary::marker { content: ''; }
.pdrop > summary:hover { background: var(--surface-2); }
.pdrop > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pdrop .cal { width: 17px; height: 17px; flex: none; }
.pdrop .car {
  width: 0; height: 0; margin-left: 2px;
  border: 5px solid transparent; border-top-color: currentColor; border-bottom: 0;
  transition: transform .12s;
}
.pdrop[open] > summary .car { transform: rotate(180deg); }

.pdrop .menu {
  position: absolute; z-index: 40; top: calc(100% + 6px); right: 0;
  min-width: 264px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: 0 8px 28px rgba(30, 20, 45, .14);
}
.pdrop .menu a {
  display: block; padding: 9px 14px; border-radius: 9px;
  color: var(--ink); text-decoration: none; font-size: 14px; line-height: 1.25;
}
.pdrop .menu a:hover { background: var(--surface-2); }
.pdrop .menu a.on { background: var(--accent); color: var(--btn-ink); font-weight: 550; }

/* ВЫГРУЗКА КОДОВ ЗАКАЗА — то же меню, но пункты в нём кнопки формы:
   вместе с выбранным пунктом уходит галочка «отдельными файлами».
   Кнопка стоит слева в карточке, поэтому меню раскрывается вправо от
   неё, а не влево за край. Правила кнопок — только для этого меню:
   общее «.pdrop .menu button» перекрашивало «Показать» в выборе
   периода на всех страницах. */
.pdrop.dl .menu { left: 0; right: auto; min-width: 300px; }
.pdrop .menu .mh {
  padding: 8px 14px 2px; color: var(--ink-3);
  font-size: 12px; font-weight: 550; letter-spacing: .02em;
}
.pdrop .menu .msep { border-top: 1px solid var(--line-soft); margin: 6px 0; }
.pdrop.dl .menu button {
  display: block; width: 100%; padding: 8px 14px; border: 0; border-radius: 9px;
  background: none; color: var(--ink); font: inherit; font-size: 14px; line-height: 1.25;
  text-align: left; cursor: pointer;
}
.pdrop.dl .menu button:hover { background: var(--surface-2); }
.pdrop.dl .menu button:disabled { opacity: .45; cursor: not-allowed; background: none; }
.pdrop.dl .menu button small { display: block; margin-top: 2px; color: var(--ink-3); font-size: 12px; }
.dlbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }

/* ВЫБОР ТОВАРА В ЗАКАЗЕ КОДОВ — то же меню, но пункты в нём галочки:
   артикул с фото, под ним размеры, расход и есть ли свой GTIN. Меню
   длинное (весь ассортимент), поэтому со своей прокруткой и поиском. */
.pdrop.pick .menu { left: 0; right: auto; min-width: 420px; max-height: 440px; overflow: auto; }
.pdrop.pick .menu .pk-q {
  width: 100%; box-sizing: border-box; margin: 2px 0 6px; padding: 7px 10px;
  border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink); font: inherit; font-size: 13.5px;
}
.pdrop.pick .menu .qa { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 2px 6px; }
.pdrop.pick .menu .qa button {
  border: 1px solid var(--line); border-radius: 999px; background: none; color: var(--ink);
  padding: 3px 10px; font: inherit; font-size: 12.5px; cursor: pointer;
}
.pdrop.pick .menu .qa button:hover { background: var(--surface-2); }
.pdrop.pick .menu label {
  display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 9px;
  cursor: pointer; font-size: 14px; line-height: 1.25; color: var(--ink);
}
.pdrop.pick .menu label[hidden] { display: none; }
.pdrop.pick .menu label:hover { background: var(--surface-2); }
.pdrop.pick .menu label input { width: 16px; height: 16px; flex: none; accent-color: var(--accent); }
.pdrop.pick .menu label small { display: block; margin-top: 2px; color: var(--ink-3); font-size: 12px; }

/* «Выбрать интервал» — такой же пункт списка, пока не раскрыт */
.prange { border-top: 1px solid var(--line-soft); margin-top: 6px; padding-top: 6px; }
.prange > summary {
  padding: 9px 14px; border-radius: 9px; cursor: pointer;
  font-size: 14px; line-height: 1.25; color: var(--ink);
  list-style: none; user-select: none;
}
.prange > summary::-webkit-details-marker { display: none; }
.prange > summary::marker { content: ''; }
.prange > summary:hover { background: var(--surface-2); }
.prange[open] > summary { color: var(--ink-3); font-size: 13px; padding-bottom: 2px; }
.prange form {
  display: grid; grid-template-columns: auto 1fr; gap: 8px 10px;
  align-items: center; padding: 8px 14px 10px;
}
.prange label { color: var(--ink-3); font-size: 13px; }
.prange input[type="date"] {
  width: 100%; padding: 7px 10px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: inherit; font-size: 14px; line-height: 1.2;
}
.prange input[type="date"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.prange button {
  grid-column: 1 / -1; margin-top: 2px; padding: 8px 14px;
  border: 0; border-radius: 999px; cursor: pointer;
  background: var(--accent); color: var(--btn-ink);
  font: inherit; font-size: 14px; font-weight: 550;
}
.prange button:hover { filter: brightness(1.08); }

/* На узком экране список во всю ширину: 264 пикселя вылезали за край */
@media (max-width: 520px) {
  .phead .period { width: 100%; }
  .pdrop, .pdrop > summary { display: flex; width: 100%; justify-content: center; }
  .pdrop .menu { left: 0; right: 0; min-width: 0; }
  .pdrop.dl .menu { right: 0; min-width: 0; }
  .pdrop.pick .menu { right: 0; min-width: 0; }
}

/* Период переехал в шапку — там он один на все разделы и не должен
   растягиваться вместе с ней. */
.who .period { margin: 0; }
.who .pdrop > summary { padding: 6px 12px; font-size: 13.5px; }
.who .pdrop .menu { left: auto; right: 0; }

/* Изменение к прошлому периоду */
.trend { font-weight: 550; white-space: nowrap; }
.trend.good { color: var(--good); }
.trend.bad { color: var(--bad); }

/* Что требует внимания */
.alerts { display: grid; gap: 10px; margin-bottom: 22px; }
.alert {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line);
  border-left: 1px solid var(--ink-3); border-radius: var(--radius); padding: 12px 16px;
}
.alert.warn { border-left-color: var(--warn); }
.alert.bad { border-left-color: var(--bad); }
.alert .a-t { font-weight: 600; }
.alert .a-x { color: var(--ink-2); flex: 1 1 320px; }

/* Полосы распределения оценок */
.bar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.bar-row:last-child { margin-bottom: 0; }
/* Подпись полосы. Ширину задаёт страница — у долей это «5%», у округов
   целое название, — но обрезка нужна всегда: без неё длинная подпись
   наезжает на саму полосу и читаются оба слоя разом. */
.bar-lab {
  width: 42px; color: var(--ink-2); font-size: 13px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar { flex: 1; height: 12px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.bar-in { display: block; height: 100%; border-radius: 999px; background: var(--ink-3); }
.bar-in.ok { background: var(--good); }
.bar-in.warn { background: var(--warn); }
.bar-in.bad { background: var(--bad); }
.bar-val { width: 110px; text-align: right; font-size: 13px; font-variant-numeric: tabular-nums; }

/* Текст отзыва в раскрытой строке */
.fb { padding: 6px 2px; max-width: 780px; }
.fb p { margin: 0 0 8px; }

/* Переписка в раскрытой строке чата. Реплики покупателя слева на
   подложке, свои — справа на акцентной плашке: кто ждёт кого, видно
   без чтения. Ширина ограничена: строка на весь экран не читается. */
.chat { padding: 6px 2px; max-width: 720px; }
.chat .m {
  margin: 0 0 8px; padding: 8px 12px; border-radius: 12px; max-width: 85%;
  font-size: 14px; line-height: 1.45; overflow-wrap: anywhere;
}
/* Переносы строк покупателя сохраняем; pre-wrap только на тексте, иначе
   отступы разметки вокруг него превратились бы в пустые строки. */
.chat .m .t { white-space: pre-wrap; }
.chat .m.client { background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.chat .m.seller { background: var(--accent-2); margin-left: auto; border-bottom-right-radius: 4px; }
.chat .m .who { font-size: 12px; color: var(--ink-3); margin-bottom: 3px; }

/* Сетка коэффициентов приёмки */
table.rows.coefs th, table.rows.coefs td { padding: 7px 6px; }
table.rows.coefs td:first-child, table.rows.coefs th:first-child {
  position: sticky; left: 0; background: var(--bg); white-space: nowrap;
}

/* Вход */
.auth { max-width: 380px; margin: 8vh auto; }
.auth .card { padding: 26px; }
.auth h1 { margin-bottom: 16px; }
.auth .alt { margin-top: 14px; font-size: 14px; color: var(--ink-2); text-align: center; }

@media (max-width: 720px) {
  /* Период, кабинет, тема и анимация в ширину телефона не помещались и
     раздвигали страницу вбок (проверено на «Пульте», 03.10.2026). */
  .who { width: 100%; margin-left: 0; flex-wrap: wrap; }
  .wrap { padding: 14px 14px 48px; }
  .card { padding: 16px; }
}


/* Узкий экран: боковое меню уезжает за край и выдвигается кнопкой.
   Оставлять его в потоке нельзя — 236 пикселей от 360 не оставят
   таблице ничего, а прятать совсем значит запереть половину разделов. */
@media (max-width: 1080px) {
  .burger { display: flex; }
  .sfold { display: none; }
  .side-close { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; flex: none; border: 0; background: none; color: var(--nav-ink); cursor: pointer; }
  .side-close svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
  .top { gap: 12px; padding: 12px 16px; }
  .mobile-cabinet { display: inline; font-weight: 600; }
  .side {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 60;
    margin: 0; width: 284px; flex-basis: 284px; max-height: none;
    border-radius: 0;
    transform: translateX(-102%); transition: transform .2s ease;
  }
  .side.open { transform: none; box-shadow: 0 0 0 100vmax rgba(20, 14, 28, .38); }
  .wrap { padding: 14px 16px 48px; }
  /* Свёрнутое меню — привычка большого экрана. Выдвижная панель и так
     занимает экран целиком, и показывать в ней одни значки незачем:
     разворачиваем её обратно, не трогая сохранённый выбор. */
  :root[data-side="mini"] .side {
    width: 284px; flex-basis: 284px; padding: 14px 10px 16px;
  }
  :root[data-side="mini"] .side .bname,
  :root[data-side="mini"] .side-cabinet,
  :root[data-side="mini"] .nv span,
  :root[data-side="mini"] .side-sec { display: inline; }
  :root[data-side="mini"] .nvsub { display: block; }
  :root[data-side="mini"] .side-sec { display: block; }
  :root[data-side="mini"] .side-head { flex-direction: row; justify-content: flex-start; padding: 2px 4px 12px 10px; }
  :root[data-side="mini"] .nv { justify-content: flex-start; padding: 9px 10px; }
  :root[data-side="mini"] .side-settings > summary::after { display: block; }
  :root[data-side="mini"] .side-cabinet { display: block; }
}
@media (max-width: 560px) {
  .who .pdrop > summary .lab { max-width: 108px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .who { gap: 6px; }
  .who .theme { width: 38px; height: 38px; padding: 6px; justify-content: center; }
  .who .theme > span:not(.ico) {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip-path: inset(50%); white-space: nowrap;
  }
}

/* ---- Плашка со спарклайном ---------------------------------------
   Спарклайн стоит в правом нижнем углу и не толкает текст: он
   дополняет число, а не спорит с ним за место. */
.tile.has-spark { position: relative; overflow: hidden; }
.tile .spark {
  position: absolute; right: 12px; bottom: 10px;
  width: 104px; height: 32px; pointer-events: none;
}
.tile.has-spark .n { max-width: calc(100% - 108px); }
@media (max-width: 420px) {
  .tile .spark { display: none; }
  .tile.has-spark .n { max-width: none; }
}
.trend.flat { color: var(--ink-3); font-weight: 500; }

/* ---- Графики -----------------------------------------------------
   Рисуем своим SVG: точек десятки, а не тысячи, и лишняя библиотека
   на шаред-хостинге живёт до первого сбоя CDN. */
.chart-card { padding: 16px 18px; margin-bottom: 18px; }
.chead {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 12px;
}
.chead h3 { margin: 0; font-size: 15px; font-weight: 600; }
.legend { display: flex; gap: 14px; font-size: 13px; color: var(--ink-2); }
.legend i {
  display: inline-block; width: 12px; height: 3px; border-radius: 2px;
  margin-right: 6px; vertical-align: 3px; background: var(--accent);
}
.legend i.bar { width: 9px; height: 11px; border-radius: 2px; vertical-align: -1px; }
.legend i.ln { background: var(--good); }

.chart { display: block; width: 100%; height: auto; }
.chart .grid { stroke: var(--line); stroke-dasharray: 2 5; }
/* Столбик графика называется cbar, а не bar, хотя bar здесь напрашивался.
   Класс .bar в приложении уже занят полосой распределения оценок, у неё
   height:12px — а по правилам SVG2 CSS-свойство перебивает одноимённый
   атрибут прямоугольника, и столбики выходили ростом ровно в двенадцать
   пикселей при любом значении. Сбросить высоту обратно в auto нельзя:
   Chrome считает auto нулём. Поэтому имя, а не борьба со стилем. */
.chart .cbar { fill: var(--accent); opacity: .8; transition: opacity .12s; }
.chart .cbar:hover { opacity: 1; }
.chart .ln {
  fill: none; stroke: var(--good); stroke-width: 2.2;
  stroke-linejoin: round; stroke-linecap: round;
}
.chart .lnend { fill: var(--good); }
/* Прозрачные кружки поверх точек линии: попасть курсором в саму линию
   почти невозможно, а подсказка нужна именно по точке. */
.chart .hit { fill: transparent; }
.chart .ax { fill: var(--ink-3); font-size: 11px; }
.chart .ax-mobile { display: none; }
.chart-note {
  margin: 10px 0 0; font-size: 13px; color: var(--ink-2);
  padding-top: 10px; border-top: 1px solid var(--line);
}

/* ==================================================================
   ДВИЖЕНИЕ
   ------------------------------------------------------------------
   Анимации здесь не украшение: появление по очереди задаёт порядок
   чтения (сначала главное число, потом соседние), а рост столбиков и
   отрисовка линии показывают, что график читается слева направо.
   Всё живёт меньше секунды и не повторяется — иначе страница, на
   которую заходят двадцать раз в день, начинает раздражать.
   ================================================================== */

@keyframes ui-rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
@keyframes ui-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ui-grow {
  from { transform: scaleY(.02); }
  to   { transform: scaleY(1); }
}
@keyframes ui-draw { to { stroke-dashoffset: 0; } }
@keyframes ui-sheen {
  from { background-position: -160% 0; }
  to   { background-position: 260% 0; }
}
@keyframes ui-pulse {
  0%, 100% { transform: scale(1);   opacity: 1; }
  50%      { transform: scale(1.5); opacity: .35; }
}

/* Появление каскадом. Шаг задаёт разметка через --i, а не отдельный
   класс на каждую плашку: пятая плашка не должна знать, что она пятая. */
.rise { animation: ui-rise .5s cubic-bezier(.22, .8, .3, 1) both; }
.rise { animation-delay: min(calc(var(--i, 0) * 60ms), 420ms); }

/* ==================================================================
   СВОДКА
   ------------------------------------------------------------------
   Не «все цифры одного размера», а один главный показатель и свита.
   Сетка на 12 колонок: главная плашка занимает половину строки, и
   глаз находит её раньше, чем успевает прочитать подпись.
   ================================================================== */

.dhead { margin-bottom: 20px; }
.dhead h1 { font-size: 27px; letter-spacing: -.02em; margin-bottom: 10px; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  font-size: 13px; color: var(--ink-2); white-space: nowrap;
}
.chip b { font-weight: 600; color: var(--ink); }
.chip.live::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--good); animation: ui-pulse 2.4s ease-in-out infinite;
}

.kpis {
  display: grid; grid-template-columns: repeat(12, 1fr);
  gap: 14px; margin-bottom: 20px;
}
.kpi {
  grid-column: span 4; position: relative; overflow: hidden;
  display: flex; flex-direction: column;
  min-height: 132px; padding: 16px 18px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
  transition: transform .22s cubic-bezier(.22, .8, .3, 1),
              box-shadow .22s ease, border-color .22s ease;
}
.kpi:hover {
  transform: none;
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  box-shadow: none;
}
.kpi.hero { grid-column: span 6; min-height: 168px; }
.kpi.half { grid-column: span 3; }

/* Тонкая полоса акцента сверху — она же держит цвет тона плашки. */
.kpi::before {
  content: ''; position: absolute; inset: 0 0 auto; height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent 70%);
  opacity: .55;
}
.kpi.t-good::before  { background: linear-gradient(90deg, var(--good), transparent 70%); }
.kpi.t-warn::before  { background: linear-gradient(90deg, var(--warn), transparent 70%); }
.kpi.t-brand::before { background: linear-gradient(90deg, var(--brand-2), var(--brand-1) 55%, transparent 88%); opacity: .9; }
.kpi.t-bad::before   { background: linear-gradient(90deg, var(--bad), transparent 70%); }

.kpi-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 8px;
}
.kpi-k { color: var(--ink-3); font-size: 13px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 8px; }
/* Значок показателя: квадрат с подложкой, цвет — от тона плашки.
   Подложка светлая, а не заливка акцентом: рядом стоит крупное число,
   и второе яркое пятно с ним спорит. */
.kpi-i {
  width: 30px; height: 30px; flex: none; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-2); color: var(--accent);
}
.kpi-i svg { width: 17px; height: 17px; fill: none; stroke: currentColor;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.kpi.t-good .kpi-i  { background: var(--good-bg); color: var(--good); }
.kpi.t-warn .kpi-i  { background: var(--warn-bg); color: var(--warn); }
.kpi.t-bad .kpi-i   { background: var(--bad-bg);  color: var(--bad); }
.kpi.t-brand .kpi-i { background: var(--accent-2); color: var(--brand-2); }
.kpi-v {
  font-size: 30px; font-weight: 620; letter-spacing: -.025em; line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.kpi.hero .kpi-v { font-size: 42px; }
.kpi-n { color: var(--ink-2); font-size: 13px; margin-top: 6px; }
.kpi-n .trend { margin-right: 2px; }

/* Мини-график прижат к нижнему краю карточки во всю её ширину:
   он фон, а не сосед текста, и потому не отнимает у числа место. */
.kpi-art {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 54px; pointer-events: none;
}
.kpi.hero .kpi-art { height: 76px; }
.kpi-art svg { display: block; width: 100%; height: 100%; }
.kpi-art .ln {
  fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round;
  stroke-dasharray: 2400; stroke-dashoffset: 2400;
  animation: ui-draw 1.15s cubic-bezier(.3, .7, .3, 1) both;
  animation-delay: calc(var(--i, 0) * 60ms + 180ms);
}
.kpi-art .ar { animation: ui-fade .7s ease both; animation-delay: calc(var(--i, 0) * 60ms + 420ms); }
.kpi-art .dot { animation: ui-fade .4s ease both; animation-delay: calc(var(--i, 0) * 60ms + 900ms); }

/* Место под график освобождаем отступом, а не полями текста: иначе
   длинная подпись «к предыдущим 30 дням» наезжает на линию. */
.kpi.has-art { padding-bottom: 44px; }
.kpi.hero.has-art { padding-bottom: 58px; }

/* Знак тренда — не голый символ, а метка: цвет плюс форма, потому что
   один цвет не читается при дальтонизме и в чёрно-белой печати. */
.kpi .trend {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 3px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 600; line-height: 1.2;
  background: var(--surface-2); color: var(--ink-2);
}
.kpi .trend.good { background: var(--good-bg); color: var(--good); }
.kpi .trend.bad  { background: var(--bad-bg);  color: var(--bad); }
.kpi .trend.flat { background: var(--surface-2); color: var(--ink-3); }
.kpi-n .trend { padding: 0; background: none; font-size: 13px; font-weight: 550; }

@media (max-width: 1080px) {
  .kpi, .kpi.half { grid-column: span 6; }
  .kpi.hero { grid-column: span 12; }
}
@media (max-width: 620px) {
  .kpi, .kpi.half, .kpi.hero { grid-column: span 12; }
  .kpi.hero .kpi-v { font-size: 34px; }
}

/* ---- Заголовок раздела внутри Сводки ---- */
.dsec {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; margin: 26px 0 12px;
}
.dsec h2 { margin: 0; }
.dsec .cnt { color: var(--ink-3); font-size: 13px; }

/* ---- Что требует внимания ---- */
.alerts { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.alert {
  align-items: flex-start; gap: 12px;
  transition: transform .2s cubic-bezier(.22, .8, .3, 1), box-shadow .2s ease;
}
.alert:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.alert .a-i {
  flex: none; width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center; font-size: 15px; line-height: 1;
  background: var(--surface-2); color: var(--ink-2);
}
.alert.warn .a-i { background: var(--warn-bg); color: var(--warn); }
.alert.bad  .a-i { background: var(--bad-bg);  color: var(--bad); }
.alert .a-b { flex: 1 1 240px; min-width: 0; }
.alert .a-t { margin-bottom: 2px; }
.alert .a-x { flex: none; font-size: 13.5px; }
.alert .btn.ghost { white-space: nowrap; }
.alert .btn.ghost::after {
  content: '→'; margin-left: 6px; display: inline-block;
  transition: transform .2s ease;
}
.alert:hover .btn.ghost::after { transform: translateX(3px); }

.calm {
  display: flex; align-items: center; gap: 12px;
  color: var(--ink-2);
}
.calm .a-i {
  flex: none; width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center;
  background: var(--good-bg); color: var(--good);
}

/* ---- График: столбики растут, линия рисуется ---- */
.chart .cbar {
  transform-box: fill-box; transform-origin: 50% 100%;
  animation: ui-grow .5s cubic-bezier(.22, .8, .3, 1) both;
  /* Потолок на задержку. Шаг 18 мс на столбик хорош для тридцати
     столбиков; на двухстах последний ждал бы почти четыре секунды, и
     график «рисовался» дольше, чем на него смотрят. */
  animation-delay: min(calc(var(--i, 0) * 18ms + 120ms), 600ms);
}
.chart .ln {
  stroke-dasharray: 3200; stroke-dashoffset: 3200;
  animation: ui-draw 1.4s cubic-bezier(.3, .7, .3, 1) both; animation-delay: .25s;
}
.chart .lnend { animation: ui-fade .4s ease both; animation-delay: 1.4s; }
.chart .ax    { animation: ui-fade .5s ease both; animation-delay: .5s; }

/* Таблица внутри карточки: у карточки свои 18 пикселей полей, а таблице
   нужны свои — иначе первая колонка липнет к рамке, а последняя строка
   рисует лишнюю линию поверх границы. */
.jobs-card { padding: 4px 6px 2px; }
.jobs-card table.rows { min-width: 560px; }
.jobs-card table.rows th { padding-top: 12px; }
.jobs-card table.rows tr:last-child td { border-bottom: 0; }

/* Вложенная таблица в раскрытой строке: та же сетка, но мельче — она
   поясняет строку, а не спорит с ней за внимание. */
table.rows.compact th, table.rows.compact td { padding: 6px 8px; font-size: 13px; }
table.rows.compact th { font-size: 12px; }

/* Кому движение мешает — тому его нет. Это не «поменьше», а совсем:
   вестибулярные нарушения не лечатся уменьшением амплитуды. */
@media (prefers-reduced-motion: reduce) {
  .rise, .kpi-art .ln, .kpi-art .ar, .kpi-art .dot,
  .chart .cbar, .chart .ln, .chart .lnend, .chart .ax, .chip.live::before {
    animation: none !important;
  }
  .kpi-art .ln, .chart .ln { stroke-dashoffset: 0; }
  .kpi:hover, .alert:hover { transform: none; }
}

/* ВЫКЛЮЧАТЕЛЬ ДВИЖЕНИЯ В САМОМ ПРИЛОЖЕНИИ.
   Системная настройка «меньше движения» есть не у всех и не про то:
   человек может хотеть анимацию в системе и не хотеть её в таблице, на
   которую смотрит двадцать раз в день. Кнопка рядом с темой ставит
   data-motion="off" на корень, и всё, что двигается, перестаёт —
   совсем, включая переходы: половинчатое «поменьше» не помогает ни
   вестибулярному аппарату, ни слабому ноутбуку. */
:root[data-motion="off"] *, :root[data-motion="off"] *::before, :root[data-motion="off"] *::after {
  animation: none !important;
  transition: none !important;
}
:root[data-motion="off"] .kpi-art .ln, :root[data-motion="off"] .chart .ln { stroke-dashoffset: 0; }
:root[data-motion="off"] .kpi:hover, :root[data-motion="off"] .alert:hover { transform: none; }

/* СВОДНЫЕ КАРТОЧКИ: «показатель — значение» столбиком.
   Формат плотный нарочно. Тридцать чисел крупными плашками заняли бы три
   экрана и потребовали бы прокрутки, чтобы сравнить первое с последним;
   здесь их читают одним движением сверху вниз, а глаз цепляется за
   правый столбец, где всё выровнено по разряду.
   Цветной кант слева и цвет заголовка — единственное, чем карточки
   различаются: рамка вокруг каждой строки превратила бы список в
   таблицу, а он не таблица. */
.sumcards {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0; margin-bottom: 24px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden;
}
.sumcard {
  background: transparent; border: 0; border-radius: 0;
  padding: 20px 16px; box-shadow: none; min-width: 0;
}
.sumcard + .sumcard { border-left: 1px solid var(--line-soft); }
.sumcard h3 {
  margin: 0 0 12px; font-size: 16px; font-weight: 600;
  letter-spacing: 0; text-transform: none; color: var(--ink);
}

.sumrow {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; padding: 7px 0; font-size: 14px;
  border-bottom: 1px solid var(--line-soft);
}
.sumrow:last-child { border-bottom: 0; }
.sumrow .l { color: var(--ink-2); min-width: 0; }
/* tabular-nums здесь обязателен: числа стоят столбиком, и без него
   разряды разъезжаются — глазу приходится читать каждое целиком. */
.sumrow .v { font-weight: 550; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sumrow .v .mut { display: block; white-space: nowrap; }
.sumrow .v .mut { font-weight: 500; color: var(--ink-3); }
.sumrow .v .none { font-weight: 500; color: var(--ink-3); }
/* Строка-пояснение под списком: почему часть цифр пуста. */
.sumcard .why { margin: 8px 0 0; font-size: 12px; color: var(--ink-3); line-height: 1.35; }

/* Четыре числа не подменяют подробную сводку: источники и ограничения
   остаются в пояснениях, все прежние строки — в листе ниже графика. */
.dash-metrics {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
}
.dash-metric { display: flex; gap: 16px; min-width: 0; padding: 24px 22px; color: var(--ink); text-decoration: none; }
.dash-metric + .dash-metric { border-left: 1px solid var(--line-soft); }
.dash-metric:hover { background: var(--surface-2); }
.dash-metric > svg { width: 26px; height: 26px; margin-top: 4px; flex: none; fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.dash-metric > div { min-width: 0; }
.dash-metric .k { font-size: 14px; color: var(--ink-2); }
.dash-metric .v { display: block; margin: 4px 0 2px; font-size: 32px; font-weight: 600; letter-spacing: -.02em; overflow-wrap: anywhere; }
.dash-metric .n { display: block; color: var(--ink-2); font-size: 13px; }
.dash-overview { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(300px, 1fr); gap: 18px; margin-bottom: 18px; align-items: start; }
.dash-overview .chart-card { min-width: 0; margin: 0; padding: 22px; container-type: inline-size; }
.dash-overview .chead h3 { font-size: 17px; }
.dash-overview .chart .grid { stroke-dasharray: none; stroke: var(--line-soft); }
.dash-overview .chart .ax, .dash-overview .chart .ay { fill: var(--ink-3); font-size: 16px; }
.dash-overview .chart .ln { stroke: var(--ink-3); stroke-width: 1.8px; vector-effect: non-scaling-stroke; }
.dash-overview .chart .lnend, .dash-overview .legend i.ln { fill: var(--ink-3); background: var(--ink-3); }
.dash-attention { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px; }
.dash-attention .dsec { margin: 0 0 14px; gap: 4px; }
.dash-attention .dsec .cnt { font-size: 12px; }
.dash-attention .alerts { display: block; margin: 0; }
.dash-attention .alert { background: transparent; border: 0; border-radius: 0; padding: 14px 0; margin: 0; box-shadow: none; flex-wrap: wrap; gap: 8px 10px; }
.dash-attention .alert + .alert { border-top: 1px solid var(--line-soft); }
.dash-attention .alert:hover { transform: none; box-shadow: none; }
.dash-attention .alert .a-i { width: 22px; height: 24px; background: none; border-radius: 0; color: var(--ink-3); }
.dash-attention .alert .a-i svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.dash-attention .alert.bad .a-i { color: var(--bad); }
.dash-attention .alert.warn .a-i { color: var(--warn); }
.dash-attention .alert .a-b { flex: 1 1 160px; }
.dash-attention .alert .a-t { font-size: 14px; }
.dash-attention .alert .a-x { font-size: 13px; }
.dash-attention .alert .btn.ghost { margin-left: 32px; padding: 0; min-height: 28px; border: 0; font-size: 13px; text-align: left; }
.dash-attention .calm { padding: 10px 0; margin: 0; border: 0; box-shadow: none; }
.dash-overview .rise { animation: none; }
.dash-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.dash-head h1 { margin: 0; font-size: 32px; line-height: 1.25; }
.dash-head .chips { gap: 4px 16px; }
.dash-head .chip { border: 0; background: none; padding: 0; border-radius: 0; }
.dash-head .chip.live::before { animation: none; }
@media (max-width: 1400px) {
  .sumcards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sumcard:nth-child(3) { border-left: 0; }
  .sumcard:nth-child(n+3) { border-top: 1px solid var(--line-soft); }
  .dash-metric { padding: 18px 14px; gap: 10px; }
  .dash-metric .v { font-size: 25px; }
}
@media (max-width: 780px) {
  .dash-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-metric:nth-child(3) { border-left: 0; }
  .dash-metric:nth-child(n+3) { border-top: 1px solid var(--line-soft); }
  .dash-overview { grid-template-columns: minmax(0, 1fr); }
  .dash-overview .chart-card, .dash-attention { padding: 18px; }
}
@media (max-width: 560px) {
  .sumcards { grid-template-columns: minmax(0, 1fr); }
  .sumcard + .sumcard { border-left: 0; border-top: 1px solid var(--line-soft); }
  .dash-metric { padding: 16px 12px; gap: 8px; }
  .dash-metric > svg { display: none; }
  .dash-metric .v { font-size: 24px; }
  .dash-head h1 { font-size: 27px; }
}
/* SVG имеет viewBox 1000px. Компенсируем уменьшение именно по ширине
   графика, а не окна: рядом с меню и предупреждениями он тоже узкий. */
@container (max-width: 620px) { .dash-overview .chart .ax, .dash-overview .chart .ay { font-size: 22px; } }
@container (max-width: 430px) {
  .dash-overview .chart .ax, .dash-overview .chart .ay { font-size: 32px; }
  .dash-overview .chart .ax { display: none; }
  .dash-overview .chart .ax-mobile { display: block; }
}
@container (max-width: 330px) { .dash-overview .chart .ax, .dash-overview .chart .ay { font-size: 40px; } }
@container (max-width: 260px) { .dash-overview .chart .ax, .dash-overview .chart .ay { font-size: 48px; } }

/* ПАНЕЛЬ ФИЛЬТРОВ И СОРТИРУЕМАЯ ШАПКА ТАБЛИЦЫ.

   Фильтры лежат в общей карточке и переносятся сами: на «Кластерах» их
   пять, и в одну строку на ноутбуке они не помещаются. Подпись стоит
   НАД полем, а не слева: со «Кликов не меньше» слева каждое поле
   получало бы свою ширину, и колонки формы гуляли бы при любом
   изменении текста. */
.filters { display: flex; flex-wrap: wrap; gap: 12px 14px; align-items: flex-end; }
.fbox { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.fbox > span { font-size: 12px; }
.fbox select { max-width: 300px; }
.fbox.narrow select, .fbox.narrow input { width: 150px; }
.fbtn { flex-direction: row; gap: 8px; align-items: center; margin-left: auto; }

/* Заголовок-ссылка. Стрелка направления показана только у активной
   колонки: значок у всех сразу читается как «здесь что-то сломано»,
   а не как подсказка. */
table.rows th.sortable { padding: 0; }
table.rows th.sortable a {
  display: block; padding: 9px 10px; color: inherit; text-decoration: none;
  white-space: nowrap; border-radius: 6px;
}
table.rows th.sortable.num a { text-align: right; }
table.rows th.sortable a:hover { background: var(--surface-2); color: var(--ink); }
table.rows th.sortable.on a { color: var(--accent); }
table.rows th.sortable i { font-style: normal; margin-left: 3px; }

/* Название кластера — это фраза из четырёх-пяти слов. Без нижней границы
   ширины браузер отдаёт ей место по остаточному принципу и рвёт на три
   строки, а рядом четырнадцать колонок цифр в одну. */
table.rows td.cl { min-width: 230px; }

/* ПАНЕЛЬ МАССОВЫХ ДЕЙСТВИЙ под таблицей кластеров.

   Липкая снизу: таблица длинная, и кнопка «сохранить» должна быть под
   рукой на любой строке. Сверху она накрывала первые строки; снизу — не
   мешает. Стоит после таблицы: sticky bottom иначе не работает. */
.bulkbar {
  position: sticky; bottom: 12px; z-index: 5;
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  margin-top: 10px; box-shadow: 0 -6px 24px rgba(0, 0, 0, .08), var(--shadow);
}
.bulkbar input[type=text] { width: 80px; }

/* Исключённый кластер. Не скрыт и не вычеркнут: цифры по нему настоящие
   и нужны, чтобы решить, возвращать ли. Приглушён — и только. */
table.rows tr.off td { opacity: 0.55; }
table.rows tr.off td:first-child, table.rows tr.off td.cl { opacity: 1; }

/* ВСПЛЫВАЮЩАЯ ПАНЕЛЬ СОХРАНЕНИЯ.

   Кнопка сохранения лежит под таблицей, а таблица длинная и строки в ней
   раскрываются: изменив бюджет у кампании в середине списка, человек
   должен был бы искать кнопку прокруткой и по дороге забыть, что менял.
   Панель всплывает от первой же правки и висит внизу экрана, пока есть
   что сохранять.

   Появление снизу, а не мгновенное: резко возникший блок в поле зрения
   читается как ошибка страницы. */
.savebar {
  position: fixed; left: 50%; bottom: 18px; z-index: 40;
  display: none; gap: 12px; align-items: center;
  padding: 10px 14px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .18);
  transform: translate(-50%, 12px); opacity: 0;
  transition: transform .16s ease-out, opacity .16s ease-out;
}
.savebar.on { display: flex; transform: translate(-50%, 0); opacity: 1; }
.savebar .cnt { font-size: 13px; color: var(--ink-2); white-space: nowrap; }
/* Атрибут hidden прячет элемент лишь потому, что браузер даёт ему
   display:none по умолчанию, — а у .btn display задан явно и это
   перебивает. Без правила кнопки остаются на экране, хотя в разметке
   спрятаны: панель показывает ход операции и рядом кнопки, которые всё
   равно не нажать. Правило уже было, жило в <style> на странице и
   пропало при переносе стилей в общий файл. */
.savebar [hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  .savebar { transition: none; }
}

/* ВКЛАДКИ-КНОПКИ.
   Это список работы, а не оглавление: каждая вкладка — действие, а число
   рядом отвечает «сколько там». Форма взята у переключателя периода и
   чипов — таблетка; выбранная залита акцентом, остальные обведены.
   Счётчик держим отдельной плашкой внутри: слитно с названием он читался
   бы как часть слова. */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.tabs a {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  font-size: 14px; font-weight: 500; line-height: 1.2; color: var(--ink-2);
  text-decoration: none; white-space: nowrap;
  transition: background .12s, color .12s, border-color .12s;
}
.tabs a:hover { border-color: var(--accent); color: var(--ink); }
.tabs a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tabs a.on {
  background: var(--accent); border-color: var(--accent);
  color: var(--btn-ink); font-weight: 550;
}
.tabs a i {
  font-style: normal; font-size: 12px; font-weight: 600;
  padding: 1px 7px; border-radius: 999px;
  background: var(--bg); color: var(--ink-2);
}
.tabs a.on i { background: rgba(255, 255, 255, .22); color: var(--btn-ink); }

/* ШАПКА ТАБЛИЦЫ С ФИЛЬТРАМИ.
   Стоит рядом с правилами table.rows нарочно: это её продолжение, а не
   отдельный виджет. Раньше жила двумя копиями в <style> на страницах
   кампании и Честного знака — и уже начала расходиться.

   Заголовки отделены от строк фильтра и от данных: три ряда подряд без
   границ читаются как один шумный блок. Поля мельче обычных форм —
   их полтора десятка в ряд, и обычный размер растянул бы таблицу вдвое,
   — но рамка, скругление и подсветка фокуса те же, что у всех полей. */
table.rows tr.fltrow th { padding: 5px 6px 7px; }
table.rows tr.fltrow input {
  width: 100%; box-sizing: border-box;
  padding: 5px 8px; font: inherit; font-size: 12px; line-height: 1.3;
  color: var(--ink); background: var(--surface);
  border: 1px solid transparent; border-radius: 8px;
}
table.rows tr.fltrow input::placeholder { color: var(--ink-3); }
table.rows tr.fltrow input:hover { border-color: var(--accent-2); }
table.rows tr.fltrow input:focus { outline: 2px solid var(--btn-ink); outline-offset: 1px; }

/* Шапка с фильтрами — одной плашкой.
   Заголовки и два ряда полей — это одно целое: «вот колонки и вот чем их
   отбирать». Раздельными полосами они читались как три чужих ряда над
   таблицей. Плашка залита акцентом, как главная кнопка, и скруглена по
   углам — форма та же, что у карточек и вкладок.

   Скругление на таблице требует separate: при collapse браузеры срезают
   радиус у ячеек. Границы у нас только нижние, так что схлопывать нечего
   и вид не меняется. */
table.rows.fltd { border-collapse: separate; border-spacing: 0; }
table.rows.fltd thead th {
  background: var(--accent); color: var(--btn-ink); border-bottom: 0;
}
table.rows.fltd thead th a { color: var(--btn-ink); }
table.rows.fltd thead tr:first-child th { padding-top: 12px; }
table.rows.fltd thead tr:first-child th:first-child { border-top-left-radius: 14px; }
table.rows.fltd thead tr:first-child th:last-child { border-top-right-radius: 14px; }
table.rows.fltd thead tr:last-child th { padding-bottom: 12px; }
table.rows.fltd thead tr:last-child th:first-child { border-bottom-left-radius: 14px; }
table.rows.fltd thead tr:last-child th:last-child { border-bottom-right-radius: 14px; }
table.rows.fltd tbody tr:first-child td { padding-top: 14px; }
/* Поле даты в браузере шире текстового: убираем внутренние отступы у
   кнопки календаря, иначе колонка «Продан» распирает таблицу. */
table.rows tr.fltrow input[type=date] { padding: 3px 4px 3px 6px; }
table.rows tr.fltrow input[type=date]::-webkit-calendar-picker-indicator { padding: 0; margin: 0; }
table.rows tr[hidden] { display: none !important; }

/* ==================================================================
   ПУЛЬТ РЕКЛАМЫ (promo, бывшие «Товары»), фаза 3, 03.10.2026.
   ------------------------------------------------------------------
   Таблица товаров с ячейкой машины, массовой панелью и окнами. Широкая:
   четырнадцать столбцов в ширину ноутбука не помещаются, поэтому таблица
   живёт в своей прокрутке, а отметка, товар и «Машина» на широком экране
   закреплены слева — прокрутив до «Запаса», видно, чей это запас и что с
   ним делает машина. На узком экране закреплять нечего: три столбца
   заняли бы весь экран, и таблица просто прокручивается.
   ================================================================== */

/* Строка состояния машины под заголовком. */
.pstat { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; margin: -8px 0 14px; font-size: 13px; }
.pstat .ptail { flex-basis: 100%; font-size: 12px; }

/* Вкладки, «Столбцы», «Обновить список» — одной строкой над таблицей. */
.ptools { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin: 6px 0 6px; }
.ptools .tabs { margin: 0; }
.pcols { position: relative; margin-left: auto; }
.pcols > summary { list-style: none; }
.pcols > summary::-webkit-details-marker { display: none; }
.pcols-m {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30;
  display: grid; gap: 2px; min-width: 210px; padding: 8px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 8px 28px rgba(30, 20, 45, .14);
}
.pcol { display: flex; gap: 8px; align-items: center; padding: 5px 6px; font-size: 13px; border-radius: 7px; cursor: pointer; }
.pcol:hover { background: var(--surface-2); }
.pcol input { accent-color: var(--accent); }
.pnote { font-size: 12px; margin: 0 0 10px; }
.psm { font-size: 12px; }
form.inl { display: inline; margin: 0; }

/* Таблица. separate, а не collapse: у закреплённых ячеек при collapse
   линии остаются на месте и едут поверх соседей при прокрутке.
   Строка товара — по макету 05.10.2026 (ветка pult-design): поля ячеек
   ниже, разделители и подсветка строки светлее обычных, — строк на
   экране больше, а читаются они так же. Светлее — на шаг, не до нуля:
   строки разной высоты, таблица шире экрана, и при 60% / 55% линия на
   подсвеченной строке пропадала совсем (1,04:1 к подсветке). */
table.rows.pult {
  border-collapse: separate; border-spacing: 0; min-width: 980px;
  --prow-hover: color-mix(in srgb, var(--surface-2) 70%, var(--surface));
}
table.rows.pult td {
  vertical-align: top; padding-top: 8px; padding-bottom: 8px;
  border-bottom-color: color-mix(in srgb, var(--line-soft) 85%, var(--surface));
}
table.rows.pult tbody tr.prow:hover { background: var(--prow-hover); }
.pult .c-sel { width: 66px; min-width: 66px; white-space: nowrap; }
.pult .c-sel input[type=checkbox] { width: 16px; height: 16px; margin: 4px 8px 0 0; vertical-align: top; accent-color: var(--accent); }
.pult .c-item { min-width: 210px; max-width: 260px; }
.pult .c-item .pt {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; line-height: 1.3; font-size: 14px;
}
.pult .c-item .pcell { align-items: flex-start; }
/* Фото 40×52 со скруглением 8 px. thumb() пишет размер в style (40×53 —
   три к четырём), поэтому !important. */
.pult .c-item .th { width: 40px !important; height: 52px !important; border-radius: 8px; }
/* Артикул · цвет — одной строкой, целиком — в подсказке: длинный цвет
   («коричневый, шоколадный, мокко») иначе добавлял строке высоты.
   width: 0 + min-width: 100% — чтобы строка не раздвигала столбец: в
   таблице с автоматической раскладкой nowrap-текст входит в наименьшую
   ширину ячейки целиком, и многоточие не сужало, а расширяло товар до
   max-width (210 → 260 px, «Расход» уезжал за край). */
.pult .c-item .pvc { width: 0; min-width: 100%; margin-top: 1px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pult .c-item .pvc .mono { font-size: inherit; }
.pult .pbadges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.pult .pbadges .pill { white-space: nowrap; padding: 1px 7px; font-size: 11.5px; }
/* Остаток: значок коробки (тот же, что у «Остатков» в меню) и слово. */
.pult .pstock { display: inline-flex; align-items: center; gap: 4px; }
.pult .pstock svg { flex: none; width: 12px; height: 12px; fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* Полоса слева у строки с остатком меньше дня или без остатка — красная,
   с прочим низким — жёлтая. Как у кластеров (фаза 6): тень внутрь первой
   ячейки, а не рамка; плашка со словом — в ячейке товара. */
table.rows.pult tr.pstk-bad > td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
table.rows.pult tr.pstk-warn > td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
/* «Кампании» — по самому широкому чипу (чип в одну строку и сам держит
   столбец), без запаса сверху: лишние 37 px уводили «Расход» за край.
   «Машина» — 236 px: у строк машины плашка «машина · 1 из 5» и «лента: 7
   · 1 крит.» встают в одну строку, цель и бюджет — тоже. Замер на копии
   прода (кабинет 1): «Расход» виден с окна 1366, «Заказы» — с 1440; при
   1280 «Расход» не влезает при любой из 200–244 px — «Кампании» в одну
   строку шире прежних. */
.pult .c-mach { min-width: 236px; max-width: 250px; }
.pult .c-camps { min-width: 190px; max-width: 320px; }
.pult .c-menu { width: 44px; }
.pult .ab-cell .btn.sm { padding: 1px 6px; }

/* Цифры: главное 14 px, жирное — только в столбце, по которому сейчас
   сортировка (data-sk на таблице ставит скрипт сортировки); вторая строка
   мельче и серая. Заметный рост расхода к прошлому периоду (от +20%) —
   жёлтым (promo_delta). */
.pult td.num { font-size: 14px; line-height: 1.35; }
.pult td.num .psm { margin-top: 1px; font-size: 11.5px; line-height: 1.35; font-weight: 400; }
.pult td.num .pdup { color: var(--warn); }
.pult[data-sk="today"] tbody td.c-today, .pult[data-sk="spend"] tbody td.c-spend,
.pult[data-sk="orders"] tbody td.c-orders, .pult[data-sk="cpo"] tbody td.c-cpo,
.pult[data-sk="drr"] tbody td.c-drr, .pult[data-sk="drrall"] tbody td.c-drrall,
.pult[data-sk="room"] tbody td.c-room, .pult[data-sk="ctr"] tbody td.c-ctr,
.pult[data-sk="cpc"] tbody td.c-cpc { font-weight: 650; }
/* «Запас до предела» — плашкой, у неё свой вес: перебиваем её. */
.pult[data-sk="room"] tbody td.c-room .pill { font-weight: 700; }

/* Ячейка машины (ab_cell_row_html): плашка «кто ведёт» и лента справа,
   под ней серые строки — цель и бюджет, утро и данные, — предупреждения. */
.ab-cell-row { min-width: 176px; font-size: 12px; line-height: 1.45; }
.ab-cell-row .abr-1 { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; }
.ab-cell-row .abr-f { margin-left: auto; font-size: 11.5px; white-space: nowrap; color: var(--ink-3); }
.ab-cell-row .abr-crit { color: var(--bad); }
.ab-cell-row .abr-2, .ab-cell-row .abr-3 { margin-top: 3px; color: var(--ink-3); }
.ab-cell-row .abr-3 { font-size: 11.5px; }
/* Цель и бюджет — без точки между ними: не влезли — бюджет переносится
   целиком, и «·» не висит в конце строки. */
.ab-cell-row .abr-2 { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; }
.ab-cell-row .ab-cap-lock { white-space: nowrap; cursor: help; }
/* Замок — маской цвета текста: в каждой строке разметки не прибавляет, а
   тема меняет его цвет сама (в data: URI переменную не подставить, в маску
   она и не нужна). Рисунок — как у замка в поле ставки кластера. */
.ab-cell-row .ab-cap-lock::before {
  content: ''; display: inline-block; width: 10px; height: 10px; margin-right: 3px; vertical-align: -1px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Crect x='2' y='5.5' width='8' height='5.5' rx='1'/%3E%3Cpath d='M4 5.5V4a2 2 0 0 1 4 0v1.5' fill='none' stroke='%23000' stroke-width='1.3'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Crect x='2' y='5.5' width='8' height='5.5' rx='1'/%3E%3Cpath d='M4 5.5V4a2 2 0 0 1 4 0v1.5' fill='none' stroke='%23000' stroke-width='1.3'/%3E%3C/svg%3E") center / contain no-repeat;
}
.ab-cell-row .abr-w { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 4px; }
/* Бюджет своих — та же кнопка (окно бюджета или раскладки), но без рамки:
   кнопкой её видно по плашке, а рамка уводила плашку на отдельную строку. */
.ab-cell-row .abr-2 .btn.sm.ab-cap { padding: 0; border: 0; border-radius: 999px; background: none; vertical-align: baseline; }
.ab-cell-row .abr-2 .btn.sm.ab-cap:hover .pill { box-shadow: inset 0 0 0 1px currentColor; }

/* Отметка «для машины» — переключатель поверх того же checkbox: поле,
   имя и обработчик прежние, меняется только вид. Бегунок — градиентом,
   без ::before (на input он есть не во всех браузерах). */
.pult .ppick { display: inline-flex; gap: 6px; align-items: center; margin-top: 6px; font-size: 12px; color: var(--ink-2); cursor: pointer; }
.pult .ppick input.ptgl {
  -webkit-appearance: none; appearance: none; flex: none; margin: 0; width: 28px; height: 16px;
  /* Рамка выключенного — темнее --line: та давала 1,3:1 к фону, и
     переключатель на подсвеченной строке пропадал (нужно от 3:1). */
  border: 1px solid color-mix(in srgb, var(--ink-3) 80%, var(--line)); border-radius: 999px; cursor: pointer;
  background: radial-gradient(circle at 7px 50%, var(--ink-3) 0 4.5px, transparent 5px) var(--surface-2);
}
.pult .ppick input.ptgl:checked {
  border-color: var(--accent);
  background: radial-gradient(circle at calc(100% - 7px) 50%, var(--btn-ink) 0 4.5px, transparent 5px) var(--accent);
}
.pult .ppick input.ptgl:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pult .ppick input.ptgl:disabled { opacity: .5; cursor: progress; }

/* Шапка таблицы липкая: ячейки сдвигает скрипт (translateY), sticky тут
   не работает — таблица в своей прокрутке по ширине. Поверх строк —
   z-index; закреплённые слева в шапке — ещё выше (ниже, в @media). */
.pult thead th { position: relative; z-index: 3; }
table.rows.pult.phead-float thead tr th { border-radius: 0; box-shadow: 0 1px 0 var(--line); }

/* Сортируемые заголовки — кнопки: сортировка в браузере, адрес не меняется. */
.pult th button.sk {
  display: block; width: 100%; padding: 9px 10px; border: 0; border-radius: 6px;
  background: none; color: inherit; font: inherit; text-align: inherit; white-space: nowrap; cursor: pointer;
}
.pult th button.sk:hover { background: var(--line-soft); color: var(--ink); }
.pult th.sortable.on button.sk { color: var(--accent); }
.pult th.sortable i { font-style: normal; }

/* Столбцы, спрятанные набором «Столбцы». */
.pult.hide-camps .c-camps, .pult.hide-today .c-today, .pult.hide-spend .c-spend,
.pult.hide-orders .c-orders, .pult.hide-cpo .c-cpo, .pult.hide-drr .c-drr,
.pult.hide-drrall .c-drrall, .pult.hide-room .c-room, .pult.hide-ctr .c-ctr,
.pult.hide-cpc .c-cpc { display: none; }

@media (min-width: 900px) {
  .pult .c-sel, .pult .c-item, .pult .c-mach { position: sticky; z-index: 2; background: var(--surface); }
  .pult thead .c-sel, .pult thead .c-item, .pult thead .c-mach,
  .pult tfoot .c-sel, .pult tfoot .c-item, .pult tfoot .c-mach { background: var(--surface-2); z-index: 3; }
  /* Закреплённые ячейки шапки — над остальной шапкой: та при прокрутке
     вбок уезжает под них. */
  .pult thead .c-sel, .pult thead .c-item, .pult thead .c-mach { z-index: 4; }
  .pult .c-sel { left: 0; }
  .pult .c-item { left: var(--pl1, 66px); }
  .pult .c-mach { left: var(--pl2, 300px); box-shadow: inset -1px 0 0 var(--line); }
  table.rows.pult.phead-float thead tr th.c-mach { box-shadow: inset -1px 0 0 var(--line), 0 1px 0 var(--line); }
  /* Подсветка строки под курсором — и у закреплённых: у них свой фон. */
  .pult tbody tr.prow:hover > .c-sel, .pult tbody tr.prow:hover > .c-item,
  .pult tbody tr.prow:hover > .c-mach { background: var(--prow-hover); }
}

/* Чипы кампаний в строке товара — каждый одной строкой (макет 05.10.2026):
   точка и статус словом одним цветом, вид серым, ставка справа. У своих —
   вторая короткая строка: кто, бюджет сегодня, почему стоит и когда
   поднимется; рамка акцентом — у тех, что под машиной. */
.pchips { display: flex; flex-direction: column; align-items: stretch; gap: 3px; }
.pchip {
  display: flex; flex-direction: column; min-width: 0;
  padding: 2px 8px; border: 1px solid var(--line-soft); border-radius: 8px;
  background: var(--surface); color: var(--ink-2); font-size: 12px; line-height: 16px;
  text-decoration: none; cursor: pointer;
}
.pchip:hover { border-color: var(--accent); color: var(--ink); }
.pchip.own { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.pchip .pc1 { display: flex; align-items: center; gap: 6px; min-width: 0; white-space: nowrap; }
.pchip .pst { flex: none; font-weight: 550; }
.pchip .pst::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%;
  background: currentColor; vertical-align: 1px; }
.pchip .pst.ok { color: var(--good); }
.pchip .pst.warn { color: var(--warn); }
.pchip .pst.bad { color: var(--bad); }
.pchip .pst.mute { color: var(--ink-3); }
.pchip .pkind { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--ink-3); }
.pchip .pbid { flex: none; margin-left: auto; padding-left: 4px; font-variant-numeric: tabular-nums; }
.pchip .pc2 { margin-top: 1px; font-size: 11.5px; line-height: 15px; color: var(--ink-3); }
.pchip .pc2 .pcap { white-space: nowrap; color: var(--ink-2); }
/* Почему стоит и когда поднимется — по строке, дальше многоточие
   (целиком — в подсказке чипа). width: 0 + min-width: 100% — как у
   артикула: иначе nowrap-строка раздвинула бы весь столбец «Кампании». */
.pchip .pc2.pwhy { width: 0; min-width: 100%; margin-top: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pchip .pc2 .acc { color: var(--accent); }
.pchip .pc2 .warn { color: var(--warn); }
.pchip .pc2 .bad { color: var(--bad); }
/* «ещё 2 кампании» — раскрывает строку (data-expand), не чип. */
.pchips .pmore-c {
  align-self: flex-start; padding: 0 2px; border: 0; background: none; cursor: pointer;
  color: var(--accent); font: inherit; font-size: 11.5px; line-height: 16px;
}
.pchips .pmore-c:hover { text-decoration: underline; }

/* Раскрытие строки. Ширина — видимой части прокрутки, и прилипает к её
   левому краю: иначе блок шириной во всю таблицу уезжал бы вбок вместе с
   прокруткой. Ширину выставляет скрипт страницы. */
.pdx { position: sticky; left: 12px; padding: 2px 0 6px; }
.pdx h3 { font-size: 14px; margin: 14px 0 6px; }
.pdpanel { margin: 0 0 4px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); }
.pdcamps { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 10px; }
.pdc {
  display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); font-size: 13px;
}
.pdc.own { border-left: 1px solid var(--accent); }
.pdc .ab-cell { border-top: 1px solid var(--line-soft); padding-top: 6px; }
.pd-y .card { margin: 0 0 8px; padding: 10px 12px; box-shadow: none; }

/* Массовая панель: та же .savebar, что на «Маркировке», но полей в ней
   больше — переносится, а на узком экране встаёт во всю ширину. */
.pbar { flex-wrap: wrap; row-gap: 8px; width: max-content; max-width: calc(100vw - 24px); }
.pbar label { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.pbar select, .pbar input[type=text] { width: auto; padding: 5px 8px; font-size: 13px; }
.pbar input[type=text] { width: 90px; text-align: right; }
@media (max-width: 720px) {
  .pbar, .pbar.on { left: 12px; right: 12px; width: auto; transform: none; }
  .pbar label { white-space: normal; }
}

/* Окно «Пульта»: бюджет, раскладка, тест цены, меню товара, вопросы и итоги. */
dialog.pdlg {
  width: min(660px, calc(100vw - 24px)); max-height: calc(100vh - 32px); padding: 0;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: 0 18px 48px rgba(20, 14, 28, .3);
}
dialog.pdlg::backdrop { background: rgba(20, 14, 28, .42); }
.pdlg-h { display: flex; align-items: flex-start; gap: 10px; padding: 16px 18px 6px; }
.pdlg-h h3 { flex: 1; margin: 0; font-size: 16px; line-height: 1.35; }
.pdlg-b { padding: 6px 18px 8px; font-size: 14px; overflow: auto; max-height: calc(100vh - 190px); }
.pdlg-b p { margin: 0 0 10px; }
.pdlg-b h4 { margin: 12px 0 4px; font-size: 14px; }
.pdlg-b input[type=text] { width: 120px; text-align: right; }
.pdlg-b input[type=date] { width: auto; padding: 7px 10px; font: inherit; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.pdlg-b .psplit input[type=text] { width: 96px; padding: 5px 8px; }
.pdlg-b .pcreate input[type=text], .pdlg-b .pcreate select { width: 100%; text-align: left; }
.pdlg-f { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; padding: 10px 18px 16px; border-top: 1px solid var(--line-soft); }
.pres { display: flex; gap: 10px; align-items: baseline; margin: 0 0 10px; }
.pres .pill { flex: none; }
.perr { color: var(--bad); font-size: 13px; }
.perr:empty { display: none; }
.pwarn { padding: 8px 10px; border-radius: 8px; background: var(--warn-bg); color: var(--warn); font-size: 13px; }
.pmenu-l { display: flex; flex-direction: column; gap: 2px; margin: 0 -6px; }
.pmenu-l a, .pmenu-l .lnk {
  display: block; width: 100%; padding: 9px 10px; border: 0; border-radius: 9px;
  background: none; color: var(--ink); font: inherit; font-size: 14px; text-align: left; text-decoration: none; cursor: pointer;
}
.pmenu-l a:hover, .pmenu-l .lnk:hover { background: var(--surface-2); }
.pmenu-l .lnk:disabled { opacity: .45; cursor: not-allowed; }
.pmenu-l form.inl { display: block; }

/* Итог обычной формы после перезагрузки на середине таблицы: копия flash
   всплывает сверху, потому что сам flash остался в начале страницы. */
.ptoast {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 70;
  display: flex; gap: 12px; align-items: flex-start; margin: 0;
  max-width: min(720px, calc(100vw - 24px)); box-shadow: 0 8px 28px rgba(0, 0, 0, .2);
}

details.psum { margin: 18px 0 8px; }
details.psum > summary { cursor: pointer; font-size: 13px; padding: 6px 0; }

/* ==================================================================
   «МАШИНА» — ДИСПЕТЧЕРСКАЯ (autobid), фаза 4, 03.10.2026.
   ------------------------------------------------------------------
   Шапка — одна карточка строками «подпись слева — состояние справа»:
   рубильник, область действия, токен, задачи. Строки, а не плитки:
   у каждой есть слово состояния и объяснение, и в плитку они не влезали
   (плитки и ушли). Лампы задач — сеткой в две группы, «пишут в WB» и
   «готовят данные»: при сбое ищут глазами сначала первую.
   ================================================================== */
.mhead { margin-bottom: 18px; }
.mrow {
  display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center;
  padding: 10px 0; border-top: 1px solid var(--line-soft); font-size: 14px;
}
.mrow:first-child { border-top: 0; padding-top: 0; }
.mrow:last-child { padding-bottom: 0; }
.mrow .mk { flex: 0 0 96px; color: var(--ink-3); font-size: 13px; }
/* Область действия — форма карточки настроек в компактном виде: в строке
   шапки она только поле, кнопка и счётчик, без своих отступов. */
.mrow form.row-actions { margin: 0; }
.mrow .chk { margin: 0; }
.mrun { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin: 0 0 0 auto; }
.mrow-prev { flex-direction: column; align-items: stretch; gap: 8px; }
.mlamps {
  flex-basis: 100%; display: grid; gap: 4px 24px; margin-top: 4px;
  /* min(…, 100%) — на телефоне колонка уже 320 px, и сетка не должна
     вылезать за край карточки. */
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
}
.mlg-h { margin: 2px 0 4px; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.mlamp {
  /* Плашка — постоянной ширины, чтобы названия задач стояли ровной
     колонкой; 124 px вмещают самое длинное слово, «нет в расписании». */
  display: grid; grid-template-columns: 124px 1fr; gap: 0 8px; align-items: baseline;
  padding: 4px 0; font-size: 13px;
}
.mlamp .pill { grid-row: span 2; justify-self: start; white-space: nowrap; }
.mlamp small { grid-column: 2; font-size: 12px; color: var(--ink-3); overflow-wrap: anywhere; }

/* «Деньги сегодня» — лестница из трёх ступеней с номером и линией между
   ними: порядок здесь и есть смысл (кабинет ограничивает раньше
   пополнений, пополнения — раньше бюджетов кампаний). */
.msmall { font-size: 12px; }
.missues { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 6px; }
.missues li { display: flex; gap: 8px; align-items: baseline; font-size: 13.5px; }
.missues .pill { flex: none; }
.mladder { list-style: none; margin: 0; padding: 0; counter-reset: mstep; }
.mstep { position: relative; padding: 0 0 16px 34px; font-size: 14px; }
.mstep:last-child { padding-bottom: 0; }
.mstep::before {
  counter-increment: mstep; content: counter(mstep);
  position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--ink-2); font-size: 12px; font-weight: 600;
}
.mstep::after { content: ''; position: absolute; left: 11px; top: 26px; bottom: 4px; width: 1px; background: var(--line); }
.mstep:last-child::after { display: none; }
.mstep-h { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; margin-bottom: 4px; }
.mstep > div + div { margin-top: 2px; }
.mstep .tscroll { margin-top: 6px; }

/* «Под машиной»: лампы контуров кампании — плашками со словом. */
.mcont { display: flex; flex-wrap: wrap; gap: 4px; }

/* Справка «Как машина решает». */
.mhow { margin-top: 12px; }
.mhow p { margin: 0 0 10px; font-size: 14px; line-height: 1.55; }
.mhow p:last-child { margin-bottom: 0; }

@media (max-width: 640px) {
  .mrow .mk { flex-basis: 100%; }
  .mrun { margin-left: 0; }
  .mlamp { grid-template-columns: 1fr; }
  .mlamp .pill { grid-row: auto; }
  .mlamp small { grid-column: 1; }
}

/* ==================================================================
   ЛИСТ ПЕРЕДАЧИ (кампания, &handover=1; пульт, фаза 5).
   Проверки — строками: плашка со словом слева постоянной ширины, чтобы
   названия стояли ровной колонкой («не пускает» — самое длинное слово),
   справа — название, объяснение, «как исправить» и «можно будет …».
   Правки не из приложения — списком под объяснением. До 640 px плашка
   встаёт над текстом.
   ================================================================== */
.hochk { list-style: none; margin: 0; padding: 0; }
.hochk > li {
  display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 2px 10px; align-items: baseline;
  padding: 10px 0; border-top: 1px solid var(--line-soft); font-size: 14px;
}
.hochk > li:first-child { border-top: 0; padding-top: 0; }
.hochk > li:last-child { padding-bottom: 0; }
.hochk > li > .pill { justify-self: start; white-space: nowrap; }
.hochk .hox { color: var(--ink-2); font-size: 13.5px; overflow-wrap: anywhere; }
.hochk .hoact { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; font-size: 13px; }
.hochk .hoitems { margin: 6px 0 0; padding-left: 18px; font-size: 12.5px; color: var(--ink-2); }
.hochk .hoitems li { margin: 2px 0; overflow-wrap: anywhere; }

@media (max-width: 640px) {
  .hochk > li { grid-template-columns: 1fr; }
}

/* ==================================================================
   ТАБЛИЦА КЛАСТЕРОВ — РАБОЧЕЕ МЕСТО (пульт, фаза 6).
   Общие для вкладки «Кластеры» кампании и страницы «Кластеры». Данные и
   слова — ab_cl_* в autobid_ui.php: разметка своей правды не считает.
   Статус — всегда цвет и слово: полоса слева только дублирует плашку
   статуса в строке, одна она не читается ни при дальтонизме, ни в печати.
   ================================================================== */

/* Полоса статуса слева в строке — тенью внутрь первой ячейки, а не
   border-left: у table.rows border-collapse: collapse, и рамка сдвинула бы
   столбец на свою ширину. Цвет — тон ab_cl_status (ok, warn, bad, acc, mute). */
table.rows tr.clrow-ok > td:first-child { box-shadow: inset 3px 0 0 var(--good); }
table.rows tr.clrow-warn > td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
table.rows tr.clrow-bad > td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
table.rows tr.clrow-acc > td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
table.rows tr.clrow-mute > td:first-child { box-shadow: inset 3px 0 0 var(--line); }

/* Пятый цвет плашки — «ждёт исключения», «под контролем»: не хорошо и не
   плохо, а «в работе у машины». */
.pill.acc { background: var(--accent-2); color: var(--accent); }

/* Статус в строке: плашка, под ней записка («37 / 100 показов»). */
.clst { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.clst small { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }

/* Кто держит ставку — плашка мельче обычной: стоит в каждой строке. */
.pill.clwho { font-size: 11px; padding: 1px 7px; white-space: nowrap; }

/* Счётчик предела «исключено 307 / 1000» (ab_cl_cap_html): полоса и слово.
   Серый до 800, жёлтый (warn) с 800, красный (bad) с 950. */
.clcap { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.clcap b { font-weight: 600; white-space: nowrap; }
.clbar { flex: none; display: inline-block; width: 72px; height: 6px; border-radius: 3px;
         background: var(--surface-2); overflow: hidden; vertical-align: middle; }
.clbar > i { display: block; height: 100%; border-radius: 3px; background: var(--ink-3); }
.clcap.warn b { color: var(--warn); }
.clcap.warn .clbar > i { background: var(--warn); }
.clcap.bad b { color: var(--bad); }
.clcap.bad .clbar > i { background: var(--bad); }
/* Та же полоса поменьше — прогресс в строке: «37 / 100 показов». */
.clprog { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ink-3); }
.clprog .clbar { width: 44px; height: 4px; }
.clprog .clbar > i { background: var(--accent); }

/* Ячейка решения машины (ab_cl_decisions): решение, под ним прогноз
   исключения. «Сделала бы» и пропуски — серые: в WB это не уходило. */
.cldec { min-width: 200px; max-width: 320px; font-size: 12.5px; line-height: 1.35; white-space: normal; }
.cldec .cd-m { color: var(--ink); }
.cldec .cd-m.ok { color: var(--good); }
.cldec .cd-m.warn { color: var(--warn); }
.cldec .cd-m.bad { color: var(--bad); }
.cldec .cd-m.mute { color: var(--ink-3); }
.cldec .cd-h { color: var(--ink-2); }
.cldec .cd-f { margin-top: 2px; color: var(--ink-3); }
.cldec .cd-f.warn { color: var(--warn); }
.cldec .cd-f.acc { color: var(--accent); }

/* Ставка в строке и её отправка по Enter. Уход с поля только помечает
   изменённое (.cl-dirty) — отправляет Enter или кнопка (план, п. 16).
   Состояние строки — класс на tr и слово в .clmsg под полем:
   «отправляется…», «принято», «отказ: ниже 421 ₽», «итог неизвестен». */
td.clbid input.cl-dirty { border-color: var(--warn); background: var(--warn-bg); }
td.clbid .clmsg { display: block; margin-top: 2px; font-size: 11.5px; line-height: 1.3; white-space: normal;
                  text-align: right; min-width: 74px; }
td.clbid .clmsg.wait { color: var(--ink-3); }
td.clbid .clmsg.ok { color: var(--good); }
td.clbid .clmsg.warn { color: var(--warn); }
td.clbid .clmsg.bad { color: var(--bad); }
table.rows tr.cl-sending td.clbid input { opacity: .55; pointer-events: none; }
table.rows tr.cl-done td.clbid { background: var(--good-bg); }
table.rows tr.cl-refused td.clbid { background: var(--bad-bg); }
table.rows tr.cl-unknown td.clbid { background: var(--warn-bg); }

/* ВКЛАДКА «КЛАСТЕРЫ» КАМПАНИИ (пульт, фаза 6): (i) у заголовков, вкладки
   статуса со счётчиком предела, правила исключения, отчёт о ставках, замок
   на поле. Разметка — _camp_clusters.php. */

/* Значок (i) у заголовка столбца: формула и источник — подсказкой, а не
   сноской под таблицей. Span, а не <i>: <i> в заголовке-ссылке — стрелка
   сортировки со своими отступами. Цвет — currentColor: в шапке на акценте
   он белый, в тексте карточки — как текст. */
.thi {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 15px; height: 15px; margin-left: 4px; vertical-align: middle;
  border: 1px solid currentColor; border-radius: 50%;
  font: 600 10px/1 var(--font); font-style: normal; opacity: .7; cursor: help;
}
.thi:hover, .thi:focus-visible { opacity: 1; outline: none; }
/* Заголовок-ссылка с (i): ссылка не во всю ячейку, значок — рядом с ней,
   а не строкой ниже (у th.sortable a — display: block). */
table.rows th.thx { white-space: nowrap; }
table.rows th.thx > a { display: inline-block; vertical-align: middle; }
table.rows th.thx > .thi { margin: 0 8px 0 0; }

/* Вкладки статуса — те же .tabs, что у вкладок кампании, поменьше.
   Счётчик предела у «исключены» — цветом и словом («· близко к пределу»). */
.tabs.cltabs { margin: 4px 0 12px; gap: 6px; }
.tabs.cltabs a { padding: 5px 12px; font-size: 13px; }
.tabs a i.warn { background: var(--warn-bg); color: var(--warn); }
.tabs a i.bad { background: var(--bad-bg); color: var(--bad); }
.tabs a.on i.warn, .tabs a.on i.bad { background: var(--surface); }

/* Поле ставки в строке. Под замком — значок замка в самом поле: строк
   бывают тысячи, и подпись словами в каждой раздула бы таблицу; причина —
   над таблицей и в «Чья ставка». Значок — фоном, цвет без переменной (в
   data: URI её не подставить) — серый, читается в обеих темах. */
td.clbid input[type=text] { width: 74px; text-align: right; }
td.clbid input.cl-lock {
  padding-left: 22px; cursor: not-allowed;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Crect x='2' y='5.5' width='8' height='5.5' rx='1' fill='%238a8494'/%3E%3Cpath d='M4 5.5V4a2 2 0 0 1 4 0v1.5' fill='none' stroke='%238a8494' stroke-width='1.3'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 7px center;
}

/* Правила исключения и предпросмотр над таблицей. */
.clrules { padding-top: 14px; padding-bottom: 14px; }
.clrules .clr-list { margin: 8px 0 0; font-size: 13px; line-height: 1.6; color: var(--ink-2); }
.clrules .clr { white-space: nowrap; }
.clrules .clr-none { margin: 8px 0 0; font-size: 13px; }
.clrules details.clprev { margin-top: 8px; font-size: 13px; }
.clrules details.clprev > summary { cursor: pointer; padding: 4px 0; }
.clrules details.clprev ul { margin: 6px 0 10px; padding-left: 18px; }
.clrules details.clprev li { margin: 3px 0; overflow-wrap: anywhere; }

/* Отчёт о ставках формы — над таблицей, после flash: что принято, что
   отвергнуто и почему. Отказы и неизвестные — первыми. */
details.clrep { padding-top: 12px; padding-bottom: 12px; font-size: 13px; }
details.clrep > summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
details.clrep ul { list-style: none; margin: 10px 0 0; padding: 0; max-height: 320px; overflow: auto; }
details.clrep li { padding: 4px 0; border-top: 1px solid var(--line-soft); overflow-wrap: anywhere; }
details.clrep li .pill { margin-right: 6px; }

@media (max-width: 640px) {
  .clrules .clr { white-space: normal; }
}

/* Заголовок, по которому сейчас сортировка, в шапке на акценте: цвет акцента
   у th.sortable.on a там сливался с фоном, и столбец сортировки (по
   умолчанию — «Расход» у кластеров кампании) читался пустым. Стрелка
   остаётся знаком сортировки, подчёркивание — выделением. */
table.rows.fltd th.sortable.on a { color: var(--btn-ink); text-decoration: underline; text-underline-offset: 3px; }

/* ---- Фаза 7: закрепление кластера, заморозка, потолок, полоса суток ---- */

/* Кнопки закрепления в столбце «Чья ставка» — текстом, мелко: стоят в
   каждой строке таблицы на сотни строк. */
button.clpin { display: block; margin-top: 3px; padding: 0; border: 0; background: none; cursor: pointer;
               font: inherit; font-size: 11.5px; color: var(--accent); text-align: left; white-space: nowrap; }
button.clpin:hover { text-decoration: underline; }
.clpinw { display: block; margin-top: 2px; font-size: 11.5px; color: var(--accent); white-space: nowrap; }
.clpin-opts .chk { display: flex; gap: 6px; align-items: baseline; margin: 0 0 6px; }
.pdlg-b ul { margin: 0 0 10px; padding-left: 18px; }
/* Потолок по экономике под решением машины (wb_autobid_unit_state). */
.cldec .cd-u { margin-top: 2px; color: var(--ink-3); }

/* Полоса суток кампании: 24 клетки — подложка «шла / стояла», столбик —
   расход за час. Цвет всегда со словом — в подсказке клетки и в легенде. */
.dstrip-days { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.dstrip-days a { padding: 2px 9px; border: 1px solid var(--line); border-radius: 999px; font-size: 12.5px;
                 color: var(--ink-2); text-decoration: none; }
.dstrip-days a.on { background: var(--accent); border-color: var(--accent); color: var(--btn-ink); }
.dstrip-row, .dstrip-ax { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); gap: 2px; }
.dstrip-h { position: relative; height: 56px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.dstrip-h > i { position: absolute; left: 22%; right: 22%; bottom: 0; border-radius: 2px 2px 0 0; background: var(--ink-2); }
.dstrip-h.run { background: var(--good-bg); }
.dstrip-h.stop { background: var(--warn-bg); }
.dstrip-h.mix { background: linear-gradient(90deg, var(--good-bg) 50%, var(--warn-bg) 50%); }
.dstrip-h.fut { background: transparent; border: 1px dashed var(--line); }
.dstrip-h.now { outline: 2px solid var(--accent); outline-offset: -2px; }
.dstrip-ax span { font-size: 11px; color: var(--ink-3); font-family: var(--mono); }
.dstrip-leg { margin: 6px 0 4px; font-size: 12px; }
.dstrip-k { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin: 0 4px 0 10px;
            vertical-align: -1px; background: var(--surface-2); }
.dstrip-k:first-child { margin-left: 0; }
.dstrip-k.run { background: var(--good-bg); border: 1px solid var(--good); }
.dstrip-k.stop { background: var(--warn-bg); border: 1px solid var(--warn); }
.dstrip-k.mix { background: linear-gradient(90deg, var(--good-bg) 50%, var(--warn-bg) 50%); border: 1px solid var(--line); }
@media (max-width: 640px) {
  .dstrip-h { height: 40px; }
  .dstrip-row, .dstrip-ax { gap: 1px; }
}

/* ---- Фаза 8: удержание места, ставка за клик руками, тепловая карта ---- */

/* Удержание места в строке кластера: плашка правила под «Чья ставка» и
   кнопки текстом, как у закрепления. Цвет всегда со словом
   («наблюдение», «в бою», «в бою, не действует»). */
button.clhold { display: block; margin-top: 3px; padding: 0; border: 0; background: none; cursor: pointer;
                font: inherit; font-size: 11.5px; color: var(--accent); text-align: left; white-space: nowrap; }
button.clhold:hover { text-decoration: underline; }
button.clhold[disabled] { color: var(--ink-3); cursor: not-allowed; text-decoration: none; }
.clholdw { display: block; margin-top: 3px; font-size: 11.5px; white-space: nowrap; color: var(--ink-3); }
.clholdw.ok { color: var(--good); }
.clholdw.warn { color: var(--warn); }
.cldec .cd-hold { margin-top: 3px; color: var(--accent); }
.clholdbar { margin-bottom: 12px; }

/* Ставка за клик руками в карточке «Машина за клик»: строка на товар,
   поле в копейках, ответ WB — словом и цветом под полем. */
.cpch { margin: 12px 0 14px; }
.cpch h3 { margin: 0 0 6px; font-size: 15px; }
.cpch-f { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0; }
.cpch-f input[name=bid] { width: 92px; text-align: right; }
.cpch-msg { flex-basis: 100%; font-size: 12px; line-height: 1.3; }
.cpch-msg:empty { display: none; }
.cpch-msg.wait { color: var(--ink-3); }
.cpch-msg.ok { color: var(--good); }
.cpch-msg.warn { color: var(--warn); }
.cpch-msg.bad { color: var(--bad); }

/* Тепловая карта 7×24: один оттенок от светлого к тёмному (больше —
   темнее), ноль — подложка, «нет данных» — пунктир. Значение — в
   подсказке клетки, словами — в легенде. Тёмная тема — те же ступени от
   своих --accent и --surface. */
/* Виды переключаются атрибутом hidden, а у .hm-grid display задан явно и
   перебивал бы его: без правила на экране стояли все три карты разом
   (ревизия фазы 8; то же, что у .savebar выше). */
.hm [hidden] { display: none !important; }
.hm-note, .hm-few, .hm-leg { margin: 0 0 8px; font-size: 12.5px; color: var(--ink-2); }
.hm-leg { margin-top: 8px; }
.hm-sw { display: inline-flex; flex-wrap: wrap; gap: 4px; margin: 0 0 8px; }
.hm-sw button { padding: 2px 10px; border: 1px solid var(--line); border-radius: 999px; background: none; cursor: pointer;
                font: inherit; font-size: 12.5px; color: var(--ink-2); }
.hm-sw button.on { background: var(--accent); border-color: var(--accent); color: var(--btn-ink); }
.hm-grid { display: grid; grid-template-columns: 26px repeat(24, minmax(0, 1fr)); gap: 2px; align-items: center; }
.hm-ax, .hm-dn { font-size: 11px; color: var(--ink-3); font-family: var(--mono); }
.hm-k { display: block; height: 18px; border-radius: 3px; background: var(--surface-2); }
.hm-leg .hm-k { display: inline-block; width: 12px; height: 12px; vertical-align: -1px; }
.hm-k.hm-1 { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); }
.hm-k.hm-2 { background: color-mix(in srgb, var(--accent) 32%, var(--surface)); }
.hm-k.hm-3 { background: color-mix(in srgb, var(--accent) 50%, var(--surface)); }
.hm-k.hm-4 { background: color-mix(in srgb, var(--accent) 68%, var(--surface)); }
.hm-k.hm-5 { background: color-mix(in srgb, var(--accent) 88%, var(--surface)); }
.hm-k.hm-x { background: transparent; border: 1px dashed var(--line); }
.pd-heat { margin: 4px 0 10px; }
.pd-heat > summary { cursor: pointer; font-size: 13px; color: var(--ink-2); padding: 4px 0; }
@media (max-width: 640px) {
  .hm-grid { grid-template-columns: 22px repeat(24, minmax(0, 1fr)); gap: 1px; }
  .hm-k { height: 14px; }
}

/* ==================================================================
   СТРАНИЦА КАМПАНИИ И «МАШИНА» ПО МАКЕТУ (08.10.2026, ветка pult-design2).
   ------------------------------------------------------------------
   Только вид: формы, поля, ссылки и скрипты прежние. Кнопки отделены от
   фактов (раньше стояли вперемешку одинаковыми плашками), вторичное ушло
   в подсказки и раскрытия, редкие действия — в меню «⋯».
   ================================================================== */

/* Путь «Пульт › название» над заголовком — вместо «← к пульту». */
.crumbs { display: flex; gap: 6px; align-items: baseline; min-width: 0; margin: 0 0 4px; font-size: 13px; color: var(--ink-3); }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { color: var(--accent); text-decoration: underline; }
.crumbs [aria-current] { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* Строка заголовка: название, статус цветом и словом, справа — главное
   действие и «⋯». Под ней — одна серая строка фактов, «·» ставит CSS. */
.dhead.chd { margin-bottom: 12px; }
.chd-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.chd-top h1 { min-width: 0; margin: 0; font-size: 26px; line-height: 1.2; }
.chd-st { padding: 3px 10px; font-size: 12.5px; white-space: nowrap; }
.chd-act { display: flex; align-items: center; gap: 8px; margin-left: auto; }
/* «·» стоит перед каждым пунктом, а строка сдвинута влево на его ширину и
   этот край обрезан: при переносе (узкий экран) строка не начинается с «·». */
.chd-facts { display: flex; flex-wrap: wrap; row-gap: 2px; margin: 6px 0 0 -18px; clip-path: inset(0 0 0 18px);
             font-size: 13px; color: var(--ink-2); }
/* Текст — --ink-2, серее только «·»: --ink-3 на --bg в светлой теме 4,43:1,
   ниже 4,5 при 13 px (раньше факты стояли плашками, 7,79:1). */
.chd-facts > span::before { content: '·'; display: inline-block; width: 18px; text-align: center; color: var(--ink-3); }
.chd-facts b { font-weight: 600; color: var(--ink-2); }
.chd-facts .mono { font-size: 12.5px; }
.chd-facts [title] { cursor: help; }

/* Меню «⋯» шапки — <details>: открывается и без скрипта; скрипт шапки
   закрывает его щелчком мимо и по Esc. Внутри — те же формы и кнопки. */
.cmenu { position: relative; }
.cmenu > summary { list-style: none; padding-left: 13px; padding-right: 13px; font-weight: 700; letter-spacing: .04em; }
.cmenu > summary::-webkit-details-marker { display: none; }
.cmenu[open] > summary { background: var(--surface-2); }
.cmenu-m {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30;
  display: grid; gap: 2px; min-width: 280px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 8px 28px rgba(30, 20, 45, .16);
}
/* У формы «Удалить» display задан в style (общая кнопка advert_delete_button). */
.cmenu-m form { display: block !important; margin: 0; }
.cmenu .cmenu-m button {
  display: block; width: 100%; padding: 8px 10px; border: 0; border-radius: 9px;
  background: none; color: var(--ink); font: inherit; font-size: 14px; font-weight: 500;
  line-height: 1.35; text-align: left; cursor: pointer;
}
.cmenu .cmenu-m button small { display: block; margin-top: 1px; font-size: 12px; font-weight: 400; color: var(--ink-3); }
.cmenu .cmenu-m button:hover:not(:disabled) { background: var(--surface-2); }
.cmenu .cmenu-m button:disabled { opacity: .45; cursor: not-allowed; }
.cmenu-sep { height: 1px; margin: 4px 6px; background: var(--line-soft); }
.cmenu .cmenu-del button { color: var(--bad); }

/* Плитки: период — подписью над ними; в плитке число и одна строка
   изменения, вторичное — в подсказке (title). */
.chd-per { margin: 2px 0 6px; font-size: 12.5px; color: var(--ink-2); }
.tiles.ctiles { margin-bottom: 6px; }
.ctiles .tile { padding: 12px 16px; cursor: help; }
.ctiles .tile .v { margin-top: 2px; font-size: 24px; line-height: 1.25; }
.ctiles .tile .n { margin-top: 2px; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* «Сегодня» и «по остатку бюджета» — одной серой строкой, все числа. */
.chd-today { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 16px; margin: 0 0 12px; font-size: 12.5px; color: var(--ink-2); }
.chd-today b { font-weight: 600; color: var(--ink-2); }
.chd-today [title] { cursor: help; }

/* Полоса «Машина и бюджет» одной строкой: кто ведёт | бюджет на сутки
   полосой заполнения со словом | держит ли | готовые суммы и «Другой…». */
.card.cmb { margin-bottom: 12px; padding: 12px 16px; }
.cmb-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 0; }
.cmb-div { flex: none; width: 1px; height: 18px; background: var(--line); }
.cmb-k { font-size: 13px; color: var(--ink-2); }
.cmb-cap { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); white-space: nowrap; cursor: help; }
.cmb-cap b { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.cmb-bar { flex: none; width: 88px; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden;
           box-shadow: inset 0 0 0 1px var(--line-soft); }
.cmb-bar > i { display: block; height: 100%; border-radius: 3px; background: var(--ink-3); }
.cmb-cap.ok .cmb-bar > i { background: var(--good); }
.cmb-cap.warn, .cmb-cap.warn b { color: var(--warn); }
.cmb-cap.warn .cmb-bar > i { background: var(--warn); }
.cmb-cap.bad, .cmb-cap.bad b { color: var(--bad); }
.cmb-cap.bad .cmb-bar > i { background: var(--bad); }
.cmb-set { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-left: auto; }
/* «Другой…» — поле суммы и «Записать» той же формы #daycap всплывают под
   кнопкой; закрытое раскрытие форма всё равно шлёт. */
.cmb-other { position: relative; }
.cmb-other > summary { list-style: none; }
.cmb-other > summary::-webkit-details-marker { display: none; }
.cmb-other[open] > summary { background: var(--surface-2); }
.cmb-in {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 25;
  display: flex; gap: 6px; align-items: center; padding: 8px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 8px 28px rgba(30, 20, 45, .16);
}
.cmb-in input[type=text] { width: 104px; padding: 5px 8px; text-align: right; }
/* Кнопка по умолчанию #daycap (Enter в поле суммы = «Записать»): первая в
   форме, невидимая. Не display:none — такую Safari для Enter не берёт. */
.cmb-dflt { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden;
            clip-path: inset(50%); white-space: nowrap; }
/* Пояснение — одной строкой: текст с многоточием (целиком — в title),
   ссылки не сжимаются. До 640 px — переносом. */
.cmb-note { display: flex; align-items: baseline; gap: 2px 12px; margin: 8px 0 0; font-size: 12.5px; line-height: 1.5;
            color: var(--ink-2); }
.cmb-nt { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cmb-note a { flex: none; white-space: nowrap; }
.cmb-note .cmb-cab { font-size: 12px; }
.cmb-loss { margin: 8px 0 0; font-size: 13px; }

/* Пополнить счёт кампании (19.10.2026) — карточка под полосой «Машина и
   бюджет», тем же языком и одной строкой: счёт | сегодня внесено |
   источник, «и запустить», готовые суммы и «Другая…». Раскрытие «Другая…»,
   разделитель и кнопка по умолчанию — классы полосы (.cmb-*). */
.card.cdep { margin-bottom: 12px; padding: 10px 16px; }
.cdep-bal, .cdep-today { font-size: 13px; color: var(--ink-2); white-space: nowrap; cursor: help; }
.cdep-bal b, .cdep-today b { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.cdep-row select { width: auto; padding: 3px 8px; font-size: 12.5px; border-radius: 6px; }
.cdep-start { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--ink-2);
              white-space: nowrap; cursor: pointer; }
.cdep-start input { margin: 0; accent-color: var(--accent); }
.cdep-other .cmb-in { flex-wrap: wrap; width: 232px; }
.cdep-hint { flex-basis: 100%; font-size: 12px; color: var(--ink-2); }
.cdep-why { margin-left: auto; font-size: 12.5px; color: var(--ink-2); }
.cdep-err { flex-basis: 100%; font-size: 12.5px; color: var(--bad); }
.cdep-err:empty { display: none; }
/* Итог прошлой отправки — над строкой, плашкой со словом. */
.cdep-res { display: flex; gap: 8px; align-items: baseline; margin: 0 0 8px; font-size: 13.5px; }
.cdep-res .pill { flex: none; }
.cdep-note { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin: 8px 0 0; font-size: 12.5px;
             color: var(--ink-2); }
/* Вопрос без скрипта (второй шаг сервера) — под строкой, тем же текстом,
   что окно #depdlg. */
.cdep-ask { margin: 10px 0 0; padding: 10px 12px; border-radius: 8px; background: var(--surface-2); font-size: 13.5px; }
.cdep-ask p { margin: 0 0 8px; }
.cdep-ask .chk { margin: 2px 0 8px; }
.cdep-ask p.cdep-ask-f { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
/* Галочку «больше 5 000 ₽» окно прячет атрибутом hidden, а у .chk display
   задан явно (grid) — без этого она видна всегда (interfeis.md, «Ловушки»). */
#depdlg [hidden] { display: none !important; }

/* Вкладки кампании — подчёркиванием, а не плашками-кнопками. На узком
   экране — прокруткой в строку: перенос рвал бы линию подчёркивания. */
.tabs.ctabs {
  flex-wrap: nowrap; gap: 22px; margin: 16px 0 16px; overflow-x: auto; scrollbar-width: none;
  box-shadow: inset 0 -1px 0 var(--line);
}
/* Линия под вкладками — тенью внутри, а не border-bottom с -1px у ссылок:
   overflow-x: auto делает и overflow-y auto, и вынесенная на пиксель
   рамка ссылки обрезалась (из 2 px акцента виднелось 0,6), а полоса
   прокручивалась колесом на 1 px. Тень рисуется под содержимым — рамка
   активной ложится поверх неё внутри полосы. */
.tabs.ctabs::-webkit-scrollbar { display: none; }
.tabs.ctabs a {
  padding: 8px 1px 9px; border: 0; border-bottom: 2px solid transparent; border-radius: 0;
  background: none; color: var(--ink-2); font-size: 14.5px;
}
.tabs.ctabs a:hover { color: var(--ink); border-bottom-color: var(--line); }
.tabs.ctabs a:focus-visible { outline-offset: -2px; }
.tabs.ctabs a.on { background: none; color: var(--ink); font-weight: 600; border-bottom-color: var(--accent); }
.tabs.ctabs a i { background: var(--surface-2); color: var(--ink-2); }
.tabs.ctabs a.on i { background: var(--accent-2); color: var(--accent); }

/* Вкладки статуса кластеров на вкладке кампании — тихой полосой: открытая
   на фоне, остальные текстом. Счётчик предела у «исключены» — прежний,
   цветом и словом. Страница «Кластеры» — без .clq, как была. */
.tabs.cltabs.clq { gap: 2px; margin: 2px 0 10px; }
.tabs.cltabs.clq a { padding: 4px 10px; border-color: transparent; background: none; color: var(--ink-2); }
.tabs.cltabs.clq a:hover { background: var(--surface-2); color: var(--ink); }
/* Открытая — фоном акцента, как счётчик открытой вкладки кампании: --surface
   на --bg давал 1,08:1, и открытую отличала только жирность. */
.tabs.cltabs.clq a.on { background: var(--accent-2); border-color: transparent; color: var(--accent); font-weight: 600; }
.tabs.cltabs.clq a i { padding: 0 0 0 1px; background: none; color: var(--ink-3); font-weight: 500; }
.tabs.cltabs.clq a.on i { background: none; color: var(--accent); }
.tabs.cltabs.clq a i.warn { padding: 1px 6px; background: var(--warn-bg); color: var(--warn); }
.tabs.cltabs.clq a i.bad { padding: 1px 6px; background: var(--bad-bg); color: var(--bad); }

/* Правила исключения — свёрнуты: в заголовке кто исключает и итог
   предпросмотра, пороги и список — в раскрытии. */
details.card.clrules { padding: 10px 16px; }
details.clrules > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; cursor: pointer; list-style: none; }
details.clrules > summary::-webkit-details-marker { display: none; }
details.clrules > summary::before, details.mscope > summary::before, details.mjl > summary::before {
  content: ''; flex: none; width: 0; height: 0; border-left: 5px solid var(--ink-3);
  border-top: 4px solid transparent; border-bottom: 4px solid transparent; transition: transform .15s ease;
}
details.clrules[open] > summary::before, details.mscope[open] > summary::before,
details.mjl[open] > summary::before { transform: rotate(90deg); }
.clr-sum { font-size: 13px; color: var(--ink-3); }
.clr-sum.acc { color: var(--accent); font-weight: 550; }
.clrules .clr-link { margin: 8px 0 0; font-size: 13px; }

/* Замок ставок — одной строкой со значком; весь абзац — в раскрытии. */
details.cllock { margin: 0 0 10px; font-size: 13px; }
details.cllock > summary { display: flex; align-items: center; gap: 8px; min-width: 0; cursor: pointer; list-style: none; }
details.cllock > summary::-webkit-details-marker { display: none; }
details.cllock > summary .pill { flex: none; }
.cllock-i {
  flex: none; width: 12px; height: 12px; background: var(--warn);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Crect x='2' y='5.5' width='8' height='5.5' rx='1'/%3E%3Cpath d='M4 5.5V4a2 2 0 0 1 4 0v1.5' fill='none' stroke='%23000' stroke-width='1.3'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Crect x='2' y='5.5' width='8' height='5.5' rx='1'/%3E%3Cpath d='M4 5.5V4a2 2 0 0 1 4 0v1.5' fill='none' stroke='%23000' stroke-width='1.3'/%3E%3C/svg%3E") center / contain no-repeat;
}
.cllock-w { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--ink-2); }
.cllock-more { flex: none; color: var(--accent); font-size: 12.5px; }
details.cllock[open] .cllock-more { color: var(--ink-3); }
details.cllock > p { margin: 6px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }

/* Шапка таблицы кластеров кампании — светлая: фон поверхности, текст
   приглушённый, снизу линия. Только #cltab: у остальных таблиц с отбором
   шапка прежняя, акцентом. */
#cltab.fltd thead th { background: var(--surface); color: var(--ink-3); }
#cltab.fltd thead th a { color: inherit; }
#cltab.fltd thead th.sortable a:hover { background: var(--surface-2); color: var(--ink); }
#cltab.fltd thead th.sortable.on a { color: var(--accent); text-decoration: none; }
#cltab.fltd thead tr th { border-radius: 0; }
#cltab.fltd tbody tr:first-child td { padding-top: 6px; border-top: 1px solid var(--line); }
#cltab tr.fltrow input { border-color: var(--line); background: var(--surface); }
#cltab tr.fltrow input:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
#cltab tr.fltrow input:focus { outline-color: var(--accent); }
/* «Фильтры» — кнопка второй строки отбора (_tblfilter.php, $fltFold). */
.fltfold { display: flex; gap: 6px; align-items: center; }
.fltfold input { flex: 1 1 auto; min-width: 0; }
table.rows tr.fltrow button.fltmore {
  flex: none; padding: 4px 9px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--accent); font: inherit; font-size: 12px; font-weight: 550;
  white-space: nowrap; cursor: pointer;
}
table.rows tr.fltrow button.fltmore[aria-expanded="true"] { border-color: transparent; background: var(--accent-2); }
table.rows tr.fltrow button.fltmore:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* «Машина» в строке: решение и время, ниже серым — причина одной строкой
   (width: 0 + min-width: 100% — многоточие не раздвигает столбец). */
/* Первая строка — не длиннее двух строк (прогноз, когда он первый, бывает
   длинным); целиком — в подсказке ячейки. */
.cldec > div:first-child { margin-top: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cldec .cd-2 { width: 0; min-width: 100%; margin-top: 1px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
               font-size: 12px; color: var(--ink-3); }
td.cldec[title] { cursor: help; }

/* «Чья ставка» — плашка и меню строки «⋯». Меню раскрывается в строке, не
   всплывает: выпадающее в прокручиваемой таблице обрезалось бы её краем. */
td.clwhoc { white-space: nowrap; }
/* Плашка и «⋯» — по верху: открытое меню растит ячейку вниз, а не
   сбрасывает «⋯» под плашку (display: block у открытого так и делал, и
   строка росла с 52 до 115 px). */
td.clwhoc > .pill.clwho { vertical-align: top; }
details.clrm { display: inline-block; margin-left: 2px; vertical-align: top; }
details.clrm > summary {
  display: inline-block; padding: 0 6px; border-radius: 6px; list-style: none;
  font-weight: 700; line-height: 18px; color: var(--ink-3); cursor: pointer;
}
details.clrm > summary::-webkit-details-marker { display: none; }
details.clrm > summary:hover, details.clrm[open] > summary { background: var(--surface-2); color: var(--ink); }
details.clrm > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
details.clrm > span { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; margin: 3px 0 2px;
                      padding: 2px 0 2px 8px; border-left: 2px solid var(--accent-2); }
/* Подписи не рвём («держать / место»): столбец на время раскрытия шире. */
details.clrm > span button.clpin, details.clrm > span button.clhold { margin: 0; white-space: nowrap; font-size: 12px; line-height: 1.35; }

/* «Машина»: шапка-карточка — режим, кампании под машиной, прогон и
   «Пересчитать»; серым — область и токен; задачи — плашкой и списком. */
.mh1 { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.mh-mode { padding: 3px 11px; font-size: 13px; }
.mh-sum { font-size: 14px; color: var(--ink-2); }
.mh-sum a { color: var(--ink); font-weight: 600; text-decoration: none; }
.mh-sum a:hover { color: var(--accent); text-decoration: underline; }
.mh2 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 20px; margin-top: 6px; font-size: 13px; color: var(--ink-3); }
.mh-edit { color: var(--accent); font-size: 12.5px; }
details.mscope > summary { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; }
details.mscope > summary::-webkit-details-marker { display: none; }
details.mscope[open] { flex-basis: 100%; }
.mscope-f {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 8px 0 2px; padding: 10px 12px;
  border-radius: 10px; background: var(--surface-2); color: var(--ink-2);
}
.mscope-f form.row-actions { margin: 0; }
.mscope-f .chk { margin: 0; }
.mh-tok .pill { margin: 0 4px; }
.mh-tok .btn { margin-left: 6px; }
.mjobs { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.mjobs .mlamps-bad { margin: 10px 0 2px; }
details.mjl > summary { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; }
details.mjl > summary::-webkit-details-marker { display: none; }
.mjg-h { margin: 12px 0 4px; font-size: 12px; font-weight: 600; color: var(--ink-3); }
ul.mjg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px 28px; margin: 0; padding: 0; list-style: none; }
.mjob { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 3px 0; font-size: 13px; cursor: help; }
.mdot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--good); }
.mjob.warn .mdot { background: var(--warn); }
.mjob.bad .mdot { background: var(--bad); }
.mjob.mute .mdot { background: var(--ink-3); }
.mjob-n { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--ink); }
.mjob-t { flex: none; margin-left: auto; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.mjob.mute .mjob-t { font-style: italic; }

@media (max-width: 900px) {
  ul.mjg { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .chd-top h1 { font-size: 22px; }
  /* Плитки по две: по одной в ряд пять плиток занимали два экрана. */
  .tiles.ctiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .ctiles .tile { padding: 10px 12px; }
  .ctiles .tile .v { font-size: 20px; }
  .cmb-div { display: none; }
  .cmb-set { margin-left: 0; }
  .cmb-other[open] { flex-basis: 100%; }
  .cmb-in { position: static; margin-top: 6px; box-shadow: none; }
  .cmb-note { flex-wrap: wrap; }
  .cmb-nt { white-space: normal; }
  .cdep-why { margin-left: 0; }
  .cdep-other .cmb-in { width: auto; }
  ul.mjg { grid-template-columns: 1fr; }
}

/* ==================================================================
   ВКЛАДКА «ПО ДНЯМ» СТРАНИЦЫ КАМПАНИИ (15.10.2026, ветка camp-stats).
   ------------------------------------------------------------------
   Таблица дней кампании и её товара: группы столбцов подписью над ними,
   (i) у заголовков, сортировка кнопками в браузере, день закреплён слева
   (таблица шире экрана — без него при прокрутке вбок не видно, чей это
   день). Числа — tabular-nums; вторичное — второй строкой мельче и серым,
   как на «Пульте». Статус — цвет и слово.
   ================================================================== */
/* Строка итога: слева — дни по статусу и главные доли (переносятся),
   справа — «Столбцы», всегда на одном месте. */
.dd-sum { display: flex; align-items: flex-start; gap: 4px 16px; margin: 0 0 4px; font-size: 13.5px; color: var(--ink-2); }
.dd-sl { display: flex; flex: 1 1 auto; flex-wrap: wrap; align-items: center; gap: 4px 16px; min-width: 0; padding-top: 3px; }
.dd-sum b { font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; }
.dd-sum [title] { cursor: help; }
.dd-st { display: inline-flex; align-items: center; gap: 6px; }
/* Квадратик статуса — та же пара «цвет и слово», что плашка в строке;
   «стояла» — пустым контуром, чтобы не читаться серым «шла». */
.dd-k { flex: none; width: 9px; height: 9px; border-radius: 3px; background: var(--ink-3); }
.dd-k.ok { background: var(--good); }
.dd-k.warn { background: var(--warn); }
.dd-k.mute { background: none; box-shadow: inset 0 0 0 1.5px var(--ink-3); }
/* «Столбцы» — справа в строке итога; меню в две колонки с подписями групп. */
.dd-sum .dd-cols { flex: none; margin-left: auto; }
.dd-cols .pcols-m { grid-template-columns: repeat(2, minmax(150px, 1fr)); gap: 0 6px; min-width: 340px;
                    max-width: calc(100vw - 32px); max-height: 70vh; overflow-y: auto; }
.dd-cols .dd-cg { grid-column: 1 / -1; margin: 6px 6px 2px; font-size: 11.5px; font-weight: 600; color: var(--ink-3); }
.dd-cols .dd-cg:first-child { margin-top: 0; }
.dd-cols .dd-all { grid-column: 1 / -1; justify-self: start; margin: 8px 6px 2px; }
.dd-note { margin: 0 0 10px; font-size: 12.5px; line-height: 1.5; color: var(--ink-2); }
/* Образец полосы дня в пояснении — та же полоса, что у ячейки дня. */
.dd-lg { display: inline-block; width: 3px; height: 12px; margin: 0 5px 0 2px; vertical-align: -1px; background: var(--ink-3); }
.dd-lg.cap { background: var(--warn); }
.dd-foot { margin: 8px 2px 18px; font-size: 12.5px; line-height: 1.5; }
.card.dd-card { padding: 4px 4px 2px; }

/* separate, а не collapse: у закреплённого столбца при collapse линии
   остаются на месте и едут поверх соседей (ловушка «Пульта»). */
table.rows.ddt {
  border-collapse: separate; border-spacing: 0; min-width: 1180px;
  --dd-hover: color-mix(in srgb, var(--surface-2) 70%, var(--surface));
}
table.rows.ddt th, table.rows.ddt td { padding: 6px 7px; font-size: 13px; line-height: 1.35; }
table.rows.ddt td { vertical-align: top; border-bottom-color: color-mix(in srgb, var(--line-soft) 85%, var(--surface)); }
table.rows.ddt tbody tr:hover { background: var(--dd-hover); }
/* Подписи групп — над своими столбцами, тонкая линия слева у первого
   столбца группы проходит через всю таблицу. */
table.rows.ddt tr.ddg th { padding: 7px 8px 2px; border-bottom: 0; font-size: 11.5px; font-weight: 600; color: var(--ink-2); }
.ddt .g1, .ddt th.dd-g { box-shadow: inset 1px 0 0 var(--line); }
/* Заголовки — кнопки сортировки; длинные («Заказы по фразам кампании»)
   переносятся, а не раздвигают столбец. */
table.rows.ddt tr.ddc th { padding: 0 3px 3px; vertical-align: bottom; white-space: normal; font-size: 12px; }
/* Узкие числовые столбцы (0–40 заказов) иначе рвали подпись по слову в
   строку: «Заказы / по / фразам» — шапка росла до четырёх строк. */
table.rows.ddt tr.ddc th.num { min-width: 66px; }
table.rows.ddt tr.ddc th.num { text-align: right; }
table.rows.ddt th.thx { white-space: normal; }
/* Кнопка и (i) — одним блоком: подпись переносится внутри кнопки, значок
   стоит у её последней строки, а не падает строкой ниже. */
.ddt .thw { display: inline-flex; align-items: flex-end; max-width: 100%; vertical-align: bottom; }
.ddt .thw > .thi { flex: none; margin: 0 3px 7px 0; }
.ddt th button.sk {
  display: inline-block; padding: 6px 5px; border: 0; border-radius: 6px;
  background: none; color: inherit; font: inherit; line-height: 1.25; text-align: inherit; cursor: pointer;
}
.ddt th button.sk:hover { background: var(--line-soft); color: var(--ink); }
.ddt th.sortable.on button.sk { color: var(--accent); }
.ddt th button.sk i { font-style: normal; }
.ddt th button.sk:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* Ячейки: числа — вправо, в строку, цифры одной ширины (класс num на
   каждой из двух тысяч ячеек весил бы больше, чем правило); день и статус —
   влево. Вторая строка — мельче и серым; ноль и прочерк — классом z у
   ячейки, серым: день стоянки иначе был бы стеной нулей того же веса, что
   настоящие числа. */
.ddt tbody td, .ddt tfoot td { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ddt td.dd-day, .ddt td.dd-run { text-align: left; }
.ddt td.z { color: var(--ink-3); font-weight: 400; }
.ddt .ds { display: block; margin-top: 1px; font-size: 11.5px; font-weight: 400; color: var(--ink-3); white-space: nowrap; }
.ddt .ds2 { font-size: 12px; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.ddt td[title] { cursor: help; }
.ddt .pill { padding: 1px 7px; font-size: 11.5px; white-space: nowrap; }
.ddt td.num .ds .pill { margin-top: 2px; }
.ddt .dch { margin-left: 1px; color: var(--accent); font-weight: 700; }

/* День — закреплён слева, со ссылкой на полосу суток «Журнала». */
.ddt .dd-day { position: sticky; left: 0; z-index: 1; background: var(--surface); white-space: nowrap;
               box-shadow: inset -1px 0 0 var(--line-soft); }
.ddt thead .dd-day, .ddt tfoot .dd-day { z-index: 2; background: var(--surface-2); }
.ddt tbody tr:hover > .dd-day { background: var(--dd-hover); }
.ddt td.dd-day a { color: var(--ink); text-decoration: none; }
.ddt td.dd-day a:hover { color: var(--accent); text-decoration: underline; }
/* День, когда упёрлась в бюджет, — полоса слева оранжевая; день стоянки —
   серая. Слово — в ячейках «Статус» и «Бюджет на сутки». Полоса — тенью
   внутрь, а не рамкой: рамка сдвигала бы столбец (ловушка кластеров). */
.ddt tr.dd-cap > td.dd-day { box-shadow: inset 3px 0 0 var(--warn), inset -1px 0 0 var(--line-soft); }
.ddt tr.dd-stop > td.dd-day { box-shadow: inset 3px 0 0 var(--ink-3), inset -1px 0 0 var(--line-soft); }
/* Сегодня — день ещё идёт: подложка чуть теплее, всё, кроме расхода, дозреет. */
.ddt tr.dd-now > td { background: color-mix(in srgb, var(--accent-2) 40%, var(--surface)); }

@media (max-width: 640px) {
  .dd-sum, .dd-sl { gap: 4px 12px; font-size: 13px; }
  .dd-cols .pcols-m { grid-template-columns: 1fr; min-width: 220px; }
  table.rows.ddt th, table.rows.ddt td { padding: 5px 6px; }
}

/* Пульт одной CPC-кампании: режим, деньги, две отдельные зоны. */
.cc-control { display:grid; grid-template-columns:minmax(0,1.1fr) minmax(0,1fr); gap:20px; margin:20px 0; }
.cc-mode,.cc-finance,.cc-bids { background:var(--surface); border:1px solid var(--line-soft); border-radius:var(--radius-lg); padding:20px; min-width:0; }
.cc-control h2,.cc-bids h2 { font-size:17px; margin:0 0 8px; }
.cc-current { margin:0 0 16px; color:var(--ink-2); font-size:13px; }
.cc-mode fieldset { border:0; padding:0; margin:0; min-width:0; }
.cc-choice { display:grid; grid-template-columns:18px minmax(0,1fr); gap:10px; padding:10px 0; cursor:pointer; border-top:1px solid var(--line-soft); }
.cc-choice input { width:16px; height:16px; margin:3px 0 0; accent-color:var(--accent); }
.cc-choice strong { display:block; font-size:14px; font-weight:600; }
.cc-choice small { display:block; margin-top:3px; color:var(--ink-2); font-size:12px; line-height:1.45; }
.cc-choice:has(input:checked) strong { color:var(--accent); }
.cc-choice.is-disabled { cursor:default; }
.cc-choice.is-disabled strong { color:var(--ink-2); }
.cc-follow-options { display:none; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:12px 16px; padding:12px 0 6px 28px; }
.cc-mode:has(input[name=work_mode][value=wb_follow]:checked) .cc-follow-options { display:grid; }
.cc-follow-options>label { display:flex; flex-direction:column; gap:6px; font-size:13px; color:var(--ink-2); }
.cc-follow-options input,.cc-follow-options select { width:100%; min-width:0; }
.cc-follow-options .cc-help { grid-column:1/-1; margin:0; }
.cc-effective-caps { grid-column:1/-1; border-block:1px solid var(--line-soft); padding:12px 0; }
.cc-effective-caps>strong { display:block; font-size:14px; }
.cc-effective-caps>p { display:flex; flex-wrap:wrap; align-items:baseline; justify-content:space-between; gap:6px 16px; margin:10px 0 4px; }
.cc-effective-caps>p b { font-size:20px; font-variant-numeric:tabular-nums; }
.cc-effective-caps>small { display:block; color:var(--ink-2); font-size:13px; line-height:1.5; }
.cc-effective-caps details { margin-top:10px; font-size:13px; }
.cc-effective-caps summary { cursor:pointer; color:var(--accent); }
.cc-effective-caps dl { margin:10px 0; }
.cc-effective-caps dl>div { display:flex; flex-wrap:wrap; justify-content:space-between; gap:4px 16px; margin:6px 0; }
.cc-effective-caps dt { color:var(--ink-2); }
.cc-effective-caps dd { margin:0; font-variant-numeric:tabular-nums; }
@media(max-width:600px) { .cc-follow-options { padding-left:0; grid-template-columns:1fr; } }
.cc-mode-footer { display:flex; flex-wrap:wrap; align-items:center; gap:14px; margin-top:14px; }
.cc-help { font-size:12px; color:var(--ink-2); margin:10px 0 0; line-height:1.5; }
.cc-control .cmb,.cc-control .cdep { border:0; padding:0; margin:0; background:none; border-radius:0; }
.cc-control .cmb-row { display:flex; flex-wrap:wrap; gap:10px; align-items:center; }
.cc-control .cmb-who { flex-basis:100%; }
.cc-control .cmb-btns { margin-left:0; }
.cc-control .cmb-in { align-items:center; }
.cc-control .cmb-in input { max-width:145px; }
.cc-control .cmb-note { margin:12px 0 0; }
.cc-deposit { border-top:1px solid var(--line); margin-top:18px; padding-top:14px; }
.cc-deposit>summary { cursor:pointer; font-weight:550; font-size:14px; display:list-item; }
.cc-deposit>summary span { color:var(--accent); margin-left:8px; font-size:12px; }
.cc-deposit[open]>.cdep { margin-top:14px; }
.cc-control .cdep-today { flex-basis:100%; }
.cc-product-budget { border-top:1px solid var(--line); margin-top:20px; padding-top:20px; scroll-margin-top:75px; }
.cc-product-budget h3 { font-size:15px; margin:0 0 10px; }
.cc-product-budget-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin-top:16px; }
.cc-product-budget-fields label { display:grid; align-content:start; gap:7px; font-size:12px; color:var(--ink-2); min-width:0; }
.cc-product-budget-fields input,.cc-product-budget-fields select { width:100%; min-width:0; }
.cc-product-budget-form>.btn { margin-top:14px; }
.cc-product-budget-plan { margin-top:20px; }
.cc-product-budget-plan>strong { font-size:13px; }
.cc-product-budget-plan dl { margin:10px 0 0; }
.cc-product-budget-plan dl>div { display:flex; justify-content:space-between; gap:12px; padding:9px 0; border-bottom:1px solid var(--line-soft); font-size:13px; }
.cc-product-budget-plan dd { margin:0; font-weight:600; white-space:nowrap; }
.cc-product-budget-details { margin-top:16px; }
.cc-product-budget-details>summary { color:var(--accent); cursor:pointer; font-size:12px; }
.cc-product-budget-details table { font-size:12px; }
@media(max-width:600px) { .cc-product-budget-fields { grid-template-columns:1fr; } .cc-product-budget-form>.btn { width:100%; } }
.cc-section-head { display:flex; justify-content:space-between; gap:12px; align-items:baseline; flex-wrap:wrap; }
.cc-section-head p { color:var(--ink-2); font-size:12px; margin:0; }
.cc-product { display:flex; gap:10px; flex-wrap:wrap; margin:12px 0; font-size:13px; }
.cc-product>a { font-weight:600; }
.cc-product>span { color:var(--ink-2); }
.cc-zones { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:28px; }
.cc-zone { min-width:0; padding-top:14px; border-top:1px solid var(--line-soft); }
.cc-zone-head { display:flex; gap:12px; align-items:center; justify-content:space-between; }
.cc-zone h3 { font-size:16px; margin:0; }
.cc-bid-value { display:flex; align-items:baseline; gap:12px; margin:10px 0; flex-wrap:wrap; }
.cc-bid-value strong { font-size:24px; font-weight:600; font-variant-numeric:tabular-nums; }
.cc-bid-value>span { font-size:12px; color:var(--ink-2); }
.cc-bid-form { display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin:0; }
.cc-bid-form>label { max-width:150px; }
.cc-bid-form input[name=bid] { width:100%; font-variant-numeric:tabular-nums; }
.cc-bid-result,.cc-bid-confirm { flex-basis:100%; margin:2px 0 0; font-size:13px; overflow-wrap:anywhere; }
.cc-bid-result:empty { display:none; }
.cc-bid-result.ok { color:var(--good); }
.cc-bid-result.warn { color:var(--warn); }
.cc-bid-confirm { background:var(--surface-2); border-radius:var(--radius); padding:12px; }
.cc-bid-confirm[hidden] { display:none; }
.cc-bid-confirm p { margin:0 0 10px; }
.cc-diagnostics { margin-top:20px; border-top:1px solid var(--line); padding-top:16px; }
.cc-diagnostics>summary { cursor:pointer; font-weight:550; padding:4px 0; }
.cc-diagnostics[open]>summary { margin-bottom:20px; }
.cc-mode :focus-visible,.cc-bids :focus-visible,.cc-deposit>summary:focus-visible,.cc-diagnostics>summary:focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
#campaign-control,#campaign-bids,.cc-diagnostics [id] { scroll-margin-top:24px; }
@media(max-width:1100px) { .cc-control { grid-template-columns:1fr; } }
@media(max-width:600px) { .cc-mode,.cc-finance,.cc-bids { padding:16px; } .cc-control { gap:14px; } .cc-zones { grid-template-columns:1fr; gap:22px; } .cc-section-head { display:block; } .cc-section-head p { margin-top:6px; } .cc-bid-form>label { flex:1; max-width:none; } }

.cc-control .sr-only,.cc-bids .sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }

.cc-budget-status>span { display:block; font-size:13px; color:var(--ink-2); margin:14px 0 4px; }
.cc-budget-status>strong { display:block; font-size:24px; font-variant-numeric:tabular-nums; }
.cc-budget-status small { font-size:16px; font-weight:400; color:var(--ink-2); }
.cc-budget-status>strong.bad { color:var(--bad); }
.cc-budget-status progress { width:100%; height:5px; display:block; margin:12px 0 18px; accent-color:var(--accent); }
.cc-budget-form { display:flex; align-items:end; flex-wrap:wrap; gap:10px; }
.cc-budget-form label { display:grid; gap:5px; font-size:12px; color:var(--ink-2); flex:1; min-width:130px; }
.cc-budget-form input { width:100%; }
.cc-budget-note { margin:14px 0 0; font-size:12px; color:var(--ink-2); line-height:1.55; overflow-wrap:anywhere; }
.cc-budget-warning { color:var(--bad); }
.cc-bids+#group-watch { margin-top:20px; }

/* Зоны всей РК и реальные ориентиры аукциона WB. */
.cc-zone-switch-form { margin:0; }
.cc-zone-switch { display:inline-flex; align-items:center; gap:8px; border:0; background:transparent; padding:4px 0 4px 4px; color:var(--ink-2); cursor:pointer; min-height:36px; }
.cc-zone-switch>span { position:relative; width:34px; height:20px; border-radius:999px; background:var(--ink-3); flex:none; }
.cc-zone-switch>span::after { content:""; position:absolute; top:3px; left:3px; width:14px; height:14px; border-radius:50%; background:var(--surface); }
.cc-zone-switch[aria-checked=true]>span { background:var(--accent); }
.cc-zone-switch[aria-checked=true]>span::after { left:17px; }
.cc-zone-switch b { font-size:13px; font-weight:500; }
.cc-zone-switch:disabled { cursor:default; opacity:1; }
.cc-zone-switch:disabled>span { opacity:.5; }
.cc-zone-switch:focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
.cc-switch-why { margin:5px 0 0; max-width:65ch; }
.cc-zone-message { font-size:13px; color:var(--ink-2); }
.cc-zone-message:empty { display:none; }
.cc-quote { border-top:1px solid var(--line-soft); margin-top:16px; padding-top:12px; }
.cc-quote-head { display:flex; flex-wrap:wrap; gap:6px 12px; justify-content:space-between; font-size:13px; }
.cc-quote-head>span { color:var(--ink-2); font-size:13px; }
.cc-quote-levels { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin:12px 0 0; }
.cc-quote-levels dt { font-size:13px; color:var(--ink-2); }
.cc-quote-levels dd { font-size:17px; font-weight:600; font-variant-numeric:tabular-nums; margin:3px 0 0; }
.cc-quote-empty { margin:14px 0 0; font-size:13px; color:var(--ink-2); line-height:1.5; }
.cc-quote-frequency { display:block; font-size:13px; color:var(--ink-2); margin-top:8px; }

/* Весь день — один tbody: итог, поиск, рекомендации. */
.dd-zone-note { margin:8px 0 12px; color:var(--ink-2); font-size:13px; line-height:1.5; max-width:110ch; }
.ddt .dd-day-total>td { font-weight:600; background:var(--surface-2); border-top:1px solid var(--line); }
.ddt .dd-zone-row>td { padding-top:5px; padding-bottom:5px; font-size:13px; color:var(--ink-2); background:var(--surface); border-bottom:0; }
.ddt .dd-zone-row>td.z { color:var(--ink-3); }
.ddt .dd-zone-row>td.dd-zone-name { padding-left:20px; font-weight:500; }
.ddt .dd-zone-row .ds { font-size:13px; }
.ddt tbody:hover .dd-zone-row>td { background:var(--dd-hover); }

.ddt .dd-zone-name .ds { max-width:150px; white-space:normal; line-height:1.3; }

/* Настройки чтения рекламного кабинета: состояние, затем расписание. */
.adset { max-width:900px; }
.adset>p { max-width:72ch; }
.adset-card { padding:24px; margin-top:24px; }
.adset-card h2 { font-size:17px; margin:0 0 16px; }
.adset-head { display:flex; align-items:baseline; justify-content:space-between; gap:16px; }
.adset-facts { display:flex; flex-wrap:wrap; gap:16px 40px; margin:0 0 20px; }
.adset-facts dt { color:var(--ink-2); font-size:13px; }
.adset-facts dd { margin:4px 0 0; font-variant-numeric:tabular-nums; }
.adset-message { color:var(--ink-2); max-width:72ch; }
.az-alert { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px 24px; background:var(--bad-bg); color:var(--bad); border:1px solid var(--bad); border-radius:var(--radius); padding:16px 20px; margin:16px 0; }
.az-alert>div { flex:1 1 320px; min-width:0; }
.az-alert strong { font-size:15px; }
.az-alert p { margin:6px 0 0; font-size:13px; line-height:1.5; overflow-wrap:anywhere; }
.az-alert .btn.ghost { color:inherit; border-color:currentColor; background:transparent; }
.adset fieldset { border:0; margin:0; padding:0; min-width:0; }
.adset-toggle { display:flex; align-items:center; gap:8px; font-weight:600; }
.adset select { width:100%; }
.adset .grid2 { margin:24px 0 8px; }
@media(max-width:600px) { .adset-card { padding:16px; } .adset-head { align-items:center; } }
