/* ============================================================
   Структурные правила, не покрытые theme.css: позиционирование,
   видимость и поведение. Оформление задаёт тема выше.
   ============================================================ */

/* Вкладки */
.tabpane[hidden] { display: none; }
.tabpane > h2:first-child { margin-top: 6px; }

/* Динамика поисковых запросов: приёмник файлов и плотные таблицы отчёта */
.sqdrop { margin: 12px 0; padding: 22px; text-align: center; cursor: pointer;
          border: 1px dashed var(--line-strong); border-radius: var(--r-block);
          color: var(--muted-2); }
.sqdrop:hover, .sqdrop.over { border-color: var(--accent); color: var(--text);
                              background: var(--card); }
.sqtable { width: 100%; border-collapse: collapse; margin: 8px 0 4px; font-size: 13px; }
.sqtable th { text-align: left; font-size: 11px; color: var(--muted-2); font-weight: 500;
              padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.sqtable td { padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.sqtable td.num, .sqtable th.num { text-align: right; font-variant-numeric: tabular-nums;
                                   white-space: nowrap; }
.sqtable input { width: 92px; padding: 4px 6px; }
.sqtable td.nowrap { white-space: nowrap; }
.sqtable td.del { width: 34px; text-align: right; }
.sqtable td.del button { border: none; background: none; box-shadow: none; padding: 4px 6px;
                         color: var(--muted-2); font-size: 13px; }
.sqtable td.del button:hover { color: var(--up); background: none; }

/* Список файлов: строка-итог с кнопкой сбора, таблица под ней разворачивается. */
.sqfiles { margin-top: 12px; }
.sqfiles .sqfiles-bar { display: flex; align-items: center; gap: 12px; }
.sqfiles .qsec-head { flex: 1; }
.sqfiles .qsec-head .sub { font-size: 12.5px; color: var(--muted-2);
                           font-variant-numeric: tabular-nums; margin-right: 12px; }
.sqfiles .qsec-body { margin-left: 0; max-height: 420px; overflow: auto; }
.sqfiles-foot { display: flex; align-items: flex-start; gap: 16px; }
.sqfiles-foot p { flex: 1; margin: 6px 0 0; font-size: 12.5px; }
.sqfiles-foot .ghost { background: none; border: 1px solid var(--line-strong);
                       color: var(--text-2); padding: 8px 16px; }
.sqfiles-foot .ghost:hover { border-color: var(--text); color: var(--text); }
.sqtable tr.total td { font-weight: 600; background: var(--st-ok-bg); }
.sqtable td.over { color: var(--st-err-fg); font-weight: 600; }
.sqtable input { background: var(--card); border: 1px solid var(--line);
                 border-radius: 8px; color: var(--text); font: inherit; font-size: 12px; }
.sqwrap { overflow-x: auto; }
.sqrisk { display: inline-block; margin: 1px 4px 1px 0; padding: 1px 7px; font-size: 11px;
          border-radius: 999px; background: var(--st-warn-bg); color: var(--st-warn-fg); }
.sqcard { margin-top: 18px; }
.sqcard h3 { margin-bottom: 2px; }
.sqcard .muted { margin-bottom: 6px; }

/* Формы: поля тянутся по ширине строки */
.addform { flex-wrap: wrap; }
/* display:flex из темы перебивает атрибут hidden — возвращаем ему силу */
.addform[hidden], [hidden] { display: none !important; }
.addform input { flex: 1; min-width: 140px; }
.cform input { flex: 1; min-width: 0; }
.comments { margin-top: 0; }

/* Стрелки сортировки */
.sar { display: inline-block; width: 12px; text-align: center; font-size: 11px; }
.sortable .sar::after { content: "\2195"; color: var(--line); font-weight: 400; }
/* Стрелка показывает, что стоит наверху: вверх — большие значения (убывание),
   вниз — маленькие (возрастание). */
.sortable.asc .sar::after { content: "\2193"; }
.sortable.desc .sar::after { content: "\2191"; }

/* Колонка действий */
td.actions { width: 1%; white-space: nowrap; text-align: right; }

/* Перетаскивание своих товаров */
#own tbody tr.product.dragging { opacity: .4; }
.drag-ghost { position: fixed; z-index: 100; pointer-events: none; table-layout: fixed;
              border-collapse: collapse; background: var(--surface); opacity: .9;
              box-shadow: var(--sh-modal); border-radius: var(--r-row); overflow: hidden; }
.drag-ghost td { border: none; white-space: nowrap; padding: 10px 18px; }

/* История замеров */
.hist { width: 100%; border-collapse: separate; table-layout: fixed; }
.hist td .badge { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

/* Свёртки по дням */
details.day > summary { display: flex; gap: 10px; align-items: center; cursor: pointer; list-style: none; }
details.day > summary::-webkit-details-marker { display: none; }
details.day > summary::before { content: "\203A"; color: var(--muted-2); font-size: 13px; width: 12px; }
details.day[open] > summary::before { content: "\2304"; }
details.day > .hourbody { padding: 0 0 6px 0; }
.dcell.date { flex: 1; font-weight: 600; }
.dcell.num { width: 96px; text-align: right; white-space: nowrap; }
.dcell.avg { width: 180px; text-align: right; white-space: nowrap; }
.dcell.avg .lbl { color: var(--muted); font-size: 12px; margin-right: 4px; }
.dcell.count { width: 74px; text-align: right; color: var(--muted); font-size: 12px; }

/* Автокомплит: выпадающий список */
.ac { position: relative; }
.ac input { width: 100%; }
.addform .ac { flex: 1; min-width: 140px; }
.ac-list { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); overflow: hidden; }
.ac-item { padding: 8px 12px; cursor: pointer; font-size: 13px; line-height: 1.3; }
.ac-empty { padding: 8px 12px; color: var(--muted-2); font-size: 13px; }

/* Экран входа: раскладка оверлея */
.login-overlay { position: fixed; inset: 0; z-index: 50; display: flex;
                 align-items: center; justify-content: center; padding: 24px; }
.login-overlay[hidden] { display: none; }
.login-card { width: 100%; }
.login-card h1 { margin: 0 0 4px; }
.login-card p.sub { font-size: 13px; margin: 0 0 20px; }
.login-card label { display: block; margin: 0 0 6px; }
.login-card input { width: 100%; font: inherit; }
.login-card button { margin-top: 16px; }
.login-err { font-size: 13px; margin-top: 12px; min-height: 18px; }

/* === доработки: спарклайн, хедер, сбор, микро-анимации, пустое состояние === */

/* 1. Спарклайн «24 ч» в таблице своих товаров (макет 6a) */
.spark24 { display: block; margin: 0 auto; }
.spark24 polyline { fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.spark24.up polyline, .spark24.up circle { stroke: var(--up); fill: none; }
.spark24.up circle { fill: var(--up); }
.spark24.down polyline { stroke: var(--down); }
.spark24.down circle { fill: var(--down); }
.spark24.flat polyline { stroke: var(--disabled); }
.spark24.flat circle { fill: var(--disabled); }
.spark24-empty { font-size: 11px; color: var(--disabled); }
#own th.c, #own td.c { width: 96px; text-align: center; }

/* 2. Плотный хедер вместо стеклянных плашек (макет 9a): на светло-сером фоне
      блюр почти не читается, поэтому плашки сплошные и тянутся по высоте. */
.pagehead { align-items: stretch; }
.pagetitle { line-height: .9; }
.stats { align-items: stretch; }
.stat { width: 264px; flex: 0 0 264px; height: auto;
        background: var(--card); border: 1px solid var(--line);
        backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: var(--sh-card);
        display: flex; flex-direction: column; justify-content: space-between; }
.stat.accent { background: var(--accent-soft); border-color: rgba(110,231,183,.34); }
.stat.accent .stat-value { color: var(--accent-2); }
.stat-value { font-size: 52px; }

/* 3. Живой индикатор сбора (макет 10a) */
.pulse { position: relative; width: 8px; height: 8px; flex: none; display: block; }
.pulse i { position: absolute; inset: 0; border-radius: 50%; background: var(--disabled); }
.collecting .pulse i:first-child { background: var(--down); animation: pulse-breathe 2.4s ease-in-out infinite; }
.collecting .pulse i:last-child  { background: var(--down); animation: pulse-ring 2.4s ease-out infinite; }
@keyframes pulse-breathe { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.8); opacity: .7; } }
@keyframes pulse-ring { 0% { transform: scale(1); opacity: .5; } 100% { transform: scale(3.2); opacity: 0; } }

/* Панели нужен только position: relative. overflow: hidden из макета не ставим —
   он бы обрезал выпадающие подсказки по каталогу; скругление полоски держит она сама. */
.ownpanel { position: relative; padding-top: 6px; }
#collect-bar { position: absolute; top: 0; left: 0; right: 0; height: 3px;
               background: rgba(255,255,255,.08); border-radius: 24px 24px 0 0; overflow: hidden; }
#collect-bar span { display: block; height: 100%; width: 6%; background: var(--accent);
                    animation: collect 5.5s ease-in-out infinite; }
@keyframes collect { 0% { width: 6%; } 70% { width: 62%; } 100% { width: 96%; } }

/* 4. Микро-анимации (макет 11a).
      Подъём строки на 2px не делаем: раскрытая строка класса не получает, а
      transform на <tr> во время drag-and-drop даёт дрожание. Остаётся тень. */
/* Тень при наведении убрана: и на ячейках, и на строке целиком она рисовала
   края на стыках колонок — тонкие вертикальные полосы поперёк строки.
   Наведение показываем только подсветкой фона. */
tr.product { transition: background 120ms ease; }
tr.product:hover td { background: var(--card-hover); }
tr.product.dragging, tr.product.dragging:hover { transform: none; filter: none; box-shadow: none; }

button, .primary { transition: background 120ms ease, border-color 120ms ease, transform 120ms ease; }
button:active, .primary:active { transform: scale(.96); }

#refresh { display: inline-flex; align-items: center; gap: 8px; }
#refresh .spin circle { fill: none; stroke: var(--disabled); stroke-width: 1.8; }
#refresh .spin .arc { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 12 22; }
#refresh .spin { opacity: .45; }
#refresh.busy .spin { opacity: 1; animation: spin 1.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 5. Пустое состояние таблицы своих товаров (макет 12a) */
.emptystate { border: 1px dashed var(--line-strong); border-radius: 16px; background: var(--card);
              padding: 46px 40px; display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
.emptystate-dots { display: flex; gap: 6px; }
.emptystate-dots i { width: 9px; height: 9px; background: rgba(255,255,255,.07);
                     border: 1px solid var(--line); }
.emptystate-dots i.on { background: var(--accent); border-color: var(--accent); }
.emptystate-title { font-size: 24px; font-weight: 600; letter-spacing: -.03em; color: var(--text); }
.emptystate-sub { font-size: 14px; color: var(--muted); max-width: 420px; text-wrap: pretty; }
.stat-value.dim { color: var(--disabled); }

/* Автосбор включён, но прямо сейчас ничего не собирается: точка светится
   спокойно, без расходящегося кольца — оно означает активный сбор. */
.auto-on .pulse i:first-child { background: var(--down); animation: pulse-idle 3.2s ease-in-out infinite; }
.auto-on .pulse i:last-child { background: transparent; }
/* Активный сбор важнее режима: его ритм и кольцо перебивают спокойное свечение. */
.collecting .pulse i:first-child { animation: pulse-breathe 2.4s ease-in-out infinite; }
.collecting .pulse i:last-child { background: var(--down); animation: pulse-ring 2.4s ease-out infinite; }
@keyframes pulse-idle { 0%,100% { opacity: 1; } 50% { opacity: .45; } }

/* Подсказки: показываем все совпадения, но окно высотой в 8 строк — дальше
   прокрутка, чтобы список не закрывал пол-экрана. */
.ac-list { max-height: 368px; overflow-y: auto; overscroll-behavior: contain; }
.ac-item { min-height: 46px; }

/* Панель добавления после удаления «Обновить» и «Запустить сбор»:
   поле занимает всю свободную ширину, кнопка выровнена по правому краю таблицы. */
.panelbar .addform { flex: 1; min-width: 0; gap: 12px; }
.panelbar .addform .ac { flex: 1; min-width: 0; }
.panelbar .addform button { flex: none; }

/* График соинвеста за день: зелёный, независимо от знака — он про динамику,
   а не про «хорошо/плохо»; цвет знака остаётся у числа в колонке «Соинвест». */
.spark24 polyline { fill: none; stroke: #4a7a3e; stroke-width: 1.6;
                    stroke-linecap: round; stroke-linejoin: round; }
.spark24 circle { fill: #4a7a3e; stroke: none; }
.spark24 rect { cursor: default; }
.spark24.up polyline, .spark24.down polyline, .spark24.flat polyline { stroke: #4a7a3e; }
.spark24.up circle, .spark24.down circle, .spark24.flat circle { fill: #4a7a3e; }

/* Стрелки тренда: тонкая линия с наконечником, цвет от родителя */
.arr { display: inline-block; vertical-align: -1px; }
.arr path { fill: none; stroke: currentColor; stroke-width: 1.5;
            stroke-linecap: round; stroke-linejoin: round; }
.arrow-up, .arrow-down { display: inline-flex; align-items: center; }

/* Заголовки и значения в таблице своих товаров стоят по центру своих колонок:
   при выравнивании по правому краю подпись «уезжала» от чисел. */
#own th.num, #own td.num { text-align: center; }
#own th.c, #own td.c { text-align: center; }

/* Шапка: вкладки прижаты к логотипу, справа — плашка сбора, выбор магазина
   и отдельная круглая кнопка настроек. */
.headinner { justify-content: flex-start; }
/* Логотип и капсула вкладок — разные по смыслу блоки, вплотную читались как один. */
.brand { flex: none; margin-right: 40px; }
.headspacer { flex: 1 1 auto; min-width: 12px; }
.headright { flex: none; }
.headright .gearbtn { width: 40px; height: 40px; padding: 0; flex: none;
                      border-radius: 50%; background: var(--card); border: 1px solid var(--line);
                      display: inline-flex; align-items: center; justify-content: center; }
.headright .gearbtn:hover { background: var(--card-hover); border-color: var(--line-strong); }
.headright .gearbtn svg { display: block; }
/* Цвета шестерёнки заданы атрибутами в разметке — перекрываем их стилем,
   чтобы иконка жила в палитре темы, а не в старой светлой. */
.gearbtn svg g { fill: var(--muted); }
.gearbtn:hover svg g { fill: var(--text); }
.gearbtn svg > circle { fill: var(--bg); }

/* Подсказка графика соинвеста */
.spark-tip { position: fixed; z-index: 80; pointer-events: none;
             background: var(--surface); color: var(--text); font-size: 12px; font-weight: 500;
             padding: 6px 10px; border-radius: 8px; white-space: nowrap;
             border: 1px solid var(--line);
             box-shadow: 0 6px 18px rgba(0,0,0,.5); }
.spark24 rect { cursor: crosshair; }

/* Место под фото карточки: в строке товара — справа от названия, в подсказках
   каталога — перед артикулом. Пока заглушка в полоску, как в макете. */
.pcell-row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pcell-row .pcell { flex: 1; min-width: 0; }
.thumb.sm { width: 52px; height: 69px; border-radius: 10px; flex: none; }
/* Плитка сама задаёт пропорцию 3:4 — фото просто заполняет её. */
.thumb.tile { width: 100%; height: 100%; border: none; border-radius: 0; object-fit: cover; }
.thumb.xs { width: 24px; height: 32px; border-radius: 6px; flex: none; }
.ac-item { display: flex; align-items: center; gap: 10px; }
.ac-text { display: flex; flex-direction: column; min-width: 0; }
.ac-text .sku { font-size: 12px; color: var(--muted-2); }

/* Фото карточки товара */
/* Пропорции рамки совпадают с фото, поэтому cover заполняет её без полей. */
img.thumb { object-fit: cover; background: var(--card); }
.ac-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Настройки открыты: вкладки прячем, а выбор магазина остаётся — им и
   переключаются настройки, которые показаны ниже. */
.settings-open #tabs { display: none; }

/* Фото-ссылка на карточку Ozon */
.thumb-link { display: block; flex: none; line-height: 0; border-radius: 8px; }
.thumb-link:hover { opacity: .85; }

/* Комментарий к замеру: текст и кнопка удаления */
.comment { display: inline-flex; align-items: center; gap: 8px; }
.comment-del { border: none; background: none; box-shadow: none; color: var(--muted-2);
               font-size: 12px; padding: 2px 4px; line-height: 1; }
.comment-del:hover { color: var(--up); background: none; }

/* Интерфейс крупнее: базовый кегль и контролы подросли вместе с шириной main. */
body { font-size: 15px; }
.stat-value { font-size: 56px; }
.pagetitle { font-size: clamp(48px, 5vw, 68px); }
#own td, #comp td, #accounts td { font-size: 15px; }
#own th, #comp th { font-size: 13px; }
.hist { font-size: 15px; }

/* Раскладка таблиц по заданным ширинам, а не по содержимому: длинное название
   товара в одну строку раздвигало таблицу шире панели и уезжало под её край.
   При фиксированной раскладке лишнее обрезается многоточием, как и задумано. */
#own, #comp { table-layout: fixed; }
/* Числовые колонки собраны в плотную группу у правого края: свободное место
   остаётся в середине, после названия товара, а не висит справа от цифр. */
#own th.num, #own td.num, #comp th.num, #comp td.num { width: 112px; }
#own th.c, #own td.c { width: 88px; }
#own td.actions, #comp td.actions, #own th:last-child, #comp th:last-child { width: 56px; }
/* Крестик не впритык к краю строки: у самой кромки он читался как обрезанный. */
#own td.actions, #comp td.actions { padding-right: 20px; }
#comp td:nth-child(4) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* === доработки: панель-обёртка и свечение (макет 2a, 20d) === */
/* Дашборд лежит в двух вложенных плашках: внешняя держит заголовок со сводками,
   внутренняя — сам список. Полоска сбора идёт по верхней кромке внешней. */
/* Свет лежит под всей страницей, а не внутри панели: иначе кромки пятен
   обрезались обёрткой и читались как второй прямоугольник. */
.pagelight { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.pagelight span { position: absolute; border-radius: 50%; }
/* Свет под страницей: на тёмном фоне пятна работают только на малой
   непрозрачности — на светлой теме они были почти сплошной заливкой. */
.glow-a { top: -220px; right: -160px; width: 900px; height: 620px;
          background: #34d399; filter: blur(170px); opacity: .10; }
.glow-b { bottom: -300px; left: -220px; width: 980px; height: 680px;
          background: #3b7fd4; filter: blur(180px); opacity: .11; }
main { position: relative; z-index: 1; }
/* Шапка выше содержимого: выпадающий список магазинов уходил под панель. */
header { position: relative; z-index: 30; }
.glow { padding: 28px 0; }
.panel { position: relative; overflow: hidden; border-radius: 24px; padding: 22px;
         background: var(--surface); border: 1px solid var(--line);
         box-shadow: var(--sh-panel); }
.panelblock { background: var(--card); border-radius: 18px;
              padding: 22px 24px 24px; }
.pagehead { margin-bottom: 30px; }
.ownpanel { padding-top: 22px; }

/* Пока данные едут, показываем каркас будущих строк: пустой экран с надписью
   «Загрузка…» выглядел так, будто ничего не происходит. */
.skeleton { display: block; border-radius: 8px; background: rgba(255,255,255,.09);
            animation: skeleton-pulse 1.2s ease-in-out infinite; }
.skeleton-value { width: 96px; height: 42px; }

/* Каркас повторяет форму будущей строки: пульсируют только фото, название и
   числа, а сама плашка выглядит как обычная — мигание во всю строку читалось
   как поломка вёрстки. */
.skeleton-tr td { background: var(--card); }
.skeleton-cell { display: flex; align-items: center; gap: 14px; }
.skeleton-thumb { width: 52px; height: 69px; border-radius: 10px; flex: none; }
.skeleton-lines { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.skeleton-line { height: 12px; }
.skeleton-line.title { width: 46%; }
.skeleton-line.sub { width: 26%; height: 10px; }
.skeleton-num { height: 14px; width: 72px; margin: 0 auto; }
.skeleton-row { height: 58px; border-radius: var(--r-row); margin-bottom: 6px;
                background: var(--card); display: flex; align-items: center;
                gap: 14px; padding: 0 18px; }
@keyframes skeleton-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }

/* Тонкая полоска под шапкой — общий признак того, что запрос в пути. */
#busy-bar { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 90;
            background: transparent; pointer-events: none; overflow: hidden; }
#busy-bar span { display: block; height: 100%; width: 30%;
                 background: linear-gradient(90deg, transparent, var(--text), transparent);
                 animation: busy-slide 1.1s ease-in-out infinite; }
@keyframes busy-slide { from { transform: translateX(-120%); } to { transform: translateX(430%); } }

/* Точка на графике позиций проявляется под курсором — постоянные точки на
   длинном ряду дней превращают линию в пунктир. */
.spark svg .dot { fill: var(--text); opacity: 0; transition: opacity 120ms ease; pointer-events: none; }
.spark svg .hit:hover + .dot { opacity: 1; }

/* Счётчик занятых запросов и окно правил */
.budget { font-size: 13px; font-weight: 600; color: var(--muted); padding: 8px 14px;
          border-radius: var(--r-pill); background: var(--card); white-space: nowrap;
          cursor: default; font-variant-numeric: tabular-nums; }
.budget.tight { background: var(--st-warn-bg); color: var(--st-warn-fg); }

/* Кнопка правил — знак вопроса, который оживает под курсором. */
.rulesbtn { width: 38px; height: 38px; padding: 0; flex: none; border-radius: 50%;
            display: inline-flex; align-items: center; justify-content: center;
            border: 1px solid var(--line-strong); background: var(--card);
            color: var(--muted); transition: color .18s, border-color .18s, transform .18s; }
.rulesbtn svg circle:first-child { fill: none; stroke: currentColor; stroke-width: 1.3; }
.rulesbtn svg path { fill: none; stroke: currentColor; stroke-width: 1.5;
                     stroke-linecap: round; stroke-linejoin: round; }
.rulesbtn svg .dot { fill: currentColor; stroke: none; }
.rulesbtn:hover { color: var(--text); border-color: var(--text); transform: scale(1.06); background: var(--card); }
.rulesbtn:hover svg { animation: rules-nudge .5s ease; }
@keyframes rules-nudge {
  0%, 100% { transform: rotate(0); }
  35% { transform: rotate(-9deg); }
  70% { transform: rotate(7deg); }
}
.rules-lead, .rules-note { font-size: 13px; color: var(--muted); line-height: 1.5; margin: 0 0 14px; }
.rules-table { width: 100%; border-collapse: collapse; margin-bottom: 16px; font-size: 14px; }
.rules-table th { text-align: left; font-size: 11px; color: var(--muted-2); padding-bottom: 8px; }
.rules-table td { padding: 8px 0; border-top: 1px solid var(--line); }
.rules-table tr.on td { font-weight: 600; }
.rules-table .num { text-align: right; }

/* Шкала ячеек матрицы: зелёное — мы выше конца выдачи, жёлтое и красное — ниже.
   Насыщенность растёт вместе с отрывом. */
/* Шкала переведена на тёмный: тот же порядок насыщенности, но краска ложится
   прозрачностью поверх фона, а не светлой заливкой — иначе светлый текст в
   ячейке пропадал. */
.mcell.heat-green      { background: rgba(79,209,197,.30); }
.mcell.heat-green-pale { background: rgba(79,209,197,.14); }
.mcell.heat-yellow     { background: rgba(244,200,120,.28); }
.mcell.heat-yellow-pale{ background: rgba(244,200,120,.13); }
.mcell.heat-red-pale   { background: rgba(255,122,107,.14); }
.mcell.heat-red        { background: rgba(255,122,107,.30); }

/* Колонка удаления в матрице: запрос убирается там, где он показан. */
.mhead, .mrow { grid-template-columns: 250px 92px 96px 44px; }
.mrow .kw-del { width: 26px; height: 26px; padding: 0; border: none; background: none;
                box-shadow: none; color: var(--muted-2); font-size: 12px; line-height: 1; }
.mrow .kw-del:hover { color: var(--up); background: none; }

/* Поле новых запросов внутри полосы чипов: своей рамки у него нет, чтобы
   набранное выглядело продолжением ряда, а не отдельным полем. */
.chipinput { flex: 1; min-width: 140px; border: none; background: none; box-shadow: none;
             padding: 7px 4px; font: inherit; font-size: 13px; color: var(--text); }
.chipinput:focus { outline: none; }
.chip.draft { background: var(--accent-soft); color: var(--accent-2); }

/* Предупреждение о бюджете обращений к кабинету */
.poscapacity { margin: 0 0 14px; padding: 12px 16px; border-radius: 14px;
               background: var(--st-warn-bg); color: var(--st-warn-fg);
               font-size: 13px; line-height: 1.45; }
.seg button[disabled] { opacity: .45; cursor: not-allowed; }

/* Капсула магазина: текст и стрелка стоят симметрично, а сама она по высоте
   равна соседней круглой кнопке — иначе ряд в шапке выглядел сбитым. */
/* Список магазинов рисуем сами: нативный select открывается системным окном
   поверх шапки и растягивается под самое длинное название, из-за чего у
   короткого имени справа зияла пустота. */
.shoppicker { position: relative; flex: none; }
.shopbtn { display: inline-flex; align-items: center; gap: 10px; height: 40px;
           padding: 0 16px; border: 1px solid var(--line);
           border-radius: var(--r-pill); background: var(--card); color: var(--text);
           font: inherit; font-size: 13px; font-weight: 600; text-transform: uppercase;
           letter-spacing: .01em; cursor: pointer; box-shadow: none; }
.shopbtn svg { transition: transform 160ms ease; }
.shopbtn.open svg { transform: rotate(180deg); }

.shopmenu { position: absolute; top: calc(100% + 6px); left: 0; min-width: 100%;
            padding: 6px; background: var(--surface); border: 1px solid var(--line);
            border-radius: 16px; box-shadow: var(--sh-modal);
            z-index: 60; display: flex; flex-direction: column; gap: 2px;
            transform-origin: top center; animation: shopmenu-open 140ms ease; }
@keyframes shopmenu-open {
  from { opacity: 0; transform: translateY(-6px) scale(.98); }
  to   { opacity: 1; transform: none; }
}
.shopitem { display: block; width: 100%; text-align: left; white-space: nowrap;
            padding: 9px 14px; border: none; border-radius: 10px; background: none;
            font: inherit; font-size: 13px; font-weight: 600; text-transform: uppercase;
            color: var(--text); cursor: pointer; box-shadow: none; }
.shopitem:hover { background: var(--card-hover); }
.shopitem.on { background: var(--accent-soft); color: var(--accent-2); }
.shopitem.empty { color: var(--muted); cursor: default; text-transform: none; font-weight: 400; }
/* «+» отделён линией: это действие, а не ещё один магазин в списке. */
.shopitem.add { text-transform: none; color: var(--muted); border-top: 1px solid var(--line);
                border-radius: 0 0 10px 10px; margin-top: 4px; }
.shopitem.add:hover { color: var(--text); }

/* История замеров вложена в строку товара: плашки уже основной таблицы,
   но без своей подложки — серый блок вокруг читался как лишний уровень. */
.detail-inner { padding: 6px 44px; }
/* Поле комментария занимает всю свою колонку и сжимается вместе с ней:
   фиксированный минимум распирал таблицу за край панели, а нулевая ширина
   схлопывала поле в кружок. */
.hist td.hcomment .cform { min-width: 0; width: 100%; }
.hist td.hcomment .cform input { flex: 1 1 auto; min-width: 0; width: 100%; }
/* Готовые ключи: строка с галочкой вместо формы ввода. */

/* --- АБ-тесты главных фото --- */
/* Тест — про картинки, поэтому список показывает их, а не строку параметров.
   Все главные фото Ozon в пропорции 3:4 — под неё и сделаны все места под фото. */
.abgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
          gap: 16px; }
/* Кнопка режима выбора стоит рядом с «Новый тест» и не должна с ней спорить. */
#ab-pick-mode { background: none; border: 1px solid var(--line-strong); color: var(--text-2); }
#ab-pick-mode:hover { border-color: var(--text); color: var(--text); }
#ab-pick-mode.on { background: var(--card-hover); border-color: var(--accent-2);
                   color: var(--accent); }
.abtile { background: var(--card); border-radius: 22px; padding: 14px 14px 16px;
          display: flex; flex-direction: column; gap: 12px; cursor: pointer;
          transition: box-shadow 160ms ease; }
.abtile:hover { box-shadow: var(--sh-card); background: var(--card-hover); }
.abtile-photo { position: relative; aspect-ratio: 3 / 4; border-radius: 16px;
                overflow: hidden; background: rgba(255,255,255,.06); }
.abtile-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.abtile-strip { display: flex; justify-content: center; gap: 8px; }
.abtile-strip img { width: 51px; height: 68px; object-fit: cover; border-radius: 9px;
                    background: rgba(255,255,255,.06); }
.abtile-strip img.win { box-shadow: 0 0 0 2px var(--st-ok-fg); }
.abtile-title { font-size: 14.5px; font-weight: 700; letter-spacing: -.015em;
                line-height: 1.3; }
.abtile-sku { font-size: 12px; color: var(--muted-2); margin-top: -8px; }
.abtile-lead { font-size: 13px; font-weight: 600; color: var(--st-ok-fg);
               padding-top: 10px; border-top: 1px solid var(--line); margin-top: auto; }
.abtile-lead.muted { color: var(--muted-2); }

.abrow-status { padding: 4px 12px; border-radius: var(--r-pill); font-size: 13px;
  background: var(--st-na-bg); color: var(--st-na-fg); white-space: nowrap; }
.abrow-status.ab-running { background: var(--st-ok-bg); color: var(--st-ok-fg); }
.abrow-status.ab-paused, .abrow-status.ab-calibrating { background: var(--st-warn-bg); color: var(--st-warn-fg); }
/* Остановлен сам, из-за кампании: это не ошибка теста, но и не норма —
   тот же красный, что у сбоя, отличает его от «пауза». */
.abrow-status.ab-paused_error, .abrow-status.ab-stopped { background: var(--st-err-bg); color: var(--st-err-fg); }

/* Поверх фото полупрозрачная подложка статуса не работает — под ней товар,
   а не тема. Правило стоит после статусных, поэтому затемнение перебивает
   их фон при любом статусе; цвет текста остаётся смысловым. */
.abtile-photo .abrow-status { position: absolute; right: 12px; top: 12px;
                              background: rgba(0,0,0,.8); }

/* «Идёт» и «остановлен» должны читаться с одного взгляда, в том числе поверх
   пёстрого фото: сплошная заливка вместо приглушённой подложки. Правила стоят
   после затемняющего, иначе оно перебивало бы их фон. */
.abrow-status.ab-running,
.abtile-photo .abrow-status.ab-running {
  background: var(--accent); color: var(--accent-ink); font-weight: 700;
  box-shadow: 0 0 14px rgba(110,231,183,.4);
}
.abrow-status.ab-stopped, .abrow-status.ab-paused_error,
.abtile-photo .abrow-status.ab-stopped,
.abtile-photo .abrow-status.ab-paused_error {
  background: var(--up); color: #2a0f0b; font-weight: 700;
  box-shadow: 0 0 14px rgba(255,122,107,.4);
}

/* Выбор тестов пачкой. Кружок появляется только в режиме выбора: в обычном
   списке галочка на фото шумит, а плитка и так открывается кликом. */
.abpick { position: absolute; left: 12px; top: 12px;
          width: 24px; height: 24px; border-radius: 50%;
          border: 1.5px solid rgba(255,255,255,.85); background: rgba(0,0,0,.35);
          backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
          opacity: 0; transform: scale(.85); pointer-events: none;
          transition: opacity .15s ease, transform .15s ease, background .15s ease; }
#ab-rows.picking .abpick { opacity: 1; transform: scale(1); }
#ab-rows.picking .abtile { cursor: pointer; }
#ab-rows.picking .abtile:hover .abpick { background: rgba(0,0,0,.55); }
.abtile.picked .abpick { background: var(--accent-2); border-color: var(--accent-2); }
.abtile.picked .abpick::after { content: ""; position: absolute; left: 8px; top: 4px;
                                width: 5px; height: 10px; border: solid #12201a;
                                border-width: 0 2px 2px 0; transform: rotate(45deg); }
/* Выбранная плитка приподнята кольцом и приглушённым фото — видно с краю
   экрана, какие уйдут под удаление. */
.abtile.picked { box-shadow: 0 0 0 2px var(--accent-2); background: var(--card-hover); }
.abtile.picked .abtile-photo img { opacity: .75; }

/* Шапка карточки: одна строка вместо трёх блоков, действия — в меню. */
.abhead { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.abhead-title { font-size: 16px; font-weight: 700; letter-spacing: -.02em; }
.abhead-sub { font-size: 12px; color: var(--muted-2); margin-top: 2px; }
.abmenu { position: relative; }
.abmenu-list { position: absolute; right: 0; top: 42px; z-index: 20; width: 260px;
               background: var(--surface); border: 1px solid var(--line);
               border-radius: 20px; padding: 8px;
               box-shadow: var(--sh-modal);
               display: flex; flex-direction: column; }
.abmenu-list[hidden] { display: none; }
.abmenu-list button { text-align: left; border: 0; background: none; font: inherit;
                      font-size: 13.5px; color: var(--text); padding: 10px 12px;
                      border-radius: 12px; cursor: pointer; box-shadow: none; }
.abmenu-list button:hover { background: var(--card-hover); }
.abmenu-list button.danger { color: var(--up); }
.abmenu-list button.danger:hover { background: var(--st-err-bg); }
.abmenu-list hr { border: 0; border-top: 1px solid var(--line); margin: 6px 12px; }

/* Варианты — колонками, фото в той же пропорции 3:4, что и на витрине Ozon. */
.abvariants { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
              gap: 14px; align-items: start; margin-bottom: 16px; }
.abvariant { background: var(--card); border: 0; border-radius: 22px;
             padding: 12px 12px 16px; display: flex; flex-direction: column; gap: 12px; }
.abvariant.win { background: var(--card); box-shadow: 0 0 0 2px var(--st-ok-fg); }
/* Фото, которое крутится прямо сейчас, обведено синим неоном: видно с другого
   конца страницы, какой вариант сейчас на витрине. Свечение дышит, поэтому
   карточка не путается с зелёной обводкой лидера. */
.abvariant.live { box-shadow: 0 0 0 2px #2f6bff, 0 0 18px rgba(47,107,255,.45); }
.abvariant.live.win { box-shadow: 0 0 0 2px #2f6bff, 0 0 18px rgba(47,107,255,.45),
                      0 0 0 5px var(--st-ok-bg); }
@media (prefers-reduced-motion: no-preference) {
  .abvariant.live { animation: live-glow 2.4s ease-in-out infinite; }
}
@keyframes live-glow {
  50% { box-shadow: 0 0 0 2px #2f6bff, 0 0 26px rgba(47,107,255,.7); }
}
.abvariant-photo { position: relative; aspect-ratio: 3 / 4; border-radius: 14px;
                   overflow: hidden; background: rgba(255,255,255,.06); }
.abvariant-photo img { width: 100%; height: 100%; object-fit: cover;
                       display: block; border-radius: 0; }
.abvariant-photo .photo-link { display: block; width: 100%; height: 100%; }
.abvariant-photo .photo-link:hover img { opacity: .88; }
/* Лидер и текущее фото — разные вещи и могут совпасть, поэтому метки стоят
   столбиком, а не вытесняют друг друга. */
.abvariant-tags { position: absolute; left: 10px; top: 10px; display: flex;
                  flex-direction: column; align-items: flex-start; gap: 6px; }
/* Метки лежат на фотографии, а не на теме: полупрозрачная подложка статуса
   там не работает — нужен собственный тёмный слой. */
.abvariant-photo .tag { height: 24px; display: inline-flex; align-items: center;
                        padding: 0 10px; border-radius: var(--r-pill);
                        background: rgba(0,0,0,.78); color: var(--st-ok-fg);
                        box-shadow: inset 0 0 0 1px rgba(127,224,214,.45);
                        font-size: 11px; font-weight: 700; }
/* Фото, которое Ozon показывает покупателям прямо сейчас, — по нему и идёт сбор. */
/* Метки и крестик лежат поверх фото, а не поверх темы: подложка светлая,
   поэтому чернила заданы явно тёмными, а не переменной темы. */
.abvariant-photo .tag.now { background: rgba(255,255,255,.92); color: #17181a; }
/* padding: 0 обязателен — общее правило кнопок даёт 10px/20px, и крестик
   раздувало в широкую плашку поверх фото вместо круга 26×26. */
.ab-del-variant { position: absolute; right: 10px; top: 10px; width: 26px; height: 26px;
                  padding: 0; display: inline-flex; align-items: center; justify-content: center;
                  border: 0; border-radius: 50%; background: rgba(0,0,0,.78);
                  color: rgba(255,255,255,.86); font-size: 12px; line-height: 1;
                  cursor: pointer; box-shadow: inset 0 0 0 1px rgba(255,255,255,.22); }
.ab-del-variant:hover { background: var(--bad); color: #2a0f0b; box-shadow: none; }
.abvariant-head { display: flex; align-items: baseline; justify-content: space-between;
                  padding: 0 4px; }
.abvariant-label { font-size: 18px; font-weight: 700; letter-spacing: -.02em; }
.abvariant-ctr { font-size: 18px; font-weight: 600; letter-spacing: -.02em;
                 font-variant-numeric: tabular-nums; }
.abvariant-ctr.thin { color: var(--disabled); }
.abvariant-stats { display: flex; flex-direction: column; gap: 6px; padding: 0 4px;
                   margin: 0; }
.abvariant-stats div { display: flex; justify-content: space-between; font-size: 12px; }
.abvariant-stats dt { color: var(--muted); }
.abvariant-stats dd { margin: 0; font-variant-numeric: tabular-nums; }
.abvariant-note { margin: 2px 4px 0; padding-top: 10px; border-top: 1px solid var(--line);
                  font-size: 11.5px; color: var(--muted-2); text-wrap: pretty; }
.abvariant.add { border: 1px dashed var(--disabled); background: none;
                 align-items: center; justify-content: center; gap: 10px;
                 aspect-ratio: 3 / 4.4; cursor: pointer; text-align: center; }
.abvariant.add:hover { border-color: var(--text); }
.abvariant.add .plus { width: 34px; height: 34px; border-radius: var(--r-pill);
                       background: rgba(255,255,255,.10); color: var(--text-2); font-size: 18px;
                       display: flex; align-items: center; justify-content: center; }
.abvariant.add .t { font-size: 13px; font-weight: 600; }
.abvariant.add .n { font-size: 11.5px; color: var(--muted-2); padding: 0 8px;
                    text-wrap: pretty; }

/* Вывод — одна тёмная полоса: раньше он тонул в трёх абзацах подряд. */
/* Вывод — выделенная полоса. На светлой теме она была тёмной; на тёмной
   выделяем наоборот, подложкой и рамкой. */
.abresult { display: flex; align-items: center; gap: 18px; background: var(--card-active);
            border: 1px solid var(--line); box-shadow: var(--sh-card);
            border-radius: 20px; padding: 18px 22px; margin-bottom: 20px; }
.abresult .k { display: block; font-size: 11px; font-weight: 600; letter-spacing: .1em;
               text-transform: uppercase; color: var(--muted-2); margin-bottom: 4px; }
.abresult .v { font-size: 17px; font-weight: 600; letter-spacing: -.02em; color: var(--text); }
.abresult button { height: 38px; padding: 0 20px; border-radius: var(--r-pill);
                   border: 0; font: inherit; font-size: 13.5px; font-weight: 600;
                   cursor: pointer; }
.abresult .ghost { background: none; border: 1px solid var(--line-strong); color: var(--text-2); }
.abresult .ghost:hover { border-color: var(--text); color: var(--text); }
.abresult .accent { background: var(--accent-grad); color: var(--accent-ink); }
.abdraft { font-size: 13px; color: var(--muted); padding: 14px 2px 4px;
           margin-bottom: 16px; text-wrap: pretty; }
.abnote { color: var(--muted); font-size: 13px; margin-bottom: 16px; }

/* История окон — под раскрывашкой: в карточке важны варианты и вывод, а окон
   за сутки набирается полсотни строк. Закрыта по умолчанию. */
.abwins > summary { display: flex; align-items: center; gap: 10px; cursor: pointer;
  list-style: none; padding: 10px 2px; font-size: 15px; font-weight: 600; }
.abwins > summary::-webkit-details-marker { display: none; }
.abwins > summary::before { content: "\203A"; color: var(--muted-2); font-size: 13px; width: 12px; }
.abwins[open] > summary::before { content: "\2304"; }
.abwins > summary:hover .t { color: var(--text); }
.abwins > summary .n { color: var(--muted); font-size: 13px; font-weight: 400; }
.abwins > .abwindows { padding-top: 6px; }

.abwindows { display: flex; flex-direction: column; gap: 6px; }
.abwindow { display: grid; grid-template-columns: 190px 130px 1fr; gap: 12px;
  font-size: 13px; padding: 8px 12px; border-radius: var(--r-row); background: var(--st-na-bg); }
.abwindow.ok { background: transparent; border: 1px solid var(--line); }
.abwindow.invalid { background: var(--st-err-bg); color: var(--st-err-fg); }
@media (max-width: 700px) {
  .abwindow { grid-template-columns: 1fr; gap: 2px; }
}

/* Подтверждение действия — вместо системного confirm().
   Одно окно на все места: обычное действие и опасное (danger). */
.confirmwrap { position: fixed; inset: 0; z-index: 90; display: flex;
               align-items: center; justify-content: center; padding: 24px; }
.confirmwrap[hidden] { display: none; }
.confirmback { position: absolute; inset: 0; background: rgba(0,0,0,.62);
               animation: cfade 160ms ease; }
.confirmbox { position: relative; width: min(452px, 100%); background: var(--surface);
              border-radius: 26px; padding: 30px 30px 24px;
              box-shadow: var(--sh-modal);
              display: flex; flex-direction: column; gap: 12px;
              animation: crise 200ms cubic-bezier(.2,.8,.3,1); }
.confirmbox .kicker { font-size: 11px; font-weight: 600; letter-spacing: .1em;
                      text-transform: uppercase; color: var(--muted-2); }
.confirmbox.danger .kicker { color: var(--up); }
.confirmbox .ctitle { font-size: 21px; font-weight: 600; letter-spacing: -.025em;
                      color: var(--text); line-height: 1.25; text-wrap: pretty; }
.confirmbox .ctext { font-size: 14px; line-height: 1.5; color: var(--text-2);
                     text-wrap: pretty; }
.confirmbox .ctext:empty { display: none; }
.confirmacts { display: flex; gap: 10px; justify-content: flex-end; margin-top: 10px; }
.confirmacts button { height: 42px; border-radius: var(--r-pill); border: 0;
                      font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
                      transition: background 140ms ease, color 140ms ease; }
/* Города в окне копирования: набор запросов разводят сразу по нескольким,
   поэтому отметки, а не выпадающий список. */
.copylabel { font-size: 11px; font-weight: 600; letter-spacing: .1em;
             text-transform: uppercase; color: var(--muted-2); margin-top: 4px; }
.cityfind { height: 38px; border-radius: 12px; border: 0; padding: 0 12px;
            background: var(--card); color: var(--text); font: inherit; font-size: 14px;
            box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.cityfind:focus { outline: none; box-shadow: inset 0 0 0 1px var(--accent); }
.copyregions { display: flex; flex-direction: column; gap: 2px;
               max-height: 214px; overflow-y: auto; margin: -2px -6px; padding: 2px 6px; }
.copycity { display: flex; align-items: center; gap: 10px; padding: 7px 10px;
            border-radius: 12px; font-size: 14px; color: var(--text);
            cursor: pointer; }
.copycity:hover { background: var(--card); }
.copycity.same { color: var(--muted-2); cursor: default; }
.copycity.same:hover { background: none; }
.copycity input { width: 16px; height: 16px; accent-color: var(--accent); cursor: inherit; }

/* Отчёт живёт в том же окне, но шире: девять колонок в 452 пикселя не влезают. */
.reportbox { width: min(980px, 100%); }
.reportbody { max-height: min(52vh, 460px); overflow: auto; margin-top: 4px; }
.rephead, .reprow { display: grid; align-items: center; gap: 8px;
                    grid-template-columns: 22px minmax(150px, 1fr) repeat(7, 74px); }
.rephead { padding: 0 10px 8px; font-size: 11px; font-weight: 500; color: var(--muted-2); }
.rephead .c, .reprow .c { text-align: center; }
.reprow { padding: 9px 10px; border-radius: var(--r-row); background: var(--card);
          margin-bottom: 5px; font-size: 13px; cursor: pointer;
          font-variant-numeric: tabular-nums; }
.reprow:hover { background: var(--card-hover); }
.reprow.taken { opacity: .45; cursor: default; }
.reprow .q { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reprow input { accent-color: var(--accent); }
.report-open { height: 52px; border-radius: 16px; flex: none; }

.confirmacts .cno { padding: 0 22px; background: transparent; color: var(--text-2); }
.confirmacts .cno:hover { background: var(--card-hover); color: var(--text); }
.confirmacts .cyes { padding: 0 26px; background: var(--accent-grad); color: var(--accent-ink);
                     box-shadow: 0 2px 10px rgba(0,0,0,.4); }
.confirmacts .cyes:hover { background: var(--accent-grad-hi); }
.confirmbox.danger .cyes { background: var(--up); color: #2a0f0b;
                           box-shadow: 0 2px 10px rgba(255,122,107,.25); }
.confirmbox.danger .cyes:hover { background: #ff9c90; }
@keyframes cfade { from { opacity: 0; } }
@keyframes crise { from { opacity: 0; transform: translateY(10px) scale(.98); } }

/* Пометки на запросах и словах: кружок слева от текста красит строку.
   Разметка личная, живёт в браузере — цвет нужен, чтобы глаз цеплялся. */
.sqtable td.qcell { display: flex; align-items: center; gap: 8px; }
.qmark { width: 12px; height: 12px; flex: none; padding: 0; border-radius: 50%;
         border: 1.5px solid var(--line-strong); background: none; box-shadow: none;
         cursor: pointer; transition: background .15s ease, border-color .15s ease; }
.qmark:hover { border-color: var(--muted-2); background: none; }
.qmark.mark-warn { background: #e8c34a; border-color: #e8c34a; }
.qmark.mark-ok { background: var(--accent-2); border-color: var(--accent-2); }
.qmark.mark-bad { background: var(--up); border-color: var(--up); }
.sqtable tr.marked.mark-warn td { background: rgba(232,195,74,.12); }
.sqtable tr.marked.mark-ok td { background: rgba(52,211,153,.12); }
.sqtable tr.marked.mark-bad td { background: rgba(255,122,107,.12); }
.qenote { margin: 8px 0 0; font-size: 12.5px; color: var(--muted-2); }

/* Любой столбец отчёта сортируется кликом по заголовку. */
.sqtable th { cursor: pointer; user-select: none; }
.sqtable th:hover { color: var(--text); }
.sqtable th.sorted-asc::after { content: " ↑"; color: var(--accent); }
.sqtable th.sorted-desc::after { content: " ↓"; color: var(--accent); }

/* ---------- Распределение по кластерам ---------- */
.split-lead { margin: 4px 0 16px; font-size: 13px; max-width: 780px; }
.splitform { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end;
             margin-bottom: 14px; }
.splitform .fld { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.splitform .fld label { font-size: 11px; color: var(--muted-2); }
.splitform .fld.ac { position: relative; flex: 1 1 260px; }
.splitform input, .splitform select { background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-pill); padding: 9px 14px; color: var(--text); font: inherit;
  font-size: 14px; }
.splitform input[type="number"] { width: 130px; }
.splitform .ac-list { top: 100%; }

.splitwh { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
           gap: 6px 14px; margin: 10px 0 12px; }
.splitwh-item { display: flex; align-items: center; gap: 8px; font-size: 13px;
                color: var(--text-2); cursor: pointer; }
.splitwh-item.blocked { color: var(--muted); cursor: default; }
.splitwh-item input { accent-color: var(--accent-2); width: 15px; height: 15px; }
.splitwh-actions { display: flex; gap: 8px; }
.splitwh-actions .ghost { background: none; border: 1px solid var(--line-strong);
                          color: var(--text-2); padding: 7px 14px; }
.splitwh-actions .ghost:hover { border-color: var(--text); color: var(--text); }

.splithead { margin: 18px 0 10px; }
.splithead-title { font-size: 16px; font-weight: 700; letter-spacing: -.02em; }
.splithead-sub { font-size: 12px; color: var(--muted-2); margin-top: 3px; }
.splitsrc { margin-top: 12px; }
.splitsrc-seg { margin: 0 0 12px; }
.splitdrop { margin: 0 0 14px; }
.splitdrop-note { font-size: 12px; color: var(--muted-2); margin-top: 6px; }
.splitdrop-file { font-size: 12.5px; color: var(--accent); margin-top: 8px; }

/* Кампания теста правится прямо в шапке: системное окно ввода в тёмной панели
   выглядит чужим, а менять её приходится каждый раз, когда заводят новую. */
.abfield { border: none; background: none; box-shadow: none; padding: 0 2px;
           font: inherit; color: var(--accent); cursor: pointer;
           border-bottom: 1px dashed rgba(110,231,183,.5); border-radius: 0; }
.abfield:hover { background: none; color: var(--text); border-bottom-color: var(--text); }
.abfield:disabled { color: var(--muted-2); border-bottom-style: dotted; cursor: default; }
.abfield-input { width: 120px; padding: 2px 8px; font: inherit; font-size: 12px;
                 background: var(--card); border: 1px solid var(--accent-2);
                 border-radius: var(--r-pill); color: var(--text); }

/* Крупное фото при наведении на миниатюру. Панель висит поверх всего: таблицы
   прокручиваются внутри себя, и выросшая миниатюра обрезалась бы их краем. */
.photo-peek { position: fixed; z-index: 200; width: 280px; height: 280px;
              padding: 8px; background: var(--surface);
              border: 1px solid var(--line); border-radius: var(--r-block);
              box-shadow: var(--sh-modal); pointer-events: none; }
.photo-peek img { width: 100%; height: 100%; object-fit: contain;
                  border-radius: var(--r-row); background: var(--card); }
