/* Панель StroyMir: вид как у нынешней админки — токены и элементы sm-* из ../site/sm-panel-7jqrx/view/stylesheet/stroymir-admin.css
   (те же значения, что у сайта; меняются вместе). Bootstrap не нужен: шапка, меню, формы, кнопки, таблицы — здесь. Цвета — только var(--…). */
:root {
  color-scheme: light;
  --brand: #006dff; --brand-d: #0057cc; --brand-l: #e8f1ff; --brand-l2: #d6e6ff; --btn: #006dff; --btn-h: #0057cc;
  --text: #1d2433; --muted: #5b6577; --line: #e3e7ee; --soft: #f4f6fa; --bg: #fff;
  --card: #fff; --field: #fff; --hover: #f7f9fc; --img: #fff;
  --ok: #1a7f37; --ok-l: #e9f6ee; --err: #c62828; --err-l: #fdecec; --warn: #b54708; --warn-l: #fff4e5;
  --dark: #151b26; --side: #f7f9fc; --side-2: #eef2f7; --side-text: #3a4356; --side-muted: #5f6878; --side-strong: #0b1220; --side-hover: rgba(21, 27, 38, .05); --side-hover-2: rgba(21, 27, 38, .08); --side-line: #e3e7ee;   /* боковая панель — светлая в светлой теме, тёмная в тёмной */
  --r: 10px; --shadow: 0 8px 28px rgba(21, 27, 38, .14); --shadow-s: 0 1px 2px rgba(21, 27, 38, .06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --hdr: 56px; --menu: 260px;
  --ctl: 40px; --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1.5 1.75l4.5 4.5 4.5-4.5' fill='none' stroke='%235b6577' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");   /* высота поля и кнопки в ряду; шеврон списка — цвета --muted */
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --brand: #5c9dff; --brand-d: #8ab8ff; --brand-l: rgba(92, 157, 255, .16); --brand-l2: rgba(92, 157, 255, .26); --btn: #2b70e3; --btn-h: #1f66db;
  --text: #e7eaf0; --muted: #9aa4b5; --line: #2b3544; --soft: #121822; --bg: #0e131b;
  --card: #18202b; --field: #121822; --hover: #1e2733; --img: #fff;
  --ok: #3fb96b; --ok-l: rgba(63, 185, 107, .14); --err: #ff6b6b; --err-l: rgba(255, 107, 107, .14); --warn: #f5a623; --warn-l: rgba(245, 166, 35, .14);
  --dark: #0a0e14; --side: #0b1017; --side-2: #080c12; --side-text: #b3bac6; --side-muted: #8b95a7; --side-strong: #fff; --side-hover: rgba(255, 255, 255, .04); --side-hover-2: rgba(255, 255, 255, .08); --side-line: rgba(255, 255, 255, .06);
  --shadow: 0 8px 28px rgba(0, 0, 0, .5); --shadow-s: 0 1px 2px rgba(0, 0, 0, .4);
  --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1.5 1.75l4.5 4.5 4.5-4.5' fill='none' stroke='%239aa4b5' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --brand: #5c9dff; --brand-d: #8ab8ff; --brand-l: rgba(92, 157, 255, .16); --brand-l2: rgba(92, 157, 255, .26); --btn: #2b70e3; --btn-h: #1f66db;
    --text: #e7eaf0; --muted: #9aa4b5; --line: #2b3544; --soft: #121822; --bg: #0e131b;
    --card: #18202b; --field: #121822; --hover: #1e2733; --img: #fff;
    --ok: #3fb96b; --ok-l: rgba(63, 185, 107, .14); --err: #ff6b6b; --err-l: rgba(255, 107, 107, .14); --warn: #f5a623; --warn-l: rgba(245, 166, 35, .14);
    --dark: #0a0e14; --side: #0b1017; --side-2: #080c12; --side-text: #b3bac6; --side-muted: #8b95a7; --side-strong: #fff; --side-hover: rgba(255, 255, 255, .04); --side-hover-2: rgba(255, 255, 255, .08); --side-line: rgba(255, 255, 255, .06);
    --shadow: 0 8px 28px rgba(0, 0, 0, .5); --shadow-s: 0 1px 2px rgba(0, 0, 0, .4);
  --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1.5 1.75l4.5 4.5 4.5-4.5' fill='none' stroke='%239aa4b5' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  }
}

/* ---------- основа */
* { box-sizing: border-box; }
html, body { margin: 0; font: 14px/1.5 var(--font); color: var(--text); background: var(--soft); -webkit-font-smoothing: antialiased; }
a { color: var(--brand-d); } a:hover { color: var(--brand-d); text-decoration-thickness: 2px; }   /* --brand-d: контраст ≥ 4.5 и на фоне страницы (--soft) */
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
::selection { background: var(--brand-l); }
code { color: var(--brand-d); background: var(--brand-l); border-radius: 5px; padding: 0 4px; }
h1, h2, h3 { color: var(--text); }
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
[hidden] { display: none !important; }
.htmx-request { opacity: .6; transition: opacity .2s; }

/* ---------- шапка (закреплена): меню на телефоне, логотип текстом как на сайте; справа — тема, язык, сайт, сотрудник, выход */
.top { position: fixed; top: 0; left: 0; right: 0; z-index: 30; display: flex; align-items: center; height: var(--hdr); background: var(--card); border-bottom: 1px solid var(--line); }
.top__brand { display: flex; align-items: center; width: var(--menu); height: 100%; padding: 0 18px; border-right: 1px solid var(--line); text-decoration: none; }
.logo { display: flex; flex-direction: column; line-height: 1.1; }
.logo b { font-size: 21px; font-weight: 800; letter-spacing: -.4px; color: var(--text); } .logo b span { color: var(--brand); }
.logo small { margin-top: 2px; font-size: 11.5px; color: var(--muted); }
.top__tools { display: flex; align-items: center; gap: 6px; margin-left: auto; padding: 0 12px; }
.btn-icon { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 36px; height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--card); color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; text-decoration: none; transition: border-color .15s, color .15s; }
.btn-icon:hover, .btn-icon:focus-visible { border-color: var(--brand); color: var(--brand); }
.lang { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.lang button { height: 34px; padding: 0 10px; border: 0; background: var(--card); color: var(--muted); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.lang button[aria-pressed="true"] { background: var(--brand-l); color: var(--brand-d); }
.who { display: flex; align-items: center; gap: 8px; padding-left: 6px; color: var(--text); font-weight: 600; }
.who form { margin: 0; }
.menu-toggle { display: none; }

/* ---------- левое меню (цвета — темы: светлое в светлой, тёмное в тёмной; закреплено, своя прокрутка без полосы); на телефоне выезжает по кнопке */
.side { position: fixed; top: var(--hdr); bottom: 0; left: 0; z-index: 20; display: flex; flex-direction: column; width: var(--menu); padding: 10px 0 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; background: var(--side); border-right: 1px solid var(--side-line); }
.side::-webkit-scrollbar { display: none; }
.side__title { padding: 16px 18px 6px; color: var(--side-muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.side a.item { display: flex; align-items: center; gap: 10px; padding: 9px 18px; color: var(--side-text); text-decoration: none; border-left: 3px solid transparent; }
.side a.item .ic { color: var(--side-muted); }
/* наведение — только мышью (на телефоне :hover «залипает» после касания) и слабее отмеченного: отмечен один пункт — синей полосой и подложкой */
@media (hover: hover) { .side a.item:hover { background: var(--side-hover); color: var(--side-strong); } }
.side a.item[aria-current="page"] { color: var(--side-strong); background: color-mix(in srgb, var(--brand) 20%, transparent); border-left-color: var(--brand); font-weight: 600; }
.side a.item[aria-current="page"] .ic { color: var(--brand); }
/* группы меню сворачиваются (<details>, _side.twig), стрелка справа; в свёрнутой — новое (счётчик) точкой у заголовка */
.side__group > summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; user-select: none; }
.side__group > summary::-webkit-details-marker { display: none; }
.side__group > summary::after { content: ''; order: 2; width: 6px; height: 6px; margin: 0 2px 0 auto; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(-45deg); transition: transform .15s; }
.side__group[open] > summary::after { transform: rotate(45deg); }
.side__group:not([open]):has(.side__count:not(:empty)) > summary::before { content: ''; order: 1; width: 7px; height: 7px; border-radius: 50%; background: #f5a623; }
.side__group > summary:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
@media (hover: hover) { .side__group > summary:hover { color: var(--side-text); } }
@media (prefers-reduced-motion: reduce) { .side__group > summary::after { transition: none; } }
.side__site { margin-top: auto; padding: 12px 14px 16px; border-top: 1px solid var(--side-line); }
.side__site a { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 8px 12px; border-radius: 8px; background: var(--btn); color: #fff; font-weight: 600; text-decoration: none; }
.side__site a:hover { background: var(--btn-h); color: #fff; }

/* ---------- страница */
main { min-height: 100vh; padding: calc(var(--hdr) + 18px) 24px 32px calc(var(--menu) + 24px); }
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 0 0 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.page-head h1 { margin: 0; font-size: 22px; font-weight: 700; }
.crumbs { display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; color: var(--muted); font-size: 13px; }
.crumbs li + li::before { content: "\203A"; padding-right: 6px; }
.crumbs a { color: var(--muted); text-decoration: none; } .crumbs a:hover { color: var(--brand); }
.page-head__actions { display: flex; gap: 6px; margin-left: auto; }

/* ---------- кнопки, поля, таблицы */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--ctl); padding: 7px 14px; border: 1px solid var(--btn); border-radius: 8px; background: var(--btn); color: #fff; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--btn-h); border-color: var(--btn-h); color: #fff; }
.btn--ghost { background: var(--card); border-color: var(--line); color: var(--text); } .btn--ghost:hover { background: var(--hover); border-color: var(--brand); color: var(--brand-d); }
.btn--danger { background: var(--err); border-color: var(--err); color: var(--bg); } .btn--danger:hover { filter: brightness(.92); background: var(--err); border-color: var(--err); color: var(--bg); }   /* текст — цвета фона: в тёмной на светло-красном тёмный (контраст ≥ 4.5) */
.btn--sm { min-height: 30px; padding: 4px 10px; font-size: 13px; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; color: var(--muted); font-size: 13px; font-weight: 600; }
.field small { font-weight: 400; }
/* поля — свой вид, без системного: поле, список, дата, число, поиск, файл — одна высота --ctl с кнопкой, одна рамка,
   радиус, фон, кольцо фокуса; :where — без веса, классы экранов (ширина, ячейка таблицы) перекрывают. Открытый список — системный (телефон, доступность) */
:where(input:not([type=checkbox], [type=radio], [type=hidden], [type=range], [type=color]), select, textarea) {
  appearance: none; width: 100%; min-height: var(--ctl); padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px;
  background-color: var(--field); color: var(--text); font: inherit; font-weight: 400; line-height: 1.5; }
:where(input:not([type=checkbox], [type=radio], [type=hidden], [type=range], [type=color], [type=file]), select:not([multiple], [size])) { height: var(--ctl); padding-top: 0; padding-bottom: 0; }
::placeholder { color: var(--muted); opacity: 1; }
/* список: стрелка-шеврон (--chev — цвет темы), длинное — многоточием, стрелка не налезает на текст */
:where(select:not([multiple], [size])) { padding-right: 34px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; cursor: pointer;
  background-image: var(--chev); background-repeat: no-repeat; background-position: right 12px center; background-size: 12px 8px; }
:where(select[multiple], select[size]) { padding: 4px; }
/* раскрытый список — в стиле панели, а не системный (Chrome, Edge — appearance: base-select, без своего JS: клавиатура и
   чтение экрана — как у обычного списка); Mac и Safari — системный (класс .pick ставит panel.js не на Mac; Safari base-select не умеет) */
@supports (appearance: base-select) {
  html.pick select:not([multiple], [size]), html.pick select:not([multiple], [size])::picker(select) { appearance: base-select; }
  html.pick select:not([multiple], [size]) { display: inline-flex; align-items: center; }   /* текст — по центру высоты, как у полей */
  html.pick select:not([multiple], [size])::picker-icon { display: none; }   /* шеврон — свой (--chev) */
  html.pick select::picker(select) { margin-block: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--text);
    box-shadow: var(--shadow); max-block-size: min(360px, 60vh); }
  html.pick select option { min-block-size: 36px; padding: 8px 12px; border-radius: 6px; white-space: normal; }
  html.pick select option:hover, html.pick select option:focus-visible { background: var(--hover); outline: none; }
  html.pick select option:checked { background: var(--brand-l); color: var(--brand-d); font-weight: 600; }
  html.pick select option::checkmark { display: none; }   /* выбранное — цветом строки */
  html.pick select option:disabled { color: var(--muted); }
  html.pick select optgroup { color: var(--muted); font-size: 12.5px; font-weight: 600; }
}
select[multiple] option { padding: 4px 8px; border-radius: 4px; }
input[type=number] { appearance: textfield; }   /* без крутилок: число — с клавиатуры (стрелки ↑↓ работают) */
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { appearance: none; margin: 0; }
input[type=search]::-webkit-search-decoration { appearance: none; }
input[type=date] { text-align: left; } input[type=date]::-webkit-date-and-time-value { text-align: left; }   /* iOS ставит дату по центру */
input[type=date]::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .75; }   /* цвет — от color-scheme темы: в тёмной светлый */
input[type=date]::-webkit-calendar-picker-indicator:hover { opacity: 1; }
:where(input[type=file]) { padding: 4px; cursor: pointer; }
input[type=file]::file-selector-button { height: 30px; margin-right: 10px; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
input[type=file]::file-selector-button:hover { border-color: var(--brand); color: var(--brand); }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-l); }
/* флажок и радио — свои (accent-color в тёмной теме не хватает): квадрат / круг, отметка белым по цвету кнопки, фокус — кольцо */
input[type=checkbox], input[type=radio] { appearance: none; position: relative; flex: none; width: 18px; height: 18px; margin: 0; border: 1.5px solid var(--muted); border-radius: 5px;
  background: var(--field) no-repeat center / 12px 12px; vertical-align: -4px; cursor: pointer; transition: background-color .12s, border-color .12s; }
input[type=radio] { border-radius: 50%; }
input[type=checkbox]:hover, input[type=radio]:hover { border-color: var(--brand); }
input[type=checkbox]:checked, input[type=checkbox]:indeterminate { border-color: var(--btn); background-color: var(--btn);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.3l2.4 2.4 4.6-5' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
input[type=checkbox]:indeterminate { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 6h6' stroke='%23fff' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); }
input[type=radio]:checked { border-color: var(--btn); background: radial-gradient(circle, #fff 0 3px, var(--btn) 3.5px); }
input[type=checkbox]:focus-visible, input[type=radio]:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
input[type=checkbox]:disabled, input[type=radio]:disabled { opacity: .5; cursor: not-allowed; }
@media (pointer: coarse) { input[type=checkbox]::before, input[type=radio]::before { content: ""; position: absolute; inset: -12px; } }   /* касание — 40 px и у флажка без подписи (в таблице) */
/* без права: поле видно, но не меняется и не уходит с формой — пунктирная рамка, курсор «нельзя» */
input:disabled, select:disabled, textarea:disabled { background-color: transparent; border-style: dashed; border-color: var(--muted); color: var(--muted); cursor: not-allowed; }
.field.has-err :is(input, select, textarea):focus { box-shadow: 0 0 0 3px var(--err-l); }
/* флажок с подписью: нажимается вся подпись; на телефоне — строка не ниже 40 px */
.check { display: inline-flex; align-items: center; gap: 8px; min-height: 24px; color: var(--text); font-weight: 400; cursor: pointer; }
.check:has(input:disabled) { color: var(--muted); cursor: not-allowed; }
@media (pointer: coarse) { .check { min-height: 40px; } }
table.sm-table { width: 100%; border-collapse: collapse; }
.sm-table th, .sm-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.sm-table th { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.sm-table tbody tr:hover td { background: var(--hover); }
.table-wrap { overflow-x: auto; }
.alert { margin: 0 0 12px; padding: 9px 12px; border-radius: 8px; background: var(--err-l); color: var(--err); }

/* ================= Готовые элементы для экранов (sm-*) — макросы templates/panel/ui.twig, образец — «Елементи панелі» (/ui) */
/* карточка: .sm-card > .sm-card__head (заголовок h3, справа .sm-card__actions) + .sm-card__body; .sm-card--flat — без тени */
.sm-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-s); margin-bottom: 18px; }
.sm-card--flat { box-shadow: none; }
.sm-card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.sm-card__head h3, .sm-card__title { margin: 0; font-size: 15px; font-weight: 600; color: var(--text); }
.sm-card__head h3 .ic { color: var(--brand); margin-right: 6px; }
.sm-card__actions { display: flex; flex-wrap: wrap; gap: 6px; }
.sm-card__body { padding: 16px; }
fieldset.sm-card__body { margin: 0; border: 0; min-width: 0; }   /* тело карточки-группы полей одного права: disabled — вся группа только для чтения */
.sm-card__foot { padding: 10px 16px; border-top: 1px solid var(--line); background: var(--soft); border-radius: 0 0 var(--r) var(--r); }
/* сетка: .sm-grid (авто, от 220 px), .sm-grid--2 / --3 / --4 — колонки; на телефоне — одна */
.sm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.sm-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sm-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sm-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 991px) { .sm-grid--3, .sm-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 599px) { .sm-grid--2, .sm-grid--3, .sm-grid--4 { grid-template-columns: 1fr; } }
/* показатель: .sm-stat > .sm-stat__label, .sm-stat__value, .sm-stat__delta (.is-up / .is-down) */
.sm-stat { padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.sm-stat__label { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.sm-stat__value { margin-top: 2px; font-size: 26px; font-weight: 700; line-height: 1.15; color: var(--text); font-variant-numeric: tabular-nums; }
.sm-stat__delta { margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.sm-stat__delta.is-up { color: var(--ok); }
.sm-stat__delta.is-down { color: var(--err); }
/* статус: .sm-badge + --ok / --warn / --err / --info / --muted */
.sm-badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.6; white-space: nowrap; background: var(--soft); color: var(--muted); border: 1px solid var(--line); }
.sm-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.sm-badge--ok { background: var(--ok-l); color: var(--ok); border-color: transparent; }
.sm-badge--warn { background: var(--warn-l); color: var(--warn); border-color: transparent; }
.sm-badge--err { background: var(--err-l); color: var(--err); border-color: transparent; }
.sm-badge--info { background: var(--brand-l); color: var(--brand-d); border-color: transparent; }
.sm-badge--plain::before { display: none; }
/* пояснение: .sm-note (+ --ok / --warn / --err) — блок с полосой слева */
.sm-note { margin: 0 0 14px; padding: 10px 14px; border-left: 4px solid var(--brand); border-radius: 8px; background: var(--brand-l); color: var(--text); font-size: 13.5px; }
.sm-note--ok { border-color: var(--ok); background: var(--ok-l); }
.sm-note--warn { border-color: var(--warn); background: var(--warn-l); }
.sm-note--err { border-color: var(--err); background: var(--err-l); }
/* пусто: .sm-empty > .sm-empty__icon (svg или .fa), .sm-empty__title, p, кнопка */
.sm-empty { padding: 34px 16px; text-align: center; color: var(--muted); }
.sm-empty__icon { color: var(--muted); margin-bottom: 8px; } .sm-empty__icon .ic { width: 34px; height: 34px; }
.sm-empty__title { margin-bottom: 4px; font-size: 15px; font-weight: 600; color: var(--text); }
.sm-empty p { margin: 0 0 12px; }
/* «метка — значение»: dl.sm-kv > dt + dd */
.sm-kv { display: grid; grid-template-columns: minmax(120px, max-content) minmax(0, 1fr); gap: 6px 16px; margin: 0; }
.sm-kv dt { color: var(--muted); font-weight: 500; }
.sm-kv dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }   /* длинное имя, IBAN, ключ — переносом, а не за край карточки */
/* панель фильтров и действий над таблицей: .sm-toolbar (поля и кнопки в ряд, переносятся) */
.sm-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-bottom: 14px; }
.sm-toolbar__end { margin-left: auto; display: flex; gap: 6px; }
/* таблица модуля: .table.sm-table — без внешней рамки, числа — по правому краю (.sm-num) */
.sm-num, td.sm-num, th.sm-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* мелкое: .sm-muted, .sm-mono, .sm-nowrap, .sm-gap (отступ между элементами в ряд) */
.sm-muted { color: var(--muted); }
.sm-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.sm-nowrap { white-space: nowrap; }
.sm-gap { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
/* скелет загрузки: .sm-skel (мигает), высота — своя */
.sm-skel { border-radius: 8px; background: var(--soft); animation: sm-adm-blink 1.2s ease-in-out infinite; min-height: 14px; }
@keyframes sm-adm-blink { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .sm-skel { animation: none; } }


/* ---------- страницы без каркаса: вход, ошибка, заглушка витрины */
body.plain { display: block; }
.error { max-width: 560px; margin: 15vh auto; padding: 0 16px; text-align: center; } .error h1 { font-size: 48px; margin: 0 0 8px; } .error h1 b { color: var(--brand); }
.login { max-width: 380px; margin: 12vh auto; padding: 0 16px; } .login .logo { align-items: center; margin-bottom: 18px; }
.login form { padding: 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-s); }
.login .btn { width: 100%; margin-top: 4px; }

/* ---------- окно помощника: плавающее, как консультант сайта (перетащить за заголовок, растянуть за уголок, свернуть в кнопку); на телефоне — во весь экран */
.as-fab { position: fixed; right: 16px; bottom: 16px; z-index: 40; display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px; border: 0; border-radius: 999px; background: var(--btn); color: #fff; font: inherit; font-weight: 600; box-shadow: var(--shadow); cursor: pointer; }
.as-fab:hover { background: var(--btn-h); }
.as { position: fixed; right: 16px; bottom: 16px; z-index: 50; display: flex; flex-direction: column; width: min(400px, calc(100vw - 32px)); height: min(560px, calc(100vh - var(--hdr) - 32px));
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.as.is-drag { user-select: none; opacity: .96; }
.as__head { display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 14px; background: var(--btn); color: #fff; cursor: move; touch-action: none; user-select: none; }
.as__head h2 { flex: 1; margin: 0; color: #fff; font-size: 15px; }
.as__head button { display: inline-flex; padding: 4px; border: 0; border-radius: 6px; background: transparent; color: #fff; cursor: pointer; }
.as__head button:hover { background: rgba(255, 255, 255, .16); }
.as__msgs { flex: 1; display: flex; flex-direction: column; gap: 6px; padding: 12px; overflow-y: auto; }
.msg { max-width: 92%; padding: 8px 10px; border-radius: var(--r); } .msg.me { align-self: flex-end; background: var(--brand-l); } .msg.bot { background: var(--soft); }
.as form { display: flex; gap: 6px; padding: 10px; border-top: 1px solid var(--line); }
.as textarea { resize: none; min-height: 40px; }
.as__grip { position: absolute; right: 0; bottom: 0; width: 18px; height: 18px; cursor: nwse-resize; touch-action: none;
  background: linear-gradient(135deg, transparent 50%, var(--line) 50%, var(--line) 60%, transparent 60%, transparent 70%, var(--line) 70%, var(--line) 80%, transparent 80%); }

/* ---------- телефон и планшет */
@media (max-width: 767px) {
  .top__brand { width: auto; border: 0; padding: 0 10px; }
  .menu-toggle { display: inline-flex; margin-left: 8px; }
  .top__tools { gap: 4px; padding: 0 8px; }
  .top__tools .btn-icon span:not(.av), .who__name { display: none; }   /* подписи прячем, кружок с инициалами — нет (правка: пустая кнопка «Мій профіль» на 390 px) */
  .side { left: calc(-1 * var(--menu)); transition: left .2s; box-shadow: none; }
  body.menu-open .side { left: 0; box-shadow: var(--shadow); }
  main { padding: calc(var(--hdr) + 14px) 14px 90px; }
  .page-head h1 { font-size: 19px; }
  .as { inset: 0 !important; width: auto !important; height: auto !important; border-radius: 0; border: 0; }
  .as__grip { display: none; }
  .as-fab { width: 52px; height: 52px; padding: 0; justify-content: center; }   /* на телефоне — только значок: «таблетка» закрывала поля и «Зберегти» */
  .as-fab span { display: none; }
}
@media (prefers-reduced-motion: reduce) { .side { transition: none; } }

h2 { margin: 22px 0 10px; font-size: 16px; }
.sm-card__head h3 { display: flex; align-items: center; }

/* ---------- товары: список, карточка, редактор описания */
/* строка отборов: поиск шире, списки поровну — на 1366 ровно в 2 ряда, на телефоне — столбиком */
.filters > input[type=search] { flex: 2 1 240px; width: auto; min-width: 0; }
.filters > select { flex: 1 1 140px; width: auto; min-width: 0; max-width: 260px; }
.sm-table.products td.thumb { width: 52px; padding-top: 5px; padding-bottom: 5px; }
.sm-table.products img, .row img { width: 40px; height: 40px; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; background: var(--img); }
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.product__grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr); gap: 16px; min-width: 0; margin: 0; padding: 0; border: 0; }
@media (max-width: 1180px) { .product__grid { grid-template-columns: minmax(0, 1fr); } }
.product__col { display: grid; gap: 16px; align-content: start; min-width: 0; }
.product__col > .sm-card { margin: 0; }
.field.has-err input, .field.has-err textarea, .field.has-err select, .field.has-err .ed { border-color: var(--err); }
.field .err { color: var(--err); font-size: 12.5px; font-weight: 400; }
.lang button.has-err::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 5px; border-radius: 50%; background: var(--err); vertical-align: 2px; }
.count { float: right; color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; }
.count.is-off { color: var(--warn); font-weight: 600; }
.prefixed { display: flex; align-items: center; gap: 4px; }
.prefixed > span { flex: none; font-weight: 400; }
.rows { display: grid; gap: 6px; margin-bottom: 10px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.row__grow { flex: 1 1 160px; min-width: 0; overflow-wrap: anywhere; }
.attrs td { padding: 5px 6px; } .attrs td:first-child { width: 40%; padding-top: 12px; }
.history ul { margin: 0; padding-left: 16px; }
.ed { border: 1px solid var(--line); border-radius: 8px; background: var(--field); color: var(--text); font-weight: 400; }
.ed__bar { position: sticky; top: var(--hdr); z-index: 2; display: flex; flex-wrap: wrap; gap: 2px; padding: 4px; border-bottom: 1px solid var(--line); border-radius: 8px 8px 0 0; background: var(--card); }
.ed__bar button { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 30px; padding: 0 8px; border: 0; border-radius: 6px; background: none; color: var(--text); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.ed__bar button:hover, .ed__bar button[aria-pressed="true"] { background: var(--brand-l); color: var(--brand-d); }
.ed__bar button:disabled { opacity: .35; cursor: default; }
.ed__bar .ed__italic { font-style: italic; }
.ed__area { min-height: 260px; max-height: 70vh; padding: 10px 14px; overflow: auto; line-height: 1.6; outline: none; }
.ed__area:focus { box-shadow: inset 0 0 0 2px var(--brand-l); }
.ed__area[contenteditable=false] { color: var(--muted); }
.ed:has(.ed__src:disabled) { border-style: dashed; border-color: var(--muted); }
.ed__area h2 { margin: 16px 0 6px; font-size: 19px; } .ed__area h3 { margin: 14px 0 6px; font-size: 16px; }
.ed__area p { margin: 0 0 8px; } .ed__area ul, .ed__area ol { margin: 0 0 8px; padding-left: 22px; } .ed__area > :first-child { margin-top: 0; }
textarea.ed__src { min-height: 260px; border: 0; border-radius: 0 0 8px 8px; font: 12.5px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; resize: vertical; }
/* разделы деревом: отмеченные — кнопками сверху, ветки — с отступом и стрелкой */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px 3px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--soft); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.chip::after { content: '×'; color: var(--muted); font-size: 16px; line-height: 1; }
.chip:hover { border-color: var(--muted); } .chip:hover::after { color: var(--err); }
.tree { margin-top: 8px; }   /* без своей прокрутки: ветки свёрнуты, большое — поиском */
.chip--ro { cursor: default; } .chip--ro::after { content: none; }
.tree__row { display: flex; align-items: center; gap: 2px; min-height: 30px; }
.tree__row.d1 { padding-left: 22px; } .tree__row.d2 { padding-left: 44px; } .tree__row.d3 { padding-left: 66px; } .tree__row.d4 { padding-left: 88px; }
/* линии уровней: у ветки видно, чей это раздел (по линии на каждый уровень вложенности, под стрелкой родителя) */
.tree__row.d1, .tree__row.d2, .tree__row.d3, .tree__row.d4 { background: repeating-linear-gradient(to right, transparent 0 11px, var(--line) 11px 12px, transparent 12px 22px) no-repeat 0 0 / var(--tree-w) 100%; }
.tree__row.d1 { --tree-w: 22px; } .tree__row.d2 { --tree-w: 44px; } .tree__row.d3 { --tree-w: 66px; } .tree__row.d4 { --tree-w: 88px; }
.tree__tog { width: 24px; height: 24px; flex: none; display: inline-grid; place-items: center; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; }
.tree__tog .ic { width: 14px; height: 14px; transition: transform .15s; }
.tree__tog[aria-expanded="true"] .ic { transform: rotate(90deg); }
button.tree__tog:hover { background: var(--soft); color: var(--text); }
@media (max-width: 767px) { .tree__tog { width: 32px; height: 32px; } .tree__row.d1 { padding-left: 26px; } .tree__row.d2 { padding-left: 52px; } .tree__row.d3 { padding-left: 78px; } .tree__row.d4 { padding-left: 104px; } }
@media (max-width: 767px) { .tree__row.d1, .tree__row.d2, .tree__row.d3, .tree__row.d4 { background-image: repeating-linear-gradient(to right, transparent 0 15px, var(--line) 15px 16px, transparent 16px 26px); } .tree__row.d1 { --tree-w: 26px; } .tree__row.d2 { --tree-w: 52px; } .tree__row.d3 { --tree-w: 78px; } .tree__row.d4 { --tree-w: 104px; } }   /* под палец */
.tree .check { flex: 1; min-width: 0; }
/* сканер: окно QR, точка «телефон подключён», всплывающее «отримано код», страница сканера на телефоне */
/* узкое окно с мышью — «Сканер» не нужен (шапке на 375 px нужно место под «Вийти»); телефон (сенсорный экран) — нужен: камера окном,
   а «Сайт» там есть в меню; на странице сканера телефона для компьютера камера уже есть */
@media (max-width: 600px) and (pointer: fine) { [data-scan-open] { display: none; } }
@media (max-width: 600px) and (pointer: coarse) { .top__tools > a.btn-icon[target] { display: none; } }
body:has([data-scan-phone]) [data-scan-open] { display: none; }
@media (pointer: coarse) { [data-scan-open]:not([data-scan-cam]) { display: none; } }   /* камера на телефоне — только Продавцю и Комірнику (scan.camera) */
.scan-dlg.scan-cam { width: min(560px, calc(100vw - 16px)); padding: 12px 12px 16px; }   /* после .scan-dlg ниже — потому двойной класс */
.scan-cam__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; } .scan-cam__head h2 { margin: 0; }
.scan-cam .scan { max-width: none; } .scan-cam > .sm-muted { margin: 12px 0 0; }
.scan-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok, #16a34a); }
.scan-dlg { width: min(420px, calc(100vw - 32px)); padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--text); box-shadow: var(--shadow); }
.scan-dlg::backdrop { background: rgba(15, 23, 42, .45); }
.scan-dlg h2 { margin: 0 0 8px; font-size: 18px; }
.scan-dlg__qr { display: block; width: 240px; height: 240px; margin: 12px auto; border-radius: 8px; background: #fff; }
.scan-dlg__state { font-weight: 600; }
.scan-dlg__state[data-now="on"] { color: var(--ok, #16a34a); } .scan-dlg__state[data-now="expired"], .scan-dlg__state[data-now="off"] { color: var(--muted); }
.scan-dlg__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.scan-toast { position: fixed; left: 50%; bottom: 76px; z-index: 60; transform: translateX(-50%); max-width: calc(100vw - 32px); padding: 10px 16px; border-radius: 999px; background: var(--text); color: var(--bg); font-weight: 600; box-shadow: var(--shadow); }
.scan { display: grid; gap: 12px; max-width: 520px; }
.scan.is-hit .scan__view { animation: scan-hit .5s; }   /* код распознан — рамка мигнула (вибрации без касания браузер не даёт) */
@keyframes scan-hit { from { box-shadow: 0 0 0 4px var(--ok, #16a34a); } to { box-shadow: 0 0 0 0 transparent; } }
.scan__view { position: relative; border-radius: 12px; overflow: hidden; background: #000; }   /* окно камеры — горизонтальное, как штрихкод, линия прицела по центру */
.scan__view:has(.scan__video[hidden]) { display: none; }
.scan__view::after { content: ''; position: absolute; left: 8%; right: 8%; top: 50%; height: 2px; background: rgba(239, 68, 68, .85); box-shadow: 0 0 6px rgba(239, 68, 68, .8); pointer-events: none; }
.scan__video { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.scan__manual { display: flex; gap: 8px; align-items: flex-end; } .scan__manual .field { flex: 1; margin: 0; }
.scan__list { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; font-family: var(--mono, ui-monospace, monospace); }
.scan__list li { padding: 6px 10px; border-radius: 8px; background: var(--soft); } .scan__list li.is-ok::before { content: '✓ '; color: var(--ok, #16a34a); } .scan__list li.is-err { color: var(--err); }
/* фото: поле загрузки в карточке — выбрать или перетащить; ход по каждому файлу — строкой под полем (плитка — раздел «фото товара» в конце файла) */
.drop { margin-bottom: 12px; }
.drop__zone { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 14px 16px; border: 2px dashed var(--line); border-radius: 10px; background: var(--soft); color: var(--text); cursor: pointer; }
.drop__zone:hover, .drop__zone:focus-within, .drop.is-drop .drop__zone { border-color: var(--brand); background: var(--brand-l); }
.drop__zone:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }
.drop__zone input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }   /* выбор файла — подписью; поле доступно с клавиатуры */
.drop__zone .ic { width: 22px; height: 22px; color: var(--brand); flex: none; }
.drop__zone small { flex-basis: 100%; color: var(--muted); font-weight: 400; }
.drop__list { display: grid; gap: 6px; margin: 8px 0 0; padding: 0; list-style: none; font-size: 12.5px; }
.drop__list:empty { display: none; }
.drop__list li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(60px, 140px) auto; align-items: center; gap: 4px 10px; }
.drop__list b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.drop__list .drop__state { color: var(--muted); }
.drop__list li.is-err { grid-template-columns: minmax(0, auto) minmax(0, 1fr); color: var(--err); }
.drop__list li.is-err .drop__state { color: var(--err); overflow-wrap: anywhere; }
.drop__list progress { display: block; width: 100%; height: 6px; margin: 0; border: 0; border-radius: 3px; background: var(--line); color: var(--brand); -webkit-appearance: none; appearance: none; }
.drop__list progress::-webkit-progress-bar { border-radius: 3px; background: var(--line); }
.drop__list progress::-webkit-progress-value { border-radius: 3px; background: var(--brand); }
.drop__list progress::-moz-progress-bar { border-radius: 3px; background: var(--brand); }

/* ---------- «Система → API» — новый ключ: поле во всю ширину и «Скопіювати» рядом */
.api-token { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.api-token input { flex: 1 1 260px; min-width: 0; }
.api-top { margin-bottom: 18px; }
.api-top > .sm-card { margin: 0; }
.api-keys { margin-bottom: 72px; }   /* место под плавающую «Помічник»: «Вимкнути» в последней строке не прячется под ней */

/* ---------- справочники каталога: разделы деревом, бренды, характеристики, единицы */
.dict-tree .tree__row { flex-wrap: wrap; column-gap: 8px; padding-top: 2px; padding-bottom: 2px; border-bottom: 1px solid var(--line); }   /* отступ уровня (d1–d4) не перебивать — иначе дочерние разделы не видны деревом */
.dict__name { flex: 1 1 180px; min-width: 0; overflow-wrap: anywhere; }
.dict__meta { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; margin-left: auto; font-size: 13px; }
.dict__img { display: block; width: 120px; height: 120px; margin: -4px 0 12px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; background: var(--img); }
.dict__one { max-width: 760px; }
.dict__del { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.dict__del p, .dict__del form { margin: 0; }
.dict-table td.thumb { width: 52px; padding-top: 5px; padding-bottom: 5px; }
.dict-table img { width: 40px; height: 40px; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; background: var(--img); }

/* ---------- список «Товари» — правка в строке, масові зміни, колонки, «від — до» */
.filters .range { display: inline-flex; align-items: center; gap: 6px; height: var(--ctl); color: var(--muted); font-size: 13px; font-weight: 600; }
.filters .range input { width: 84px; }
.cols { position: relative; }
.cols > summary { list-style: none; } .cols > summary::-webkit-details-marker { display: none; }
.cols__list { position: absolute; z-index: 20; right: 0; top: calc(100% + 4px); display: grid; gap: 6px; min-width: 200px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); box-shadow: var(--shadow); }
@media (max-width: 599px) {   /* «Колонки» — справа, список открывается влево от края */
  .filters > input[type=search], .filters > select, .filters > .range { flex: 1 1 100%; min-width: 0; max-width: none; }
  .filters .range > span:first-child { flex: 0 0 72px; } .filters .range input { flex: 1 1 0; width: 0; min-width: 0; }
  .filters > button, .filters > .cols { flex: 1 1 0; } .filters .cols > summary { width: 100%; } }
.bulk > summary, .batches > summary { cursor: pointer; list-style: none; flex-wrap: wrap; justify-content: flex-start; }
.bulk > summary::-webkit-details-marker, .batches > summary::-webkit-details-marker { display: none; }
.bulk > summary::before, .batches > summary::before { content: '▸'; color: var(--muted); } .bulk[open] > summary::before, .batches[open] > summary::before { content: '▾'; }
.bulk:not([open]) > summary, .batches:not([open]) > summary { border-bottom: 0; }
.sm-table.products td.name { min-width: 200px; }   /* на телефоне таблица листается вбок внутри себя, а название не рвётся по слову в строке */
.bulk__scope { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0 0 10px; padding: 0; border: 0; min-width: 0; }
.bulk__scope legend { padding: 0; margin-bottom: 6px; color: var(--muted); font-size: 13px; font-weight: 600; }
.bulk__do .field { margin: 0; } .bulk__do select { width: auto; min-width: 120px; max-width: 100%; }
.bulk__for { display: contents; } .bulk__for[hidden] { display: none; }
.bulk__do input[name=value] { width: 120px; }
.bulk__cats { flex: 1 1 280px; } .bulk__cats select { width: 100%; }
.bulk__preview { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.bulk__preview .sm-toolbar { margin: 10px 0 0; align-items: center; }
td.bulk__new { color: var(--ok); font-weight: 600; }
.bulk-undo { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.sm-table td.pick, .sm-table th.pick { width: 32px; }
a.sort { color: inherit; text-decoration: none; } a.sort:hover { color: var(--brand); }
.cell-msg { min-height: 21px; margin: 0 0 6px; font-size: 13px; } .cell-msg.is-ok { color: var(--ok); } .cell-msg.is-err { color: var(--err); }
.cell { display: inline-block; min-width: 1.5em; padding: 1px 4px; margin: -1px -4px; border-radius: 4px; border: 1px dashed transparent; cursor: text; }
.cell:hover, .cell:focus-visible { border-color: var(--muted); background: var(--hover); }
.cell.is-busy { opacity: .55; }
.cell.is-saved { animation: cell-ok 1.5s; }
.cell.is-err { border-color: var(--err); background: var(--err-l); }
@keyframes cell-ok { from { background: var(--ok-l); box-shadow: 0 0 0 2px var(--ok); } to { background: transparent; box-shadow: none; } }
@media (prefers-reduced-motion: reduce) { .cell.is-saved { animation: none; outline: 2px solid var(--ok); } }
input.cell__in, select.cell__in { width: 110px; height: 32px; min-height: 32px; padding: 3px 6px; }
select.cell__in { padding-right: 24px; background-position: right 7px center; }
.sm-num input.cell__in { text-align: right; }

/* ---------- контент сайта и адреса: вкладки-ссылки, превью картинки, списки */
.sm-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 14px; border-bottom: 1px solid var(--line); }
.sm-tabs a { padding: 8px 12px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 600; text-decoration: none; }
.sm-tabs a:hover { color: var(--text); }
.sm-tabs a[aria-current="page"] { color: var(--brand-d); border-bottom-color: var(--brand); }
.content__image { display: flex; align-items: flex-end; gap: 10px; } .content__image .field { flex: 1; min-width: 0; }
.content__thumb { width: 48px; height: 48px; flex: none; margin-bottom: 12px; object-fit: cover; border: 1px solid var(--line); border-radius: 6px; background: var(--img); }
.content-list td.thumb { width: 60px; padding-top: 5px; padding-bottom: 5px; } .content-list td.thumb .content__thumb { margin: 0; }
.content-list td.sm-mono { min-width: 150px; overflow-wrap: anywhere; }   /* длинные адреса — переносом, но столбец не уже 150 px (на телефоне таблица листается в .table-wrap) */
.content__narrow { max-width: 720px; }
.reviews td:nth-child(3) { min-width: 220px; }
/* ---------- подсказка от названия в пустом поле блока «Тексти» — серым, с пометкой у подписи; правит человек — обычный текст */
.field.is-hint input { color: var(--muted); font-style: italic; }
.field.is-hint > span:first-child::after { content: attr(data-hint-text); display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 6px; background: var(--brand-l); color: var(--text); font-size: 11.5px; font-weight: 400; }
/* ---------- акції в картці товару (кожна — сіткою полів, нова — шаблоном) і колонка «Акція» в списку */
.promo { padding: 12px 0; border-top: 1px solid var(--line); } .promo:first-child { padding-top: 4px; border-top: 0; }
.promo__head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-bottom: 10px; font-size: 13px; }
.promo__on { align-self: end; }
.promos:has(.promo) + .promos__none { display: none; }
td.promo-cell { min-width: 120px; }

/* ---------- свой штрихкод в карточке, «Друк етикеток» в списке, лист этикеток A4 (размеры в мм — из data-* через CSS-переменные, panel.js) */
.barcode-gen { margin: 4px 0 12px; }
.barcode-gen__h { margin: 0 0 6px; color: var(--muted); font-size: 13px; font-weight: 600; }
.barcode-gen__row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.barcode-gen__row input.barcode-gen__qty { width: 90px; }
.barcode-gen__row select { width: auto; }
#barcode-msg .sm-note { margin: 8px 0 0; }
.labels-pick { align-items: center; margin: 0 0 10px; }
.labels-edit__grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 0 18px; align-items: start; }
@media (max-width: 991px) { .labels-edit__grid { grid-template-columns: minmax(0, 1fr); } }
.labels-add { display: flex; align-items: flex-end; gap: 8px; } .labels-add .field { flex: 1; min-width: 0; } .labels-add .btn { margin-bottom: 12px; }
.labels-items input.labels-n { width: 76px; text-align: right; }
.labels-items td { vertical-align: middle; }
.labels-opts { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 12px; }
.labels-sizes > summary { cursor: pointer; margin-bottom: 10px; color: var(--muted); font-size: 13px; font-weight: 600; }
.labels-sizes input[readonly] { background: transparent; border-style: dashed; color: var(--muted); }
/* лист: бумага всегда белая, текст чёрный — и в тёмной теме */
.labels-print { --w: 70mm; --h: 37mm; --cols: 3; --top: .5mm; --left: 0mm; --gx: 0mm; --gy: 0mm; --dx: 0mm; --dy: 0mm; --k: 1; }
.sheet { position: relative; width: 210mm; height: 297mm; overflow: hidden; background: #fff; color: #000; }
.sheet__grid { position: absolute; top: calc(var(--top) + var(--dy)); left: calc(var(--left) + var(--dx)); display: grid;
  grid-template-columns: repeat(var(--cols), var(--w)); grid-auto-rows: var(--h); column-gap: var(--gx); row-gap: var(--gy); }
.label { display: flex; flex-direction: column; justify-content: center; gap: .4mm; min-width: 0; padding: 1.2mm 3mm; overflow: hidden; container-type: size;
  font: 400 10pt/1.15 Arial, Helvetica, sans-serif; text-align: center; }
.label > * { font-size: clamp(5pt, 9cqh, 10pt); }   /* от высоты этикетки: cqh — у детей контейнера (у самого .label — от экрана) */
.labels-print--cut .label { outline: .2mm dashed #777; outline-offset: -.1mm; }
.label__name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-weight: 700; overflow-wrap: anywhere; }
.label__code { display: flex; flex: 1 1 0; flex-direction: column; align-items: center; justify-content: center; min-height: 0; }
.label__code .ean { display: block; flex: 1 1 0; width: 100%; max-width: 46mm; min-height: 3mm; max-height: 25mm; }   /* модуль ≈ 0,3 мм; высота — что осталось */
.label__digits { font: 400 .9em/1.1 monospace; letter-spacing: .08em; white-space: nowrap; }
.label__digits--only { font-weight: 700; font-size: 1.3em; white-space: normal; overflow-wrap: anywhere; }
.label__meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.label__sum { font-weight: 700; }
.label > .label__price { font-size: clamp(9pt, 19cqh, 22pt); font-weight: 700; line-height: 1.05; white-space: nowrap; } .label__price small { font-size: .5em; font-weight: 400; }
.label--small { gap: .2mm; }
.label--price .label__code { max-height: 45%; }
.labels-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
@media screen {
  .labels-print { display: grid; gap: 18px; justify-items: start; margin-bottom: 72px; }
  .sheet { zoom: var(--k); box-shadow: var(--shadow); outline: 1px solid var(--line); }
}
@media print {
  body:has(.labels-print) { background: #fff; }
  body:has(.labels-print) > :not(main), body:has(.labels-print) .page > :not(.labels-print) { display: none !important; }
  body:has(.labels-print) main { min-height: 0; padding: 0; }
  .sheet { break-after: page; }
  .sheet:last-child { break-after: auto; }
}
/* строки листа на телефоне — без прокрутки вбок, «×» на экране */
@media (max-width: 600px) { .labels-items td.sm-nowrap { white-space: normal; } .labels-items td .sm-mono { display: block; }
  .labels-items input.labels-n { width: 56px; } .labels-items th, .labels-items td { padding-left: 6px; padding-right: 6px; } }
/* ошибка блока карточки вне поля (разделы, характеристики) — красным, как у поля */
.sm-card__body > .err { display: block; color: var(--err); font-size: 12.5px; margin: 4px 0; }

/* ---------- поля — свои (основа — «кнопки, поля, таблицы» выше), ряды экранов ровные */
.sm-toolbar > .field { margin-bottom: 0; }   /* в ряду поля и кнопка стоят ровно по нижнему краю */
/* сетка полей: у поля — три строки сетки (подпись, поле, ошибка, subgrid): подписи по верху, поля — на одной линии, даже если у соседа
   подсказка в 2 строки или ошибка; флажок — на линии полей */
.sm-grid:has(> .field) { row-gap: 4px; } .sm-grid:has(> .field) > * { grid-row: span 3; }   /* зазор между рядами — отступ поля (12 px) */
.sm-grid:has(> .field) > .field { display: grid; grid-template-rows: subgrid; align-content: start; }
.sm-grid:has(> .field) > .field > .check { grid-row: 2; }
.labels-pick > .sm-muted { flex: 1 1 260px; min-width: 0; }   /* подсказка переносится сама, кнопки не уходят за край */
@media (max-width: 599px) {
  .bulk__do > .field, .bulk__for > .field, .bulk__do > button, #bulk-values { flex: 1 1 100%; }   /* «Масові зміни» на телефоне — столбиком */
  .bulk__do select, .bulk__do input[name=value] { width: 100%; }
}

/* ---------- «Каталог → Фільтр каталогу» — кружки тонів, як Filter::TONES (на сайті — smf__sw теми); поле з помилкою в рядку таблиці */
.filter-tones { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 12px; }
.filter-tone { display: inline-flex; align-items: center; gap: 6px; }
.filter-sw { flex: none; width: 18px; height: 18px; border-radius: 50%; box-shadow: 0 0 0 1px var(--line); }   /* обводка видна и у белого, и у чёрного в тёмной */
.filter-sw--bilyj { background: #ffffff; } .filter-sw--bezhevyj { background: #e3d2b4; } .filter-sw--siryj { background: #9aa1a9; } .filter-sw--chornyj { background: #2f3338; }
.filter-sw--korychnevyj { background: #7a5230; } .filter-sw--blakytnyj { background: #5b9bd5; } .filter-sw--zelenyj { background: #69a84f; } .filter-sw--zhovtyj { background: #f0b43c; }
.filter-sw--chervonyj { background: #d6544f; }
.filter-sw--wood { background: repeating-linear-gradient(100deg, #b98a57 0 3px, #9a6c3f 3px 5px, #c99b66 5px 9px); }
.filter-sw--stone { background: radial-gradient(circle at 30% 35%, #f1f1ef 0 18%, transparent 19%), radial-gradient(circle at 70% 65%, #b9bcc0 0 14%, transparent 15%), linear-gradient(135deg, #d9dadc, #9fa3a8); }
.filter-sw--pattern { background: conic-gradient(from 45deg, #e8e8e8 0 25%, #b8c4d6 0 50%, #e8e8e8 0 75%, #b8c4d6 0) 0 0 / 8px 8px; }
.filter-table input.cell__in { width: 90px; } .filter-table select.cell__in { width: 160px; } .filter-table select.filter-here { width: 220px; } .filter-table select.filter-tone-sel { width: 290px; }
.filter-table .cell__in.is-err { border-color: var(--err); }
@media (max-width: 599px) { .filter-table select.cell__in, .filter-table select.filter-here, .filter-table select.filter-tone-sel { width: 150px; } }   /* телефон: таблица уже, листается в .table-wrap */
/* «Порядок» на вкладке «Характеристики» виден и на 1024 px */
.filter-table select.cell__in { width: 130px; }

/* ---------- «Система → Інтеграції» — карточки сервисов: поле ключа растягивается, кнопки рядом; место под «Помічник» внизу */
/* группы интеграций; карточки группы — колонками (CSS columns): высота у каждой своя, пустот под короткими нет */
.integr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 14px; align-items: start; margin-bottom: 72px; }
.integr__group { min-width: 0; }
.integr__group:has(> .integr__cards--cols), #integr-g-ai { grid-column: 1 / -1; }   /* пошта (кілька карток) і Claude (таблиці) — на всю ширину; одиночні — по дві в ряд */
@media (max-width: 767px) { .integr { grid-template-columns: minmax(0, 1fr); } }
.integr__gh { margin: 0 0 10px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.integr__cards--cols { columns: 2 380px; column-gap: 14px; }
.integr__cards > .sm-card { margin: 0; }
.integr__cards--cols > .sm-card { break-inside: avoid; margin: 0 0 14px; }
.integr .sm-card__head h3 { display: flex; align-items: center; gap: 10px; }
.integr__ic { display: inline-grid; flex: none; place-items: center; width: 32px; height: 32px; border-radius: 8px; color: var(--ic, var(--brand)); background: color-mix(in srgb, var(--ic, var(--brand)) 14%, transparent); }
.integr .sm-card__head h3 .integr__ic .ic { display: block; width: 18px; height: 18px; margin: 0; color: inherit; }   /* сильнее «.sm-card__head h3 .ic» (отступ справа сдвигал значок в плашке) */
.integr__ic--telegram { --ic: #229ed9; }
.integr__ic--novaposhta { --ic: #e2231a; }
.integr__ic--anthropic { --ic: #d97757; }
.integr .sm-toolbar { margin-bottom: 10px; }
.integr .sm-toolbar > .field { flex: 1 1 220px; min-width: 0; }
.integr .sm-card__body > p { margin-top: 0; }
.integr__state { margin: 0 0 12px; font-weight: 600; }
.integr__more form { margin: 0; }
/* ---------- закреплённые разделы меню — кнопки у пункта (закріпити, вище, нижче): на компьютере — при наведении и с клавиатуры,
   на телефоне (шторка меню) — всегда; закреплённый пункт в своей группе — значок виден всегда (залит). Место под значок группы занято всегда (текст не прыгает);
   три кнопки «Закріплені» на компьютере — поверх конца строки при наведении (длинное название не переносится из-за пустого места) */
.side__row { display: flex; align-items: center; padding-right: 6px; }
.side__row a.item { flex: 1; min-width: 0; padding-right: 4px; }
.side__tools { display: flex; flex: none; align-items: center; }
/* подложка отмеченного и наведённого — на весь ряд, с кнопками (полоса слева — у ссылки, как была) */
.side__row:has(> a.item[aria-current="page"]) { background: color-mix(in srgb, var(--brand) 20%, transparent); }
.side__row > a.item[aria-current="page"] { background: none; }
@media (hover: hover) { .side__row:hover { background: var(--side-hover); } .side__row > a.item:hover { background: none; } }
.side__btn { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 28px; height: 30px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--side-muted); cursor: pointer; }
.side__btn .ic { width: 16px; height: 16px; }
.side__btn:disabled { opacity: .35; cursor: default; }
.side__btn:focus-visible { outline-offset: -2px; }
.side__up .ic { transform: rotate(-90deg); }
.side__down .ic { transform: rotate(90deg); }
.side__pin[aria-pressed="true"] { color: var(--brand); }
.side__pin[aria-pressed="true"] .ic { fill: currentColor; }
.side[aria-busy="true"] .side__btn { cursor: progress; }
@media (hover: hover) and (pointer: fine) { .side__btn:hover:not(:disabled) { background: var(--side-hover-2); color: var(--side-strong); } }
@media (hover: hover) and (pointer: fine) and (min-width: 768px) {   /* шторка (уже 768) — кнопки видны всегда, как на телефоне */
  .side__btn:not([aria-pressed="true"]) { opacity: 0; }
  .side__row:hover .side__btn, .side__row:has(:focus-visible) .side__btn { opacity: 1; }
  .side__row:hover .side__btn:disabled, .side__row:has(:focus-visible) .side__btn:disabled { opacity: .35; }
  /* «Закріплені»: всё и так закреплено — кнопки при наведении, поверх текста, подложкой ряда (обычной, наведённой, отмеченной) */
  .side__row[data-pinned] { position: relative; }
  .side__row[data-pinned] a.item { padding-right: 18px; }
  .side__tools { position: absolute; top: 0; right: 0; bottom: 0; padding: 0 6px 0 14px; opacity: 0; background: linear-gradient(to right, transparent, var(--side) 12px); }
  .side__row:hover .side__tools, .side__row:has(:focus-visible) .side__tools { opacity: 1; }
  .side__row:hover .side__tools { background: linear-gradient(to right, transparent, color-mix(in srgb, var(--side-strong) 4%, var(--side)) 12px); }
  .side__row:has(> a.item[aria-current="page"]) .side__tools { background: linear-gradient(to right, transparent, color-mix(in srgb, var(--brand) 20%, var(--side)) 12px); }
}
/* поле ключа — текстовое (не пароль: менеджер паролей браузера его не берёт), введённое скрыто маской */
.integr input[name=value] { -webkit-text-security: disc; }
/* на телефоне кнопки закрепления 40×40 (палец), шторка шире; черта между «Закріплені» и «Головна»; отступ поверх ссылки не глотает щелчок */
@media (max-width: 767px) { :root { --menu: min(320px, 86vw); } }
@media (pointer: coarse) { .side__btn { width: 40px; height: 40px; } }
.side__row[data-pinned] + a.item { margin-top: 10px; border-top: 1px solid var(--side-line); }
.side__tools { pointer-events: none; } .side__tools .side__btn { pointer-events: auto; }

/* «Пошта (SMTP)» — одна форма: порт уже остальных полей, состояние пароля — своей строкой под полем, «Зберегти» — под ним */
.integr__server .field:has(select[name=port]) { flex: 0 1 170px; }
.integr__server .integr__state { flex-basis: 100%; margin: 0; }

/* «Telegram-бот» — вебхук (длинный адрес и кнопка «Переключити бота з …» переносятся); «Мій профіль» — QR и разделы; имя в шапке — ссылка на профиль */
.integr__hook { margin: 0 0 12px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.integr__hook p { margin: 0 0 8px; }
.integr__url, .integr__hook .btn { overflow-wrap: anywhere; }
.integr__hook .btn { text-align: left; }
.profile { align-items: start; }
.profile > .sm-card { margin: 0; }
.profile__sections fieldset { display: grid; gap: 8px; margin: 0 0 14px; padding: 0; border: 0; min-width: 0; }
.profile__sections legend { margin-bottom: 8px; padding: 0; font-weight: 600; }
.profile__off { margin-top: 14px; }
.profile__link { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.profile__link p { margin: 0 0 10px; }
.profile__qr { width: 200px; height: 200px; border-radius: 8px; background: #fff; }
.who__me[aria-current="page"] { border-color: var(--brand); color: var(--brand); }
.profile .sm-card__body > p:first-child { margin-top: 0; }
.who__name { max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* «Система → Сповіщення»: раздел — блоком (названия, порядок; флажки переносятся), события — сеткой, группы — блоками с флажками */
.notify > .sm-card, .notify__groups { margin: 0 0 16px; }
.notify__sec { margin: 0 0 14px; padding: 0 0 14px; border: 0; border-bottom: 1px solid var(--line); min-width: 0; }
.notify__sec:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }
.notify__names { margin-bottom: 8px; }
.notify__flags, .notify__roles, .notify__gform, .notify__ghead { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; }
.notify__roles { gap: 6px 12px; }
.notify__del { margin-left: auto; }
.notify__add { margin: 0 0 16px; }
.notify__group { padding: 12px 0; border-top: 1px solid var(--line); }
.notify__group > * + * { margin-top: 8px; }
.notify .sm-card__body > p.sm-muted:first-child, .notify__groups .sm-card__body > p.sm-muted:first-child { margin-top: 0; }
@media (max-width: 600px) { .top__tools > a.btn-icon[target] { display: none; } }   /* телефон: место под «Мій профіль»; сайт — «Відкрити сайт» внизу меню */
/* «Інтеграції» → «Claude (Anthropic)» — на всю ширину; место — строкой (название, модель, режим, лимит), на телефоне — столбиком;
   адрес теста — адрес + подпись; «Витрати» — сегодня и за месяц */
#integr-anthropic { min-width: 0; }   /* min-width — таблица «Витрати» листается внутри себя, карточка не шире экрана */
.claude__sec { margin: 16px 0 0; padding: 16px 0 0; border-top: 1px solid var(--line); }
.claude__sec h4 { margin: 0 0 6px; font-size: 15px; }
.claude__sec > p.sm-muted { margin: 0 0 12px; }
/* ряд — по верху (ошибка под «Ліміт» не сдвигает соседние поля); назва — на уровне полей */
.claude__place { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.3fr) minmax(0, 1.3fr) minmax(0, 120px); gap: 0 12px; align-items: start; padding-top: 8px; border-bottom: 1px solid var(--line); }
.claude__name { padding-top: 22px; margin-bottom: 12px; font-weight: 600; }
.claude__name small { display: block; color: var(--muted); font-weight: 400; }
.claude__notes { grid-column: 1 / -1; }
.claude__notes .sm-note { margin: 0 0 10px; }
/* строка «Разом» и «Зберегти моделі» — справа место под плавающую «Помічник», снизу — отступ */
.claude__save { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 12px 0 16px; padding-right: 168px; }   /* справа — место под плавающую «Помічник» */
.claude__sum { margin: 0; font-weight: 600; }
.claude__ip { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 0 12px; align-items: end; }
.claude__ipdel { margin-bottom: 12px; }   /* «Видалити» — в ряд с полями (отступ поля снизу — 12 px) */
.claude__lost { color: var(--warn); }
.claude__mine { margin-top: 12px; }
.claude__mine .field { flex: 1 1 260px; min-width: 0; }
.claude__mine-state { margin: 0; font-weight: 600; }
.claude__spend small { display: block; color: var(--muted); font-size: 12.5px; }   /* в строку: на телефоне таблица листается вбок внутри себя (.table-wrap), а не рвётся по слову */
.claude__total td { font-weight: 600; border-bottom: 0; }
@media (max-width: 767px) { .claude__place { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .claude__name { grid-column: 1 / -1; padding-top: 0; margin-bottom: 4px; } .claude__save { padding-right: 68px; } }
@media (max-width: 479px) { .claude__place, .claude__ip { grid-template-columns: minmax(0, 1fr); } .claude__ipdel { justify-self: start; } }

/* ---------- «Звернення» — компьютер (от 1100 px): список 360 px слева, переписка справа, у каждой своя прокрутка; планшет и телефон — список,
   нажали — переписка во весь экран («← Звернення»), поле ответа закреплено внизу, плавающая «Помічник» на телефоне скрыта (закрыла бы «Надіслати») */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* фото сотрудника — круг; нет фото — инициалы на постоянном цвете по номеру (белый текст — контраст ≥ 4.5 на всех восьми) */
.av { display: inline-grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50%; object-fit: cover; overflow: hidden; background: #57606a; color: #fff;
  font-size: 12.5px; font-weight: 700; line-height: 1; letter-spacing: .02em; }
.av--xs { width: 22px; height: 22px; font-size: 9.5px; } .av--sm { width: 36px; height: 36px; font-size: 13px; } .av--top { width: 26px; height: 26px; font-size: 10.5px; }
.av--lg { width: 96px; height: 96px; font-size: 32px; }
.av--c0 { background: #1f62d6; } .av--c1 { background: #7a4bd0; } .av--c2 { background: #b1347c; } .av--c3 { background: #c2252f; }
.av--c4 { background: #8a5a00; } .av--c5 { background: #1a7f37; } .av--c6 { background: #0b6f91; } .av--c7 { background: #57606a; }
.who__me .av { margin: 0 -2px; }
.side__count { margin-left: auto; padding: 0 7px; border-radius: 999px; background: #f5a623; color: #151b26; font-size: 11.5px; font-weight: 700; line-height: 18px; }
.side__count:empty { display: none; }
.sup { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.sup__side { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.sup__search input { width: 100%; }
.sup__tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.sup__tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 13px; font-weight: 600; text-decoration: none; }
.sup__tabs a:hover { border-color: var(--brand); color: var(--brand-d); }
.sup__tabs a[aria-current="page"] { border-color: transparent; background: var(--brand-l); color: var(--brand-d); }
.sup__n { min-width: 18px; padding: 0 5px; border-radius: 999px; background: #f5a623; color: #151b26; font-size: 11.5px; line-height: 18px; text-align: center; }
.sup__list { margin: 0 -12px -12px; border-top: 1px solid var(--line); }
.sup__found { margin: 0; padding: 8px 12px 0; font-size: 12.5px; }
.sup__row { position: relative; display: flex; align-items: flex-start; gap: 10px; padding: 10px 28px 10px 12px; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; }
.sup__row:hover { background: var(--hover); color: var(--text); }
.sup__row[aria-current="page"] { background: var(--brand-l); box-shadow: inset 3px 0 0 var(--brand); }
.sup__main { display: flex; flex: 1; flex-direction: column; gap: 1px; min-width: 0; }
.sup__top { display: flex; align-items: baseline; gap: 8px; }
.sup__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.sup__when { flex: none; color: var(--muted); font-size: 12px; }
.sup__meta { display: flex; align-items: center; gap: 4px; min-width: 0; overflow: hidden; color: var(--muted); font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
.sup__meta .ic { width: 14px; height: 14px; }
.sup__last { overflow: hidden; color: var(--muted); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.sup__row.is-unread .sup__last { color: var(--text); font-weight: 600; }
.sup__wait { color: var(--muted); font-size: 12px; } .sup__wait.is-late { color: var(--warn); font-weight: 700; }
.sup__lead { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; }
.sup__dot { position: absolute; top: 50%; right: 12px; width: 9px; height: 9px; margin-top: -4px; border-radius: 50%; background: var(--brand); }
.sup__pane { display: flex; flex-direction: column; min-width: 0; }
.sup__pane > .sm-note { margin-bottom: 10px; }
.sup__pane > .sm-empty { flex: 1; display: grid; place-content: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.sup__live { display: flex; flex: 1; flex-direction: column; min-height: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--r) var(--r) 0 0; }
.sup__head { display: grid; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.sup__back { display: none; align-items: center; gap: 4px; justify-self: start; font-weight: 600; text-decoration: none; } .sup__back .ic { transform: rotate(180deg); }
.sup__title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; } .sup__title h2 { margin: 0; font-size: 17px; }
.sup__cust { font-size: 13.5px; } .sup__cust dd { min-width: 0; overflow-wrap: anywhere; }
.sup__orders { display: flex; flex-direction: column; }
.sup__acts { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; } .sup__acts form { margin: 0; }
.sup__take { min-width: 180px; font-size: 15px; }
.sup__more > summary, .sup__prod > summary { list-style: none; } .sup__more > summary::-webkit-details-marker, .sup__prod > summary::-webkit-details-marker { display: none; }
.sup__menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 12; display: grid; gap: 10px; width: min(300px, calc(100vw - 48px)); padding: 12px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.sup__menu .btn { width: 100%; } .sup__transfer .field { margin-bottom: 8px; }
.sup__msgs { display: flex; flex: 1; flex-direction: column; gap: 10px; padding: 14px 16px; background: var(--soft); }
.sup__ev { align-self: center; max-width: 100%; margin: 0; padding: 2px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--muted); font-size: 12px; text-align: center; }
.sup__msg { display: flex; flex-direction: column; max-width: min(80%, 560px); }
.sup__msg--customer { align-self: flex-start; } .sup__msg--staff { align-self: flex-end; align-items: flex-end; }
.sup__by { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 3px; color: var(--muted); font-size: 12px; }
.sup__bubble { padding: 8px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); overflow-wrap: anywhere; }
.sup__msg--staff .sup__bubble { border-color: transparent; background: var(--brand-l); }
.sup__bubble p { margin: 0; }
.sup__time { display: block; margin-top: 4px; color: var(--muted); font-size: 11.5px; text-align: right; }
.sup__st--sent { color: var(--ok); } .sup__st--failed, .sup__st--blocked { color: var(--err); font-weight: 600; }
/* фото переписки — в рамке постоянного размера: опрос перерисовывает переписку, новое <img> до загрузки было бы нулевой высоты, и браузер (scroll anchoring)
   сдвигал бы прочитанное на высоту фото; фото — целиком внутри рамки, маленькое (стикер) — своего размера, не растягивается */
.sup__img { display: flex; align-items: center; justify-content: center; width: 240px; max-width: 100%; height: 180px; margin-bottom: 6px; overflow: hidden; border-radius: 8px;
  background: var(--img); }
.sup__img img { display: block; max-width: 100%; max-height: 100%; height: auto; }   /* width / height у <img> — размер в рамке (Support::photo): место до загрузки, пропорции на узком */
.sup__pdf { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 6px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); font-weight: 600; text-decoration: none; }
.sup__compose { padding: 10px 16px 12px; background: var(--card); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--r) var(--r); }
.sup__compose > .sm-note, .sup__why { margin: 0; }
.sup__quick { display: flex; gap: 6px; margin-bottom: 6px; padding-bottom: 6px; overflow-x: auto; scrollbar-width: thin; }
.sup__chip { flex: none; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--soft); color: var(--text); font: inherit; font-size: 12.5px; white-space: nowrap; cursor: pointer; }
.sup__chip:hover, .sup__chip:focus-visible { border-color: var(--brand); color: var(--brand-d); }
.sup__form textarea { min-height: 64px; max-height: 40vh; resize: vertical; }
.sup__tools { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
/* 📎 — кнопкой (поле файла прозрачное поверх неё), имя выбранного файла — в кнопке */
.sup__attach { position: relative; flex: 0 1 auto; min-width: 0; max-width: 100%; overflow: hidden; }
.sup__attach span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 24ch; }
.sup__attach input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.sup__attach:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }
.sup__muted { color: var(--muted); font-weight: 400; }
/* язык ответа обращения — как переключатель языка в шапке */
.sup__lang { display: inline-flex; margin: 0 0 0 auto; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.sup__lang button { height: 28px; padding: 0 9px; border: 0; background: var(--card); color: var(--muted); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.sup__lang button[aria-pressed="true"] { background: var(--brand-l); color: var(--brand-d); }
/* «Товар» и «⋯» — выпадают от края своего ряда, а не от кнопки: на телефоне не вылезают за экран */
.sup__prodbox { position: absolute; bottom: calc(100% + 6px); left: 0; right: 0; z-index: 12; max-width: 520px; padding: 10px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow); }
.sup__plist { max-height: 260px; margin: 8px 0 0; padding: 0; overflow-y: auto; list-style: none; }
.sup__pitem { display: flex; justify-content: space-between; gap: 10px; width: 100%; padding: 8px; border: 0; border-radius: 6px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.sup__pitem:hover, .sup__pitem:focus-visible { background: var(--hover); } .sup__pitem span { flex: none; color: var(--muted); white-space: nowrap; }
.sup__send { margin-left: auto; }
.sup__sign { margin: 6px 0 0; font-size: 12px; }
.sup__call { margin: 0 0 8px; } .sup__called .sm-toolbar { margin: 0; } .sup__called .field { flex: 1 1 240px; margin: 0; }
@media (min-width: 1100px) {
  .sup { grid-template-columns: 360px minmax(0, 1fr); height: calc(100dvh - var(--hdr) - 136px); min-height: 520px; }
  .sup__side, .sup__pane { min-height: 0; }
  .sup__list { flex: 1; overflow-y: auto; }
  .sup__msgs { min-height: 0; overflow-y: auto; }
}
@media (max-width: 1099px) {
  .sup.is-open .sup__side, .sup:not(.is-open) .sup__pane { display: none; }
  .sup__back { display: inline-flex; }
  .sup__compose { position: sticky; bottom: 0; z-index: 6; box-shadow: 0 -6px 16px rgba(21, 27, 38, .08); }
}
@media (max-width: 767px) {
  body:has([data-support]) .as-fab { display: none; }
  main:has([data-support]) { padding-bottom: 0; }
  .sup__msg { max-width: 88%; }
  .sup__head, .sup__msgs, .sup__compose { padding-left: 12px; padding-right: 12px; }
  /* на телефоне поле ответа компактнее — ниже поле, мельче подпись, имя файла короче */
  .sup__compose { padding-top: 8px; padding-bottom: 8px; }
  .sup__form textarea { height: 56px; min-height: 48px; }
  .sup__tools { gap: 6px; margin-top: 6px; }
  .sup__attach span { max-width: 12ch; }
  .sup__sign { margin-top: 4px; font-size: 11.5px; }
}
/* «Швидкі відповіді» и «Фото» в профиле */
fieldset.sup-r__row { min-width: 0; margin: 0 0 14px; padding: 0; }
.sup-r__names { margin-bottom: 4px; } .sup-r__add { margin: 0 0 16px; }
.sup-r__langs { display: flex; justify-content: flex-end; margin: 0 0 12px; }
.profile__av { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.profile__av h4 { margin: 0 0 10px; font-size: 14px; }
.profile__avrow { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 16px; }
.profile__avdo { flex: 1 1 220px; min-width: 0; } .profile__avdo p { margin: 0 0 8px; } .profile__avdo form { margin: 0 0 8px; }
.profile__avform input[type=file] { flex: 1 1 200px; width: auto; min-width: 0; }
/* ---------- канал «Пошта» в «Зверненнях» — письмо в переписке (HTML очищен, без картинок; цитата прошлой переписки — приглушённо), пометки, «Написати лист» */
.sup__tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; }
.sup__subj { display: block; margin-bottom: 4px; }
.sup__rej { margin: 6px 0 0; color: var(--muted); font-size: 12.5px; }
.sup__new { display: flex; flex: 1; flex-direction: column; min-height: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.sup__new .sup__head p { margin: 0; font-size: 12.5px; }
.sup__newform { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; overflow-y: auto; }
.sup__newform .field { margin: 0; }
.sup__newform textarea { min-height: 140px; max-height: none; }
.sup__people:empty { display: none; }
.sup__people { margin-top: 6px; padding: 4px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); box-shadow: var(--shadow); }
.sup__people .sup__plist { margin: 0; } .sup__people .sm-muted { margin: 4px 8px; font-size: 12.5px; }
.sup__people .sup__pitem span { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.integr__read { margin: 12px 0 0; padding-top: 12px; border-top: 1px solid var(--line); }
.integr__read .integr__state { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
/* «Деталі листа», пересланное письмо, «Спам», стоп-лист в карточке ящика */
.sup__det { margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.sup__det summary { cursor: pointer; }
.sup__det .sm-kv { margin: 6px 0 0; } .sup__det dd { min-width: 0; overflow-wrap: anywhere; }
.sup__fwd { margin-top: 8px; padding: 6px 0 6px 10px; border-left: 3px solid var(--line); }
.sup__fwd p { margin: 0 0 4px; } .sup__fwdh { color: var(--muted); font-size: 12.5px; }
.sup__spam { margin: 0 0 0 auto; }
.integr__block { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.integr__block h4 { margin: 0 0 8px; font-size: 14px; } .integr__block p { margin: 0; }
.integr__blockrow { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 6px; }
.integr__blockrow span { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 767px) {
  .sup__newform { padding-left: 12px; padding-right: 12px; }
  .sup__people .sup__pitem { flex-direction: column; gap: 0; }
}
/* ---------- «Пошта» contact@ — папки (телефон — ряд кнопок, компьютер — колонка слева), список, письмо, форма; HTML письма — рамкой, как в «Зверненнях» (.mail__frame) */
.mail { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.mail__folders { display: flex; flex-wrap: wrap; align-content: start; gap: 4px; min-width: 0; }
.mail__folders a { display: inline-flex; align-items: center; gap: 6px; min-width: 0; padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted);
  font-size: 13px; font-weight: 600; text-decoration: none; }
.mail__folders a:hover { border-color: var(--brand); color: var(--brand-d); }
.mail__folders a[aria-current="page"] { border-color: transparent; background: var(--brand-l); color: var(--brand-d); }
.mail__folders a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail__folders .ic { flex: none; width: 15px; height: 15px; }
.mail__n { flex: none; min-width: 18px; margin-left: auto; padding: 0 5px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 11.5px; line-height: 18px; text-align: center; }
.mail__pane { min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.mail__pane .sm-empty { padding: 32px 16px; }
.mail__search { display: flex; gap: 8px; padding: 12px; border-bottom: 1px solid var(--line); } .mail__search input[type=search] { flex: 1; min-width: 0; }
.mail__h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin: 0; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 16px; }
.mail__h small { font-size: 12.5px; font-weight: 400; }
.mail__hint { margin: 0; font-size: 12.5px; } .mail__pane > .mail__hint { padding: 8px 12px; border-bottom: 1px solid var(--line); }
.mail__hint .ic { width: 14px; height: 14px; margin-right: 4px; vertical-align: -2px; }
.mail__row { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 9px 12px; border-bottom: 1px solid var(--line);
  color: var(--text); text-decoration: none; }
a.mail__row:hover { background: var(--hover); color: var(--text); }
.mail__row.is-unread { box-shadow: inset 3px 0 0 var(--brand); }
.mail__row.is-unread .mail__who, .mail__row.is-unread .mail__subj { font-weight: 700; }
.mail__who, .mail__subj { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail__subj .ic { width: 14px; height: 14px; margin-right: 4px; vertical-align: -2px; color: var(--muted); }
.mail__date { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.mail__draft { grid-template-columns: minmax(0, 220px) minmax(0, 1fr) auto auto; } .mail__draft form { margin: 0; }
.mail__pages { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; padding: 12px; }
.mail__head { display: grid; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.mail__head h2 { margin: 0; font-size: 18px; overflow-wrap: anywhere; }
.mail__back { justify-self: start; font-weight: 600; text-decoration: none; }
.mail__kv { margin: 0; font-size: 13.5px; } .mail__kv dd { min-width: 0; overflow-wrap: anywhere; }
.mail__acts, .mail__ro { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; } .mail__acts form { display: flex; gap: 6px; min-width: 0; margin: 0; }
.mail__move select { width: auto; min-width: 0; max-width: 180px; height: 30px; min-height: 30px; font-size: 13px; }   /* в ряд с кнопками btn--sm */
.mail__body { padding: 14px 16px; }
.mail__text { margin: 0; overflow-wrap: anywhere; }
.mail__files { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; } .mail__files li { min-width: 0; max-width: 100%; }
.mail__files .sup__pdf { max-width: 100%; overflow-wrap: anywhere; }
.mail__form { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; }
.mail__form .field { margin: 0; } .mail__form textarea { min-height: 200px; resize: vertical; }
.mail__formhead h2 { margin: 0; font-size: 18px; } .mail__formhead p { margin: 2px 0 0; font-size: 12.5px; }
.mail__quote summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.mail__quote pre { max-height: 240px; margin: 6px 0 0; padding: 6px 10px; overflow-y: auto; border-left: 3px solid var(--line); color: var(--muted); font: inherit; font-size: 13px;
  white-space: pre-wrap; overflow-wrap: anywhere; }
.mail__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; } .mail__saved { margin: 0; font-size: 12.5px; } .mail__send { margin-left: auto; }
.mail .btn:disabled { opacity: .5; cursor: not-allowed; }   /* staging — только чтение; лимит писем */
/* вложенные папки — отступом, заполненность ящика, «і в тексті», Reply-To переключателем, «оригінал переміщено», папки на телефоне — списком */
.mail__folders a.mail__d1 { margin-left: 14px; } .mail__folders a.mail__d2 { margin-left: 28px; } .mail__folders a.mail__d3 { margin-left: 42px; }
.mail__quota { display: grid; gap: 4px; margin: 8px 0 0; padding: 0 11px; color: var(--muted); font-size: 12px; } .mail__quota meter { width: 100%; height: 6px; }
.mail__search .mail__all { flex: none; margin: 0; font-size: 13px; }
.mail__rt { margin: -4px 0 0; font-size: 13px; }
.mail__gone { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.mail__fsel { display: none; margin: 0; } .mail__fsel .field { flex: 1 1 auto; min-width: 0; margin: 0; }
.side__count--mail { background: var(--brand); color: #fff; }
.integr__live .sm-note { margin: 8px 0; }
@media (max-width: 767px) {
  .mail__folders { display: none; }
  .mail__fsel { display: flex; }
  .mail__search { flex-wrap: wrap; } .mail__search input[type=search] { flex-basis: 100%; }
}
.integr__sign h4 { margin: 0 0 4px; font-size: 14px; } .integr__sign > p { margin: 0 0 10px; } .integr__sign .field { margin-bottom: 10px; }
@media (min-width: 1100px) {
  .mail { grid-template-columns: 220px minmax(0, 1fr); align-items: start; }
  .mail__folders { flex-direction: column; flex-wrap: nowrap; }
  .mail__folders a { border-color: transparent; border-radius: 8px; }
}
@media (max-width: 767px) {
  .mail__row, .mail__draft { grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; }
  .mail__row .mail__subj { grid-column: 1 / -1; grid-row: 2; color: var(--muted); }
  .mail__row.is-unread .mail__subj { color: var(--text); }
  .mail__draft .mail__subj { grid-column: 1; } .mail__draft form { grid-column: 2; grid-row: 2; }
  .mail__head, .mail__body, .mail__form { padding-left: 12px; padding-right: 12px; }
}
/* ---------- «Мій профіль» → «Сповіщення» — таблиця «розділ × канал» (Telegram · Windows), пристрої Windows */
.profile__wide { grid-column: 1 / -1; min-width: 0; }   /* таблиці — у .table-wrap: на телефоні гортаються в собі, а не розпирають сторінку */
.profile__notify > p { margin: 0 0 10px; }
.profile__matrix { max-width: 760px; margin-bottom: 12px; } .profile__devices { max-width: 760px; }   /* галочки — ближче до назв розділів */
.profile__matrix tbody th { color: var(--text); font-size: 14px; font-weight: 600; }
.profile__matrix tbody th small { display: block; margin-top: 2px; font-size: 12.5px; font-weight: 400; }
.profile__matrix .profile__ch { width: 96px; text-align: center; vertical-align: middle; }
.profile__matrix .check { justify-content: center; }
.profile__win { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.profile__win h4 { margin: 0 0 6px; font-size: 14px; } .profile__win > p { margin: 0 0 10px; }
.profile__pushon { margin-bottom: 10px; }
.profile__devices { margin-bottom: 4px; } .profile__devices td { vertical-align: middle; }
.profile__devoff { width: 1%; white-space: nowrap; text-align: right; } .profile__devoff form { margin: 0; }
@media (max-width: 767px) {
  .profile__matrix .profile__ch { width: 64px; }
  .profile__devices th:nth-child(2), .profile__devices td:nth-child(2) { display: none; }   /* «Додано» — на телефоні зайве */
  .profile__devices th, .profile__devices td { padding-left: 6px; padding-right: 6px; }
}

/* «Звернення → Налаштування» — окно «Написати менеджеру» на сайте; в шапке «Зверненнь» — режим окна и звонки сверх лимита */
.sup-chat { margin-bottom: 16px; }
.sup-chat__p { margin: 0 0 10px; font-size: 13.5px; line-height: 1.45; }
.sup-chat .sm-toolbar { margin-bottom: 8px; }
.sup-chat .sm-toolbar .field { margin-bottom: 0; min-width: 220px; }
.page-head__actions .sup__chatmode:not(.btn), .page-head__actions .sup__suspects { align-self: center; }
.sup__suspects { font-size: 13px; color: var(--muted); }
.page-head__actions:has(.sup__chatmode) { flex-wrap: wrap; justify-content: flex-end; }

/* «Система → Кеш сторінок» */
.pcache__form { margin: 12px 0 0; }

/* ---------- письмо со всей разметкой — рамкой (светлым листом и в тёмной теме; высоту по содержимому ставит panel.js) */
.mail__frame { display: block; width: 100%; height: 160px; margin: 0; border: 1px solid var(--line); border-radius: 10px; background: #fff; color-scheme: light; }
.sup__msg:has(.mail__frame) { width: 100%; max-width: 100%; }
.sup__bubble .mail__frame { margin: 4px 0; }
.sup__imgs { margin: 0 0 8px; }
.mail__asktext { margin: 0 0 8px; }
.mail__askhost { margin: 0 0 6px; overflow-wrap: anywhere; }
.mail__askwarn { margin: 0 0 6px; color: var(--err); }
.mail__askurl { margin: 0 0 14px; font: 13px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-wrap: anywhere; }

/* «API-ключі» — блок «Інструменти MCP»: команда подключения (поле с «Скопіювати»), таблица инструментов; место под «Помічник» — у последней карточки */
.api-keys { margin-bottom: 18px; }
.api-mcp { margin-bottom: 72px; }
.api-mcp__label { margin: 12px 0 6px; font-weight: 600; }
.api-mcp .api-token { margin-bottom: 14px; }
.mcp-tools td.sm-mono { white-space: nowrap; }
.mcp-tools td:nth-child(2) { min-width: 220px; }   /* «Що робить» — не столбиком по слову */
/* на телефоне инструменты — карточками (имя, что делает, вид и право, доступно ли ключу), без прокрутки вбок */
@media (max-width: 600px) {
  .mcp-tools thead { display: none; }
  .mcp-tools, .mcp-tools tbody, .mcp-tools tr { display: block; }
  .mcp-tools tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  .mcp-tools td { display: inline-block; padding: 2px 6px 2px 0; border: 0; min-width: 0; vertical-align: middle; }
  .mcp-tools td.mcp-tools__name, .mcp-tools td:nth-child(2) { display: block; min-width: 0; }
  .mcp-tools td.mcp-tools__name { font-weight: 600; }
}
/* ---------- «Пошта» — отметки в списке (флажок слева от строки, отмеченная — подсветкой), действия с отмеченными, соседние письма в шапке письма */
.mail__item { display: grid; grid-template-columns: auto minmax(0, 1fr); border-bottom: 1px solid var(--line); }
.mail__item > .mail__row { border-bottom: 0; padding-left: 6px; }
.mail__item:has(> .is-unread) { box-shadow: inset 3px 0 0 var(--brand); } .mail__item > .mail__row.is-unread { box-shadow: none; }
.mail__item:has(.mail__pick input:checked) { background: var(--brand-l); }
.mail__pick { display: flex; align-items: center; padding: 0 2px 0 12px; cursor: pointer; }
.mail__tools { position: sticky; top: var(--hdr); z-index: 4; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line);
  background: var(--card); }   /* прилипает под шапкой: отметили внизу длинного списка — кнопки на экране */
.mail__pickall { margin: 0; font-size: 13px; } .mail__picked { min-width: 8.5em; font-size: 12.5px; }   /* место под «Позначено: N» — ряд не перестраивается */
.mail__do, .mail__tools .mail__move { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; min-width: 0; }
@media (max-width: 767px) {   /* телефон: кнопки — полосой внизу экрана, только когда отмечено; список под ними не сдвигается */
  .mail__do { position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line);
    background: var(--card); box-shadow: 0 -6px 16px rgba(21, 27, 38, .12); }
  .mail__bulk:not(:has(.mail__pick input:checked)) .mail__do { display: none; }
  .mail__bulk:has(.mail__pick input:checked) .mail__list { padding-bottom: 120px; }
}
.mail__nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; } .mail__step { display: inline-flex; gap: 6px; }
@media (pointer: coarse) { .mail__pick { padding-right: 6px; } .mail__pick input { width: 22px; height: 22px; } }
/* ---------- «Пошта» — «Повернути» рядом с итогом, «Позначити всі N у папці», строка под курсором клавиш (j / k) видна, окно «Клавіші» */
.mail__done { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; margin: 0 0 14px; } .mail__done > [role=status] { flex: 1 1 260px; min-width: 0; }
.mail__done .sm-note { margin: 0; } .mail__undo { display: flex; margin: 0; } .mail__undo .btn { height: auto; min-height: var(--ctl); }
.mail__every { display: inline-flex; align-items: center; min-height: 24px; padding: 0; border: 0; background: none; color: var(--brand-d); font: inherit; font-size: 12.5px;
  font-weight: 600; text-decoration: underline; cursor: pointer; }
.mail__every--max { color: var(--muted); font-weight: 400; text-decoration: none; cursor: default; }
.mail__every:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
@media (max-width: 767px) { .mail__tools:has([data-mail-every]:not([hidden])) .mail__picked { display: none; } }   /* телефон: ссылка — вместо «Позначено: 50», ряд не растёт */
.mail__row:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.mail__item:focus-within:not(:has(.mail__pick input:checked)) { background: var(--hover); }
.mail__keys dl { grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; margin: 4px 0 10px; font-size: 13.5px; }
.mail__keys kbd { display: inline-block; min-width: 1.6em; padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; background: var(--soft);
  color: var(--text); font: 600 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; text-align: center; }
.mail__keysnote { margin: 0 0 12px; font-size: 12.5px; }
.mail__keysbtn { min-width: 30px; font-weight: 700; }
@media (pointer: coarse) { .mail__keysbtn { display: none; } }   /* сенсорный экран — без клавиатуры */
.mail__keyson { margin: 0 0 4px; font-size: 13px; }
/* ---------- «Контент → Тема сайту»: разделы флажками в окне с прокруткой, превью логотипа и иконки, преимущества и бейджи — блоками с чертой */
.theme__set { min-width: 0; margin: 0; padding: 0; border: 0; }
.theme__cats { max-height: 280px; overflow: auto; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--field); }
.theme__preview { display: block; max-width: 160px; max-height: 64px; margin: -4px 0 12px; padding: 4px; border: 1px solid var(--line); border-radius: 6px; background: var(--img); object-fit: contain; }
.theme__benefit + .theme__benefit, .theme__badge + .theme__badge, .theme__badge + .field { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
/* журнал темы на телефоне — записи карточками: «Відкотити» не уезжает за край */
@media (max-width: 599px) { .theme-history thead { display: none; } .theme-history table, .theme-history tbody, .theme-history tr, .theme-history td { display: block; width: 100%; } .theme-history tr { padding: 10px 0; border-bottom: 1px solid var(--line); } .theme-history td { padding: 2px 0; border: 0; } .theme-history .table-wrap { overflow: visible; } }
/* ---------- ШІ: «Журнал ШІ» (запити й прогони атак) і рядок «Атаки» у місця в картці Claude */
.claude__rt { grid-column: 1 / -1; margin: -4px 0 10px; color: var(--muted); font-size: 13px; }
.claude__rt.is-leak { color: var(--err); }
.claude__rt-dry { display: block; margin-top: 2px; color: var(--muted); }
.ai-journal { padding-bottom: 72px; }   /* последняя строка и «Старіші» — не под плавающей «Помічник» */
.ai-filter .field { margin-bottom: 0; min-width: 200px; }
.ai-filter .check { margin-bottom: 9px; }
#ai-log { margin-bottom: 16px; }
.ai-log td small, .ai-runs td small { display: block; font-size: 12.5px; }
.ai-log__tools { min-width: 180px; }
.ai-log__tool { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0 8px 4px 0; }
.ai-log__guard { color: var(--err); }
.ai-runs__more { margin-top: 6px; font-size: 13px; }
.ai-runs__more ul { margin: 6px 0 0; padding-left: 18px; }
.ai-runs td:last-child { min-width: 220px; }
/* на телефоне запросы и прогоны — карточками (без прокрутки вбок: подсумок и цена видны сразу) */
@media (max-width: 600px) {
  .ai-log thead, .ai-runs thead { display: none; }
  .ai-log, .ai-log tbody, .ai-log tr, .ai-runs, .ai-runs tbody, .ai-runs tr { display: block; }
  .ai-log tr, .ai-runs tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  .ai-log td, .ai-runs td { display: inline-block; padding: 2px 10px 2px 0; border: 0; min-width: 0; vertical-align: top; text-align: left; }
  .ai-log td.ai-log__tools, .ai-runs td:last-child { display: block; min-width: 0; }
  .ai-log td.ai-log__tools.is-empty { display: none; }
  .ai-log tbody tr:hover td, .ai-runs tbody tr:hover td { background: none; }
}

/* ---------- «Співробітники», «Ролі», «Журнал», вхід із 2FA, «Вхід і безпека» */
.users-top { margin-bottom: 18px; } .users-top > .sm-card { margin: 0; }
.user-card { margin-bottom: 18px; } .user-card > .sm-card { margin: 0; }
.user-roles { display: flex; flex-wrap: wrap; gap: 6px 16px; min-width: 0; margin: 4px 0 14px; padding: 0; border: 0; }
.user-roles legend { width: 100%; margin-bottom: 6px; padding: 0; font-weight: 600; }
.user-roles.has-err legend { color: var(--err); }
.users-table tr.is-off td { color: var(--muted); }
.users-state { min-width: 140px; } .users-state .sm-badge { margin: 1px 0; }
.user-acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; } .user-acts > .sm-kv, .user-acts > p { flex: 1 1 100%; margin: 0 0 6px; }
.roles-matrix th[scope="row"] { font-weight: 400; min-width: 200px; }
.roles-matrix__r { text-align: center; white-space: nowrap; } .roles-matrix__c { text-align: center; }
.roles-matrix__g th { background: var(--soft); font-weight: 600; }
.roles-yes { color: var(--ok); font-weight: 700; }
.role-perms { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 16px; margin: 16px 0 0; }
.role-perms > .sm-card { margin: 0; }
.role-perms { align-items: start; } .role-group fieldset.sm-card__body { display: grid; gap: 10px; }
.role-perm { align-items: flex-start; } .role-perm > span { display: grid; gap: 2px; } .role-perm small { font-size: 12.5px; }
.role-users { margin: 0; padding-left: 18px; }
.jrn-filter { margin-bottom: 16px; } .jrn-table td { vertical-align: top; }
.jrn-diff, .jrn-error { min-width: 220px; max-width: 520px; overflow-wrap: anywhere; font-size: 13px; }
.login--wide { max-width: 460px; } .login__h { margin: 0 0 10px; font-size: 20px; }
.login section { padding: 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-s); }
.tfa-setup { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin: 10px 0 14px; }
.tfa-setup__qr { width: 200px; height: 200px; padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: 8px; }   /* QR — на белом и в тёмной теме: камера телефона читает чёрное на белом */
.tfa-setup__key { display: inline-block; margin-top: 4px; font-size: 15px; letter-spacing: .04em; overflow-wrap: anywhere; }
.tfa-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 18px; margin: 12px 0; padding-left: 22px; font-size: 15px; }
.security > .sm-card { margin: 0; } .security .sm-toolbar { margin-top: 10px; }
.my-sessions { margin: 0 0 12px; padding: 0; list-style: none; display: grid; gap: 10px; }
@media (max-width: 767px) {   /* телефон: строка журнала — карточкой (столбцы друг под другом), без прокрутки таблицы вбок */
  .jrn-table thead { display: none; } .jrn-table, .jrn-table tbody, .jrn-table tr, .jrn-table td { display: block; }
  .jrn-table tr { padding: 10px 12px; border-bottom: 1px solid var(--line); } .jrn-table td { padding: 2px 0; border: 0; max-width: none; min-width: 0; text-align: left; }
}
@media (max-width: 767px) { .roles-matrix .is-other { display: none; } }   /* «Хто що може» на телефоне — один столбец выбранной роли */
@media (min-width: 768px) { .roles-matrix__pick { display: none; } }
.login__backup { margin: 0 0 12px; } .login__backup summary { cursor: pointer; color: var(--brand-d); }
/* ---------- графики панели (templates/panel/_chart.twig, Core\Chart): SVG с сервера, цвета — классами тонов; узкий экран — прокрутка внутри рамки */
.sm-chart { margin: 0; min-width: 0; }
.sm-chart__box { min-height: 120px; }
.sm-chart--brand { --tone: var(--brand); } .sm-chart--soft { --tone: color-mix(in srgb, var(--brand) 35%, transparent); } .sm-chart--warn { --tone: var(--warn); } .sm-chart--ok { --tone: var(--ok); } .sm-chart--err { --tone: var(--err); }
.sm-chart__legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 4px; color: var(--muted); font-size: 12.5px; }
.sm-chart__key { display: inline-flex; align-items: center; gap: 6px; }
.sm-chart__key::before { content: ''; width: 12px; height: 12px; border-radius: 3px; background: var(--tone); }
.sm-chart__key--line::before { height: 3px; border-radius: 2px; }
/* подсказка ApexCharts — в цветах панели */
.sm-chart .apexcharts-tooltip { border: 1px solid var(--line) !important; box-shadow: var(--shadow-s) !important; font-size: 12.5px; }
.sm-chart .apexcharts-tooltip.apexcharts-theme-light { background: var(--card); color: var(--text); }
.sm-chart .apexcharts-tooltip.apexcharts-theme-light .apexcharts-tooltip-title { background: var(--soft); border-bottom-color: var(--line); }
/* ---------- «SEO → Позиції» і «Дані Google» */
.sg-seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--card); }
.sg-seg a { padding: 7px 12px; color: var(--text); font-size: 13.5px; font-weight: 600; text-decoration: none; border-left: 1px solid var(--line); }
.sg-seg a:first-child { border-left: 0; }
.sg-seg a:hover { background: var(--hover); color: var(--brand-d); }
.sg-seg a[aria-current="true"] { background: var(--brand-l); color: var(--brand-d); }
.sg-filters { align-items: center; }
.sg-cards { margin-bottom: 18px; }
.sg-cols { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 0 18px; align-items: start; }
@media (max-width: 1180px) { .sg-cols { grid-template-columns: minmax(0, 1fr); } }
.sg-side, .sg-data > * { min-width: 0; }   /* колонка сетки не шире экрана: длинное — прокруткой своей таблицы */
.sg-table .num, .sg-data .num, .sm-card .sm-table th.num, .sm-card .sm-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.sg-nowrap { white-space: nowrap; }
.sg-name { padding: 0; border: 0; background: none; color: var(--brand-d); font: inherit; text-align: left; overflow-wrap: break-word; cursor: pointer; }
.sg-table td:first-child { min-width: 9em; }   /* запрос не рвётся по буквам на телефоне: узко — таблица прокручивается в своей рамке */
.sg-name:hover { text-decoration: underline; }
.sg-page { display: block; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.sg-url { overflow-wrap: anywhere; }
.sg-move { font-size: 12px; font-weight: 600; } .sg-move.is-up { color: var(--ok); } .sg-move.is-down { color: var(--err); }
.sg-help { margin: 8px 0 0; font-size: 12.5px; }
.sg-keywords { margin-top: 14px; } .sg-keywords .field { margin-bottom: 8px; }
.sg-sub { margin: 16px 0 6px; font-size: 14px; }
.sg-score.is-ok { color: var(--ok); } .sg-score.is-warn { color: var(--warn); } .sg-score.is-err { color: var(--err); }
.sg-run { margin: 0; }
.sg-speed .field { flex: 1 1 260px; margin: 0; }
.sg-hist { width: min(880px, calc(100vw - 16px)); max-height: calc(100vh - 32px); overflow: auto; }
.sg-hist__title { overflow-wrap: anywhere; }
.sg-hist__sum { margin: 12px 0; }
.integr__google .field { margin-bottom: 10px; }
.integr textarea[name=value] { -webkit-text-security: disc; font-family: ui-monospace, monospace; font-size: 12px; }   /* JSON ключа Google — маска, как у поля ключа */
.integr__ic--google { --ic: #4285f4; }
.sg-queue p { margin: 0 0 4px; } .sg-queue p:last-child { margin: 0; }
@media (max-width: 599px) {   /* телефон: «Позиція» — в экране, CTR и кліки «Моїх запитів» — прочь, стрелка — под числом */
  .sg-table .sg-opt { display: none; }
  .sg-table th, .sg-table td { padding: 8px 5px; }
  .sg-table td:first-child { min-width: 7em; }
  .sg-table .sg-move { display: block; }
}
/* ---------- «Система → Черга» (panel/queue.twig): номера записей и даты — под строкой; на телефоне — карточками */
.queue-stats { margin-bottom: 16px; }
.queue td small { display: block; font-size: 12.5px; }
.queue__error { min-width: 220px; overflow-wrap: anywhere; }
#queue-failed { margin-bottom: 72px; }   /* последняя строка — не под плавающей «Помічник» */
.queue__m { display: none; }
.queue-cancelled { margin: -6px 0 16px; }
.queue__act { min-width: 120px; }
.field .err-link { display: inline-block; margin-top: 4px; font-size: 13px; }   /* «Відкрити цю 301» под ошибкой поля раздела */
@media (max-width: 600px) {
  .queue-stats { grid-template-columns: 1fr 1fr; }
  .queue__m { display: inline; color: var(--muted); }
  .queue thead { display: none; }
  .queue, .queue tbody, .queue tr { display: block; }
  .queue tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  .queue td { display: block; padding: 2px 0; border: 0; min-width: 0; text-align: left; }
  .queue tbody tr:hover td { background: none; }
}

/* ---------- «Продажі → Доставка і оплата» (panel/delivery.twig): способы оплаты — блоками, «Для доставки» — флажки в ряд */
.ship__pay + .ship__pay { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.ship__name { margin: 0 0 6px; color: var(--text); font-size: 15px; }
.ship__for { display: flex; flex-wrap: wrap; align-items: center; gap: 0 16px; margin: 0 0 8px; font-size: 13px; }
.ship__for .field { margin: 0; }

/* ---------- «Клієнти → Покупці» (panel/customers.twig, customer.twig): список, картка — дані й кабінет, замовлення розгортаються, звернення й адреси */
.cust-table tr.is-off td { color: var(--muted); }
.cust-table__contacts { overflow-wrap: anywhere; }
.cust-table__state .sm-badge { margin: 0 4px 2px 0; }
.cust-top, .cust-more { margin-bottom: 18px; } .cust-top > .sm-card, .cust-more > .sm-card { margin: 0; }
.cust-acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.cust-acts > .sm-kv, .cust-acts > p { flex: 1 1 100%; margin: 0 0 6px; }
#cust-form .field small { display: block; margin-top: 4px; }
.cust-order { border-bottom: 1px solid var(--line); }
.cust-order:last-child { border-bottom: 0; }
.cust-order > summary { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; padding: 10px 0; cursor: pointer; list-style: none; }
.cust-order > summary::-webkit-details-marker { display: none; }
.cust-order > summary::before { content: ''; width: 6px; height: 6px; margin: 0 2px; border: solid var(--muted); border-width: 0 1.5px 1.5px 0; transform: rotate(-45deg); transition: transform .15s; }
.cust-order[open] > summary::before { transform: rotate(45deg); }
.cust-order > summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .cust-order > summary::before { transition: none; } }
.cust-order__sum { margin-left: auto; }
.cust-order__body { padding: 0 0 12px; }
.cust-order__body .sm-kv { margin-bottom: 8px; }
.cust-list { list-style: none; margin: 0; padding: 0; }
.cust-list > li { padding: 8px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.cust-list > li:last-child { border-bottom: 0; }
.cust-table__m { display: none; }
@media (max-width: 600px) {   /* телефон: список и история — карточками; подсказка заголовка — строкой ниже */
  .cust-table thead { display: none; }
  .cust-table, .cust-table tbody, .cust-table tr { display: block; }
  .cust-table tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  .cust-table td { display: block; padding: 2px 0; border: 0; text-align: left; }
  .cust-table td:empty { display: none; }
  .cust-table tbody tr:hover td { background: none; }
  .cust-table__m { display: inline; color: var(--muted); }
  .cust-card-head { flex-wrap: wrap; } .cust-card-head > .sm-muted { flex: 1 1 100%; }
  .cust-history thead { display: none; }
  .cust-history, .cust-history tbody, .cust-history tr { display: block; }
  .cust-history tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  .cust-history td { display: block; padding: 2px 0; border: 0; }
  .cust-history tbody tr:hover td { background: none; }

}
/* ---------- «SEO → Перевірки» (panel/seo-checks.twig) і «Адреси → Журнал 404» (content/urls.twig): проверка — полоса цвета слева, строки — что и почему, справа — куда идти */
.sc-at { margin: 0 0 12px; }
.sc-totals { margin-bottom: 16px; }
.sc-list { display: grid; gap: 8px; min-width: 0; }
.sc-check { min-width: 0; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: var(--r); }
.sc-check--red { border-left-color: var(--err); } .sc-check--yellow { border-left-color: var(--warn); } .sc-check--ok { border-left-color: var(--ok); } .sc-check--nodata { border-left-color: var(--muted); }
.sc-check__head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 10px 14px; }
summary.sc-check__head { cursor: pointer; }
.sc-check__body { padding: 0 14px 12px; }
.sc-check__body .sg-help { margin: 0 0 8px; }
.sc-fine__item { color: var(--muted); font-size: 13px; }
.sc-fine__item:not(:last-child)::after { content: ' ·'; }
.sc-what { min-width: 0; overflow-wrap: anywhere; }
.sc-why { display: block; color: var(--muted); font-size: 12.5px; }
.sc-act { text-align: right; }
.sc-act .sm-gap { justify-content: flex-end; }
.nf-path, .nf-ref { overflow-wrap: anywhere; }
.nf-list td:first-child { min-width: 12em; }
.nf-act form { margin: 0; }
@media (min-width: 600px) { .sc-act .sm-gap, .nf-act .sm-gap { flex-wrap: nowrap; white-space: nowrap; } }
@media (max-width: 599px) {
  .sc-items tr, .sc-items td { display: block; }
  .sc-items td { border: 0; padding: 4px 0; }
  .sc-items tr { padding: 8px 0; border-bottom: 1px solid var(--line); }
  .sc-act { text-align: left; } .sc-act .sm-gap { justify-content: flex-start; }
  .sm-grid.sc-totals { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }   /* итог — три в ряд и на телефоне */
  .sc-totals .sm-stat { padding: 10px; }
  .nf-list thead { display: none; }   /* журнал 404 на телефоне — карточками: адрес, разы, когда, Google, кнопки */
  .nf-list tr, .nf-list td { display: block; }
  .nf-list td { border: 0; padding: 2px 0; text-align: left; white-space: normal; }
  .nf-list td:first-child { min-width: 0; }
  .nf-list tr { padding: 8px 0; border-bottom: 1px solid var(--line); }
  .nf-list td[data-label]::before { content: attr(data-label) ': '; color: var(--muted); }

}
/* ---------- «Головна» (panel/home.twig, _dash.twig): сетка блоков 12 колонок, ширина блока — .dash__b--w3|4|6|8|12; «Налаштувати» — .dash.is-edit
   (инструменты блока, сховані блоки видно блёкло, перетаскивание); на планшете ¼ — половина, ⅓ ½ ⅔ — вся; на телефоне так же */
.dash { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; align-items: stretch; margin-bottom: 72px; }   /* низ — не под плавающей «Помічник» */
.dash__b { grid-column: span 12; min-width: 0; display: flex; flex-direction: column; }
.dash__b--w3 { grid-column: span 3; } .dash__b--w4 { grid-column: span 4; } .dash__b--w6 { grid-column: span 6; } .dash__b--w8 { grid-column: span 8; }
.dash__body { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; }
.dash__body > .sm-card, .dash__body > .sm-stat { flex: 1 1 auto; margin: 0; }
.dash:not(.is-edit) .dash__b.is-off, .dash__tools { display: none; }
.dash.is-edit .dash__b { padding: 6px; border: 2px dashed var(--line); border-radius: var(--r); cursor: grab; }
.dash.is-edit .dash__tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 6px; }
.dash__name { flex: 1 1 100%; font-weight: 700; font-size: 13px; }
.dash__tools select { width: auto; min-width: 0; min-height: 30px; height: 30px; padding-top: 2px; padding-bottom: 2px; font-size: 13px; }
.dash__b.is-off .dash__body { opacity: .55; }
.dash__b.is-drag { opacity: .4; }
.dash__b:not(.is-off) .dash__show, .dash__b.is-off .dash__hide { display: none; }
.dash__ghost { padding: 14px 16px; border: 1px dashed var(--line); border-radius: var(--r); color: var(--muted); }
.dash-bar { position: sticky; top: calc(var(--hdr) + 6px); z-index: 4; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px;
  margin-bottom: 16px; padding: 10px 14px; border: 1px solid var(--brand); border-radius: var(--r); background: linear-gradient(var(--brand-l), var(--brand-l)), var(--card);
  box-shadow: var(--shadow-s); }   /* «Зберегти» — под рукой, пока прокручивают блоки; фон непрозрачный и в тёмной */
.dash-bar p { margin: 0; flex: 1 1 320px; }
.dash-bar__btns { display: flex; flex-wrap: wrap; gap: 8px; }
.dash-off { margin-bottom: 16px; }
.dash-list { margin: 0; padding: 0; list-style: none; }
.dash-list li { display: flex; align-items: baseline; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.dash-list li:last-child { border-bottom: 0; }
.dash-list li > :first-child { flex: 1 1 auto; min-width: 0; }
.dash-list b { font-variant-numeric: tabular-nums; } .dash-list b.is-warn { color: var(--warn); } .dash-list b.is-err { color: var(--err); }
.dash-list small { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dash-list--cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); column-gap: 24px; }
.dash-list--cols li:last-child { border-bottom: 1px solid var(--line); }
.dash__sub { margin: 14px 0 4px; font-size: 13px; color: var(--muted); }
.dash__line { margin: 0 0 8px; }
.dash__hint { margin: 6px 0 0; font-size: 12.5px; }
.dash__ga { margin: 8px 0; }
.dash-period { display: flex; flex-wrap: wrap; gap: 4px; }
.dash-period button[aria-pressed="true"], .dash-nav__cmp[aria-pressed="true"] { background: var(--brand-l); border-color: var(--brand); color: var(--brand-d); }
.dash-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px; }
.dash-nav__title { min-width: 0; margin: 0 4px; }
.dash-nav__cmp { margin-left: auto; }
.dash-sum { margin-bottom: 12px; }
.dash-tickets { margin: 0; padding: 0; list-style: none; }
.dash-tickets a { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 7px 0; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; }
.dash-tickets a:hover .dash-tickets__name { color: var(--brand); }
.dash-tickets .ic { width: 16px; height: 16px; color: var(--muted); }
.dash-tickets__name { font-weight: 600; }
.dash-tickets__wait { margin-left: auto; font-size: 12.5px; color: var(--muted); } .dash-tickets__wait.is-late { color: var(--warn); font-weight: 600; }
.dash-geo { margin: 0; padding: 0; list-style: none; }
.dash-geo li { display: grid; grid-template-columns: minmax(90px, 1fr) minmax(60px, 2fr) 5.5em 4.5em; align-items: center; gap: 8px; padding: 5px 0; }
.dash-geo meter { width: 100%; height: 8px; border: 0; border-radius: 4px; background: var(--line); }   /* полоса — цвета панели, не системная зелёная */
.dash-geo meter::-webkit-meter-bar { height: 8px; border: 0; border-radius: 4px; background: var(--line); }
.dash-geo meter::-webkit-meter-optimum-value, .dash-geo meter::-webkit-meter-suboptimum-value, .dash-geo meter::-webkit-meter-even-less-good-value { border-radius: 4px; background: var(--brand); }
.dash-geo meter::-moz-meter-bar { border-radius: 4px; background: var(--brand); }
.dash-geo b, .dash-geo small { text-align: right; font-variant-numeric: tabular-nums; }
.dash-geo__name { overflow-wrap: anywhere; }
@media (max-width: 991px) { .dash__b--w3 { grid-column: span 6; } .dash__b--w4, .dash__b--w6, .dash__b--w8 { grid-column: span 12; } }
@media (max-width: 599px) {
  .dash { gap: 12px; }
  .dash-geo li { grid-template-columns: minmax(80px, 1fr) 5em 4em; } .dash-geo meter { grid-column: 1 / -1; grid-row: 2; }
  .dash.is-edit .dash__body { display: none; }   /* «Налаштувати» на телефоне: только названия и инструменты — порядок видно сразу */
  .dash-nav__cmp { margin-left: 0; }
  .dash-sum { grid-template-columns: 1fr 1fr; }
  .dash .sm-stat__value { font-size: 21px; }
  .dash-orders th, .dash-orders td { padding-left: 4px; padding-right: 4px; }
}

/* ---------- помощник панели: строка вопроса со скрепкой, выбранные файлы, шаги ответа, ошибки, черновик формы, подсветка подставленных полей; статья базы знаний */
.as form { flex-direction: column; }
.as__row { display: flex; gap: 6px; align-items: flex-end; }
.as__row textarea { flex: 1; min-width: 0; }
.as__clip { position: relative; flex: none; width: var(--ctl); height: var(--ctl); justify-content: center; border: 1px solid var(--line); border-radius: var(--r); cursor: pointer; }
.as__clip input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.as__clip:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }
.as__files { display: flex; flex-wrap: wrap; gap: 6px; }
.as__chip { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 2px 4px 2px 10px; border-radius: 999px; background: var(--soft); font-size: 13px; overflow-wrap: anywhere; }
.as__chip button { padding: 2px 6px; line-height: 1; }
.as.is-drop { outline: 3px dashed var(--brand); outline-offset: -6px; }
.as form.is-busy button[type=submit] { opacity: .6; pointer-events: none; }
.msg__text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg__file { display: inline-flex; align-items: center; gap: 4px; margin: 0 8px 4px 0; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.msg.msg--err { background: var(--err-l); color: var(--err); }
.msg.msg--wait { color: var(--muted); }
.msg.msg--wait .msg__text::after { content: ''; display: inline-block; width: 1em; animation: as-dots 1.2s steps(4) infinite; }
@keyframes as-dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }
.as-draft { margin-top: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); }
.as-draft__h { margin: 0 0 4px; font-weight: 600; }
.as-draft dl { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 2px 8px; margin: 6px 0; font-size: 13px; }
.as-draft dt { color: var(--muted); overflow-wrap: anywhere; } .as-draft dd { margin: 0; overflow-wrap: anywhere; }
.as-draft__was, .as-draft__now { display: block; } .as-draft__was { color: var(--muted); } .as-draft summary { cursor: pointer; color: var(--brand-d); }
.as-draft__actions { display: flex; flex-wrap: wrap; gap: 6px; }
.as-draft__state { margin: 6px 0 0; } .as-draft__state:empty { display: none; }
.as-filled { outline: 2px solid var(--brand); outline-offset: 1px; background-color: var(--brand-l) !important; }
.help__text { overflow-wrap: anywhere; line-height: 1.55; }
@media (prefers-reduced-motion: reduce) { .msg.msg--wait .msg__text::after { animation: none; content: '…'; } }

/* ---------- консультант сайта: «Клієнти → Консультант» (часті питання, розмови) і переписка з ШІ у «Зверненнях» */
.cons__stats { margin-bottom: 16px; }
@media (max-width: 599px) { .cons__stats.sm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cons .sm-card { margin-bottom: 16px; }
.cons__faq { min-width: 0; margin: 0 0 12px; padding: 10px 12px 2px; border: 1px solid var(--line); border-radius: var(--r); }
.cons__faq legend { padding: 0 6px; font-weight: 600; font-size: 13px; }
.cons__chat { padding: 6px 0; border-top: 1px solid var(--line); }
.cons__chat summary { cursor: pointer; overflow-wrap: anywhere; }
.cons__m { margin: 6px 0 0 14px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13.5px; }
.cons__m--me { color: var(--brand); }
.sup__ai { align-self: stretch; padding: 8px 10px; border: 1px dashed var(--line); border-radius: var(--r); display: flex; flex-direction: column; gap: 8px; }
.sup__ai summary { cursor: pointer; color: var(--muted); font-size: 13px; }

/* ---------- «SEO → Автопілот» (seo-pilot.twig): режим, пропозиції «було → стане», «куди вести?», шаблони мета; телефон — рядки картками */
.pilot-modes { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0; }
.pilot-modes__item { align-items: flex-start; }
.pilot-modes__item > span { display: grid; gap: 2px; min-width: 0; }
.pilot-modes__item small { font-size: 12.5px; overflow-wrap: anywhere; }
.pilot-limit { margin-top: 4px; align-items: flex-end; }
.pilot-limit .field { max-width: 14em; margin: 0; }
.pilot-filters select { max-width: 100%; }
.pilot-list td { vertical-align: top; }
.pilot-sel { width: 2.2em; }
.pilot-what, .pilot-change { min-width: 0; overflow-wrap: anywhere; }
.pilot-what { width: 34%; }
.pilot-kind { font-weight: 600; }
.pilot-target, .pilot-why, .pilot-hint { display: block; }
.pilot-target { margin-top: 2px; }
.pilot-why, .pilot-hint { color: var(--muted); font-size: 12.5px; }
.pilot-why--warn { color: var(--warn); }
.pilot-old { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line); }
.pilot-arrow { color: var(--muted); }
.pilot-new { font-weight: 600; }
.pilot-row--ask { box-shadow: inset 3px 0 0 var(--warn); }
.pilot-to { display: block; width: 100%; max-width: 32em; margin-top: 4px; }
.pilot-text summary { cursor: pointer; color: var(--brand-d); margin-top: 4px; }
.pilot-text__body { margin-top: 6px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--soft); overflow-wrap: anywhere; }
.pilot-text__body :is(h2, h3) { font-size: 15px; margin: 8px 0 4px; }
.pilot-state { min-width: 9em; }
.pilot-state .sm-muted { display: block; font-size: 12.5px; }
.pilot-act .sm-gap { justify-content: flex-end; }
.pilot-bulk { margin-top: 10px; }
.pilot-tpl > summary { cursor: pointer; list-style: none; }
.pilot-tpl > summary::-webkit-details-marker { display: none; }
.pilot-tpl:not([open]) > summary { border-bottom: 0; }
.pilot-tpl__table td { overflow-wrap: anywhere; }
.pilot-tpl__site { color: var(--muted); }
.pilot-tpl__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pilot-tpl__top .sg-help { flex: 1 1 260px; margin: 0; }
.sc-items tr.sc-kept .sc-text { color: var(--muted); }   /* «залишено як є» (автопілот: відхилено) — сірим */
@media (min-width: 900px) { .pilot-act .sm-gap { flex-wrap: nowrap; white-space: nowrap; } }
@media (max-width: 760px) {
  .pilot-list thead { display: none; }
  .pilot-list tr, .pilot-list td { display: block; }
  .pilot-list td { border: 0; padding: 3px 0; width: auto; min-width: 0; }
  .pilot-list tr { position: relative; padding: 10px 0 10px 2em; border-bottom: 1px solid var(--line); }
  .pilot-list td.pilot-sel { position: absolute; left: 0; top: 10px; width: auto; }
  .pilot-list tr.pilot-row--ask { padding-left: calc(2em + 16px); }   /* полоса «куди вести?» — отдельно от галочки и текста */
  .pilot-list tr.pilot-row--ask td.pilot-sel { left: 16px; }
  .pilot-list td[data-label]::before { content: attr(data-label) ': '; color: var(--muted); font-size: 12.5px; }
  .pilot-act .sm-gap { justify-content: flex-start; }
  .pilot-tpl__table thead { display: none; }
  .pilot-tpl__table tr, .pilot-tpl__table th, .pilot-tpl__table td { display: block; border: 0; padding: 2px 0; }
  .pilot-tpl__table tr { padding: 6px 0; border-bottom: 1px solid var(--line); }
}
/* ---------- разметка Markdown (Core\Markdown): статья базы знаний (/help) и ответ помощника — как на GitHub: заголовки, списки, таблицы, код */
.md { white-space: normal; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p, .md ul, .md ol, .md table, .md pre, .md blockquote { margin: 0 0 10px; }
.md h1, .md h2, .md h3, .md h4 { margin: 18px 0 8px; line-height: 1.3; color: var(--text); }
.md h1 { font-size: 20px; } .md h2 { font-size: 17px; } .md h3 { font-size: 15px; } .md h4 { font-size: 14px; }
.md ul, .md ol { padding-left: 22px; }
.md li + li { margin-top: 3px; }
.md code { padding: 1px 5px; border-radius: 4px; background: var(--soft); font-size: .92em; }
.md pre { padding: 10px 12px; border-radius: 8px; background: var(--soft); overflow-x: auto; }
.md pre code { padding: 0; background: none; }
.md blockquote { padding: 2px 0 2px 12px; border-left: 3px solid var(--line); color: var(--muted); }
.md table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; font-size: 13px; }
.md th, .md td { padding: 6px 10px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.md th { background: var(--soft); font-weight: 600; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
.msg__text.md h1, .msg__text.md h2, .msg__text.md h3, .msg__text.md h4 { margin: 10px 0 6px; font-size: 14px; }
.msg__text.md p, .msg__text.md ul, .msg__text.md ol, .msg__text.md table, .msg__text.md pre { margin-bottom: 6px; }

/* ---------- «Продажі → Звіти»: статуси відбору (розгортаються під рядком полів), підсумки, назви в таблицях */
.rep-filter { margin-bottom: 14px; }
.rep-filter .sm-toolbar { margin-bottom: 8px; }
.rep-st > summary { list-style: none; max-width: 100%; justify-content: flex-start; text-align: left; overflow-wrap: anywhere; }
.rep-st > summary::-webkit-details-marker { display: none; }
.rep-st__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px 14px; margin: 8px 0 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); }
.rep-st__hint { margin: 6px 0 0; font-size: 12.5px; }
.rep-stats { margin-bottom: 14px; }
.rep-name { overflow-wrap: anywhere; min-width: 160px; }
/* телефон: головне — без прокрутки таблиці вбік: дата групи без року, «Замовлень» у «Куплених» сховано, «Востаннє» — переносом */
.rep-quick { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.rep-quick a[aria-current] { border-color: var(--brand); color: var(--brand-d); }
.rep-prev { margin: 0 0 8px; font-size: 13px; }
.rep-chart { position: relative; overflow: hidden; }   /* таблица графика для читателя экрана (sr-only) шире телефона — не даёт прокрутку страницы вбок */
@media (max-width: 599px) { .rep-y, .rep-wide { display: none; } .rep-name { min-width: 110px; } .rep-table th.sm-num { white-space: normal; } }

/* ---------- товар без фото: заглушка в дизайне панели — рамка пунктиром, значок предупреждения; ведёт в отбор «Без фото» */
.thumb-none { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 1.5px dashed color-mix(in srgb, var(--warn) 70%, var(--line)); border-radius: 8px; background: var(--warn-l); color: var(--warn); }
.thumb-none:hover { border-style: solid; }
.thumb-none:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.photo-none { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; padding: 12px 14px; border: 1.5px dashed color-mix(in srgb, var(--warn) 70%, var(--line)); border-radius: var(--r); background: var(--warn-l); color: var(--text); }
.photo-none .ic { color: var(--warn); }

/* ---------- скелетон блоков «Головної»: место под блок занято сразу (высота — как у готового), полосы мерцают, пока блок грузится */
.skel { display: flex; flex-direction: column; gap: 12px; }
.skel i { display: block; border-radius: 6px; background: linear-gradient(90deg, var(--soft) 25%, color-mix(in srgb, var(--line) 70%, var(--soft)) 50%, var(--soft) 75%); background-size: 200% 100%; animation: skel 1.3s ease-in-out infinite; }
.skel__line { height: 14px; } .skel__line:nth-child(3n) { width: 72%; } .skel__line:nth-child(3n+2) { width: 88%; }
.skel__line--s { width: 45% !important; height: 12px; } .skel__line--m { width: 60% !important; height: 12px; }
.skel__num { width: 55%; height: 30px; }
.skel__tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; } .skel__tile { height: 86px; }
.skel__chart { height: 260px; }
.skel--orders, .skel--revenue, .skel--customers, .skel--online { min-height: 118px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); }
.skel--shop { min-height: 420px; } .skel--recent { min-height: 400px; } .skel--support { min-height: 280px; } .skel--countries, .skel--activity { min-height: 300px; }
@keyframes skel { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skel i { animation: none; } }
/* «Пошта» — ход большого действия заданием очереди (_mail_job.twig): полоса — цвета панели, а не системная */
.mail__job { margin: 0 0 12px; } .mail__job .sm-note p { margin: 0 0 8px; } .mail__job .mail__done { margin: 0; }
.mail__jobhelp { margin: 6px 0 0; font-size: 12.5px; }
.mail__job progress { display: block; width: 100%; height: 8px; margin: 0; border: 0; border-radius: 4px; background: var(--line); color: var(--brand); -webkit-appearance: none; appearance: none; }
.mail__job progress::-webkit-progress-bar { border-radius: 4px; background: var(--line); }
.mail__job progress::-webkit-progress-value { border-radius: 4px; background: var(--brand); }
.mail__job progress::-moz-progress-bar { border-radius: 4px; background: var(--brand); }


/* ===== «SEO → Помічник» (seo-ai.twig): місця ШІ, сайти виробників, журнал прогонів ===== */
.seoai-stats { margin: 12px 0 14px; }
.seoai-place { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.seoai-place:last-of-type { border-bottom: 0; }
.seoai-sub { margin: 16px 0 4px; font-size: 14px; }
.seoai-sites { margin-top: 8px; }
.seoai-run { border: 1px solid var(--line); border-radius: var(--r); padding: 8px 12px; margin-bottom: 8px; }
.seoai-run > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; cursor: pointer; }
.seoai-run__at { font-variant-numeric: tabular-nums; }
.seoai-run__left { color: var(--warn); font-weight: 600; }
.seoai-lines { margin: 8px 0 0; padding-left: 18px; }
.seoai-lines li { margin: 4px 0; overflow-wrap: anywhere; }
.seoai-what { overflow-wrap: anywhere; }
.seoai-place .sm-note { flex-basis: 100%; margin: 4px 0 0; }
.seoai-filter { margin: 6px 0 0; }

/* ===== фото товара: плитка в карточке (_photo.twig) — головне первым и с пометкой, «прибрати» — бледно до «Зберегти»; крупно — <dialog>;
   заглушка «немає фото» в списке — выбор файлов и перетаскивание (panel.js photoRow) ===== */
.ph-hint { margin: 0 0 10px; font-size: 12.5px; }
.ph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 10px; margin: 0 0 12px; padding: 0; list-style: none; }
.ph-grid:empty { display: none; }
.ph { position: relative; display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 6px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); }
.ph[draggable="true"] { cursor: grab; }
.ph.is-main { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.ph--new { background: var(--brand-l); }
.ph.is-moving { opacity: .4; }
.ph__img { display: block; aspect-ratio: 1; overflow: hidden; border-radius: 6px; background: var(--img); cursor: zoom-in; }
.ph__img img { display: block; width: 100%; height: 100%; object-fit: contain; }
.ph__img:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.ph__tags { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; flex-wrap: wrap; gap: 4px; pointer-events: none; }
.ph__tags .sm-badge { background: var(--card); border-color: var(--line); box-shadow: var(--shadow-s); }   /* поверх фото — сплошной фон: прозрачный пропадает на картинке */
.ph__main, .ph__gone { display: none; }
.ph.is-main .ph__main, .ph.is-gone .ph__gone { display: inline-flex; }
.ph.is-gone { border-style: dashed; }
.ph.is-gone .ph__img img { opacity: .35; filter: grayscale(1); }
.ph__bar { display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 4px; }
.ph__bar .btn { min-width: 0; padding: 4px 6px; font-size: 12.5px; }
.ph__arrow { width: 32px; }
.ph__bar .btn:disabled { opacity: .4; cursor: default; }
.ph__make { grid-column: 1 / -1; }
.ph.is-main .ph__make, .ph.is-gone .ph__make { display: none; }
.ph-url { margin-top: 10px; }
.ph-url > summary { width: fit-content; color: var(--brand-d); font-size: 13px; cursor: pointer; }
.ph-url[open] > summary { margin-bottom: 8px; }
.ph-view { width: min(960px, calc(100vw - 32px)); max-width: none; max-height: calc(100dvh - 32px); padding: 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); color: var(--text); box-shadow: var(--shadow); }
.ph-view::backdrop { background: rgb(0 0 0 / .6); }
.ph-view__head, .ph-view__nav { display: flex; align-items: center; gap: 10px; padding: 10px 14px; }
.ph-view__head { border-bottom: 1px solid var(--line); }
.ph-view__nav { justify-content: space-between; border-top: 1px solid var(--line); }
.ph-view__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
.ph-view__body { display: flex; justify-content: center; padding: 12px; background: var(--img); }
.ph-view__body img { display: block; max-width: 100%; max-height: calc(100dvh - 190px); object-fit: contain; }
@media (max-width: 767px) {   /* телефон: кнопки плитки — не меньше поля (--ctl): ← → рядом, «Прибрати» и «Зробити головним» — во всю ширину */
  .ph__bar { grid-template-columns: 1fr 1fr; }
  .ph__bar .btn { min-height: var(--ctl); }
  .ph__arrow { width: auto; }
  .ph__drop, .ph__make { grid-column: 1 / -1; }
}
#photos.is-drop { outline: 2px dashed var(--brand); outline-offset: -2px; }   /* файлы — на весь блок «Фото» */
#photos.is-drop .drop__zone { border-color: var(--brand); background: var(--brand-l); }
.cell-msg__ok { color: var(--ok); } .cell-msg__err { display: block; color: var(--err); }   /* итог загрузки из списка: успех и отказы — отдельно */
.thumb-up { cursor: pointer; }
.thumb-up:has(:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.thumb-up.is-drop { border-style: solid; border-color: var(--brand); background: var(--brand-l); color: var(--brand); }
.thumb-up.is-busy { opacity: .5; pointer-events: none; }

/* SEO-помічник: нова SEO-сторінка фільтра в «Автопілоті» — таблиця UA/RU */
.pilot-fp { width: 100%; table-layout: fixed; border-collapse: collapse; }
.pilot-fp th, .pilot-fp td { padding: 4px 6px; text-align: left; vertical-align: top; overflow-wrap: anywhere; border-bottom: 1px solid var(--line, rgba(127,127,127,.25)); }
.pilot-fp th:first-child { width: 22%; }
.pilot-fp tbody th { font-weight: 600; }

/* таблица для читателя экрана внутри .sr-only (значения графика) — в его 1 px: иначе её строки шире экрана телефона (видно не было, но элементы выходили за край) */
.sr-only table { table-layout: fixed; width: 1px; }

/* ---------- незбережені зміни: панель «Є незбережені зміни · Скасувати зміни · Зберегти» внизу по центру області сторінки (base.twig #savebar, panel.js);
   на телефоні — на всю ширину знизу. Поки видна (html.has-save): «Помічник» і підказка сканера — над нею, низ сторінки та поле під фокусом не ховаються під неї */
.savebar { position: fixed; bottom: 16px; left: var(--save-l, calc(var(--menu) + 24px)); right: var(--save-r, 24px); z-index: 35; display: flex; align-items: center; gap: 10px 16px; width: fit-content; margin: 0 auto;
  padding: 10px 10px 10px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--text); box-shadow: var(--shadow); }
.savebar__text { display: flex; align-items: center; gap: 8px; min-width: 0; margin: 0; font-weight: 600; }
.savebar__text::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); }
.savebar.is-err .savebar__text { color: var(--err); }
.savebar.is-err .savebar__text::before { background: var(--err); }
.savebar__acts { display: flex; flex: none; align-items: center; gap: 8px; }
.savebar__key { padding: 2px 6px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); font: 600 12px/1.4 var(--font); }   /* подсказка клавиш — видимым текстом */
.savebar .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }   /* aria-disabled, не disabled: фокус на кнопке во время сохранения не теряется */
html.has-save { scroll-padding-bottom: calc(var(--save-h, 64px) + 24px); }
.has-save main { padding-bottom: calc(var(--save-h, 64px) + 48px); }
.has-save .as-fab { bottom: calc(var(--save-h, 64px) + 28px); }
.has-save .scan-toast { bottom: calc(var(--save-h, 64px) + 40px); }
@media (prefers-reduced-motion: no-preference) { .savebar { animation: savebar-in .18s ease-out; } }
@keyframes savebar-in { from { opacity: 0; transform: translateY(12px); } }
@media (max-width: 767px) {
  .savebar { left: 0; right: 0; bottom: 0; flex-wrap: wrap; width: auto; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); border-width: 1px 0 0; border-radius: 12px 12px 0 0; }
  .savebar__text, .savebar__acts { flex: 1 1 100%; }
  .savebar__acts { display: grid; grid-template-columns: 1fr 1fr; }
  .has-save main { padding-bottom: calc(var(--save-h, 110px) + 90px); }
  .has-save .as-fab { bottom: calc(var(--save-h, 110px) + 12px); }
  .savebar__key { display: none; }   /* на телефоне клавиатуры нет */
  body.menu-open .savebar { display: none; }   /* открытое меню — не под панелью */
}
/* ===== «Облік → Гроші» і «Борги» (money.twig, debts.twig, debt.twig): плитка рахунку — посилання на відбір руху, вибрана — рамкою бренду ===== */
.mon-accs, .mon-totals { margin-bottom: 14px; }
a.mon-acc { color: inherit; text-decoration: none; }
a.mon-acc:hover, a.mon-acc[aria-current] { border-color: var(--brand); }
a.mon-acc:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.mon-sum { font-weight: 600; }
.mon-pager { padding: 0 12px 12px; }
@media (max-width: 599px) {   /* рух грошей і боргу на телефоні — картками: дата й сума в рядок, далі підписані рядки */
  .mon-table thead { display: none; }
  .mon-table tr { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
  .mon-table td { display: block; border: 0; padding: 0; text-align: left; white-space: normal; }
  .mon-table td[data-label], .mon-table td:nth-child(5) { flex: 1 0 100%; }
  .mon-table td[data-label]::before { content: attr(data-label) ': '; color: var(--muted); }
}

/* ===== «Облік → Довідники» і «Контрагенти» (refs/*.twig): вимкнені — сірим; на телефоні список — картками з підписами; календар — смуга 14 днів ===== */
.ref-table tr.is-off td { color: var(--muted); }
.ref-table .sm-badge { margin: 0 4px 2px 0; }
.cp-table__contacts { overflow-wrap: anywhere; }
.ref-field > small, .field > small.sm-muted { display: block; margin-top: 4px; }
.cp-cabinet { margin: 8px 0 0; overflow-wrap: anywhere; }
.cal-days { list-style: none; margin: 0 0 10px; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-day { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--ok-l); }
.cal-day.is-off { background: var(--warn-l); }
.cal-day__dow, .cal-day__kind { font-size: 12px; color: var(--muted); }
.cal-week { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 12px; }
.cal-grid { margin-bottom: 14px; }
.cp-pick input[type=search] { margin-bottom: 6px; }   /* контрагент документа: пошук над списком знайдених */
@media (max-width: 599px) {   /* телефон: список довідника — картками, підпис колонки — перед значенням */
  .ref-table thead { display: none; }
  .ref-table, .ref-table tbody, .ref-table tr { display: block; }
  .ref-table tr { padding: 8px 12px; border-bottom: 1px solid var(--line); }
  .ref-table td { display: block; padding: 2px 0; border: 0; text-align: left; }
  .ref-table td[data-label]::before { content: attr(data-label) ': '; color: var(--muted); }
  .cal-day__kind { display: none; }
}

/* облік: «Залишки» і «Рух товару» — на телефоні рядок картою: підписи колонок перед числами, кнопка «Рух» — праворуч угорі */
.stk-table__m { display: none; }
.stk-table__go { width: 1%; text-align: right; }
.stk-table__name { overflow-wrap: anywhere; }
.stk-moves tr.is-adj td, .stk-moves tr.is-rev td { color: var(--muted); }
.stk-moves__name { margin: 0 0 12px; font-size: 18px; overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .stk-table thead { display: none; }
  .stk-table, .stk-table tbody, .stk-table tr { display: block; }
  .stk-table tr { position: relative; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .stk-table td { display: block; padding: 2px 0; border: 0; text-align: left; white-space: normal; }
  .stk-table td:empty { display: none; }
  .stk-table tbody tr:hover td { background: none; }
  .stk-table__m { display: inline; color: var(--muted); }
  .stk-table td.stk-table__name { padding-right: 72px; font-weight: 600; }
  .stk-table td.stk-table__go { position: absolute; top: 8px; right: 0; width: auto; padding: 0; }
}
/* одиниці обліку: блок картки товару (рядок одиниці — пара «N складських = M одиниць», округлення, де пропонувати, своя ціна) і «Коефіцієнти панелей» */
.su-rows { display: grid; gap: 10px; margin: 8px 0 10px; }
.su-row { display: grid; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
.su-row .sm-grid { gap: 8px 12px; }
.su-row p { margin: 0; }
.su-row__head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.su-row__drop { margin-left: auto; }
.su-pair { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.su-pair input { flex: 1 1 4em; min-width: 3.5em; max-width: 8em; }
.su-pair span { white-space: nowrap; }
.su-fill__m { display: none; }
.su-fill__go { display: flex; margin-top: 12px; }   /* слева: справа внизу — кнопка «Помічник» */
.su-fill__name { overflow-wrap: anywhere; }
.su-fill__nw { white-space: nowrap; }
@media (max-width: 600px) {
  .su-fill thead { display: none; }
  .su-fill, .su-fill tbody, .su-fill tr { display: block; }
  .su-fill tr { position: relative; padding: 10px 0 10px 36px; border-bottom: 1px solid var(--line); }
  .su-fill td { display: block; padding: 2px 0; border: 0; white-space: normal; }
  .su-fill td.su-fill__pick { position: absolute; top: 10px; left: 4px; padding: 0; }
  .su-fill__m { display: inline; color: var(--muted); }
  .su-fill tbody tr:hover td { background: none; }
}
/* учёт — журнал и карточка документа, закрытие периода (docs.twig, doc.twig, doc/_lines.twig, period.twig) */
.doc-new { margin: 0 0 0 auto; align-items: center; }
.doc-new select { width: auto; max-width: 240px; }
.doc-rel { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 14px; }
.doc-form, .doc-acts { margin-bottom: 16px; }
.doc-lines-wrap { border-top: 1px solid var(--line); }
.doc-sub { margin: 0 0 10px; font-size: 15px; }
.doc-lines.is-edit { min-width: 860px; }
.doc-lines.is-edit td { padding: 6px; }
.doc-lines input { width: 100%; min-width: 0; }
.doc-lines .doc-l__product { width: 110px; } .doc-lines .doc-l__qty { width: 100px; } .doc-lines .doc-l__price { width: 110px; } .doc-lines .doc-l__note { width: 170px; }
.doc-lines .doc-l__name > span { display: block; padding-top: 10px; }
.doc-lines td.has-err input { border-color: var(--err); }
.doc-lines td .err { display: block; margin-top: 3px; color: var(--err); font-size: 12px; white-space: normal; }
.doc-lines tfoot th { color: var(--text); }
.doc-l__hint { margin: 8px 0 0; font-size: 13px; }
.doc-buttons { margin: 14px 0 0; }
.doc-act { margin: 0 0 12px; }
.doc-cancel { margin-bottom: 0; }
.doc-cancel > .field { flex: 1 1 280px; margin-bottom: 0; min-width: 0; }
.doc-moves { margin-bottom: 10px; }
.doc-files { margin: 0 0 12px; padding-left: 18px; }
.doc-files li { margin-bottom: 4px; overflow-wrap: anywhere; }
.doc-upload { margin: 0; }
.doc-upload > .field { flex: 1 1 260px; margin-bottom: 0; min-width: 0; }
.period { align-items: start; margin-bottom: 16px; }
.period > .sm-card { margin: 0; }
.period__date { margin: 0 0 8px; font-size: 18px; font-weight: 700; }
.period__drafts { margin: 0 0 12px; padding-left: 18px; }

/* телефон: журнал, рухи, рядки проведеного документа, історія — рядки картками з підписами (data-label), без прокрутки вбік */
.doc-l__u { display: none; }
#doc-filter .range input[type=date] { width: 150px; }   /* дата целиком (у .filters .range — узкие числа) */
@media (max-width: 599px) {
  :is(.doc-table, .doc-moves, .doc-history, .doc-lines:not(.is-edit)) thead { display: none; }
  :is(.doc-table, .doc-moves, .doc-history, .doc-lines:not(.is-edit)) :is(tbody, tfoot, tr, td, th) { display: block; width: 100%; }
  :is(.doc-table, .doc-moves, .doc-history, .doc-lines:not(.is-edit)) tr { padding: 8px 0; border-bottom: 1px solid var(--line); }
  :is(.doc-table, .doc-moves, .doc-history, .doc-lines:not(.is-edit)) :is(td, th) { padding: 2px 0; border: 0; text-align: left; white-space: normal; }
  :is(.doc-table, .doc-moves, .doc-history, .doc-lines:not(.is-edit)) td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); }
  .doc-lines:not(.is-edit) td:first-child, .doc-lines:not(.is-edit) .doc-l__unit, .doc-lines:not(.is-edit) .doc-l__nt:empty, .doc-lines:not(.is-edit) tfoot th:empty { display: none; }
  .doc-lines:not(.is-edit) .doc-l__u { display: inline; }
  .doc-lines:not(.is-edit) .doc-l__title { font-weight: 600; }
  .table-wrap:has(> :is(.doc-table, .doc-moves, .doc-history, .doc-lines:not(.is-edit))) { overflow: visible; }
}

.doc-warns { margin: 14px 0 0; }
.doc-warns ul { margin: 6px 0 0; padding-left: 18px; }
.doc-warns > .check { margin-top: 10px; }

/* «Новий документ» — дата поруч із видом; рядки правки на телефоні — картками з підписами, без прокрутки вбік */
.doc-new input[type=datetime-local] { width: auto; }
@media (max-width: 599px) {
  .doc-new { margin: 0; width: 100%; }
  .doc-new > * { flex: 1 1 100%; max-width: none; }
  .doc-lines.is-edit { min-width: 0; }
  .doc-lines.is-edit thead, .doc-lines.is-edit .doc-l__unit, .doc-lines.is-edit tfoot th:empty { display: none; }
  .doc-lines.is-edit :is(tbody, tfoot, tr, td, th) { display: block; width: 100%; }
  .doc-lines.is-edit tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  .doc-lines.is-edit :is(td, th) { padding: 3px 0; border: 0; text-align: left; }
  .doc-lines.is-edit td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 2px; color: var(--muted); font-size: 12.5px; }
  .doc-lines.is-edit .doc-l__n { font-weight: 600; color: var(--text); }
  .doc-lines.is-edit .doc-l__name > span { padding-top: 0; }
  .table-wrap:has(> .doc-lines.is-edit) { overflow: visible; }
}

/* продаж і повернення від покупця (panel/doc/sale*, customer_return*, panel/sale/issue): «= N шт» під кількістю, «було» під своєю ціною, партія й акція в одній
   клітинці; у продажу кнопки «Видати зараз» / «До видачі» замість загального «Провести» (воно — та сама видача без оплати); черга «Видача» — штуки крупно */
.sale-pcs, .sale-was { display: block; margin-top: 3px; color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.sale-was { text-decoration: line-through; }
.doc-lines .doc-l__unitsel { width: 90px; }
.doc-lines .doc-l__unitsel select, .sale-x select { width: 100%; min-width: 0; }
.sale-x { display: block; margin: 0 0 4px; }
.sale-x > span { display: block; color: var(--muted); font-size: 12px; }
.sale-lines .doc-l__x { min-width: 150px; }
.sale-go { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.sale-go > p { margin: 8px 0 0; font-size: 13px; }
.sale-go .sm-note, .sale-acts .sm-note { margin-bottom: 8px; }
.sale-go .sm-note ul, .sale-acts .sm-note ul { margin: 6px 0 0; padding-left: 18px; }
.sale-acts form + form, .sale-acts .sale-issue + form { margin-top: 16px; }
.sale-acts .sale-issue { flex-wrap: wrap; gap: 10px; }
.sale-acts .sale-issue .doc-act { margin: 0; }
.sale-pay .btn, .sale-return .btn { margin-top: 6px; }
.sale-return input { width: 90px; }
.sale-queue > .sm-card + .sm-card { margin-top: 14px; }
.sale-pcs-big { font-size: 17px; font-weight: 600; white-space: nowrap; }
.sale-queue h3 a, .sale-q__at { white-space: nowrap; }
.sale-q__h { margin: 22px 0 10px; font-size: 17px; }
.ret-lines.is-edit .doc-l__qty { white-space: nowrap; }
.ret-lines.is-edit .doc-l__qty input { width: calc(100% - 44px); }
@media (max-width: 599px) {
  .doc-lines .doc-l__unitsel, .sale-lines .doc-l__x { width: 100%; min-width: 0; }
  .sale-lines.is-edit .doc-l__x:not(:has(select, .check, .err)) { display: none; }   /* ні партій, ні акцій, ні пачки — без порожнього підпису */
  .sale-queue .doc-table td:empty { display: none; }
  .sale-go .sm-toolbar > .btn, .sale-acts .btn { flex: 1 1 100%; }
  .sale-return input { width: 70%; }
}

/* ===== грошові документи (doc/_payment.twig, money_transfer.twig, _debt_adjust.twig) й акт звірки (debt-act.twig) ===== */
.pay-hint { align-self: end; min-height: var(--ctl); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; color: var(--muted); font-size: 13px; }   /* клітинка поруч із сумою чи курсом — на рівні полів */
.pay-hint:empty { display: none; }
.pay-head:has(label#pay-rate) .pay-hint { grid-column: 1 / -1; min-height: 0; }   /* валютний рахунок: курс поруч із сумою, підказка — на весь рядок */
.act-totals { margin-bottom: 14px; }
@media (max-width: 599px) { .act-table td:empty { display: none; } }   /* акт на телефоні: порожні «+» / «−» без підписів */
.act-table tfoot :is(th, td) { font-weight: 600; border-top: 1px solid var(--line); }
/* прихід — шапка ПН і ПП (doc/receipt.twig, doc/supplier_return.twig), «Приймання на складі» (doc/receive.twig), «Новий товар від постачальника» */
.rcv-acts { margin: 4px 0 12px; flex-wrap: wrap; }
.rcv-checked ul { margin: 6px 0 12px; padding-left: 18px; }
.rcv-checked p, .rcv-hint { margin: 4px 0 0; font-size: 13px; }
.rcv-diff { margin-top: 8px; }
.rcv-form { margin-top: 14px; }
.rcv-lines input { width: 100%; min-width: 0; }
.rcv-lines td.has-err input { border-color: var(--err); }
.rcv-lines td .err { display: block; margin-top: 3px; color: var(--err); font-size: 12px; white-space: normal; }
.rcv-buttons { margin: 14px 0 0; align-items: center; flex-wrap: wrap; }
.rcv-state { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 4px 0 8px; }
.rcv-mark { display: flex; gap: 6px; margin-bottom: 4px; }
.rcv-mark > input:first-child:not(:last-child) { flex: 1 1 60%; min-width: 0; }
.rcv-mark > input:last-child, .rcv-mark > select { flex: 1 1 40%; min-width: 0; }
.rcv-lines .rcv-l__fact { width: 260px; }
.rcv-stale { color: var(--warn, var(--err)); }
.rcv-confirm { margin-bottom: 12px; }
.rcv-confirm ul { margin: 6px 0; padding-left: 18px; }
.rcv-free { align-self: end; min-height: var(--ctl); }
.doc-lines .doc-l__x select { min-width: 120px; }
@media (max-width: 599px) {
  .rcv-lines thead, .rcv-lines td:first-child { display: none; }
  .rcv-lines :is(tbody, tr, td) { display: block; width: 100%; }
  .rcv-lines tr { padding: 8px 0; border-bottom: 1px solid var(--line); }
  .rcv-lines td { padding: 2px 0; border: 0; text-align: left; white-space: normal; }
  .rcv-lines td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); }
  .rcv-lines .rcv-l__name { font-weight: 600; }
  .rcv-lines .rcv-l__fact { width: 100%; }
  .table-wrap:has(> .rcv-lines) { overflow: visible; }
}
/* складські документи (Stock\Docs): підказка шапки виду; назва партії під полем рядка */
.mov-hint { margin: 4px 0 12px; }
.doc-lines .doc-l__batch { display: block; margin-top: 3px; font-size: 12px; white-space: normal; }
.doc-lines input[type=checkbox] { width: 18px; }
.doc-lines .doc-l__x .check { white-space: nowrap; padding-top: 10px; }
/* ===== «Облік → Інвентаризація» (inventory*.twig): старт, лист розбіжностей (надлишок — зелений ±, нестача — червоний, «не пораховано» — смуга),
   підрахунок комірника — пошук/скан, поля пачок і штук у рядок, свої записи; на телефоні таблиці — картками з підписами (data-label) ===== */
.inv-start, .inv-request, .inv-head, .inv-next, .inv-drop, .inv-todo { margin-bottom: 14px; }
.inv-scope { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; padding: 0; border: 0; min-width: 0; }
.inv-scope legend { width: 100%; padding: 0; margin-bottom: 6px; color: var(--muted); font-size: 13px; font-weight: 600; }
.inv-acts { margin: 0 0 14px; }
.inv-table tr.is-plus .inv-table__diff { color: var(--ok); font-weight: 600; }
.inv-table tr.is-minus .inv-table__diff { color: var(--err); font-weight: 600; }
.inv-table tr.is-left td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.inv-table__who { font-size: 13px; }
.inv-table tfoot th { text-align: left; font-weight: 600; }
.inv-table tfoot th.sm-num { text-align: right; }
.inv-next .sm-card__body { display: grid; gap: 12px; }
.inv-recount .field { margin-bottom: 0; min-width: 220px; }
.inv-where { margin: 0 0 10px; font-weight: 600; }
.inv-todo ul { margin: 0; padding-left: 18px; }
.inv-found ul { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 6px; }
.inv-found .btn { width: 100%; justify-content: flex-start; height: auto; min-height: var(--ctl); white-space: normal; text-align: left; }
.inv-find { margin-bottom: 12px; }
.inv-find input[type=search] { flex: 1 1 240px; min-width: 0; }
.inv-item { margin-bottom: 14px; }
.inv-qty { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.inv-qty > .field { flex: 1 1 140px; margin-bottom: 0; min-width: 0; }
.inv-mine tr.is-off td { color: var(--muted); text-decoration: line-through; }
.inv-mine tr.is-off .sm-badge { text-decoration: none; }
@media (max-width: 599px) {
  :is(.inv-table, .inv-mine, .inv-list) thead { display: none; }
  :is(.inv-table, .inv-mine, .inv-list) :is(tbody, tfoot, tr, td, th) { display: block; width: 100%; }
  :is(.inv-table, .inv-mine, .inv-list) tr { position: relative; padding: 8px 0; border-bottom: 1px solid var(--line); }
  :is(.inv-table, .inv-mine, .inv-list) :is(td, th) { padding: 2px 0; border: 0; text-align: left; white-space: normal; }
  :is(.inv-table, .inv-mine, .inv-list) td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); }
  :is(.inv-table, .inv-mine, .inv-list) td[data-label]:empty { display: none; }
  .inv-table tfoot th.sm-num { text-align: left; }
  .inv-table tr.is-left td:first-child { box-shadow: none; }
  .inv-table tr.is-left { box-shadow: inset 3px 0 0 var(--warn); padding-left: 10px; }
  .inv-table__name, .inv-mine__name { font-weight: 600; }
  .inv-table__pick { position: absolute; right: 0; top: 6px; width: auto !important; }
  .inv-table tr:has(.inv-table__pick) .inv-table__name { padding-right: 44px; }
  .table-wrap:has(> :is(.inv-table, .inv-mine, .inv-list)) { overflow: visible; }
  .inv-find .btn { flex: 1 1 100%; }
}

/* ===== «Продажі → Замовлення» (panel/orders.twig, order.twig, order-new.twig): список, картка — покупець і доставка, резерв і дії (розгортаються
   <details>), товари з резервом по складах, документи, історія; на телефоні таблиці — картками з підписами (data-label), без прокрутки вбік ===== */
.ord-meta { margin: -6px 0 14px; }
.ord-acts { display: grid; gap: 12px; align-content: start; }
.ord-acts .sm-kv { margin-bottom: 4px; }
.ord-acts > details > summary { list-style: none; width: fit-content; } .ord-acts > details > summary::-webkit-details-marker { display: none; }
.ord-acts > details[open] { padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.ord-acts > details[open] > summary { margin-bottom: 10px; }
.ord-acts .doc-act { margin: 0; }
.ord-out { margin-bottom: 10px; }
.ord-out input { max-width: 160px; }
.ord-qty { width: 96px; }
.ord-by { margin: 4px 0 0; padding-left: 16px; color: var(--muted); font-size: 13px; }
.ord-add { margin-bottom: 8px; }
.ord-add > .field:first-child { flex: 1 1 280px; min-width: 0; }
.ord-add > .field { flex: 0 1 160px; }
.ord-move > summary { cursor: pointer; list-style: none; } .ord-move > summary::-webkit-details-marker { display: none; }
.ord-move__row { align-items: flex-end; }
.ord-move__what { flex: 1 1 240px; padding-bottom: 10px; }
.ord-ret details > summary { cursor: pointer; }
.ord-ret details form { margin-top: 10px; }
.ord-hist-form { margin-bottom: 14px; }
.ord-hist__comment { white-space: pre-line; overflow-wrap: anywhere; }
.ord-edits { margin: 0; padding-left: 18px; display: grid; gap: 8px; }
.ord-edits ul { margin: 2px 0 4px; padding-left: 16px; }
.ord-list__who { overflow-wrap: anywhere; }
.ord-until { white-space: nowrap; }
@media (max-width: 599px) {
  .ord-table thead { display: none; }
  .ord-table :is(tbody, tr, td) { display: block; width: 100%; }
  .ord-table tr { padding: 8px 0; border-bottom: 1px solid var(--line); }
  .ord-table td { padding: 2px 0; border: 0; text-align: left; white-space: normal; }
  .ord-table td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); }
  .ord-table td.sm-num { text-align: left; }
  .table-wrap:has(> .ord-table) { overflow: visible; }
  .ord-add > .field, .ord-add > .field:first-child { flex: 1 1 100%; }
  .ord-out input { max-width: none; }
  .ord-top > #ord-acts { order: -1; }   /* телефон: резерв і дії — над формою контактів */
}
.ord-scope { margin: 0 0 10px; padding: 0; border: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.ord-scope > legend { margin-bottom: 6px; color: var(--muted); font-size: 13px; }
.ord-topay { margin: 4px 0 8px; font-weight: 600; }
/* ===== картка документа (doc.twig, doc/_lines.twig): форма — панеллю «Зберегти» каркаса, під рядками лише «Провести» з поясненням; партія — списком
   (підпис + залишок, довгий — обрізано, у списку повністю); сторона «в» пересортування — другим рядком під рядком документа (поля в ряд, на телефоні — стовпчиком) ===== */
.doc-buttons { align-items: center; flex-wrap: wrap; gap: 8px 14px; }
.doc-buttons__hint { display: none; font-size: 13px; }
html.has-save .doc-buttons__hint { display: inline; }   /* пояснення — лише коли є незбережене */
.doc-lines .doc-l__x select { width: 100%; max-width: 280px; }
@media (min-width: 600px) { .doc-lines--lean.is-edit .doc-l__product { width: 180px; } }   /* без цін є місце: підказка поля товару — повністю; на телефоні — уся ширина */
.doc-lines .doc-l__batch--fixed { padding-top: 10px; font-size: 13px; }
.doc-lines .doc-l__tof:has(> .doc-l__ch:empty), .sale-x--ch:has(> .doc-l__ch:empty) { display: none; }   /* список ще не потрібен (товару немає) */
.doc-lines--to tr:has(+ .doc-l__to) > td { border-bottom: 0; }
.doc-lines--to .doc-l__to > :is(td, th) { padding-top: 0; text-align: left; vertical-align: top; }
.doc-lines--to .doc-l__to > th { text-align: right; }
.doc-lines.is-edit .doc-l__unit { padding-top: 16px; }
.doc-l__tos { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px 12px; }
.doc-lines .doc-l__tohead { font-weight: 600; white-space: nowrap; }
.doc-lines.is-edit .doc-l__tohead { padding-top: 32px; }
.doc-l__tohead::before { content: "→ "; }
.doc-lines.is-edit .doc-l__tof[data-field="batch_new"] { padding-top: 20px; }
.doc-lines .doc-l__tof { flex: 0 1 220px; min-width: 0; }
.doc-lines .doc-l__tof[data-field="to_qty"] { flex-basis: 110px; }
.doc-lines .doc-l__tof[data-field="batch_new"] { flex-basis: auto; }
.doc-lines .doc-l__tof .check { padding-top: 0; min-height: var(--ctl); display: inline-flex; align-items: center; }
.doc-l__lab { display: block; margin-bottom: 2px; color: var(--muted); font-size: 12px; }
.doc-lines:not(.is-edit) .doc-l__tof { flex: 0 1 auto; }
.doc-lines:not(.is-edit) .doc-l__lab { display: inline; margin: 0; }
.doc-lines:not(.is-edit) .doc-l__lab::after { content: ": "; }
@media (max-width: 599px) {
  .doc-lines--to tr:has(+ .doc-l__to) { border-bottom: 0; padding-bottom: 0; }
  .doc-lines .doc-l__to > th:first-child { display: none; }
  .doc-lines.is-edit .doc-l__tof[data-field="batch_new"] { padding-top: 0; }
  .doc-l__tos { flex-direction: column; align-items: stretch; }
  .doc-lines .doc-l__tof, .doc-lines .doc-l__tof[data-field="to_qty"] { flex: 1 1 auto; }
  .doc-lines .doc-l__x select { max-width: none; }
  .doc-lines.is-edit :is(.doc-l__name, .doc-l__x):empty, .doc-lines.is-edit td.doc-l__x:has(> .doc-l__ch:empty):not(:has(.err)) { display: none; }   /* нового рядка: ні назви (лише товари), ні партії (товару ще немає) */
}

/* ===== Наявність на сайті з обліку (Stock\SiteStock): блок «Облік → Залишки», підказка в картці товару ===== */
.avail-site { margin-bottom: 16px; }
.avail-site .sm-card__body p { margin: 0 0 10px; }
.avail-site .sm-toolbar { margin: 0; }
.avail-note, .avail-mark { grid-column: 1 / -1; margin: 0; }
.avail-note { margin-bottom: 8px; }

/* ===== «Облік → Приват24» (privat24*.twig): «Розібрати» — поля оплати чи переміщення за вибором «Що це» (без JS), кнопки чернетки в рядок, довгі призначення — переносом ===== */
#p24-resolve:has(input[name=action][value=move]:checked) .p24-pay,
#p24-resolve:has(input[name=action][value=pay]:checked) .p24-move { display: none; }
.p24-action { border: 0; padding: 0; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.p24-action legend { padding: 0; margin-bottom: 6px; }
.p24-acts form { display: inline-block; margin: 0 4px 4px 0; }
.p24-need { margin: 0 0 12px; padding-left: 18px; }
.p24-purpose { overflow-wrap: anywhere; }
/* «Рахунки в банку» у картці «Приват24» і поле «Рахунок у Приват24» картки рахунку */
.p24-acc h4 { margin: 12px 0 6px; }
.p24-acc__list { list-style: none; margin: 0 0 8px; padding: 0; }
.p24-acc__list li { padding: 8px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.p24-acc__state { margin-top: 4px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.p24-acc__make { display: inline; }
.ref-p24 { grid-column: 1 / -1; }
.ref-p24__state { margin: 4px 0; overflow-wrap: anywhere; }
.p24-accs { margin: 0 0 8px; padding-left: 18px; }
.p24-accs li { margin-bottom: 8px; overflow-wrap: anywhere; }
.p24-open { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; margin-top: 6px; }
.p24-open .field { flex: 0 1 220px; margin: 0; }
.p24-acc__bind { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.p24-acc__bind select { max-width: 100%; }

/* ===== «Продажі → Каса» (panel/cash/*.twig): вкладки — у заголовку сторінки, поле «Товар» на всю ширину; чек ліворуч і оплата праворуч, закріплена (ширина —
   за самим вікном каси, container query: і з меню, і без нього), вужче — одне під одним; рядки чека сіткою (вузький чек — назва, далі кількість / ціна / сума);
   «Решта», «Карткою», примітки переказу й «при видачі» — за вибраним способом (без JS: :has), «Продати» при «Оплата при видачі» — сховано; товарний чек —
   80 мм чи A4 на друці ===== */
.cash-tabs { display: flex; flex-wrap: wrap; gap: 2px; }
.cash-tab { padding: 6px 12px; border-bottom: 2px solid transparent; color: var(--muted); text-decoration: none; font-weight: 600; }
.cash-tab:hover { color: var(--text); }
.cash-tab[aria-current="page"] { color: var(--brand-d); border-bottom-color: var(--brand); }
.cash { container-type: inline-size; }
.cash-scan { display: flex; gap: 10px; align-items: flex-end; margin-bottom: 12px; }
.cash-scan__field { flex: 1 1 auto; margin: 0; }
.cash-scan__field input { font-size: 18px; }
.cash-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: start; }
.cash-side { display: grid; gap: 12px; align-content: start; }
@container (min-width: 700px) {
  .cash-grid { grid-template-columns: minmax(0, 1fr) minmax(270px, 330px); }
  .cash-side { position: sticky; top: calc(var(--hdr) + 8px); }
}
.cash-check { container-type: inline-size; }
.cash-store { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.cash-store select { min-width: 150px; }
.cash-lines { display: grid; gap: 0; }
.cash-line { display: grid; grid-template-columns: 200px minmax(110px, 140px) minmax(90px, 1fr) 40px; grid-template-areas: "name name name name" "qty price sum rm";
  gap: 6px 10px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cash-line:last-child { border-bottom: 0; }
.cash-line__name { grid-area: name; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; font-weight: 600; overflow-wrap: anywhere; }
.cash-line__n { color: var(--muted); font-weight: 400; min-width: 1.4em; }
.cash-line__qty { grid-area: qty; display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; max-width: 220px; }
.cash-line__qty input { width: 84px; text-align: right; }
.cash-line__qty select { width: auto; min-width: 70px; }
.cash-line__u { color: var(--muted); }
.cash-line__pcs, .cash-line__price .sale-was { flex: 1 0 100%; color: var(--muted); font-size: 12px; }
.cash-line__price { grid-area: price; }
.cash-line__price input { width: 100%; text-align: right; }
.cash-line__lab { display: none; }
.cash-line__sum { grid-area: sum; padding-top: 9px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cash-line__rm { grid-area: rm; margin-top: 2px; }
.cash-line__x { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; padding-left: 1.9em; }
.cash-line__x label:not(.check) { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.cash-line__x select { width: auto; max-width: 100%; }
.cash-line__x .sale-hint { flex-basis: 100%; margin-top: 0; }   /* «Є акція…» і пояснення — окремим рядком під вибором */
.cash-line .err { flex: 1 0 100%; }
.cash-line--wh, .cash-line--split { background: var(--warn-l); }
.cash-line--short { background: var(--err-l); }
.cash-wh .check { display: flex; margin-top: 6px; }
@container (max-width: 520px) {
  .cash-line { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 40px; grid-template-areas: "name name name" "qty price rm" "sum sum sum"; }
  .cash-line__qty input { width: 56px; }
  .cash-line__qty select { min-width: 0; }
  .cash-line__lab { display: block; color: var(--muted); font-size: 12px; }
  .cash-line__qty::before { content: ""; display: block; flex: 1 0 100%; height: 18px; }   /* вровень з полем ціни під підписом «Ціна» */
  .cash-line__sum { padding-top: 0; }
  .cash-line__rm { margin-top: 20px; }
  .cash-line__x { padding-left: 0; }
}
.cash-total { display: flex; justify-content: flex-end; gap: 12px; align-items: baseline; padding-top: 12px; font-size: 18px; }
.cash-total b, .cash-due b { font-variant-numeric: tabular-nums; }
.cash-pay .sm-card__body { padding-top: 12px; }
.cash-due { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 8px; font-size: 15px; }
.cash-due b { font-size: 26px; }
.cash-methods { border: 0; padding: 0; margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 4px 6px; }
.cash-methods legend { padding: 0; margin-bottom: 6px; color: var(--muted); font-size: 13px; }
.cash-m { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 10px 0 8px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; font-size: 13.5px; }
.cash-m:has(input:checked) { border-color: var(--brand); background: var(--brand-l); color: var(--brand-d); }
.cash-pay__mixed, .cash-pay__got, .cash-pay__note { display: none; }
.cash-pay:has(input[name=method][value=mixed]:checked) .cash-pay__mixed,
.cash-pay:has(input[name=method][value=cash]:checked) .cash-pay__got,
.cash-pay:has(input[name=method][value=mixed]:checked) .cash-pay__got,
.cash-pay:has(input[name=method][value=transfer]:checked) .cash-pay__transfer,
.cash-pay:has(input[name=method][value=later]:checked) .cash-pay__later { display: block; }
.cash-pay:has(input[name=method][value=later]:checked) .cash-go__sell[data-act=sell] { display: none; }
.cash-pay:has(input[name=method][value=mixed]:checked) .cash-pay__round { display: none; }
.cash-pay .field { margin-bottom: 6px; }
.cash-pay__note { margin: 0 0 8px; font-size: 12.5px; }
.cash-calc { margin: 0 0 8px; color: var(--muted); }
.cash-calc output { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
.cash-change output { font-size: 18px; color: var(--ok); }
.cash-go { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.cash-go__sell { flex: 1 1 auto; font-size: 16px; }
.cash-go kbd, .cash-keys kbd { margin-left: 6px; padding: 0 5px; border: 1px solid currentColor; border-radius: 4px; font-size: 11px; opacity: .8; }
.cash-go--more { margin-top: 8px; }
.cash-go__hint { margin: 8px 0 0; font-size: 12px; }
.cash-keys { margin: 0; font-size: 12px; }
.cash-cp > summary { cursor: pointer; list-style: none; }
.cash-cp > summary::-webkit-details-marker { display: none; }
.cash-cp > summary h3 { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; font-size: 14px; }
.cash-cp:not([open]) > summary { border-bottom: 0; }
.cash-cp__now { margin: 0 0 8px; }
.cash-cps { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 0; }
.cash-cps__one { justify-content: flex-start; text-align: left; white-space: normal; height: auto; min-height: var(--ctl); }
.cash-newcp { margin-top: 10px; }
.cash-newcp summary { cursor: pointer; color: var(--brand-d); }
.cash-newcp .sm-grid { margin: 10px 0; }
.cash-found { margin-bottom: 14px; }
.cash-found__list { display: flex; flex-wrap: wrap; gap: 6px; }
.cash-found__list .btn { height: auto; min-height: var(--ctl); white-space: normal; text-align: left; }
.cash-done p { margin: 0 0 6px; }
.cash-done__change { font-size: 18px; font-weight: 700; }
.cash-done__acts { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.cash-done .cash-done__acts { margin: 8px 0 0; }
.cash-parked, .cash-held { margin-top: 14px; }
.cash-parked__list, .cash-held__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cash-parked__list li, .cash-held__list li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.cash-held__pay { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-left: auto; }
.cash-held__pay select { width: auto; }
.cash-find { margin-bottom: 10px; }
.cash-find input[type=search] { flex: 1 1 260px; }
.cash-ret__q { display: inline-flex; align-items: center; gap: 6px; }
.cash-ret__q input { width: 90px; text-align: right; }
.cash-ret .cash-methods, .cash-ord .cash-methods { margin-top: 12px; }
.cash-back { border: 0; padding: 0; margin: 12px 0 0; }
.cash-back legend { padding: 0; margin-bottom: 6px; font-weight: 600; }
.cash-day__stats, .cash-day__sum, .cash-day__ops, .cash-close { margin-bottom: 14px; }
.cash-day__ops .sm-card .btn, .cash-close .btn { margin-top: 4px; }
.cash-close__done { margin: 0; }
@media (max-width: 699px) {
  .cash-scan { flex-wrap: wrap; }
  .cash-scan .btn { flex: 1 1 auto; }
  .cash-check .sm-card__head { flex-wrap: wrap; }
  .cash-day__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cash-day__ops { grid-template-columns: minmax(0, 1fr); }
  .cash-keys, .cash-go kbd { display: none; }   /* на телефоні клавіш F немає */
  .cash-held__pay { margin-left: 0; }
}
/* товарний чек: на екрані — картка шириною стрічки; на друці — лише чек (80 мм — сторінка-стрічка, A4 — звичайна) */
.cash-receipt { max-width: 340px; margin: 0 auto 40px; padding: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); color: var(--text); font-size: 13px; }
.cash-receipt__shop { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; padding-bottom: 8px; border-bottom: 1px dashed var(--line); }
.cash-receipt__shop b { font-size: 18px; }
.cash-receipt__doc { padding: 8px 0; border-bottom: 1px dashed var(--line); }
.cash-receipt__doc h2 { margin: 0 0 2px; font-size: 14px; }
.cash-receipt__at { margin: 0 0 6px; color: var(--muted); }
.cash-receipt__lines { width: 100%; border-collapse: collapse; }
.cash-receipt__lines td, .cash-receipt__lines th { padding: 1px 0; text-align: left; vertical-align: top; }
.cash-receipt__lines .sm-num { text-align: right; white-space: nowrap; }
.cash-receipt__name { padding-top: 4px !important; }
.cash-receipt__calc td:first-child, .cash-receipt__round td:first-child { color: var(--muted); }
.cash-receipt__lines tfoot th { padding-top: 6px; font-size: 15px; border-top: 1px solid var(--line); }
.cash-receipt__change { margin: 8px 0 0; text-align: right; font-weight: 700; }
.cash-receipt__wait { margin: 6px 0 0; font-weight: 600; }
.cash-receipt__end { display: flex; flex-direction: column; align-items: center; gap: 2px; padding-top: 10px; text-align: center; }
.cash-receipt__end small { color: var(--muted); }
.cash-print-acts { justify-content: center; margin-bottom: 14px; }
@page cash80 { size: 80mm auto; margin: 3mm; }
@media print {
  body:has(.cash-receipt) { background: #fff; }
  body:has(.cash-receipt) > :not(main), body:has(.cash-receipt) .page > :not(.cash-receipt), body:has(.cash-receipt) .page-head { display: none !important; }
  body:has(.cash-receipt) main { min-height: 0; padding: 0; }
  .cash-receipt { max-width: none; margin: 0; padding: 0; border: 0; border-radius: 0; background: #fff; color: #000; font-size: 11pt; }
  .cash-receipt :is(.cash-receipt__at, .cash-receipt__calc td:first-child, .cash-receipt__round td:first-child, .cash-receipt__end small) { color: #000; }
  html.is-print-80 .cash-receipt { page: cash80; font-size: 9pt; }
  html.is-print-80 .cash-receipt__shop b { font-size: 12pt; }
}

/* ===== Нова Пошта (Sales\Ttn): блок картки замовлення, «Продажі → Нова Пошта» ===== */
.ord-np__acts { margin: 4px 0 8px; flex-wrap: wrap; }
.ord-np__acts form { margin: 0; }
.ord-np__new > summary { list-style: none; width: fit-content; } .ord-np__new > summary::-webkit-details-marker { display: none; }
.ord-np__new[open] > summary { margin-bottom: 12px; }
.ord-np .doc-sub:first-of-type { margin-top: 0; }
.ord-np .sm-kv { margin: 6px 0 10px; }
.np-days { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); white-space: nowrap; }
.np-days input { width: 80px; }
#np-filter:not(:has(select[name=show] option[value=late]:checked)) .np-days { display: none; }   /* «днів» — лише для «не доставлено» */
.np-table td { overflow-wrap: anywhere; }
.np-table td.sm-nowrap { overflow-wrap: normal; }
#np-existing { margin: 10px 0 6px; }
@media (max-width: 599px) {
  .ord-np__nums, .ord-np__dims { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }   /* телефон: вага, об'єм, місця й розміри — по три в ряд (короткі числа) */
  .ord-np__nums small, .ord-np__dims small { display: none; }
  .ord-table td.ord-hist__comment { white-space: pre-line; }   /* історія на телефоні — теж з переносами (номер ТТН, «Відстежити», вартість — окремими рядками) */
}

/* ===== Акції в обліку: картка товару — акція на партію («Скільки всього» — залишок партії), рядок видаткової — «Є акція», «Поділити» ===== */
.promo:has(select[data-promo-batch] option:checked:not([value=""])) .promo__qty { display: none; }   /* на партію — всього рахує система */
.sale-hint { display: block; margin-top: 3px; color: var(--muted); font-size: 12.5px; }
.sale-hint--warn { color: var(--text); padding-left: 6px; border-left: 3px solid var(--warn); }
.doc-l__x [data-promo-split] { margin-top: 4px; }

/* ===== «Головна» по ролях: кнопки сценаріїв (крупні, на телефоні — по дві в ряд), «Що зробити зараз», «Є товар?» (поле, склади, акція) ===== */
.dash-go { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.dash-go__f { display: contents; }
.dash-go__b { justify-content: flex-start; width: 100%; min-height: 52px; padding: 10px 14px; text-align: left; line-height: 1.25; }
.dash-go__b .ic { flex: none; width: 20px; height: 20px; }
.dash-done { margin: 0; font-size: 15px; font-weight: 600; color: var(--ok); }
.dash-todo a { font-weight: 600; }
.dash-have { margin-bottom: 12px; }
.dash-have__list { margin: 0; padding: 0; list-style: none; }
.dash-have__list > li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.dash-have__list > li:last-child { border-bottom: 0; }
.dash-have__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin-bottom: 4px; overflow-wrap: anywhere; }
.dash-have__list p { margin: 4px 0 0; }
.dash-have__no { color: var(--err); font-weight: 600; }
.dash-have__yes { color: var(--ok); font-weight: 600; }
.dash-have__promo { padding-left: 6px; border-left: 3px solid var(--warn); }
.dash-have__more { font-size: 12.5px; }
.dash-have__list .dash-list small { white-space: normal; text-align: right; }
.dash-have__defect { color: var(--muted); font-size: 12.5px; }
.inv-show { margin-bottom: 10px; }
.inv-show a[aria-current="page"] { background: var(--brand-l); border-color: var(--brand); color: var(--brand-d); }
@media (max-width: 599px) {
  .dash-go { grid-template-columns: 1fr 1fr; gap: 8px; }
  .dash-go__b { min-height: 60px; padding: 10px; font-size: 14px; }
}

/* ===== Пошук по панелі (Ctrl+K / ⌘K): вікно зверху, групи результатів, вибраний рядок — стрілками; на телефоні — на всю ширину ===== */
.ps-key { white-space: nowrap; padding: 1px 5px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); font: 600 11px/1.4 var(--font); }
.psearch { width: min(640px, calc(100vw - 32px)); max-width: none; max-height: min(600px, calc(90dvh - 16px)); margin: 10vh auto auto; padding: 0; border: 1px solid var(--line);
  border-radius: 12px; background: var(--bg); color: var(--text); box-shadow: var(--shadow); overflow: hidden; }
.psearch[open] { display: flex; flex-direction: column; }
.psearch::backdrop { background: rgba(15, 23, 42, .45); }
.psearch__form { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.psearch__form > .ic { color: var(--muted); }
.psearch__form input { flex: 1; min-width: 0; }
.psearch__list { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 6px 8px; }
.psearch__gh { margin: 10px 8px 4px; color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.psearch__item { display: flex; flex-direction: column; gap: 1px; padding: 7px 10px; border-radius: 8px; color: var(--text); text-decoration: none; }
.psearch__item:hover, .psearch__item.is-active { background: var(--brand-l); color: var(--text); }
.psearch__item.is-active { box-shadow: inset 3px 0 0 var(--brand); }
.psearch__t { font-weight: 600; overflow-wrap: anywhere; }
.psearch__s { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.psearch__empty { margin: 12px 8px; color: var(--muted); }
.psearch__gh button { margin-left: 8px; padding: 0; border: 0; background: none; color: var(--brand-d); font: inherit; text-transform: none; letter-spacing: 0; cursor: pointer; }
button.psearch__item { width: 100%; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; }
button.psearch__item:hover, button.psearch__item.is-active { background: var(--brand-l); }
.psearch__keys { margin: 0; padding: 8px 12px; border-top: 1px solid var(--line); font-size: 12px; }
@media (max-width: 600px) {   /* телефон: в шапке ещё и «Пошук» — язык одной кнопкой (другой язык), кнопки плотнее: «Вийти» помещается и на 375 px */
  .top .lang button[aria-pressed="true"] { display: none; }
  .top__tools { gap: 2px; padding: 0 6px 0 2px; }
  .top__tools .btn-icon { min-width: 34px; padding: 0 7px; }
  .who { gap: 4px; padding-left: 2px; }
}
@media (max-width: 767px) {
  .ps-key, .psearch__keys { display: none; }
  .psearch { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); margin: 8px auto auto; }
}
@media (min-width: 768px) and (max-width: 1023px) {   /* планшет: «Пошук», «Сканер», «Сайт» — значками, без Ctrl K, имя короче — шапка помещается с длинным именем */
  .ps-key { display: none; }
  .top__tools .btn-icon > span:not(.av):not(.who__name) { display: none; }
  .who__name { max-width: 12ch; }
}

/* ===== «Облік → Товари»: список і картка товару обліку (Stock\Goods) ===== */
.gd-table td.gd-thumb { width: 52px; padding-top: 5px; padding-bottom: 5px; }
.gd-table td.gd-thumb img { width: 40px; height: 40px; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; background: var(--img); }
.gd-table__name a { font-weight: 600; }
.gd-head__body { display: flex; gap: 18px; align-items: flex-start; }
.gd-photo img, .gd-photo__none { width: 160px; height: 160px; object-fit: contain; border: 1px solid var(--line); border-radius: var(--r); background: var(--img); }
.gd-photo__none { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--muted); font-size: 12.5px; }
.gd-head__info { flex: 1; min-width: 0; }
.gd-head__info .sm-kv dd { overflow-wrap: anywhere; }
.gd-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.gd-acts form { margin: 0; }
.gd-grid { margin: 14px 0; }
.gd-grid > .sm-card, .gd-grid + .sm-card { margin: 0; }
.gd-total { margin: 10px 0 0; }
#gd-cost { margin-top: 12px; }
.gd-codes { margin: 0; padding-left: 18px; } .gd-codes li { overflow-wrap: anywhere; }
.gd-stock tr.is-defect td { color: var(--muted); }
#gd-min { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }   /* мінімальний залишок — під залишком */
#gd-min .field { max-width: 320px; }
.gd-order .sm-card__head .sm-muted { font-size: 13px; }
@media (max-width: 599px) {
  .gd-head__body { flex-direction: column; align-items: stretch; }
  .gd-photo { align-self: center; }
  .gd-acts .btn { min-height: 44px; }   /* телефон — кнопки під палець */
  .gd-table td.gd-thumb { position: absolute; top: 10px; left: 0; width: auto; padding: 0; }
  .gd-table tr { padding-left: 52px; min-height: 60px; }
  .stk-table td.gd-table__name { padding-right: 0; }
}

/* ===== Друк (Core\Prints): «Система → Друк» — логотип, печатка, підпис; кнопки над аркушем форми (сам аркуш — print.css) ===== */
.prn-img h4 { margin: 0 0 8px; }
.prn-img__pic { display: block; max-width: 100%; max-height: 120px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 6px; }
.prn-img form { margin: 0 0 8px; }
.prn-acts { flex-wrap: wrap; }

/* ===== «Склад» з телефона (panel/phone/*.twig; поле коду phone/_find.twig — і в листі приймання, підрахунку, черзі «Видача»): великі кнопки по дві, поле
   коду сканера, накладні «до видачі» — картками; лист видачі — рядок картою: назва, кількість великим, позначка на весь рядок (палець), щойно відмічене —
   спалахом; телефон 375 — без прокрутки вбік ===== */
.wh { display: grid; gap: 14px; min-width: 0; }
.wh > * { min-width: 0; margin: 0; }
.wh-acts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.wh-act { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; min-height: 108px; padding: 14px; border: 1px solid var(--line);
  border-radius: var(--r); background: var(--card); box-shadow: var(--shadow-s); color: var(--text); font: inherit; font-size: 16px; font-weight: 700; line-height: 1.25; text-align: left;
  text-decoration: none; cursor: pointer; overflow-wrap: anywhere; }
.wh-act:hover, .wh-act:focus-visible { border-color: var(--brand); color: var(--text); }
.wh-act .ic { width: 28px; height: 28px; color: var(--brand-d); }
.wh-act small { display: block; margin-top: 4px; color: var(--muted); font-size: 12.5px; font-weight: 400; }
.wh-act__n { position: absolute; top: 10px; right: 10px; min-width: 26px; padding: 1px 8px; border-radius: 999px; background: var(--warn-l); color: var(--text); font-size: 14px; text-align: center; }
.wh-scan { display: grid; gap: 8px; min-width: 0; margin: 0 0 12px; }
.wh .wh-scan { margin: 0; }
.wh-scan__field { margin: 0; min-width: 0; }   /* підпис — над полем: на 375 px повністю, а не обрізаною підказкою в полі */
.wh-scan__row { flex-wrap: nowrap; min-width: 0; }
.wh-scan__row input { flex: 1; min-width: 0; }
.wh-scan__cam { justify-self: start; }
.wh-scan__cam .ic { margin-right: 6px; }
#inv-count > .wh-scan__cam { margin: 0 0 8px; }
.wh-say { margin: 0; color: var(--ok); font-weight: 600; } .wh-say.is-err { color: var(--err); }
.wh-err { display: grid; gap: 4px; } .wh-err small { overflow-wrap: anywhere; }
.wh-h { margin: 4px 0 8px; font-size: 17px; }
.wh-held__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 10px; margin-bottom: 4px; }
.wh-held__head .wh-h { margin: 0; } .wh-held__store { min-width: 0; } .wh-held__store select { max-width: 100%; }
.wh-docs, .wh-lines { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.wh-doc { display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.wh-doc:hover { border-color: var(--brand); color: var(--text); }
.wh-doc b { font-size: 16px; }
.wh-comment { padding-left: 8px; border-left: 3px solid var(--warn); }
.wh-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 2px 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--card); overflow-wrap: anywhere; }
.wh-line--mark { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; cursor: pointer; }
.wh-line--mark input { width: 26px; height: 26px; grid-row: span 2; }
.wh-line--mark:has(input:checked) { border-color: var(--ok); background: var(--ok-l); }
.wh-line__qty { font-size: 20px; white-space: nowrap; text-align: right; }
.wh-line__unit, .wh-line__note { grid-column: 1 / -1; font-size: 13px; }
.wh-line--mark .wh-line__unit, .wh-line--mark .wh-line__note { grid-column: 2 / -1; }
.wh-line__note { color: var(--text); }
@keyframes wh-hit { from { box-shadow: 0 0 0 4px var(--brand); } to { box-shadow: 0 0 0 0 transparent; } }
.wh-lines li.is-hit .wh-line { animation: wh-hit 1.2s; }
#rcv tr.is-hit > td { background: var(--brand-l); }   /* рядок, до якого привів скан, — фоном, доки не скануть інший */
.wh-issue { display: grid; gap: 8px; }
.wh-count { margin: 0; color: var(--muted); font-weight: 600; }
.wh-issue__btn { min-height: 52px; font-size: 18px; }
.wh-issue__btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }   /* «Видано» недоступне, поки не відмічено все — видно одразу */
.wh-why { margin: 0; color: var(--muted); font-size: 13px; }
.wh-issue:not(:has(.wh-issue__btn:disabled)) .wh-why { display: none; }
@media (max-width: 599px) {
  .wh-acts { gap: 8px; }
  .wh-act { min-height: 96px; padding: 12px; font-size: 15px; }
  .wh-issue { position: sticky; bottom: 0; padding: 8px 0; background: var(--soft); }   /* «Видано» — завжди під пальцем під довгим списком */
}

/* ---------- рахунок покупцю, заявка й рахунок постачальника (Sales\Invoicing, Stock\Purchases): стан у шапці, дії «на основі» ---------- */
.inv2-state { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 0 0 14px; }
.inv2-acts .sm-card__body { align-items: center; }
/* ===== «Що сталося?» — сценарії кнопками (panel/scenarios.twig) і майстри кроками (panel/scenarios/*.twig) ===== */
.scn-lead { margin: 0 0 10px; }
.scn-top { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 16px; margin: 0 0 14px; }
.scn-filter { flex: 1 1 260px; max-width: 420px; margin: 0; }
.scn-nav { display: flex; flex-wrap: wrap; gap: 6px; }
.scn-none { margin: 0 0 14px; }
.scn[hidden], .scn-sec[hidden] { display: none; }   /* відбір «Знайти сценарій» (panel.js) — сильніше за display: grid рядка */
.scn__later { flex-basis: 100%; color: var(--muted); font-size: 12px; text-align: right; }
.scn-list { margin: 0; padding: 0; list-style: none; }
.scn { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, auto); align-items: center; gap: 6px 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.scn:first-child { border-top: 0; padding-top: 0; }
.scn__text { min-width: 0; overflow-wrap: anywhere; }
.scn__title { font-size: 15px; }
.scn__who { font-size: 13px; }
.scn__hint { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.scn__acts { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px 8px; max-width: 460px; }
.scn__f { display: contents; }
.scn__acts .btn:disabled { opacity: .6; cursor: not-allowed; }
.scn__how { font-size: 13px; white-space: nowrap; }
.scn-back { margin: 0 0 12px; }
.scn-steps { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.scn-step { margin: 0; }
.scn-found { display: grid; gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; }
.scn-found > li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card);
  overflow-wrap: anywhere; }
.scn-found a[aria-current="true"] { color: var(--brand); }
.scn-found > li:has(a[aria-current="true"]) { border-color: var(--brand); background: var(--brand-l); }
.scn-choice { display: flex; flex-wrap: wrap; gap: 8px; }
.scn-act { margin: 12px 0 0; }
.scn-act p { margin: 0 0 8px; }
.scn-roles { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 12px 0; padding: 0; border: 0; }
.scn-roles legend { width: 100%; margin-bottom: 6px; padding: 0; font-weight: 600; }
@media (max-width: 767px) {
  .scn { grid-template-columns: minmax(0, 1fr); }
  .scn__acts { justify-content: flex-start; max-width: none; }
  .scn__later { text-align: left; }
  .scn__acts .btn { min-height: 44px; }   /* під палець */
  .scn-choice .btn { flex: 1 1 100%; min-height: 48px; }
}

/* ---------- каса — «Отримано» / «Решта» видачі замовлення (лише готівкою); помилка під полем контрагента документа */
.cash-ord__got { display: grid; gap: 6px; max-width: 360px; margin: 10px 0; }
#cash-ord:has(input[name=method]:checked:not([value=cash])) .cash-ord__got { display: none; }
.cp-pick .err { display: block; margin-top: 4px; line-height: 1.35; }   /* помилка контрагента — під списком, не поверх поля */
.inv-requests { margin-bottom: 14px; }
.inv-requests__list { display: grid; gap: 6px; margin: 0 0 8px; padding: 0; list-style: none; overflow-wrap: anywhere; }
.inv-requests__list > li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.sale-pm .sm-muted { margin: 4px 0 0; font-size: 12.5px; }

/* ---------- підказки й порожні стани: кнопки дії порожнього списку (ui.empty, ui.newdoc); «Що налаштувати» на «Головній» (Core\Setup) */
.sm-empty > .btn, .sm-empty__form { display: inline-block; margin: 0 4px 6px; }
.dash-setup__sum { margin: 0 0 6px; }
.dash-setup li { align-items: flex-start; flex-wrap: wrap; }
.dash-setup__skip { flex: 0 0 auto; margin: 0; }
/* «Товари обліку»: де скільки — рядок складів у шапці картки (переносом на телефоні) і під «У наявності» в списку */
.gd-stores { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin: 8px 0; }
.gd-stores__s { white-space: nowrap; }
.gd-stores__s.is-zero, .gd-stores__s.is-defect { color: var(--muted); }
.gd-table__stores { display: block; color: var(--muted); font-size: 12px; font-weight: 400; white-space: normal; }
.dash-setup li > .sm-badge { flex: 0 0 auto; min-width: 88px; justify-content: center; }
.dash-setup li > span:not(.sm-badge) { flex: 1 1 200px; min-width: 0; display: grid; gap: 2px; overflow-wrap: anywhere; }
.dash-setup li small { white-space: normal; }
.dash-setup a { font-weight: 600; }
.dash-setup li.is-done a { font-weight: 400; color: var(--muted); }

/* ===== Пошук по всьому: розділ сторінки за якорем (/oblik/privat24#p24-queue) — під закріпленою шапкою, а не за нею ===== */
#main [id] { scroll-margin-top: calc(var(--hdr) + 12px); }

/* ===== Видаткова: поле «Товар» ширше (запит «оміс дуб сіцилія» видно весь, назва в «Назві» переноситься; на телефоні — уся ширина);
   каса, видача замовлення: «Склад» — переносом ===== */
@media (min-width: 600px) { .sale-lines.is-edit .doc-l__product { width: 200px; } }
#cash-ord td[data-from] { white-space: normal; }
