/* ============================================================================
   CONTENT OPS — интерфейс как полевой измерительный прибор.

   Почему так: система не «показывает дашборд», она измеряет карточки (0–100),
   наблюдает за изменениями и увеличивает проблемные места. Язык приборов —
   засечки, шкалы, табличные цифры, латунные кольца настройки — здесь не декорация,
   а точное описание того, что происходит внутри.

   Палитра: графит и холодная сталь (ночная работа, низкая утомляемость),
   латунь как единственный акцент. Ярких неонов нет намеренно — прибор не мигает.
   ========================================================================== */

@font-face {
  font-family: 'Akrobat';
  src: url('fonts/Akrobat-SemiBold.otf') format('opentype');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Akrobat';
  src: url('fonts/Akrobat-Bold.otf') format('opentype');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'Akrobat';
  src: url('fonts/Akrobat-Black.otf') format('opentype');
  font-weight: 900;
  font-display: swap;
}

:root {
  /* поверхности */
  --ink:      #0B1118;   /* корпус прибора */
  --ink-2:    #0E1620;
  --panel:    #111A24;   /* лицевая панель модуля */
  --panel-2:  #16212D;
  --line:     #1E2C3A;   /* гравировка, засечки */
  --line-lit: #2B3E52;

  /* текст */
  --paper:    #E6EDF3;   /* основные показания */
  --steel:    #8095AA;   /* подписи, вторичное */
  /* Контраст к фону панели: было 3.6 — мелкие подписи («аудит 503478 от…») читались
     с трудом. Сейчас 5.7, выше нормы 4.5 для мелкого текста. */
  --steel-dim:#7E93A8;

  /* акцент и состояния */
  /* Акцент — личная настройка сотрудника (D-059). Здесь только значение по умолчанию;
     выбор человека приезжает переменной --accent-raw и подмешивается ниже.
     Для светлой темы тот же цвет затемняется: яркий акцент на белом слепит и перестаёт
     быть акцентом. */
  --accent-raw: #C9922F;
  --brass:    var(--accent-raw);
  --brass-lit: color-mix(in srgb, var(--accent-raw) 82%, #FFFFFF 18%);
  --pine:     #4E8C6A;   /* норма */
  --rust:     #B4503C;   /* тревога */
  --haze:     #5B7C99;   /* информация */

  /* Поверхности взаимодействия и служебные оттенки — тоже переменные: иначе светлая
     тема получается тёмной в мелочах (наведение, сетка фона, подложка окна). */
  --hover:    rgba(255,255,255,.03);
  --hover-2:  rgba(255,255,255,.024);
  --grid:     rgba(255,255,255,.014);
  --scrim:    rgba(11,17,24,.86);
  --btn-hover:#1B2836;
  --on-brass: #150F02;      /* текст на латунной кнопке */
  --ok-text:  #7FC49B;
  --bad-text: #E08872;
  --info-text:#86A9C7;

  --radius: 10px;
  --tick: 1px;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 12px 32px -18px rgba(0,0,0,.9);

  --display: 'Akrobat', system-ui, sans-serif;
  --body: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --data: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, monospace;
}

/* ── СВЕТЛАЯ ТЕМА ─────────────────────────────────────────────────────────────
   Не «инверсия», а тот же прибор при дневном свете: корпус из светлого металла,
   гравировка тёмная, латунь приглушена (на белом яркая латунь слепит и теряет
   роль единственного акцента). Зелёный и ржавый тоже темнее: на светлом фоне
   их светлые версии не читаются.

   Тема ставится атрибутом на <html>, а не классом на body: разметка появляется
   позже CSS, и при классе на body страница успевала моргнуть тёмным. */
:root[data-theme="light"] {
  --ink:      #EDF1F5;
  --ink-2:    #E4EAF0;
  --panel:    #FFFFFF;
  --panel-2:  #F5F8FA;
  --line:     #D3DBE3;
  --line-lit: #B2C0CE;

  --paper:    #15202B;
  --steel:    #55677A;
  --steel-dim:#55677A;   /* было 2.9 к светлому фону — почти нечитаемо; стало 4.8 */

  --brass:     color-mix(in srgb, var(--accent-raw) 78%, #1A1206 22%);
  --brass-lit: color-mix(in srgb, var(--accent-raw) 90%, #1A1206 10%);
  --pine:     #2E6B4A;
  --rust:     #9A3B28;
  --haze:     #3B6488;

  --hover:    rgba(0,0,0,.045);
  --hover-2:  rgba(0,0,0,.035);
  --grid:     rgba(21,32,43,.05);
  --scrim:    rgba(228,234,240,.88);
  --btn-hover:#E7EDF3;
  --on-brass: #FFFFFF;
  --ok-text:  #246143;
  --bad-text: #8E3524;
  --info-text:#2F567A;

  --shadow: 0 1px 0 rgba(255,255,255,.7) inset, 0 10px 26px -18px rgba(21,32,43,.4);
}

* { box-sizing: border-box; }

/* Собственный display в классе (.app{flex}, .gate{grid}) перебивает браузерное [hidden]{display:none},
   и «скрытый» блок остаётся на странице. Это правило возвращает hidden его смысл. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Фон корпуса: очень слабая сетка засечек — прибор, а не пустота */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 64px 64px;
  z-index: 0;
}

/* ─────────────────────────────── типографика */

h1, h2, h3, .display {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: .01em;
  margin: 0;
}
h1 { font-size: 26px; }
h2 { font-size: 19px; }
h3 { font-size: 15px; }

.eyebrow {
  font-family: var(--data);
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--steel-dim);
}

.num {
  font-family: var(--data);
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}

/* ─────────────────────────────── каркас */

.app { display: flex; min-height: 100vh; position: relative; z-index: 1; }

/* Рельс навигации — вертикальная шкала прибора с засечками */
.rail {
  width: 216px;
  flex: none;
  border-right: var(--tick) solid var(--line);
  background: linear-gradient(180deg, var(--ink-2), var(--ink));
  padding: 20px 0 16px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand { padding: 0 20px 18px; }
.brand .mark {
  font-family: var(--display);
  font-weight: 900;
  font-size: 21px;
  letter-spacing: .02em;
  line-height: 1;
  color: var(--paper);
}
.brand .mark span { color: var(--brass); }
.brand .sub { margin-top: 5px; }

.nav { display: flex; flex-direction: column; gap: 2px; padding: 0 10px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  color: var(--steel);
  font: inherit;
  font-size: 14.5px;
  text-align: left;
  cursor: pointer;
  border-radius: 8px;
  position: relative;
  transition: color .18s ease, background .18s ease;
}
.nav-item svg { width: 17px; height: 17px; flex: none; opacity: .75; transition: opacity .18s ease; }
.nav-item:hover { color: var(--paper); background: var(--hover); }
.nav-item:hover svg { opacity: 1; }
.nav-item.on { color: var(--paper); background: var(--panel); }
.nav-item.on svg { opacity: 1; color: var(--brass); }
/* активная засечка — риска слева, как отметка на шкале */
.nav-item.on::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 22px;
  background: var(--brass);
  border-radius: 0 2px 2px 0;
  animation: tick-in .22s ease;
}
@keyframes tick-in { from { height: 0; opacity: 0; } to { height: 22px; opacity: 1; } }

.nav-count {
  margin-left: auto;
  font-family: var(--data);
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 20px;
  background: var(--line);
  color: var(--steel);
}
.nav-count.hot { background: rgba(180,80,60,.2); color: var(--bad-text); }

.rail-foot { margin-top: auto; padding: 14px 20px 0; border-top: var(--tick) solid var(--line); }

/* ─────────────────────────────── основное поле */

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 58px;
  flex: none;
  border-bottom: var(--tick) solid var(--line);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 26px;
  background: var(--scrim);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
}

/* Индикатор свежести данных — как лампа на приборе */
.freshness { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--steel); }
.lamp {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--pine);
  box-shadow: 0 0 0 3px rgba(78,140,106,.16);
  animation: pulse 3.4s ease-in-out infinite;
}
.lamp.stale { background: var(--brass); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-raw) 16%, transparent); }
.lamp.cold  { background: var(--rust);  box-shadow: 0 0 0 3px rgba(180,80,60,.16); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .45; } }

.who { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.who .role {
  font-family: var(--data); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--brass); border: var(--tick) solid color-mix(in srgb, var(--accent-raw) 35%, transparent);
  padding: 2px 8px; border-radius: 20px;
}

.page { padding: 26px; max-width: 1500px; width: 100%; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .hint { color: var(--steel); font-size: 13.5px; max-width: 620px; }

/* ─────────────────────────────── модули (bento) */

.grid { display: grid; gap: 14px; grid-template-columns: repeat(12, 1fr); }
.col-3 { grid-column: span 3; } .col-4 { grid-column: span 4; }
.col-5 { grid-column: span 5; } .col-6 { grid-column: span 6; }
.col-7 { grid-column: span 7; } .col-8 { grid-column: span 8; }
.col-9 { grid-column: span 9; } .col-12 { grid-column: span 12; }
@media (max-width: 1100px) { .col-3,.col-4,.col-5,.col-6,.col-7,.col-8,.col-9 { grid-column: span 12; } }

.mod {
  background: var(--panel);
  border: var(--tick) solid var(--line);
  border-radius: var(--radius);
  padding: 17px 19px;
  box-shadow: var(--shadow);
  position: relative;
  transition: border-color .2s ease, transform .2s ease;
}
.mod:hover { border-color: var(--line-lit); }

/* Уголки визира — подпись интерфейса. Появляются на активном модуле */
.mod.sighted::after,
.mod.sighted::before {
  content: '';
  position: absolute;
  width: 11px; height: 11px;
  border: 1.5px solid var(--brass);
  opacity: .8;
}
.mod.sighted::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; border-radius: 3px 0 0 0; }
.mod.sighted::after  { bottom: -1px; right: -1px; border-left: 0; border-top: 0; border-radius: 0 0 3px 0; }

.mod-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 13px; }
.mod-head .act { margin-left: auto; }

/* ─────────────────────────────── показания */

.readout { display: flex; align-items: baseline; gap: 9px; }
.readout .val {
  font-family: var(--data);
  font-variant-numeric: tabular-nums;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -.02em;
  color: var(--paper);
  line-height: 1;
}
.readout .unit { font-size: 13px; color: var(--steel-dim); }
.readout.warn .val { color: var(--brass); }
.readout.bad  .val { color: var(--rust); }

/* ШКАЛА-ВИЗИР — главный элемент интерфейса.
   Не полоска прогресса, а измерительная шкала: засечки через 10, риска на значении. */
.scale { margin-top: 12px; }
.scale-track {
  position: relative;
  height: 26px;
  border-bottom: var(--tick) solid var(--line-lit);
}
.scale-ticks { position: absolute; inset: 0; display: flex; justify-content: space-between; }
.scale-ticks i {
  width: var(--tick);
  background: var(--line-lit);
  height: 7px;
  align-self: flex-end;
  display: block;
}
.scale-ticks i:nth-child(5n+1) { height: 12px; background: var(--steel-dim); }
.scale-mark {
  position: absolute;
  bottom: 0;
  width: 2px;
  height: 22px;
  background: var(--brass);
  box-shadow: 0 0 10px color-mix(in srgb, var(--accent-raw) 60%, transparent);
  transition: left .8s cubic-bezier(.22,1,.36,1);
}
.scale-mark::after {
  content: '';
  position: absolute;
  top: -5px; left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 6px; height: 6px;
  background: var(--brass);
}
.scale-ghost {
  position: absolute;
  bottom: 0;
  width: var(--tick);
  height: 16px;
  background: var(--steel-dim);
  opacity: .8;
}
.scale-legend {
  display: flex; justify-content: space-between;
  font-family: var(--data); font-size: 10px; color: var(--steel-dim);
  margin-top: 5px;
}

/* дельта: рост или падение */
.delta { font-family: var(--data); font-size: 12.5px; }
.delta.up { color: var(--pine); } .delta.down { color: var(--rust); } .delta.flat { color: var(--steel-dim); }

/* ─────────────────────────────── воронка */

.funnel { display: flex; flex-direction: column; gap: 7px; margin-top: 4px; }
.funnel-row { display: flex; align-items: center; gap: 11px; }
.funnel-row .lbl { width: 96px; font-size: 12.5px; color: var(--steel); flex: none; }
.funnel-bar {
  flex: 1; height: 22px; background: var(--ink-2); border-radius: 3px;
  border: var(--tick) solid var(--line); overflow: hidden; position: relative;
}
.funnel-bar span {
  display: block; height: 100%;
  background: linear-gradient(90deg, rgba(91,124,153,.5), color-mix(in srgb, var(--accent-raw) 42%, transparent));
  transform-origin: left;
  animation: bar-in .7s cubic-bezier(.22,1,.36,1) both;
}
@keyframes bar-in { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.funnel-row .cnt { width: 74px; text-align: right; font-family: var(--data); font-size: 13px; }
.funnel-row .pct { width: 54px; text-align: right; font-family: var(--data); font-size: 11.5px; color: var(--steel-dim); }

/* ─────────────────────────────── таблицы */

table.rows { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.rows th {
  text-align: left; font-weight: 500; color: var(--steel-dim);
  font-family: var(--data); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
  padding: 0 10px 9px; border-bottom: var(--tick) solid var(--line);
}
table.rows td { padding: 11px 10px; border-bottom: var(--tick) solid var(--line); vertical-align: top; }
table.rows tr:last-child td { border-bottom: 0; }
table.rows tr.clickable { cursor: pointer; transition: background .15s ease; }
table.rows tr.clickable:hover td { background: var(--hover-2); }
table.rows td.n { font-family: var(--data); font-variant-numeric: tabular-nums; text-align: right; }

/* ─────────────────────────────── элементы управления */

.btn {
  font: inherit; font-size: 13.5px;
  padding: 8px 15px;
  border-radius: 7px;
  border: var(--tick) solid var(--line-lit);
  background: var(--panel-2);
  color: var(--paper);
  cursor: pointer;
  /* Кнопкой бывает и ссылка — скачивание файла честнее делать <a download>, а не запросом
     из JS. Без этого браузер подчёркивает её, и в ряду кнопок одна выглядит чужой. */
  text-decoration: none;
  transition: border-color .16s ease, background .16s ease, transform .1s ease;
  display: inline-flex; align-items: center; gap: 7px;
}
.btn:hover { border-color: var(--steel-dim); background: var(--btn-hover); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 15px; height: 15px; }
.btn.primary {
  background: linear-gradient(180deg, var(--brass-lit), var(--brass));
  border-color: rgba(0,0,0,.3);
  color: var(--on-brass);
  font-weight: 600;
}
.btn.primary:hover { filter: brightness(1.07); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--steel); }
.btn.ghost:hover { color: var(--paper); border-color: var(--line-lit); }
.btn.danger { border-color: rgba(180,80,60,.4); color: var(--bad-text); background: rgba(180,80,60,.08); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.sm { padding: 5px 11px; font-size: 12.5px; }

input[type=text], input[type=number], textarea, select {
  width: 100%;
  font: inherit; font-size: 14px;
  background: var(--ink-2);
  border: var(--tick) solid var(--line);
  border-radius: 7px;
  color: var(--paper);
  padding: 9px 12px;
  transition: border-color .16s ease, box-shadow .16s ease;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--brass);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-raw) 12%, transparent);
}
textarea { resize: vertical; min-height: 74px; line-height: 1.5; }
/* .field — не только на <label>: выбор товара собран из div, а подпись у него та же. */
.field { display: block; margin-bottom: 12px; }

/* Поля, стоящие рядом в строке, должны начинаться и заканчиваться на одной линии.
   У select своя внутренняя высота строки, и рядом с input он вставал на пару
   пикселей ниже — глаз это ловит сразу. Тянем оба на всю высоту строки, а сам
   элемент внутри — на всё, что осталось от подписи. */
.row > .field { margin-bottom: 0; align-self: stretch; display: flex; flex-direction: column; }
.row > .field > :not(.cap) { flex: 1 1 auto; }

/* Выбор периода у кнопки выгрузки. Общее правило даёт любому select ширину 100 %,
   и в шапке раздела он растягивался на всю свободную ширину, сталкивая «Скачать Excel»
   на вторую строку. Здесь ширина — по содержимому, и пара «период + кнопка» не рвётся. */
.xlsx-dl { flex: 0 0 auto; flex-wrap: nowrap; }
.xlsx-dl select.btn { width: auto; padding: 5px 9px; }

/* Галочка с длинной подписью. На .row подпись переносилась целиком на следующую
   строку, и галочка оставалась висеть сама по себе над текстом. */
label.check { display: flex; gap: 9px; align-items: flex-start; margin-bottom: 12px; }
label.check > input[type=checkbox] { width: auto; flex: none; margin-top: 3px; }

/* Выбор товара одним элементом. Раньше стояли два блока подряд: сверху поле
   «поиск по артикулу или названию», под ним отдельный список «карточка» — два
   заголовка и две рамки на одно действие. Теперь строка поиска — это верх самого
   списка: печатаешь прямо в нём, список под строкой сужается. */
.picker-box {
  border: var(--tick) solid var(--line); border-radius: 7px;
  background: var(--ink-2); overflow: hidden;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.picker-box:focus-within {
  border-color: var(--brass);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-raw) 12%, transparent);
}
.picker-box > input { border: 0; border-radius: 0; background: transparent; }
.picker-box > input:focus { box-shadow: none; border: 0; }
.picker-list { max-height: 218px; overflow-y: auto; overscroll-behavior: contain;
               border-top: var(--tick) solid var(--line); }
.picker-list:empty { display: none; }
.picker-row { display: flex; gap: 10px; align-items: baseline; cursor: pointer;
              padding: 7px 12px; font-size: 13.5px; }
.picker-row:hover { background: var(--panel); }
.picker-row.on { background: color-mix(in srgb, var(--accent-raw) 15%, transparent); }
.picker-row b { font-family: var(--data); font-size: 12.5px; flex: none; }
.picker-row span { color: var(--steel); overflow: hidden;
                   text-overflow: ellipsis; white-space: nowrap; }
.picker-row i { margin-left: auto; flex: none; font-style: normal;
                font-size: 11.5px; color: var(--steel-dim); }
.picker-none { display: block; margin-top: 6px; }
/* Подпись над элементом. Правило было привязано к .field, и подписи вне полей —
   «шаблон», «тема», «акцентный цвет» — выглядели обычным текстом вразнобой. */
.cap {
  display: block; margin-bottom: 5px;
  font-family: var(--data); font-size: 10.5px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--steel-dim);
}
/* Узкое поле в строке не должно распирать подпись на соседа. */
.row > .field { min-width: 0; }

/* ─────────────────────────────── метки состояний */

.tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--data); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 20px;
  border: var(--tick) solid var(--line-lit); color: var(--steel);
}
.tag.ok    { color: var(--ok-text); border-color: rgba(78,140,106,.4); background: rgba(78,140,106,.09); }
.tag.warn  { color: var(--brass-lit); border-color: color-mix(in srgb, var(--accent-raw) 40%, transparent); background: color-mix(in srgb, var(--accent-raw) 9%, transparent); }
.tag.bad   { color: var(--bad-text); border-color: rgba(180,80,60,.4); background: rgba(180,80,60,.09); }
.tag.info  { color: var(--info-text); border-color: rgba(91,124,153,.4); background: rgba(91,124,153,.09); }

/* ─────────────────────────────── диалог с агентом */

.chat { display: flex; flex-direction: column; gap: 8px; padding-right: 4px;
        min-height: 0; max-height: min(52vh, 560px); overflow-y: auto;
        overscroll-behavior: contain; }
/* Переписка внутри окна (предложение, вопрос агента) — своя рамка и запас высоты:
   раньше она жила в блоке журнала на 230 px, и разговор было не читать. */
.chat.tall {
  min-height: 300px; max-height: min(46vh, 520px);
  border: var(--tick) solid var(--line); border-radius: 10px;
  padding: 12px; background: var(--ink-2);
}
.chat.tall > :first-child { margin-top: auto; }
.chat.tall > .empty { margin: auto 0; }

/* Диалог устроен как любой мессенджер: размер блока постоянный и НЕ зависит от
   числа сообщений, переписка прокручивается внутри себя, поле ввода прибито к
   низу. Высота берётся от ряда (стоящая рядом колонка с показаниями выше), поэтому
   под блоком не остаётся пустоты; min-height держит чат пригодным для работы,
   если сосед вдруг окажется низким. */
.mod.dialog { display: flex; flex-direction: column; height: clamp(420px, 72vh, 760px); }
/* Чат забирает всё, что осталось от заголовка и поля ввода. Свой потолок ему тут
   не нужен и вреден: с ним блок раздувался под переписку до 2000 px. */
.mod.dialog .chat { flex: 1 1 auto; max-height: none; }
.mod.dialog .send-row { margin-top: 12px; }
/* Свежие реплики жмутся к полю ввода, как в мессенджере. Через margin, а не
   justify-content: flex-end — тот при переполнении срезает верх переписки. */
.mod.dialog .chat > :first-child { margin-top: auto; }
.mod.dialog .chat > .empty { margin: auto 0; }
@media (max-width: 1100px) { .mod.dialog { height: 66vh; } }
.chat::-webkit-scrollbar { width: 8px; }
.chat::-webkit-scrollbar-thumb { background: var(--line-lit); border-radius: 8px; }
/* Переписка устроена как в смс: своё справа, чужое слева, стороны различаются
   цветом. Подписи «АДМИН 2026-07-29 21:39» над каждой репликой не стало — из-за
   неё слово «привет» занимало пять строк, а кто где, и так видно по стороне. */
.msg { display: flex; }
.msg.mine   { justify-content: flex-end; }
.msg.mid    { justify-content: center; }
.msg .note {
  font-family: var(--data); font-size: 10.5px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--steel-dim); padding: 2px 0;
}
.bubble {
  max-width: 78%;
  padding: 9px 13px;
  border-radius: 13px;
  border: var(--tick) solid var(--line);
  background: var(--ink-2);
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  animation: rise .25s ease both;
}
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
/* Уголок со стороны говорящего — как у пузырей в мессенджерах. */
.msg.mine   .bubble { border-bottom-right-radius: 4px; }
.msg.theirs .bubble { border-bottom-left-radius: 4px; }
.msg.mine .bubble {
  background: color-mix(in srgb, var(--accent-raw) 17%, var(--ink-2));
  border-color: color-mix(in srgb, var(--accent-raw) 34%, var(--line));
}
.bubble.agent { background: var(--panel); border-color: var(--line-lit); }
/* Второй человек в переписке — не я и не агент: третий цвет, чтобы не путать. */
.msg.theirs .bubble.human {
  background: color-mix(in srgb, var(--haze) 15%, var(--ink-2));
  border-color: color-mix(in srgb, var(--haze) 32%, var(--line));
}
.bubble .from {
  display: block; font-style: normal; font-family: var(--data);
  font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--steel-dim); margin-bottom: 3px;
}
/* Время прижимается к правому нижнему углу и делит строку с концом фразы,
   если та не заняла её целиком. */
.bubble .t {
  float: right; margin: 5px 0 0 12px;
  font-family: var(--data); font-size: 10px; color: var(--steel-dim);
}
/* Чего агенту не хватило и в каком месте — приписка внутри его же реплики,
   а не отдельная коробка над разговором. */
.bubble .lack {
  display: block; margin-top: 7px; font-size: 12px; line-height: 1.45;
  color: var(--brass);
}
.bubble .lack.ctx { color: var(--steel-dim); }

/* ─────────────────────────────── прочее */

.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.muted { color: var(--steel); }
.dim { color: var(--steel-dim); }
.small { font-size: 12.5px; }
.mt { margin-top: 14px; } .mb { margin-bottom: 14px; }

.empty {
  padding: 34px 20px; text-align: center; color: var(--steel-dim);
  border: 1px dashed var(--line-lit); border-radius: var(--radius);
}

.report {
  font-size: 14px; line-height: 1.62; max-height: 62vh; overflow-y: auto; padding-right: 8px;
}
.report h1 { font-size: 20px; margin: 6px 0 12px; }
.report h2 { font-size: 16px; margin: 22px 0 9px; padding-bottom: 6px; border-bottom: var(--tick) solid var(--line); }
.report h3 { font-size: 14px; margin: 15px 0 7px; color: var(--brass); }
.report table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin: 9px 0; }
.report th, .report td { border: var(--tick) solid var(--line); padding: 7px 9px; text-align: left; vertical-align: top; }
.report th { background: var(--ink-2); font-family: var(--data); font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--steel-dim); }
.report code { font-family: var(--data); font-size: 12.5px; background: var(--ink-2); padding: 1px 5px; border-radius: 4px; }
.report ul, .report ol { padding-left: 20px; }

/* модальное окно */
.veil {
  position: fixed; inset: 0; background: rgba(6,10,14,.74);
  backdrop-filter: blur(3px);
  /* Выравнивание по верху, а не по центру: у высокого окна центрирование срезает
     и шапку, и низ — до кнопок было не добраться. */
  display: flex; align-items: flex-start; justify-content: center;
  padding: 3vh 26px; z-index: 60; overflow-y: auto;
  animation: fade .16s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet {
  background: var(--panel); border: var(--tick) solid var(--line-lit); border-radius: 13px;
  width: min(1080px, 100%); max-height: min(92vh, 100% - 20px); overflow: auto;
  padding: 22px 24px;
  /* Прокрутка внутри окна должна работать сама по себе, не утягивая страницу. */
  overscroll-behavior: contain;
  box-shadow: 0 30px 80px -30px #000;
  animation: sheet-in .22s cubic-bezier(.22,1,.36,1);
}
@keyframes sheet-in { from { opacity: 0; transform: translateY(14px) scale(.99); } to { opacity: 1; transform: none; } }

/* журнал фоновой работы */
.log {
  font-family: var(--data); font-size: 12px; line-height: 1.65;
  background: var(--ink); border: var(--tick) solid var(--line);
  border-radius: 8px; padding: 12px 14px; max-height: 46vh; overflow-y: auto;
  overscroll-behavior: contain; color: var(--steel);
}
.log .now { color: var(--brass); }

.spinner {
  width: 13px; height: 13px; border-radius: 50%;
  border: 2px solid var(--line-lit); border-top-color: var(--brass);
  animation: spin .7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── плашки фоновой работы ─────────────────────────────────────────────────
   Угол экрана вместо окна во весь экран: видно, что работа идёт, но руки
   свободны. Несколько операций складываются стопкой. */
#tray {
  position: fixed; right: 20px; bottom: 20px; z-index: 60;
  display: flex; flex-direction: column; gap: 10px;
  width: min(380px, calc(100vw - 40px)); pointer-events: none;
}
#tray .job {
  pointer-events: auto;
  background: var(--ink-2); border: var(--tick) solid var(--line);
  border-left: 3px solid var(--brass);
  border-radius: 11px; padding: 11px 13px;
  box-shadow: 0 10px 30px rgb(0 0 0 / .18);
  animation: rise .25s ease both;
}
#tray .job.ok  { border-left-color: var(--pine); }
#tray .job.bad { border-left-color: var(--rust); }
#tray .job-head { display: flex; align-items: center; gap: 9px; cursor: pointer; }
#tray .job-title { font-size: 13.5px; line-height: 1.35; }
#tray .job-mark { font-size: 13px; }
#tray .job.ok .job-mark  { color: var(--pine); }
#tray .job.bad .job-mark { color: var(--rust); }
#tray .job-x {
  margin-left: auto; background: none; border: 0; cursor: pointer;
  color: var(--steel-dim); font-size: 17px; line-height: 1; padding: 0 2px;
}
#tray .job-x:hover { color: var(--ink-text); }
#tray .job-now {
  font-size: 12px; line-height: 1.45; margin-top: 5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#tray .job-now:empty { display: none; }
#tray .log { margin-top: 9px; max-height: 190px; }
#tray .btn { margin-top: 9px; }
@media (max-width: 700px) { #tray { right: 12px; left: 12px; bottom: 12px; width: auto; } }

/* вход */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; position: relative; z-index: 1; }
.gate-card { width: min(420px, 100%); }
.gate .mark { font-family: var(--display); font-weight: 900; font-size: 30px; letter-spacing: .02em; }
.gate .mark span { color: var(--brass); }
.gate-list { display: flex; flex-direction: column; gap: 7px; margin-top: 16px; }
.gate-user {
  display: flex; align-items: center; gap: 11px; padding: 11px 14px;
  border: var(--tick) solid var(--line); border-radius: 9px; background: var(--ink-2);
  cursor: pointer; transition: border-color .16s ease, transform .12s ease;
  text-align: left; color: var(--paper); font: inherit;
}
.gate-user:hover { border-color: var(--brass); transform: translateX(3px); }
.gate-user .av {
  width: 32px; height: 32px; border-radius: 8px; flex: none;
  display: grid; place-items: center;
  background: var(--panel-2); border: var(--tick) solid var(--line-lit);
  font-family: var(--display); font-weight: 700; font-size: 14px; color: var(--brass);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

@media (max-width: 860px) {
  .app { flex-direction: column; }
  .rail { width: 100%; height: auto; position: static; flex-direction: row; align-items: center;
          overflow-x: auto; padding: 10px; gap: 10px; border-right: 0; border-bottom: var(--tick) solid var(--line); }
  .brand { padding: 0 10px 0 6px; } .brand .sub { display: none; }
  .nav { flex-direction: row; padding: 0; }
  .nav-item.on::before { display: none; }
  .rail-foot { display: none; }
  .page { padding: 16px; }
}


/* ── Тумблер темы ──────────────────────────────────────────────────────────────
   Кнопка «◐» не говорила, в каком ты состоянии. Тумблер говорит: положение ручки
   и есть ответ. */
.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer;
          background: none; border: 0; padding: 0; font: inherit; color: var(--steel); }
.switch .track { width: 42px; height: 24px; border-radius: 999px; background: var(--panel-2);
                 border: var(--tick) solid var(--line); position: relative; transition: .22s; }
.switch .knob { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
                border-radius: 50%; background: var(--steel-dim); transition: .22s;
                display: grid; place-items: center; font-size: 10px; color: var(--panel); }
.switch[aria-checked="true"] .track { background: color-mix(in srgb, var(--brass) 26%, transparent);
                                      border-color: var(--brass); }
.switch[aria-checked="true"] .knob { left: 22px; background: var(--brass); }
.switch:focus-visible .track { outline: 2px solid var(--brass); outline-offset: 2px; }

/* ── Палитра акцента ───────────────────────────────────────────────────────── */
.swatches { display: flex; flex-wrap: wrap; gap: 9px; }
.swatch { width: 34px; height: 34px; border-radius: 9px; border: 2px solid transparent;
          cursor: pointer; padding: 0; position: relative; transition: transform .16s; }
.swatch:hover { transform: scale(1.08); }
.swatch[aria-pressed="true"] { border-color: var(--paper); }
.swatch[aria-pressed="true"]::after { content: "✓"; position: absolute; inset: 0;
          display: grid; place-items: center; color: #fff; font-size: 15px;
          text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.swatch:focus-visible { outline: 2px solid var(--paper); outline-offset: 2px; }

/* Подпись только для скринридера: название цвета нужно тому, кто не видит квадратик,
   а зрячему оно мешало — текст вылезал прямо в образец. */
.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; }


/* ── ПОТОК: воронка руслом ────────────────────────────────────────────────────
   Ширина потока — это люди, а закрашенное между ступенями — те, кто ушёл.
   Диагноз читается формой, до чтения цифр. Ступень кликабельна: она фильтрует
   список под собой. */
.river { width: 100%; height: auto; display: block; }
.river .seg { cursor: pointer; transition: opacity .2s, filter .2s; }
.river .seg:hover { filter: brightness(1.15); }
.river .leak { fill: var(--rust); opacity: .16; pointer-events: none; }
.river .cap { font-size: 11.5px; fill: var(--steel); }
.river .num { font-size: 15px; font-weight: 700; fill: var(--paper);
              font-variant-numeric: tabular-nums; }
.river-note { font-size: 13px; color: var(--brass); margin-top: 9px; }

/* ── ПУЛЬТ: кольца и ползунок ─────────────────────────────────────────────── */
.rings { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 10px; }
.ring { background: var(--panel); border: var(--tick) solid var(--line); border-radius: var(--radius);
        padding: 13px; text-align: center; }
.ring svg { width: 84px; height: 84px; }
.ring circle { fill: none; stroke-width: 7; stroke-linecap: round; }
.ring .bgc { stroke: var(--line); }
.ring .fg { stroke: var(--brass); transition: stroke-dashoffset .7s cubic-bezier(.3,.8,.3,1); }
.ring .v { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 4px; }
.ring .cap { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase;
             color: var(--steel); margin-top: 3px; }
.period { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--steel); }
.period input[type=range] { width: 150px; accent-color: var(--brass); }

/* ── ВИТРИНА: плитка карточек ─────────────────────────────────────────────── */
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 12px; }
.shelf .it { background: var(--panel); border: var(--tick) solid var(--line);
             border-radius: var(--radius); overflow: hidden; cursor: pointer;
             transition: transform .22s cubic-bezier(.2,.7,.3,1), border-color .2s; }
.shelf .it:hover, .shelf .it:focus-within { transform: translateY(-3px); border-color: var(--brass); }
.shelf .ph { aspect-ratio: 3/4; display: grid; place-items: center; position: relative;
             background: radial-gradient(120% 90% at 50% 12%, var(--panel-2), var(--ink-2)); }
.shelf .ph img { width: 100%; height: 100%; object-fit: cover; }
/* Балл и «0 заказов» были полупрозрачными и ложились на фотографию товара: на светлом
   кадре не читались вовсе. Это не украшение витрины, а две цифры, ради которых на неё
   и смотрят, — значит сплошной фон и полный контраст. */
.shelf .ph .score { position: absolute; top: 8px; left: 8px; font-size: 12px; font-weight: 600;
                    background: #fff; border: var(--tick) solid rgba(0,0,0,.18);
                    border-radius: 999px; padding: 2px 9px;
                    color: #111; font-variant-numeric: tabular-nums;
                    box-shadow: 0 1px 4px rgba(0,0,0,.28); }
.shelf .ph .flag { position: absolute; top: 8px; right: 8px; font-size: 11px; font-weight: 600;
                   background: var(--rust); color: #fff; border-radius: 999px; padding: 2px 9px;
                   box-shadow: 0 1px 4px rgba(0,0,0,.28); }
.shelf .meta { padding: 9px 10px 11px; }
.shelf .nm { font-size: 12.5px; line-height: 1.35; height: 2.7em; overflow: hidden; }
.shelf .art { font-family: var(--data); font-size: 11px; color: var(--steel-dim); margin-top: 4px; }
.shelf .mini { max-height: 0; overflow: hidden; transition: max-height .28s ease; }
.shelf .it:hover .mini, .shelf .it:focus-within .mini { max-height: 130px; }
.shelf .mini .r { display: flex; align-items: center; gap: 6px; font-size: 11px;
                  color: var(--steel); margin-top: 5px; }
.shelf .mini .tr { flex: 1; height: 4px; background: var(--line); border-radius: 3px; overflow: hidden; }
.shelf .mini .tr i { display: block; height: 100%; background: var(--brass); }
.shelf .mini .n { font-variant-numeric: tabular-nums; color: var(--paper); min-width: 32px;
                  text-align: right; }

/* ── ХРОНИКА: лента событий ───────────────────────────────────────────────── */
.chron { position: relative; padding-left: 24px; }
.chron::before { content: ""; position: absolute; left: 6px; top: 4px; bottom: 4px; width: 1px;
                 background: var(--line); }
.chron .ev { position: relative; margin-bottom: 8px; }
.chron .ev::before { content: ""; position: absolute; left: -22px; top: 13px; width: 9px; height: 9px;
                     border-radius: 50%; background: var(--panel); border: 2px solid var(--line); }
.chron .ev.hot::before { border-color: var(--brass);
                         box-shadow: 0 0 0 4px color-mix(in srgb, var(--brass) 14%, transparent); }
.chron .ev > button { width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer;
                      background: var(--panel); border: var(--tick) solid var(--line);
                      border-radius: var(--radius); padding: 10px 12px; display: flex; gap: 10px;
                      align-items: center; transition: border-color .2s; }
.chron .ev > button:hover { border-color: var(--brass); }
.chron .ev .t { font-size: 11.5px; color: var(--steel-dim); min-width: 74px;
                font-variant-numeric: tabular-nums; }
.chron .ev .txt { flex: 1; font-size: 13.5px; }
.chron .ev .car { color: var(--steel-dim); transition: transform .25s; }
.chron .ev.open .car { transform: rotate(90deg); }
.chron .body { max-height: 0; overflow: hidden; transition: max-height .3s ease;
               border-left: 2px solid var(--brass); margin-left: 5px; }
.chron .ev.open .body { max-height: 340px; overflow-y: auto; }
.chron .body .in { padding: 10px 12px; font-size: 13px; color: var(--steel); }

/* ── Подсказка в блоке ────────────────────────────────────────────────────── */
.tip { font-size: 12.5px; color: var(--steel); background: var(--ink-2);
       border-left: 2px solid var(--brass); border-radius: 0 6px 6px 0;
       padding: 8px 11px; margin: 9px 0 0; }
.tip b { color: var(--paper); }


/* ── ПУЛЬТ: ползунок периода, кольца ступеней, живой график ──────────────────
   Заменил «поток»: русло красиво объясняло форму потери, но подписи под узкими
   ступенями обрезались, а сам рисунок съедал верх экрана. Пульт даёт то же самое
   числами и позволяет крутить период. */
.pad-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.pad-chart { position: relative; }
.pad-chart svg { width: 100%; height: 132px; display: block; cursor: crosshair; }
.pad-chart .grid-l { stroke: var(--line); }
.pad-chart .area { fill: color-mix(in srgb, var(--brass) 14%, transparent); }
.pad-chart .line { fill: none; stroke: var(--brass); stroke-width: 2.2; }
.pad-chart .line.two { stroke: var(--haze); stroke-width: 1.8; stroke-dasharray: 4 3; }
.pad-chart .line.three { stroke: var(--rust); stroke-width: 1.8; }
.pad-chart .dot { fill: var(--brass); }
.pad-readout { font-size: 12.5px; color: var(--steel); font-variant-numeric: tabular-nums; }
.series { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 11px; }
.series button { display: flex; align-items: center; gap: 7px; font: inherit; font-size: 12.5px;
                 color: var(--steel-dim); background: none; border: 0; cursor: pointer; padding: 0; }
.series button i { width: 30px; height: 17px; border-radius: 999px; background: var(--line);
                   position: relative; transition: .2s; }
.series button i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 13px;
                          height: 13px; border-radius: 50%; background: var(--steel-dim); transition: .2s; }
.series button[aria-pressed="true"] { color: var(--paper); }
.series button[aria-pressed="true"] i { background: color-mix(in srgb, var(--brass) 30%, transparent); }
.series button[aria-pressed="true"] i::after { left: 15px; background: var(--brass); }

/* Поисковые запросы: то, чего у WB «не было». Позиция и видимость важнее сырых показов. */
.queries td.q { font-variant-numeric: normal; }
.queries .pos { display: inline-block; min-width: 30px; text-align: center; border-radius: 5px;
                padding: 1px 6px; font-size: 12px; font-variant-numeric: tabular-nums; }
.queries .pos.good { background: color-mix(in srgb, var(--pine) 22%, transparent); color: var(--ok-text); }
.queries .pos.bad  { background: color-mix(in srgb, var(--rust) 22%, transparent); color: var(--bad-text); }
.vis-bar { display: inline-block; width: 56px; height: 6px; background: var(--line);
           border-radius: 3px; overflow: hidden; vertical-align: middle; }
.vis-bar i { display: block; height: 100%; background: var(--brass); }

/* Кнопки действий в таблице держатся строкой: без этого «Править» и «✕» вставали
   столбиком и строка распухала вдвое. */
table.rows td .btn + .btn { margin-left: 6px; }
table.rows td.act-cell { white-space: nowrap; }

/* Выбор слайда карточки для правки: миниатюры, выбранная обведена акцентом. */
.slide-pick {
  position: relative; padding: 0; border: 2px solid var(--line); border-radius: 8px;
  background: var(--ink-2); cursor: pointer; overflow: hidden; line-height: 0;
  transition: border-color .16s ease;
}
.slide-pick img { width: 84px; height: 112px; object-fit: cover; display: block; }
.slide-pick:hover { border-color: var(--line-lit); }
.slide-pick.on { border-color: var(--brass); }
.slide-pick .num {
  position: absolute; left: 4px; top: 4px; font-size: 10px; line-height: 1;
  padding: 2px 5px; border-radius: 4px; background: var(--scrim); color: var(--paper);
}

/* Ссылка на карточку у площадки. Стрелка «наружу» — чтобы было видно, что уводит
   с нашей страницы, а не открывает наше же окно. */
.card-link {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--haze); text-decoration: none; font-family: var(--data);
  border-bottom: var(--tick) dotted currentColor;
}
.card-link:hover { color: var(--brass); }
.card-link svg { width: 11px; height: 11px; flex: none; opacity: .8; }

/* Шапка таблицы — кнопка: нажатие упорядочивает столбец. Пустые ячейки (столбец
   с кнопками) сортировать нечем, там и курсор обычный. */
table.rows th:not(:empty) { cursor: pointer; user-select: none; transition: color .15s ease; }
/* Не --ink: в светлой теме он почти белый, и заголовок пропадал при наведении. */
table.rows th:not(:empty):hover { color: var(--paper); }
table.rows th .sort-mark { margin-left: 5px; opacity: .8; letter-spacing: 0; }

/* «Назад» у окна поверх окна: маленькая, в углу, не спорит с заголовком. */
.sheet-back { float: right; margin: -2px 0 6px 12px; }

/* Те же две цифры в списке: оценка аудита — чёрным по белому, ноль заказов — красным. */
.audit-mark { background: #fff; color: #111; border: var(--tick) solid rgba(0,0,0,.2);
              border-radius: 5px; padding: 1px 7px; font-variant-numeric: tabular-nums; }
.zero-mark { background: var(--rust); color: #fff; border-radius: 5px;
             padding: 1px 8px; font-weight: 600; }

/* Кольцо-оценка отличается от измеренных подписью и приглушённой дугой. Пунктиром
   сделать нельзя: сама дуга рисуется через stroke-dasharray, и подмена стёрла бы её.
   Отличать надо обязательно — иначе через месяц никто не вспомнит, что первое кольцо
   считается по другому периоду и другим способом. */
.ring.estimate { position: relative; }
.ring.estimate .fg { stroke: var(--haze); opacity: .85; }
.ring-mark { position: absolute; top: -2px; right: 4px; font-size: 9px; letter-spacing: .06em;
             text-transform: uppercase; color: var(--steel-dim); }

/* Вертикальная полоска под курсором: показывает, к какому дню относятся числа. */
.pad-chart .crosshair { stroke: var(--haze); stroke-width: 1.5; pointer-events: none;
                        transition: opacity .12s ease; }

/* Кольцо «откуда приходят»: обе доли сразу и абсолютное число в середине. Одной дугой
   было непонятно, от чего считается процент и сколько всего было переходов. */
.ring.two-part .bgc.other { stroke: color-mix(in srgb, var(--steel) 45%, transparent); }
.ring.two-part .split { display: flex; flex-direction: column; gap: 2px; margin-top: 6px;
                        color: var(--steel); line-height: 1.35; }
.ring.two-part .split .mark { display: inline-block; width: 8px; height: 8px; border-radius: 2px;
                              margin-right: 5px; vertical-align: middle; }
.ring.two-part .split .mark.search { background: var(--haze); }
.ring.two-part .split .mark.other { background: color-mix(in srgb, var(--steel) 45%, transparent); }

/* Полоска тонкая: она указывает день, а не соперничает с линиями графика. */
.pad-chart .crosshair { stroke-width: 1; }

/* Даты под графиком. Обычной разметкой, а не текстом в SVG: холст растянут по ширине
   (preserveAspectRatio="none"), и подписи внутри растянулись бы вместе с ним. */
.pad-axis { position: relative; height: 15px; margin-top: 3px; }
.pad-axis span { position: absolute; transform: translateX(-50%); white-space: nowrap;
                 font-family: var(--data); font-size: 10.5px; color: var(--steel-dim); }

/* Числа дня — у самой полоски, чтобы не искать их наверху страницы. */
.pad-near { position: absolute; top: 6px; z-index: 3; pointer-events: none;
            display: flex; flex-direction: column; gap: 1px; padding: 6px 9px;
            background: var(--panel); border: var(--tick) solid var(--line-lit);
            border-radius: 7px; box-shadow: 0 6px 18px -8px #000;
            font-size: 11.5px; color: var(--steel); font-variant-numeric: tabular-nums;
            white-space: nowrap; }
/* --ink в светлой теме почти белый (он там для тёмных подложек), и числа на белой
   подписи были белым по белому. Цвет текста на панели в обеих темах даёт --paper. */
.pad-near b { color: var(--paper); }

/* На узком экране подписи дат налезают друг на друга — там оставляем каждую вторую. */
@media (max-width: 900px) { .pad-axis span:nth-child(even) { display: none; } }

/* Папка серии: обложка со «стопкой» под ней — видно, что внутри не одна картинка. */
.series-folder .folder-stack { position: relative; }
.series-folder .folder-stack img { width: 100%; border-radius: 7px; display: block;
                                   border: 1px solid var(--line); position: relative; z-index: 2; }
.series-folder .folder-stack::before,
.series-folder .folder-stack::after {
  content: ""; position: absolute; left: 5px; right: 5px; bottom: -4px; height: 10px;
  border: 1px solid var(--line); border-radius: 7px; background: var(--panel); z-index: 1;
}
.series-folder .folder-stack::after { left: 10px; right: 10px; bottom: -8px; z-index: 0; }
.series-folder .folder-count { position: absolute; top: 8px; right: 8px; z-index: 3;
  background: var(--paper); color: var(--panel); font-size: 11px; font-weight: 600;
  border-radius: 999px; padding: 2px 9px; }

/* Галочка выбора поверх плитки в папке — чтобы отмечать, что скачать. */
/* Обёртка с галочкой сама стала ячейкой сетки (col-3 = четыре в ряд). Без класса
   колонки она занимала одну из двенадцати, и вся папка вытягивалась в один ряд. */
.folder-item { position: relative; }
.folder-item .pick-mark { position: absolute; top: 14px; left: 14px; z-index: 4;
  background: var(--panel); border: var(--tick) solid var(--line-lit);
  border-radius: 6px; padding: 3px 5px; cursor: pointer; line-height: 0; }
.folder-item .pick-mark input { margin: 0; cursor: pointer; }
.folder-item > .mod { margin: 0; }

/* Плашка о сбое скрипта. Красная и в углу: молчаливая ошибка — худший вид поломки,
   кнопка «просто ничего не делает», и понять это можно только через консоль. */
.crash-note { position: fixed; right: 18px; bottom: 18px; z-index: 200; max-width: 420px;
  background: var(--rust); color: #fff; border-radius: 9px; padding: 11px 14px;
  font-size: 13px; line-height: 1.4; box-shadow: 0 12px 30px -10px #000; }
.crash-note button { background: none; border: 0; color: #fff; cursor: pointer;
  font-size: 15px; margin-left: 8px; float: right; }

