/* RePos components — имена и правила из dozzy-design (components.md). Значения — только var(--*) из tokens.css.
   Разделение — фоном (--surface → --surface-2 → --surface-3), тени только у всплывающего, рамка — только выбор и фокус. */

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: var(--font-sans); font-size: var(--fs-md); line-height: var(--lh-body); color: var(--text); background: var(--shell); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3 { font-weight: var(--fw-semibold); letter-spacing: var(--tracking-tight); line-height: var(--lh-tight); }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus-outline); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-muted); }
.subtle { color: var(--text-subtle); font-size: var(--fs-sm); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.icon { width: 18px; height: 18px; fill: currentColor; flex: none; }

/* ── Знак ── */
/* Знак: значок-чек + слово, один цвет (цвет текста) — как котик у dozzy */
.wordmark { display: inline-flex; align-items: center; gap: var(--sp-2); font-weight: var(--fw-semibold); font-size: var(--fs-lg); letter-spacing: -0.03em; color: var(--text); }
.wordmark svg.wordmark__mark { width: 24px; height: 24px; }

/* Выбор точки — вверху сайдбара */
.loc-switch { display: flex; align-items: center; gap: var(--sp-3); width: 100%; padding: var(--sp-2); margin-bottom: var(--sp-3); border-radius: var(--r-md); background: var(--surface); text-align: left; transition: background var(--dur-fast) var(--ease-out); }
.loc-switch:hover { background: var(--surface-2); }
.loc-switch__text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: var(--lh-snug); }
.loc-switch__text b { font-weight: var(--fw-medium); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.loc-switch__text span { font-size: var(--fs-xs); color: var(--text-subtle); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.loc-switch svg.loc-switch__caret { width: 16px; height: 16px; color: var(--text-subtle); }
.loc-thumb { width: 32px; height: 32px; border-radius: var(--r-sm); overflow: hidden; flex: none; background: var(--surface-2); display: grid; place-items: center; color: var(--text-muted); }
.loc-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.loc-thumb--lg { width: 44px; height: 44px; }
.crumbs__ctx { white-space: nowrap; }

/* ── Каркас: сайдбар на подложке + окно ── */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); height: 100vh; background: var(--shell); }
/* Свёрнутый сайдбар (кнопка в топбаре, 09.11.2026): рельс из иконок, текст скрыт */
.app[data-sidebar="hidden"] { grid-template-columns: var(--sidebar-w-collapsed) minmax(0, 1fr); }
.app[data-sidebar="hidden"] .nav-item { justify-content: center; padding: 0; }
.app[data-sidebar="hidden"] :is(.nav-item span, .sidebar__group, .sidebar__brand .wordmark span, .loc-switch__text, .loc-switch__caret, .account__text, .account__plan) { display: none; }
.app[data-sidebar="hidden"] .loc-switch { justify-content: center; padding: var(--sp-1); }
.app[data-sidebar="hidden"] :is(.sidebar__brand, .account) { padding: var(--sp-2); justify-content: center; align-items: center; }
.sidebar { display: flex; flex-direction: column; gap: var(--sp-1); padding: var(--sp-4) var(--sp-3); min-height: 0; min-width: 0; overflow-y: auto; z-index: var(--z-sidebar); }
.sidebar__brand { display: flex; align-items: center; height: 40px; padding: 0 var(--sp-3); margin-bottom: var(--sp-3); }
.sidebar__group { padding: var(--sp-3) var(--sp-3) var(--sp-1); font-size: var(--fs-xs); color: var(--text-subtle); }
.nav-item { display: flex; align-items: center; gap: var(--sp-3); min-height: 36px; padding: 0 var(--sp-3); border-radius: var(--r-sm); color: var(--text-muted); font-weight: var(--fw-medium); transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out); }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item[aria-current="page"] { background: var(--surface-3); color: var(--text); }
.nav-item__count { margin-left: auto; font-size: var(--fs-xs); color: var(--text-subtle); }

.app__main { position: relative; margin: var(--window-gap) var(--window-gap) var(--window-gap) 0; background: var(--bg); border: 1px solid var(--border); border-radius: var(--window-radius); min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.app__scroll { overflow-y: auto; flex: 1; min-height: 0; border-radius: inherit; }
.edge-toggle { flex: none; width: 32px; height: 32px; margin-left: calc(-1 * var(--sp-2)); border-radius: var(--r-sm); display: grid; place-items: center; color: var(--text-muted); transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out); }
.edge-toggle:hover { background: var(--surface-2); color: var(--text); }
.edge-toggle svg.icon { width: 18px; height: 18px; }

/* Планшет 768–1100: открытый сайдбар — рельс 72px из иконок */
@media (max-width: 1100px) and (min-width: 768px) {
  .app:not([data-sidebar="hidden"]) { grid-template-columns: var(--sidebar-w-collapsed) minmax(0, 1fr); }
  .app:not([data-sidebar="hidden"]) .nav-item { justify-content: center; padding: 0; }
  .app:not([data-sidebar="hidden"]) :is(.nav-item span, .sidebar__group, .sidebar__brand .wordmark span, .loc-switch__text, .loc-switch__caret, .account__text, .account__plan) { display: none; }
  .app:not([data-sidebar="hidden"]) .loc-switch { justify-content: center; padding: var(--sp-1); }
  .app:not([data-sidebar="hidden"]) .sidebar__brand, .app:not([data-sidebar="hidden"]) .account { padding: var(--sp-2); justify-content: center; align-items: center; }
}

/* ── Топбар и крошки ── */
.topbar { position: sticky; top: 0; z-index: var(--z-topbar); height: var(--topbar-h); display: flex; align-items: center; gap: var(--sp-2); padding: 0 var(--gutter); background: var(--bg); border-bottom: 1px solid var(--border); border-radius: var(--window-radius) var(--window-radius) 0 0; }
.topbar__mobile-brand { display: none; }
.crumbs { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; font-weight: var(--fw-medium); }
.crumbs a { color: var(--text-muted); }
.crumbs a:hover { color: var(--text); }
.crumbs__sep { color: var(--text-subtle); }
.crumbs__current { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__actions { margin-left: auto; display: flex; align-items: center; gap: var(--sp-1); }

/* ── Страница и секции ── */
.page { max-width: var(--content-max); margin: 0 auto; padding: var(--sp-5) var(--gutter) var(--sp-12); display: flex; flex-direction: column; gap: var(--sp-8); }
.section { display: flex; flex-direction: column; gap: var(--sp-3); min-width: 0; }
.section__head { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.section__title { font-size: var(--fs-lg); }
.section__tools { margin-left: auto; display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.section__more { color: var(--accent-text); font-weight: var(--fw-medium); display: inline-flex; align-items: center; gap: var(--sp-1); }

/* ── Кнопки ── */
.btn { --h: 36px; display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2); min-height: var(--h); padding: 0 var(--sp-4); border-radius: var(--r-sm); font-weight: var(--fw-medium); white-space: nowrap; transition: background var(--dur-fast) var(--ease-out); }
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent-hover); }
.btn--money { background: var(--pay); color: var(--on-action); }
.btn--money:hover { background: var(--pay-hover); }
.btn--send { background: var(--send); color: var(--on-action); }
.btn--send:hover { background: var(--send-hover); }
.btn--void { background: var(--void); color: var(--on-action); }
.btn--void:hover { background: var(--void-hover); }
.btn--secondary { background: var(--surface-2); color: var(--text); }
.btn--secondary:hover { background: var(--surface-3); }
.btn--ghost { color: var(--text-muted); }
.btn--ghost:hover { background: var(--surface-2); color: var(--text); }
.btn--light { background: var(--on-media); color: var(--text-on-light); }
.btn--glass { background: var(--media-glass); color: var(--on-media); }
.btn--sm { --h: 30px; padding: 0 var(--sp-3); font-size: var(--fs-sm); }
.btn--lg { --h: 44px; padding: 0 var(--sp-5); font-size: var(--fs-base); }
.btn--block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn { position: relative; width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: var(--r-sm); color: var(--text-muted); }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn__dot { position: absolute; top: 8px; right: 8px; width: 7px; height: 7px; border-radius: var(--r-full); background: var(--accent); box-shadow: 0 0 0 2px var(--bg); }

/* ── Навигация внутри страницы ── */
.chips { display: flex; gap: var(--sp-2); overflow-x: auto; scrollbar-width: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: var(--sp-1); min-height: 32px; padding: 0 var(--sp-3); border-radius: var(--r-full); background: var(--surface-2); color: var(--text-muted); font-weight: var(--fw-medium); }
.chip:hover { color: var(--text); }
.chip[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-soft-text); }
.segmented { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--r-sm); background: var(--surface-2); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.segmented button { flex: none; min-height: 30px; padding: 0 var(--sp-3); border-radius: 8px; color: var(--text-muted); font-weight: var(--fw-medium); }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.tabs { display: flex; gap: var(--sp-5); border-bottom: 1px solid var(--border); }
.tab { padding: var(--sp-2) 0; color: var(--text-muted); font-weight: var(--fw-medium); }
.tab[aria-selected="true"] { color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }

/* ── Меню (всплывающее: тень) ── */
.menu-wrap { position: relative; }
.menu { position: absolute; top: calc(100% + 6px); right: 0; min-width: 200px; padding: var(--sp-1); background: var(--surface); border-radius: var(--r-md); box-shadow: var(--shadow-lg); z-index: var(--z-modal); display: none; }
.menu[data-open] { display: block; }
.menu__head { padding: var(--sp-2) var(--sp-3) var(--sp-1); font-size: var(--fs-xs); color: var(--text-subtle); }
.menu__item { width: 100%; display: flex; align-items: center; gap: var(--sp-3); min-height: 36px; padding: 0 var(--sp-3); border-radius: 8px; text-align: left; }
.menu__item:hover { background: var(--surface-2); }
.menu__item[aria-checked="true"]::after { content: ""; margin-left: auto; width: 6px; height: 6px; border-radius: var(--r-full); background: var(--accent); }
.menu__sep { height: 1px; margin: var(--sp-1) var(--sp-2); background: var(--border); }

/* ── Метки ── */
.badge { display: inline-flex; align-items: center; gap: var(--sp-1); height: 22px; padding: 0 var(--sp-2); border-radius: var(--r-xs); font-size: var(--fs-xs); font-weight: var(--fw-medium); background: var(--surface-2); color: var(--text-muted); white-space: nowrap; }
.badge svg.icon { width: 14px; height: 14px; }
.badge--accent { background: var(--accent-soft); color: var(--accent-soft-text); }
.badge--success { background: var(--success-soft); color: var(--success); }
.badge--warning { background: var(--warning-soft); color: var(--warning); }
.badge--danger { background: var(--danger-soft); color: var(--danger); }
.badge--glass { background: var(--media-glass); color: var(--on-media); }
.badge__dot { width: 6px; height: 6px; border-radius: var(--r-full); background: var(--c); flex: none; }
.avatar { width: 32px; height: 32px; border-radius: var(--r-full); background: var(--surface-3); color: var(--text-muted); display: inline-grid; place-items: center; font-size: var(--fs-xs); font-weight: var(--fw-semibold); flex: none; overflow: hidden; }
.avatar--sm { width: 24px; height: 24px; font-size: 10px; }

/* ── Карточка аккаунта внизу сайдбара ── */
.account { margin-top: auto; padding: var(--sp-3); border-radius: var(--r-md); background: var(--surface); display: flex; flex-direction: column; gap: var(--sp-3); }
.account__plan { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); font-size: var(--fs-sm); color: var(--text-muted); }
.account__upgrade { color: var(--accent-text); font-weight: var(--fw-medium); }
.account__me { display: flex; align-items: center; gap: var(--sp-3); border-radius: var(--r-sm); text-align: left; }
.account__text { display: flex; flex-direction: column; min-width: 0; line-height: var(--lh-snug); }
.account__text b { font-weight: var(--fw-medium); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account__tier { font-size: var(--fs-xs); color: var(--text-subtle); }

/* ── Формы ── */
.field { display: flex; flex-direction: column; gap: var(--sp-1); }
.field__label { font-size: var(--fs-sm); font-weight: var(--fw-medium); }
.field__hint { font-size: var(--fs-xs); color: var(--text-subtle); }
.input, .textarea { width: 100%; min-height: 36px; padding: 0 var(--sp-3); border: 0; border-radius: var(--r-sm); background: var(--surface-2); color: var(--text); font: inherit; }
.textarea { padding: var(--sp-2) var(--sp-3); min-height: 88px; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--text-subtle); }
.input:focus-visible, .textarea:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.search { position: relative; display: block; min-width: 180px; }
.search svg.icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-subtle); width: 16px; height: 16px; }
.search .input { padding-left: 34px; }
.switch { width: 36px; height: 20px; border-radius: var(--r-full); background: var(--surface-3); position: relative; flex: none; transition: background var(--dur-fast) var(--ease-out); }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: var(--r-full); background: var(--surface); box-shadow: var(--shadow-sm); transition: transform var(--dur-fast) var(--ease-out); }
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"]::after { transform: translateX(16px); }

/* ── Данные: плитки чисел, график, таблица, лента ── */
/* Строка чисел — без карточек: число крупно прямо на фоне окна, разделители между колонками */
.kpi-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi { container-type: inline-size; display: flex; flex-direction: column; gap: var(--sp-2); padding: 0 var(--sp-6); border-left: 1px solid var(--border); min-width: 0; }
.kpi:first-child { padding-left: 0; border-left: 0; }
.kpi__label { color: var(--text-muted); }
.kpi__value { font-size: var(--fs-2xl); font-weight: var(--fw-semibold); letter-spacing: var(--tracking-tight); line-height: var(--lh-tight); font-variant-numeric: tabular-nums; white-space: nowrap; }
@container (max-width: 220px) { .kpi__value { font-size: var(--fs-xl); } }
@media (max-width: 900px) {
  .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: var(--sp-6); }
  .kpi:nth-child(odd) { padding-left: 0; border-left: 0; }
}
.delta { display: inline-flex; align-items: center; gap: 2px; font-size: var(--fs-sm); font-weight: var(--fw-medium); font-variant-numeric: tabular-nums; }
.delta svg.icon { width: 14px; height: 14px; }
.delta--up { color: var(--success); }
.delta--down { color: var(--danger); }

.chart { min-width: 0; }
.bars { display: flex; align-items: flex-end; gap: var(--sp-2); height: 220px; padding-top: var(--sp-8); }
.bars__col { flex: 1; min-width: 6px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; position: relative; }
.bars__bar { height: var(--v); border-radius: var(--r-sm); background: var(--surface-3); transition: background var(--dur-fast) var(--ease-out); }
.bars__col:hover .bars__bar, .bars__col[data-peak] .bars__bar { background: var(--accent); }
.bars__tip { position: absolute; bottom: calc(var(--v) + 6px); left: 50%; transform: translateX(-50%); padding: 2px var(--sp-2); border-radius: var(--r-xs); background: var(--surface); box-shadow: var(--shadow-md); font-size: var(--fs-xs); white-space: nowrap; font-variant-numeric: tabular-nums; display: none; }
.bars__col:hover .bars__tip { display: block; z-index: 1; }
.bars__col[data-peak]:not(:hover) .bars__tip { display: block; }
.bars:has(.bars__col:hover) .bars__col[data-peak]:not(:hover) .bars__tip { display: none; }
.bars__axis { display: flex; gap: 6px; margin-top: var(--sp-2); }
.bars__axis span { flex: 1; min-width: 6px; text-align: center; font-size: var(--fs-xs); color: var(--text-subtle); font-variant-numeric: tabular-nums; }

.table-wrap { overflow-x: auto; border-radius: var(--r-md); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-weight: var(--fw-medium); font-size: var(--fs-sm); color: var(--text-muted); padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { cursor: pointer; }
.table tbody tr:hover td { background: var(--surface-2); }
.table .r { text-align: right; font-variant-numeric: tabular-nums; }
.proj-dot { width: 8px; height: 8px; border-radius: var(--r-full); background: var(--c); display: inline-block; margin-right: var(--sp-2); }

/* Лента с прокруткой вбок: --rail-n карточек на ширину окна, край гаснет (как .rail в dozzy) */
.rail { --rail-n: 4.3; display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - (var(--rail-n) - 1) * var(--sp-3)) / var(--rail-n)); gap: var(--sp-3); overflow-x: auto; scrollbar-width: none; scroll-snap-type: x mandatory; }
.rail[data-more-right] { mask-image: var(--rail-fade); }
.rail > * { scroll-snap-align: start; }
@media (max-width: 1280px) { .rail { --rail-n: 3.3; } }
@media (max-width: 900px) { .rail { --rail-n: 2.3; } }
@media (max-width: 560px) { .rail { --rail-n: 1.3; } }

/* Карточка точки: фото во внутренней рамке, подпись поверх фото, цифры под ним */
.place { display: flex; flex-direction: column; gap: var(--sp-3); padding: var(--sp-2); border-radius: var(--r-md); background: var(--surface); text-align: left; min-width: 0; transition: background var(--dur-fast) var(--ease-out); }
.place:hover { background: var(--surface-2); }
.place__media { position: relative; aspect-ratio: 4 / 3; border-radius: var(--r-sm); overflow: hidden; background: var(--surface-3); }
.place__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.place__media::after { content: ""; position: absolute; inset: 0; background: var(--media-scrim); }
.place__badge { position: absolute; top: var(--sp-2); left: var(--sp-2); z-index: 1; }
.place__name { position: absolute; left: var(--sp-3); right: var(--sp-3); bottom: var(--sp-3); z-index: 1; color: var(--on-media); display: flex; flex-direction: column; line-height: var(--lh-snug); }
.place__name b { font-size: var(--fs-base); font-weight: var(--fw-semibold); }
.place__name span { color: var(--on-media-muted); font-size: var(--fs-sm); }
.place__nums { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-2); padding: 0 var(--sp-2) var(--sp-1); }
.place__value { font-size: var(--fs-lg); font-weight: var(--fw-semibold); letter-spacing: var(--tracking-tight); font-variant-numeric: tabular-nums; white-space: nowrap; }
.place__meta { display: flex; gap: var(--sp-3); padding: 0 var(--sp-2) var(--sp-2); color: var(--text-muted); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.place__meta span { display: inline-flex; align-items: center; gap: var(--sp-1); }
.place__meta svg.icon { width: 14px; height: 14px; }

.feed { display: flex; flex-direction: column; }
.feed__item { display: grid; grid-template-columns: auto 1fr auto; gap: var(--sp-1) var(--sp-3); padding: var(--sp-4) 0; border-bottom: 1px solid var(--border); align-items: start; }
.feed__item:last-child { border-bottom: 0; }
.feed__title { font-weight: var(--fw-medium); }
.feed__text { grid-column: 2 / 4; font-size: var(--fs-base); }
.feed__actions { grid-column: 2 / 4; display: flex; gap: var(--sp-2); margin-top: var(--sp-2); flex-wrap: wrap; }
.stars { display: inline-flex; gap: 1px; color: var(--warning); }
.stars svg.icon { width: 14px; height: 14px; }
.stars .off { color: var(--border-strong); }

/* ── Состояния ── */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--sp-3); padding: var(--sp-8) var(--sp-4); }
.empty__icon { display: grid; place-items: center; color: var(--text-subtle); }
.empty__icon svg.icon { width: 36px; height: 36px; }
.empty__text { color: var(--text-muted); max-width: 360px; }
.empty__actions { display: flex; gap: var(--sp-2); }
.skeleton { border-radius: var(--r-sm); background: var(--skeleton); background-size: 200% 100%; animation: skeleton 1.4s linear infinite; }
@keyframes skeleton { to { background-position: -200% 0; } }
/* Загрузка страницы (core/router.js): каркас вместо пустого окна, появляется через 0,3 с */
.page-loading { display: flex; flex-direction: column; gap: var(--sp-5); animation: fade-in .2s .3s both; }
.page-loading__title { width: 220px; height: 36px; }
.page-loading__row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-3); }
.page-loading__tile { height: 76px; }
.page-loading__block { height: 280px; }
@keyframes fade-in { from { opacity: 0; } }
.page-fail { display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-2); padding: var(--sp-6) 0; }
.toast { position: fixed; left: 50%; bottom: var(--sp-6); transform: translateX(-50%); display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-lg); z-index: var(--z-modal); }

/* ── Модалка (всплывающее) ── */
.modal { position: fixed; inset: 0; z-index: var(--z-modal); display: grid; place-items: center; padding: var(--sp-4); background: var(--overlay); }
.modal__panel { width: min(420px, 100%); padding: var(--sp-6); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: var(--sp-3); animation: modal-in var(--dur-base) var(--ease-spring); }
.modal__panel:focus { outline: none; }
.modal__icon { display: grid; place-items: center; color: var(--warning); }
.modal__icon svg.icon { width: 36px; height: 36px; }
.modal__actions { display: flex; justify-content: flex-end; gap: var(--sp-2); margin-top: var(--sp-2); }
@keyframes modal-in { from { transform: scale(.96); opacity: 0; } }

/* ── Большое окно (.dialog, как в dozzy): head + bar + body; на телефоне — лист снизу ── */
.dialog { position: fixed; inset: 0; z-index: var(--z-modal); display: grid; place-items: center; padding: var(--sp-4); }
.dialog__backdrop { position: absolute; inset: 0; background: var(--overlay); }
.dialog__panel { position: relative; width: min(480px, 100%); max-height: min(640px, calc(100vh - 2 * var(--sp-4))); display: flex; flex-direction: column; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-lg); animation: modal-in var(--dur-base) var(--ease-spring); }
.dialog__panel:focus { outline: none; }
.dialog__head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-5) var(--sp-5) var(--sp-3); }
.dialog__head h3 { font-size: var(--fs-lg); }
.dialog__bar { padding: 0 var(--sp-5) var(--sp-3); }
.dialog__body { overflow-y: auto; padding: 0 var(--sp-3) var(--sp-3); }
.dialog__label { padding: var(--sp-4) var(--sp-2) var(--sp-2); font-size: var(--fs-xs); color: var(--text-subtle); }
.dialog__empty { padding: var(--sp-6) var(--sp-2); text-align: center; color: var(--text-muted); }

/* Большое окно выбора точки: строка = фото | название | выручка | просрочки | рейтинг | отметка */
.dialog--lg .dialog__panel { width: min(760px, 100%); max-height: min(720px, calc(100vh - 2 * var(--sp-8))); }
.dialog--lg .dialog__head { padding: var(--sp-6) var(--sp-6) var(--sp-4); }
.dialog--lg .dialog__head h3 { font-size: var(--fs-xl); }
.dialog--lg .dialog__bar { display: flex; flex-direction: column; gap: var(--sp-3); padding: 0 var(--sp-6) var(--sp-3); }
.dialog--lg .search .input { min-height: 44px; font-size: var(--fs-base); }
.dialog--lg .dialog__body { padding: 0 var(--sp-4) var(--sp-4); }
.chip__count { color: var(--text-subtle); font-variant-numeric: tabular-nums; margin-left: var(--sp-1); }
.chip[aria-pressed="true"] .chip__count { color: inherit; opacity: .7; }

.loc-head, .loc-option { display: grid; grid-template-columns: 56px minmax(0, 1fr) 150px 90px 70px 24px; align-items: center; gap: var(--sp-4); }
.loc-head { padding: var(--sp-2) calc(var(--sp-4) + var(--sp-3)); border-bottom: 1px solid var(--border); font-size: var(--fs-xs); color: var(--text-subtle); }
.loc-head span:nth-child(n+3) { text-align: right; }
.loc-option { width: 100%; padding: var(--sp-3); border-radius: var(--r-md); text-align: left; transition: background var(--dur-fast) var(--ease-out); }
.loc-option:hover, .loc-option:focus-visible { background: var(--surface-2); }
.loc-option[aria-selected="true"] { background: var(--accent-soft); }
.loc-option--all { margin-top: var(--sp-3); }
.loc-thumb--lg { width: 56px; height: 56px; border-radius: var(--r-sm); }
.loc-thumb--lg svg.icon { width: 24px; height: 24px; }
.loc-option__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; line-height: var(--lh-snug); }
.loc-option__text b { font-size: var(--fs-base); font-weight: var(--fw-semibold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.loc-option__sub { display: inline-flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-sm); color: var(--text-muted); }
.loc-option__money { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.loc-option__money b { font-size: var(--fs-base); font-weight: var(--fw-semibold); }
.loc-option__stat { display: inline-flex; align-items: center; justify-content: flex-end; gap: var(--sp-1); color: var(--text-muted); font-variant-numeric: tabular-nums; }
.loc-option__stat svg.icon { width: 14px; height: 14px; }
.loc-option__check { display: grid; place-items: center; color: var(--accent-text); }
.loc-group .dialog__label { padding-left: var(--sp-3); }
@media (max-width: 640px) {
  .loc-head { display: none; }
  .loc-head, .loc-option { grid-template-columns: 48px minmax(0, 1fr) auto 20px; gap: var(--sp-3); }
  .loc-option__stat { display: none; }
  .loc-thumb--lg { width: 48px; height: 48px; }
  .dialog--lg .dialog__head, .dialog--lg .dialog__bar { padding-left: var(--sp-4); padding-right: var(--sp-4); }
  .dialog--lg .dialog__body { padding: 0 var(--sp-2) var(--sp-3); }
}

/* ── Устройства (POS, KDS, CDS): полноэкранно, без сайдбара и окна ── */
body.device { background: var(--bg); overflow: hidden; height: 100vh; }
.device-bar { height: 64px; flex: none; display: flex; align-items: center; gap: var(--sp-4); padding: 0 var(--sp-4); background: var(--shell); }
.device-bar__place { font-size: var(--fs-md); font-weight: var(--fw-medium); color: var(--text-muted); letter-spacing: 0; white-space: nowrap; }
.device-bar__end { margin-left: auto; display: flex; align-items: center; gap: var(--sp-2); }
.device-bar__staff { display: inline-flex; align-items: center; gap: var(--sp-2); min-height: 40px; padding: 0 var(--sp-3) 0 var(--sp-1); border-radius: var(--r-full); background: var(--surface); font-weight: var(--fw-medium); }
@media (max-width: 1100px) { .device-bar__hide { display: none; } }

/* Тач-размеры: POS ≥ --hit-pos */
.btn--touch { --h: var(--hit-pos); padding: 0 var(--sp-5); font-size: var(--fs-base); border-radius: var(--r-md); }
.chip--lg { min-height: 48px; padding: 0 var(--sp-4); font-size: var(--fs-base); gap: var(--sp-2); }
.input--touch { min-height: 48px; font-size: var(--fs-base); }
.segmented--touch { width: 100%; }
.segmented--touch button { flex: 1; min-height: var(--hit-pos); display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: var(--fs-base); line-height: var(--lh-snug); }
.segmented--touch small { font-size: var(--fs-xs); color: var(--text-subtle); font-weight: var(--fw-regular); }

/* Степпер: − количество + */
.stepper { display: inline-flex; align-items: center; gap: var(--sp-1); padding: 3px; border-radius: var(--r-md); background: var(--surface-2); }
.stepper__btn { width: 44px; height: 44px; border-radius: var(--r-sm); display: grid; place-items: center; color: var(--text); }
.stepper__btn:hover { background: var(--surface-3); }
.stepper__btn:disabled { color: var(--text-subtle); cursor: not-allowed; background: none; }
.stepper__value { min-width: 28px; text-align: center; font-weight: var(--fw-semibold); font-size: var(--fs-base); }

/* Вариант выбора (модификатор, способ оплаты): фон --surface-2, выбранный — рамка --accent */
.option { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); min-height: var(--hit-pos); padding: 0 var(--sp-4); border-radius: var(--r-md); background: var(--surface-2); text-align: left; font-weight: var(--fw-medium); }
.option:hover { background: var(--surface-3); }
.option[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-soft-text); box-shadow: inset 0 0 0 2px var(--accent); }
.option__price { color: var(--text-muted); font-weight: var(--fw-regular); white-space: nowrap; }
.option[aria-pressed="true"] .option__price { color: inherit; }
.option--tile { flex-direction: column; justify-content: center; gap: var(--sp-2); min-height: 88px; text-align: center; }
.option--tile svg.icon { width: 24px; height: 24px; }

.icon-btn--touch { width: 48px; height: 48px; border-radius: var(--r-md); }
.icon-btn--touch svg.icon { width: 22px; height: 22px; }
.option--lg { min-height: 64px; font-size: var(--fs-base); }
.switch--lg { width: 52px; height: 30px; }
.switch--lg::after { width: 24px; height: 24px; top: 3px; left: 3px; }
.switch--lg[aria-checked="true"]::after { transform: translateX(22px); }
.chips--wrap { flex-wrap: wrap; overflow: visible; }

/* Окна на устройствах: подвал с действием, вкладки под заголовком, большое окно блюда */
.dialog__foot { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-4) var(--sp-6) var(--sp-6); border-top: 1px solid var(--border); }
.dialog__foot[hidden] { display: none; }
.dialog__foot .side__grow { flex: 1; }
.dialog__tabs { margin-left: auto; }
.dialog__tabs button { min-height: 44px; padding: 0 var(--sp-4); font-size: var(--fs-base); }
.dialog__head > .badge { margin-left: auto; }
.dialog--lg .dialog__body { display: flex; flex-direction: column; gap: var(--sp-3); }
.dialog--xl .dialog__panel { width: min(960px, 100%); max-height: min(760px, calc(100vh - 2 * var(--sp-8))); }
.dialog--xl .dialog__head { padding: var(--sp-6) var(--sp-6) var(--sp-4); }
.dialog--xl .dialog__head h3 { font-size: var(--fs-xl); }
.dialog--xl .dialog__body { padding: 0 var(--sp-6) var(--sp-5); }
.kpi-row--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: var(--sp-5); }
.kpi-row--2 .kpi:nth-child(odd) { padding-left: 0; border-left: 0; }
.kpi__value--sm { font-size: var(--fs-xl); }

.set-row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); min-height: 48px; }
.set-row__title { display: inline-flex; align-items: center; gap: var(--sp-2); font-weight: var(--fw-medium); }
.spinner svg.icon { width: 28px; height: 28px; color: var(--accent-text); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Отклик на нажатие: сжатие + волна от точки касания (core/ui.js) ── */
:where(button, .btn, .nav-item, .chip, .option, .loc-option, a.section__more) { position: relative; -webkit-tap-highlight-color: transparent; }
:where(button:not(:disabled), .btn, .chip, .option, .nav-item, .loc-option) { transition: transform var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out); }
:where(button:not(:disabled):not([aria-disabled="true"]), .chip, .option, .nav-item, .loc-option):active { transform: scale(.96); }
.ripple { position: absolute; inset: 0; overflow: hidden; border-radius: inherit; pointer-events: none; }
.ripple span { position: absolute; left: calc(var(--x) - var(--s) / 2); top: calc(var(--y) - var(--s) / 2); width: var(--s); height: var(--s); border-radius: var(--r-full); background: currentColor; opacity: .18; transform: scale(0); animation: ripple var(--dur-slow) var(--ease-out) forwards; }
@keyframes ripple { to { transform: scale(1); opacity: 0; } }
@keyframes pop { 0% { transform: scale(.6); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }

/* ── Экранная клавиатура (core/keyboard.js): клавиши ≥ 56px, без системной клавиатуры ── */
.kb { display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-3); border-radius: var(--r-lg); background: var(--surface-2); user-select: none; }
.kb__row { display: flex; gap: var(--sp-2); justify-content: center; }
.kb__key { flex: 1 1 0; min-width: 0; height: 64px; border-radius: var(--r-sm); background: var(--surface); box-shadow: var(--shadow-sm); font-size: var(--fs-lg); font-weight: var(--fw-medium); display: grid; place-items: center; }
.kb__key:active { background: var(--surface-3); }
.kb__key svg.icon { width: 24px; height: 24px; }
.kb__key--fn { flex: 1.5 1 0; background: var(--surface-3); font-size: var(--fs-base); }
.kb__key--fn[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-soft-text); }
.kb__key--space { flex: 5 1 0; font-size: var(--fs-base); color: var(--text-muted); }
.kb__key--enter { flex: 2 1 0; background: var(--accent); color: var(--on-accent); font-size: var(--fs-base); font-weight: var(--fw-semibold); }
.kb__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-2); }
.kb__grid .kb__key { max-width: none; height: 68px; font-size: var(--fs-xl); }
.kb__grid .kb__key--fn, .kb__grid .kb__key--enter { font-size: var(--fs-base); }
.kb__key--wide { grid-column: span 2; }
.kb--numeric { max-width: 420px; width: 100%; margin: 0 auto; }
.kb--numeric .kb__row .kb__key { max-width: none; }
.kb-dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: calc(var(--z-modal) + 2); padding: var(--sp-3); background: var(--shell); box-shadow: var(--shadow-lg); animation: kb-up var(--dur-base) var(--ease-out); }
.kb-dock .kb { max-width: 1100px; margin: 0 auto; }
.kb-dock .kb--numeric { max-width: 420px; }
@keyframes kb-up { from { transform: translateY(100%); } }
[data-kb] { cursor: pointer; caret-color: transparent; }
[data-kb][data-kb-open] { box-shadow: var(--focus-ring); }

/* ── Поле поиска на сенсорных экранах — кнопка, открывающая окно поиска с клавиатурой ── */
.search-trigger { display: flex; align-items: center; gap: var(--sp-3); min-height: var(--hit-pos); padding: 0 var(--sp-4); border-radius: var(--r-md); background: var(--surface-2); color: var(--text-subtle); font-size: var(--fs-base); text-align: left; }
.search-trigger span { flex: 1; }
.search-trigger svg.icon { width: 20px; height: 20px; }

/* ── Вкладки категорий: иконка в кружке, название, счётчик; бегунок переезжает к выбранной ── */
.cat-tabs { position: relative; display: flex; gap: var(--sp-1); padding: var(--sp-1); border-radius: var(--r-lg); background: var(--surface-2); overflow-x: auto; scrollbar-width: none; }
.cat-tab { position: relative; z-index: 1; flex: 1 0 auto; display: flex; align-items: center; gap: var(--sp-3); min-height: 64px; padding: 0 var(--sp-4) 0 var(--sp-2); border-radius: var(--r-md); text-align: left; color: var(--text-muted); }
.cat-tab__icon { width: 32px; height: 32px; background: none; display: grid; place-items: center; flex: none; transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out); }
.cat-tab__icon svg.icon { width: 26px; height: 26px; }
.cat-tab__text { display: flex; flex-direction: column; line-height: var(--lh-snug); white-space: nowrap; }
.cat-tab__text b { font-size: var(--fs-base); font-weight: var(--fw-semibold); }
.cat-tab__text small { font-size: var(--fs-xs); color: var(--text-subtle); }
.cat-tab[aria-selected="true"] { color: var(--text); }
.cat-tab[aria-selected="true"] .cat-tab__icon { color: var(--accent-text); }

/* ── Окно почти на весь экран (поиск на кассе) ── */
.dialog--full .dialog__panel { width: min(1240px, 100%); height: calc(100vh - 2 * var(--sp-6)); max-height: none; }
.dialog--full .dialog__body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: var(--sp-4); padding: 0 var(--sp-6) var(--sp-5); overflow: hidden; }

/* ── Мобильная панель и drawer (< 768px) ── */
.bottom-nav { display: none; }
.drawer-backdrop { display: none; }
@media (max-width: 767px) {
  html, body { height: auto; }
  .app { display: block; height: auto; background: var(--bg); }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); background: var(--shell); z-index: var(--z-drawer); transform: translateX(-100%); visibility: hidden; transition: transform var(--dur-base) var(--ease-out), visibility var(--dur-base); }
  .app[data-drawer] .sidebar { transform: none; visibility: visible; }
  .app[data-drawer] .drawer-backdrop { display: block; position: fixed; inset: 0; background: var(--overlay); z-index: calc(var(--z-drawer) - 1); }
  .app__main { margin: 0; border: 0; border-radius: 0; }
  .app__scroll { overflow: visible; }
  .edge-toggle { display: none; }
  .topbar { border-radius: 0; }
  .topbar__mobile-brand { display: inline-flex; margin-right: auto; }
  .crumbs { display: none; }
  .page { padding-bottom: calc(var(--bottomnav-h) + var(--sp-8)); }
  .dialog { place-items: end stretch; padding: 0; }
  .dialog__panel { width: 100%; max-height: 85vh; border-radius: var(--r-lg) var(--r-lg) 0 0; }
  .bottom-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; height: var(--bottomnav-h); background: var(--surface); border-top: 1px solid var(--border); z-index: var(--z-topbar); }
  .bottom-nav a, .bottom-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; color: var(--text-muted); }
  .bottom-nav [aria-current="page"] { color: var(--accent-text); }
}

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

/* ── Бегунок переключателей [data-ink] (core/ui.js) ── */
[data-ink] { position: relative; isolation: isolate; }
.ink { position: absolute; left: 0; top: 0; z-index: -1; border-radius: var(--r-sm); background: var(--surface); box-shadow: var(--shadow-sm); pointer-events: none; opacity: 0; transition: transform var(--dur-base) var(--ease-out), width var(--dur-base) var(--ease-out), height var(--dur-base) var(--ease-out); }
.segmented[data-ink] button[aria-pressed="true"] { background: transparent; box-shadow: none; }
.segmented--touch .ink, .cat-tabs .ink, .settings-nav .ink { border-radius: var(--r-md); }
.settings-nav[data-ink] .settings-nav__item[aria-current="page"] { background: transparent; box-shadow: none; }
.kb--text .kb__row:nth-child(2) { padding: 0 4%; }
.dialog--full .search-dlg { flex: 1 1 auto; }
.dialog--full .kb { margin-top: auto; }

/* ── Правая панель (.dialog--side): редактирование в back-office — на всю высоту справа, список остаётся виден ── */
.dialog--side { place-items: stretch end; padding: var(--sp-3); }
.dialog--side .dialog__panel { width: min(560px, 100%); height: 100%; max-height: calc(100dvh - 2 * var(--sp-3)); /* не выше экрана — иначе длинная панель растёт и не прокручивается */ animation: side-in var(--dur-base) var(--ease-out); }
.dialog--side .dialog__head { padding: var(--sp-5) var(--sp-6) var(--sp-3); }
.dialog--side .dialog__head h3 { font-size: var(--fs-xl); }
.dialog--side .dialog__body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: var(--sp-5); padding: var(--sp-1) var(--sp-6) var(--sp-5); }
.dialog--side .dialog__foot { justify-content: flex-end; padding: var(--sp-4) var(--sp-6); }
.dialog--side .side-tabs { flex: none; display: flex; }
.dialog--side .side-tabs button { flex: 1 1 auto; }
@keyframes side-in { from { transform: translateX(40px); opacity: 0; } }
@media (max-width: 767px) {
  .dialog--side { place-items: end stretch; grid-template-columns: minmax(0, 1fr); padding: 0; }
  .dialog--side .dialog__panel { height: calc(100vh - var(--sp-4)); animation: kb-up var(--dur-base) var(--ease-out); }
  .dialog--side .dialog__head, .dialog--side .dialog__body, .dialog--side .dialog__foot { padding-left: var(--sp-4); padding-right: var(--sp-4); }
}

/* ── Свой чекбокс (.check — кнопка role=checkbox, aria-checked true | false | mixed) ── */
.check { position: relative; flex: none; width: 20px; height: 20px; display: inline-grid; place-items: center; border-radius: var(--r-xs); border: 1.5px solid var(--border-strong); background: var(--surface); color: var(--on-accent); vertical-align: middle; transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out); }
.check::before { content: ""; position: absolute; inset: -10px; }
.check:hover { border-color: var(--accent); }
.check svg.icon { grid-area: 1 / 1; width: 14px; height: 14px; opacity: 0; transform: scale(.4); transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-base) var(--ease-spring); }
.check[aria-checked="true"], .check[aria-checked="mixed"] { background: var(--accent); border-color: var(--accent); }
.check[aria-checked="true"] .check__on, .check[aria-checked="mixed"] .check__mixed { opacity: 1; transform: none; }
.check:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* ── Свой выпадающий список (core/select.js): кнопка .select + список .select__list в body ── */
.select { display: inline-flex; align-items: center; gap: var(--sp-2); min-height: 36px; max-width: 100%; padding: 0 var(--sp-3); border-radius: var(--r-sm); background: var(--surface-2); color: var(--text); font-weight: var(--fw-medium); white-space: nowrap; text-align: left; }
.select:hover { background: var(--surface-3); }
.select:focus-visible, .select[aria-expanded="true"] { outline: none; box-shadow: var(--focus-ring); }
.select > svg.icon:first-child { width: 18px; height: 18px; color: var(--text-muted); }
.select__value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.select__caret { width: 16px; height: 16px; color: var(--text-subtle); transition: transform var(--dur-base) var(--ease-out); }
.select[aria-expanded="true"] .select__caret { transform: rotate(180deg); }
.select--block { width: 100%; }
.select--filter.is-set { background: var(--accent-soft); color: var(--accent-soft-text); }
.select--filter.is-set svg.icon { color: inherit; }
.select__list { position: fixed; z-index: calc(var(--z-modal) + 2); max-height: min(360px, 60vh); overflow-y: auto; padding: var(--sp-1); background: var(--surface); border-radius: var(--r-md); box-shadow: var(--shadow-lg); transform-origin: top center; animation: select-in var(--dur-base) var(--ease-out); }
.select__list[data-up] { transform-origin: bottom center; }
@keyframes select-in { from { opacity: 0; transform: translateY(-4px) scale(.97); } }
.select__opt { width: 100%; display: flex; align-items: center; gap: var(--sp-3); min-height: 38px; padding: 0 var(--sp-3); border-radius: var(--r-xs); text-align: left; white-space: nowrap; }
.select__opt:hover, .select__opt:focus-visible { outline: none; background: var(--surface-2); }
.select__opt > svg.icon:first-child { width: 18px; height: 18px; color: var(--text-muted); }
.select__opt span { flex: 1; }
.select__tick { width: 16px; height: 16px; color: var(--accent-text); opacity: 0; }
.select__opt[aria-selected="true"] { color: var(--accent-text); font-weight: var(--fw-medium); }
.select__opt[aria-selected="true"] .select__tick { opacity: 1; }
.select__add { display: flex; gap: var(--sp-1); margin-top: var(--sp-1); padding-top: var(--sp-1); border-top: 1px solid var(--border); }
.select__add .input { min-height: 34px; }

/* ── Перетаскивание (core/sortable.js): ручка .drag, элементы [data-sort-id] ── */
.drag { display: inline-grid; place-items: center; width: 24px; height: 32px; border-radius: var(--r-xs); color: var(--text-subtle); cursor: grab; touch-action: none; }
.drag:hover, .drag:focus-visible { color: var(--text); background: var(--surface-2); outline: none; }
.drag:focus-visible { box-shadow: var(--focus-ring); }
.drag svg.icon { width: 18px; height: 18px; }
[data-sort-id] { transition: transform var(--dur-base) var(--ease-out); }
[data-sort-id].is-dragging { position: relative; z-index: 3; transition: none; cursor: grabbing; }
[data-sort-id].is-dragging, tr[data-sort-id].is-dragging td { background: var(--surface); box-shadow: var(--shadow-md); }
.is-dragging .drag { cursor: grabbing; color: var(--accent-text); }

/* ── Сортировка по колонке: кнопка в заголовке таблицы ── */
.th-sort { display: inline-flex; align-items: center; gap: var(--sp-1); color: inherit; font: inherit; }
.th-sort:hover { color: var(--text); }
.th-sort__ic { width: 14px; height: 14px; opacity: 0; transition: opacity var(--dur-fast) var(--ease-out); }
.th-sort:hover .th-sort__ic { opacity: .5; }
.th-sort.is-on { color: var(--text); }
.th-sort.is-on .th-sort__ic { opacity: 1; color: var(--accent-text); }
@media (prefers-reduced-motion: reduce) { .select__list { animation: none; } .check svg.icon, [data-sort-id] { transition: none; } }

/* ── Меню разделов слева — одно на все вкладки back-office, эталон «Каталог» (пользователь, 08.11.2026) ──
   <div class="set-layout"><nav class="set-nav" data-ink="…"><span class="set-nav__label">Группа</span>
   <button class="set-nav__item" aria-current="page">icon<span class="set-nav__text">…</span><span class="set-nav__count">12</span></button></nav><section>…</section></div> */
.set-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: var(--sp-6); align-items: start; }
/* Страница с меню разделов — геометрия Каталога: окно во всю ширину, меню в 16px от края окна, место под полосу прокрутки постоянное */
.app__scroll:has(.set-layout) { scrollbar-gutter: stable; }
.page:has(.set-layout) { max-width: none; margin: 0; padding-left: var(--sp-4); }
@media (max-width: 767px) { .page:has(.set-layout) { padding-left: var(--gutter); } }
.set-nav { position: sticky; top: var(--sp-5); display: flex; flex-direction: column; gap: 2px; isolation: isolate; }
.set-nav :is(.set-nav__label, .cat-nav__label, .inv-nav__label, .int-nav__label) { padding: var(--sp-3) var(--sp-3) var(--sp-1); font-size: var(--fs-xs); font-weight: var(--fw-medium); color: var(--text-subtle); }
.set-nav :is(.set-nav__label, .cat-nav__label, .inv-nav__label, .int-nav__label):first-child { padding-top: 0; }
.set-nav .set-nav__item { display: flex; align-items: center; gap: var(--sp-3); min-height: 36px; padding: 0 var(--sp-3); border-radius: var(--r-sm); color: var(--text-muted); font-weight: var(--fw-medium); text-align: left; text-decoration: none; }
.set-nav .set-nav__item:hover, .set-nav .set-nav__item[aria-current="page"] { color: var(--text); }
.set-nav .set-nav__item svg.icon { flex: none; width: 18px; height: 18px; }
.set-nav .set-nav__item[aria-current="page"] > svg.icon, .set-nav .set-nav__item[aria-current="page"] :is(.set-nav__count, .inv-nav__count) { color: var(--accent-text); }
.set-nav :is(.set-nav__text, .cat-nav__text, .inv-nav__text, .int-nav__text) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-nav :is(.set-nav__count, .inv-nav__count) { min-width: 2ch; text-align: right; font-size: var(--fs-xs); color: var(--text-subtle); font-variant-numeric: tabular-nums; }
.set-nav .ink { border-radius: var(--r-sm); }
@media (max-width: 1100px) {
  .set-layout { grid-template-columns: minmax(0, 1fr); gap: var(--sp-4); }
  .set-nav { position: static; flex-direction: row; overflow-x: auto; scrollbar-width: none; }
  .set-nav :is(.set-nav__label, .cat-nav__label, .inv-nav__label, .int-nav__label) { display: none; }
  .set-nav .set-nav__item { flex: none; }
  .set-nav :is(.set-nav__text, .cat-nav__text, .inv-nav__text, .int-nav__text) { overflow: visible; }
}

/* ── Панель над списком (core/toolbar.js): поиск · Фильтр · Сортировка · Период — по одной на вкладку ── */
.tb { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; min-height: 36px; }
.tb .search { width: min(260px, 100%); }
.tb__end { margin-left: auto; display: inline-flex; align-items: center; gap: var(--sp-2); }
.tb-btn { display: inline-flex; align-items: center; gap: var(--sp-2); min-height: 34px; max-width: 100%; padding: 0 var(--sp-3); border-radius: var(--r-sm); background: var(--surface-2); color: var(--text); font-weight: var(--fw-medium); font-size: var(--fs-sm); white-space: nowrap; }
.tb-btn:hover { background: var(--surface-3); }
.tb-btn:focus-visible, .tb-btn[aria-expanded="true"] { outline: none; box-shadow: var(--focus-ring); }
.tb-btn > svg.icon:first-child { width: 16px; height: 16px; color: var(--text-muted); }
.tb-btn__label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tb-btn__caret { width: 14px; height: 14px; color: var(--text-subtle); transition: transform var(--dur-base) var(--ease-out); }
.tb-btn[aria-expanded="true"] .tb-btn__caret { transform: rotate(180deg); }
.tb-btn.is-set { background: var(--accent-soft); color: var(--accent-soft-text); }
.tb-btn.is-set > svg.icon { color: inherit; }
.tb-btn__n { min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-full); background: var(--accent); color: var(--on-accent); font-size: var(--fs-xs); line-height: 18px; text-align: center; }
.tb-pop { min-width: 220px; max-height: min(480px, 70vh); }
.tb-pop .select__opt { min-height: 34px; font-size: var(--fs-md); }
.tb-pop .menu__head { padding: var(--sp-2) var(--sp-3) var(--sp-1); }
.tb-pop__group + .tb-pop__group { margin-top: var(--sp-1); padding-top: var(--sp-1); border-top: 1px solid var(--border); }
.tb-pop__foot { display: flex; justify-content: flex-end; margin-top: var(--sp-1); padding-top: var(--sp-1); border-top: 1px solid var(--border); }
.tb-pop--period { max-height: none; }
.tb-period { display: grid; grid-template-columns: 168px 252px; gap: var(--sp-2); }
.tb-period__quick { display: flex; flex-direction: column; padding-right: var(--sp-2); border-right: 1px solid var(--border); }
.tb-cal { display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-1); }
.tb-cal__head { display: flex; align-items: center; justify-content: space-between; text-transform: capitalize; }
.tb-cal__head .icon-btn { width: 30px; height: 30px; }
.tb-cal__head .icon-btn:disabled { opacity: .35; }
.tb-cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px 0; }
.tb-cal__wd { display: grid; place-items: center; height: 24px; font-size: var(--fs-xs); color: var(--text-subtle); text-transform: uppercase; }
.tb-cal__d { height: 32px; border-radius: var(--r-xs); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; color: var(--text); }
.tb-cal__d:hover:not(:disabled) { background: var(--surface-2); }
.tb-cal__d:disabled { color: var(--text-subtle); opacity: .45; cursor: default; }
.tb-cal__d.is-today { color: var(--accent-text); font-weight: var(--fw-semibold); }
.tb-cal__d.is-in { border-radius: 0; background: var(--accent-soft); color: var(--accent-soft-text); }
.tb-cal__d.is-end { background: var(--accent); color: var(--on-accent); }
.tb-cal__foot { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); padding-top: var(--sp-2); border-top: 1px solid var(--border); font-size: var(--fs-sm); }
@media (max-width: 560px) { .tb-period { grid-template-columns: minmax(0, 1fr); } .tb-period__quick { border-right: 0; padding-right: 0; flex-direction: row; flex-wrap: wrap; } .tb-period__quick .select__opt { width: auto; } }

/* Переход между страницами back-office (core/router.js и обычная загрузка): сайдбар и шапка стоят, меняется только страница */
/* @view-transition для обычной загрузки убран: он снимал кадр с пустыми подписями (мигание) и падал при переадресации; от белой вспышки и так спасает paint holding */
.sidebar { view-transition-name: sidebar; }
.topbar { view-transition-name: topbar; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 120ms; }

/* ── Меню пользователя (core/account.js): карточка в сайдбаре → правая панель. Иконки голые, без подложек ── */
.acc-dialog .dialog__body { display: flex; flex-direction: column; gap: var(--sp-5); }
.acc-dialog :where(ul) { margin: 0; padding: 0; list-style: none; }
.acc-me { display: flex; align-items: center; gap: var(--sp-3); }
.acc-me__av { width: 48px; height: 48px; font-size: var(--fs-base); }
.acc-me__t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.acc-me__t b { font-size: var(--fs-md); font-weight: var(--fw-semibold); }
.acc-me__t small { color: var(--text-muted); font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; }
.acc-sub { display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-4); border-radius: var(--r-lg); background: var(--surface-2); }
.acc-sub__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-2); font-size: var(--fs-sm); color: var(--text-muted); }
.acc-sub__head b { font-size: var(--fs-md); font-weight: var(--fw-semibold); color: var(--accent-text); }
.acc-sub__line { margin: 0; font-size: var(--fs-sm); line-height: 1.45; }
.acc-sub__acts { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-top: var(--sp-1); }
.acc-rows li + li { border-top: 1px solid var(--border); }
.acc-row { display: flex; align-items: center; gap: var(--sp-3); width: 100%; min-height: 56px; padding: var(--sp-2) var(--sp-1); border-radius: var(--r-sm); text-align: left; color: var(--text); }
.acc-row:hover { background: var(--surface-2); }
.acc-row__ic { flex: none; width: 20px; height: 20px; color: var(--text-muted); }
.acc-row__t { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.acc-row__t b { font-weight: var(--fw-medium); }
.acc-row__t small { color: var(--text-subtle); font-size: var(--fs-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-row__go { flex: none; width: 16px; height: 16px; color: var(--text-subtle); }
.acc-prefs { display: grid; grid-template-columns: max-content minmax(0, 1fr); align-items: center; gap: var(--sp-3) var(--sp-4); }
.acc-prefs__label { color: var(--text-muted); font-size: var(--fs-sm); }
.acc-prefs .segmented { justify-self: start; }
.acc-prefs .segmented button { display: inline-flex; align-items: center; gap: var(--sp-1); }
.acc-prefs .segmented svg.icon { width: 16px; height: 16px; }
.acc-back { display: inline-flex; align-items: center; gap: var(--sp-2); align-self: flex-start; padding: 0; color: var(--text-muted); font-size: var(--fs-sm); font-weight: var(--fw-medium); }
.acc-back:hover { color: var(--text); }
.acc-back svg.icon { width: 16px; height: 16px; }
.acc-h { margin: 0; font-size: var(--fs-md); font-weight: var(--fw-semibold); }
.acc-back + .acc-h { margin-top: calc(-1 * var(--sp-3)); }
.acc-list li { display: flex; align-items: center; gap: var(--sp-3); min-height: 56px; padding: var(--sp-2) 0; border-bottom: 1px solid var(--border); }
.acc-list li:last-child { border-bottom: 0; }
.acc-list__ic { flex: none; width: 20px; height: 20px; color: var(--text-muted); }
.acc-list__t { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.acc-list__t b { font-weight: var(--fw-medium); }
.acc-list__t small { color: var(--text-subtle); font-size: var(--fs-xs); }
.acc-here { display: inline-flex; align-items: center; gap: var(--sp-1); color: var(--success); font-size: var(--fs-sm); font-weight: var(--fw-medium); white-space: nowrap; }
.acc-here svg.icon { width: 16px; height: 16px; }
.acc-pin { display: flex; align-items: center; gap: var(--sp-2); }
.acc-pin .input { width: 88px; text-align: center; letter-spacing: .3em; }
.acc-notify li { display: grid; grid-template-columns: minmax(0, 1fr) 56px 56px; justify-items: center; }
.acc-notify li > .acc-list__t { justify-self: stretch; }
.acc-notify .acc-notify__head { min-height: 0; padding-bottom: var(--sp-1); color: var(--text-subtle); font-size: var(--fs-xs); }
.acc-note { display: flex; align-items: flex-start; gap: var(--sp-2); margin: 0; color: var(--text-muted); font-size: var(--fs-sm); line-height: 1.45; }
.acc-note svg.icon { flex: none; width: 16px; height: 16px; margin-top: 2px; color: var(--text-subtle); }
.acc-danger { color: var(--danger); }
.account__me { cursor: pointer; }

/* ── Дашборд раздела (вариант А Аналитики, 08.11.2026): строка чисел .an-kpis → блоки .an-grid/.an-tile → правая панель .an-side, пояснения — «i» .an-info. JS — core/dash.js ── */
.delta--flat { color: var(--text-subtle); }
.an-link { padding: 0; color: var(--accent-text); font: inherit; font-weight: var(--fw-medium); text-decoration: none; }
.an-link:hover { text-decoration: underline; }
/* ── Дашборд (вариант А, 08.11.2026) ── */
.an-dash { display: flex; flex-direction: column; gap: var(--sp-5); min-width: 0; }
.an-dash__head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; }
/* строка чисел: одна полоса с волосками между, не карточки */
.an-kpis { display: grid; grid-template-columns: repeat(var(--n, 6), minmax(0, 1fr)); border-block: 1px solid var(--border); }
.an-kpi { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; padding: var(--sp-3) var(--sp-4); border-left: 1px solid var(--border); text-align: left; color: var(--text); }
.an-kpi:first-child { border-left: 0; padding-left: 0; }
.an-kpi:disabled { cursor: default; opacity: 1; }
.an-kpi:not(:disabled):hover b { color: var(--accent); }
.an-kpi small { font-size: var(--fs-xs); color: var(--text-muted); }
.an-kpi b { font-size: var(--fs-lg); font-weight: var(--fw-semibold); line-height: 1.2; white-space: nowrap; }
.an-kpi b small, .an-tile__head b small { display: none; }
.an-kpi > span { display: flex; align-items: center; gap: var(--sp-1); font-size: var(--fs-xs); min-height: 18px; }
.an-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-4); }
.an-tile { display: flex; flex-direction: column; gap: var(--sp-3); min-width: 0; padding: var(--sp-4); border-radius: var(--r-lg); background: var(--surface-2); }
.an-tile[role="button"] { cursor: pointer; transition: background var(--dur-fast); }
.an-tile[role="button"]:hover { background: var(--surface-3); }
.an-tile--wide { grid-column: span 2; }
.an-tile--plain { background: none; padding: 0; }
.an-tile__head { display: flex; align-items: baseline; gap: var(--sp-2); font-size: var(--fs-sm); color: var(--text-muted); }
.an-tile__head > span:first-child { margin-right: auto; }
.an-tile__head b { font-size: var(--fs-md); font-weight: var(--fw-semibold); color: var(--text); }
.an-att { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.an-att button { display: flex; align-items: baseline; gap: var(--sp-2); width: 100%; padding: var(--sp-2) 0; border-bottom: 1px solid var(--border); text-align: left; font-size: var(--fs-sm); color: var(--text); }
.an-att li:last-child button { border-bottom: 0; }
.an-att button > svg { flex: none; width: 16px; height: 16px; color: var(--warning); transform: translateY(2px); }
.an-att button > span { flex: 1; }
.an-att__ok { display: flex; align-items: center; gap: var(--sp-2); margin: 0; font-size: var(--fs-sm); }
.an-att__ok svg { width: 18px; height: 18px; color: var(--success); }
/* ── Кнопка «i»: подсказка по наведению, фокусу и тапу ── */
.an-info { position: relative; display: inline-flex; align-items: center; margin-right: auto; color: var(--text-muted); cursor: help; border-radius: var(--r-full); }
.an-info > svg { width: 18px; height: 18px; }
.an-info:hover, .an-info:focus-visible { color: var(--accent); outline: none; }
.an-info__tip { position: absolute; top: calc(100% + 8px); left: -8px; z-index: 5; display: none; flex-direction: column; gap: var(--sp-2); width: min(340px, 78vw); padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-lg); font-size: var(--fs-sm); line-height: 1.45; color: var(--text); cursor: auto; }
.an-info:hover .an-info__tip, .an-info:focus .an-info__tip, .an-info:focus-within .an-info__tip { display: flex; }
.an-info__tip span:first-child { font-weight: var(--fw-medium); }
.an-info__tip a { color: var(--accent); }
/* ── Правая панель отчёта ── */
.an-side .dialog__panel { width: min(760px, 100%); }
/* «i» в шапке любой правой панели и у подписи поля — пояснение вместо подтекста (08.11.2026) */
.dialog--side .dialog__head { position: relative; }
.dialog--side .dialog__head h3 + .an-info { position: static; margin-left: var(--sp-2); }
.dialog--side .dialog__head .an-info__tip { top: calc(100% - var(--sp-2)); left: var(--sp-6); right: var(--sp-6); width: auto; max-width: 460px; }
.field__label:has(.an-info), .an-bd__head h3:has(.an-info) { display: inline-flex; align-items: center; gap: var(--sp-1); }
.field__label .an-info, .an-bd__head h3 .an-info { margin-right: 0; font-weight: var(--fw-regular); }
.field__label .an-info > svg, .an-bd__head h3 .an-info > svg { width: 16px; height: 16px; }
/* Заголовки секций в панелях редактирования — как в панелях Аналитики */
:is(.st-dialog, .gst-dialog, .lc-dialog, .int-dialog, .ord-dialog, .tsk-dialog, .set-dlg) .dialog__body h4 { margin: 0; font-size: var(--fs-md); font-weight: var(--fw-semibold); color: var(--text); text-transform: none; letter-spacing: 0; }
.an-side .dialog__body { display: flex; flex-direction: column; gap: var(--sp-8); }
.an-side .an-report { gap: var(--sp-6); }
.an-side__cap { margin: 0 0 calc(var(--sp-5) * -1); font-size: var(--fs-sm); color: var(--text-muted); }
.an-side .an-hero__value { font-size: var(--fs-xl); }
.an-link { display: inline-flex; align-items: center; gap: var(--sp-1); font-size: var(--fs-sm); color: var(--accent); }
.an-link svg { width: 14px; height: 14px; }
@media (max-width: 1280px) { .an-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .an-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } .an-kpi:nth-child(3n+1) { border-left: 0; padding-left: 0; } }
@media (max-width: 760px) {
  .an-grid { grid-template-columns: minmax(0, 1fr); }
  .an-tile--wide { grid-column: auto; }
  .an-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .an-kpi, .an-kpi:first-child { border-left: 0; padding-left: 0; }
}
.an-cmp { display: flex; flex-direction: column; }
.an-cmp__row { display: grid; grid-template-columns: minmax(0, 1.4fr) 1fr 1fr 90px; align-items: baseline; gap: var(--sp-3); padding: var(--sp-2) 0; border-bottom: 1px solid var(--border); font-size: var(--fs-sm); }
.an-cmp__row > :nth-child(n+2) { text-align: right; justify-self: end; }
.an-cmp__head { font-size: var(--fs-xs); color: var(--text-muted); padding-top: 0; }
.an-bd__head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; }
.an-bd__head h3 { margin: 0; font-size: var(--fs-md); font-weight: var(--fw-semibold); }
.an-sec { display: flex; flex-direction: column; gap: var(--sp-3); min-width: 0; }
.an-att li.is-danger > * > svg { color: var(--danger); }
.an-att a { display: flex; align-items: baseline; gap: var(--sp-2); width: 100%; padding: var(--sp-2) 0; border-bottom: 1px solid var(--border); font-size: var(--fs-sm); color: var(--text); }
.an-att a > svg { flex: none; width: 16px; height: 16px; color: var(--warning); transform: translateY(2px); }
.an-att a > span { flex: 1; }
.an-att li:last-child a { border-bottom: 0; }
.an-att button:hover > span, .an-att a:hover > span { color: var(--accent); }
/* короткий список строк в блоке или панели: голая иконка · текст · число справа, волосок между */
.an-rows { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; min-width: 0; }
.an-row { display: flex; align-items: center; gap: var(--sp-3); width: 100%; min-height: 44px; padding: var(--sp-1) 0; border-bottom: 1px solid var(--border); text-align: left; font-size: var(--fs-sm); color: var(--text); }
.an-rows li:last-child .an-row { border-bottom: 0; }
button.an-row:hover .an-row__main b, a.an-row:hover .an-row__main b { color: var(--accent); }
.an-row > svg.icon { flex: none; width: 18px; height: 18px; color: var(--text-muted); }
.an-row--danger > svg.icon { color: var(--danger); }
.an-row--warning > svg.icon { color: var(--warning); }
.an-row--success > svg.icon { color: var(--success); }
.an-row__img { flex: none; width: 32px; height: 32px; border-radius: var(--r-sm); object-fit: cover; }
.an-row__main { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.an-row__main b { font-weight: var(--fw-medium); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-row__main small, .an-row__end small { font-size: var(--fs-xs); color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-row__end { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; flex: none; max-width: 45%; }
.an-row__end b { font-weight: var(--fw-semibold); white-space: nowrap; }
.an-rows__empty { margin: 0; font-size: var(--fs-sm); }
.an-tile__head .an-link { margin-left: var(--sp-2); }
.an-tile__head > span:first-child:has(+ .an-info) { margin-right: 0; }
@media (max-width: 760px) { .an-cmp__row { grid-template-columns: minmax(0, 1.2fr) 1fr 1fr 70px; gap: var(--sp-2); } }
.an-tile > p.subtle { margin: 0; font-size: var(--fs-sm); }

/* Вкладки с короткой линией (пользователь, 09.11.2026): как «Продажа» в шапке кассы, без иконок — текст и линия 24×3px,
   линия переезжает бегунком data-ink. Для навигации внутри страниц и панелей (статусы над таблицей, вкладки панели). */
.ltabs { position: relative; isolation: isolate; display: flex; gap: clamp(var(--sp-3), 1.4vw, var(--sp-6)); overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--border); }
.ltabs > button { flex: none; padding: var(--sp-2) var(--sp-1) var(--sp-3); color: var(--text-muted); font-weight: var(--fw-medium); white-space: nowrap; transition: color var(--dur-fast) var(--ease-out); }
.ltabs > button:hover { color: var(--text); }
.ltabs > button[aria-pressed="true"], .ltabs > button[aria-selected="true"] { color: var(--accent-text); }
.ltabs > .ink { background: none; box-shadow: none; }
.ltabs > .ink::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 24px; height: 3px; margin-left: -12px; border-radius: var(--r-full); background: var(--accent); }

/* Шапка таблицы прилипает при прокрутке окна (пользователь, 09.11.2026): обёртка не обрезает по вертикали,
   иначе sticky цепляется за неё; широкая таблица на десктопе прокручивает окно вбок. Линия снизу — тенью (border у sticky пропадает). */
@media (min-width: 769px) { .table-wrap { overflow: visible; } }
.table thead th { position: sticky; top: 0; z-index: 2; background: var(--surface); box-shadow: inset 0 -1px 0 var(--border); }

/* Период: два месяца рядом, поля «С → По» (активное — акцентом), подсветка диапазона при наведении (09.11.2026) */
.tb-period { grid-template-columns: 160px auto; }
.tb-cal { position: relative; }
.tb-cal__range { display: flex; align-items: center; gap: var(--sp-2); }
.tb-cal__field { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 120px; padding: var(--sp-1) var(--sp-3); border-radius: var(--r-xs); box-shadow: inset 0 0 0 1px var(--border-strong); }
.tb-cal__field small { font-size: var(--fs-xs); color: var(--text-subtle); }
.tb-cal__field.is-on { box-shadow: inset 0 0 0 2px var(--accent); }
.tb-cal__dash { color: var(--text-subtle); }
.tb-cal__head { position: absolute; left: 0; right: 0; top: 64px; padding: 0 var(--sp-1); pointer-events: none; }
.tb-cal__head .icon-btn { pointer-events: auto; }
.tb-cal__months { display: grid; grid-template-columns: repeat(2, 236px); gap: var(--sp-5); }
.tb-cal__month { display: flex; flex-direction: column; gap: var(--sp-2); }
.tb-cal__title { display: grid; place-items: center; height: 30px; text-transform: capitalize; font-size: var(--fs-sm); }
@media (max-width: 640px) { .tb-cal__months { grid-template-columns: minmax(0, 1fr); } .tb-cal__month + .tb-cal__month { display: none; } .tb-cal__field { min-width: 0; } }
/* Календарь как у Stripe (09.11.2026): концы диапазона — круги, между ними сплошная полоса; поля дат вписываются руками; «Сбросить · Применить» */
.tb-cal__d { position: relative; height: 34px; border-radius: var(--r-full); }
.tb-cal__d.is-in { border-radius: 0; }
.tb-cal__d.is-end { border-radius: var(--r-full); }
.tb-cal__d.is-lo { background: radial-gradient(circle closest-side, var(--accent) 96%, transparent 100%), linear-gradient(to right, transparent 50%, var(--accent-soft) 50%); }
.tb-cal__d.is-hi { background: radial-gradient(circle closest-side, var(--accent) 96%, transparent 100%), linear-gradient(to left, transparent 50%, var(--accent-soft) 50%); }
.tb-cal__d.is-lo, .tb-cal__d.is-hi { border-radius: 0; color: var(--on-accent); }
.tb-cal__grid { gap: 4px 0; }
.tb-cal__field { flex-direction: row; align-items: center; gap: var(--sp-2); padding: 0 var(--sp-2); height: 34px; }
.tb-cal__in { width: 92px; border: 0; background: transparent; color: var(--text); font: inherit; font-size: var(--fs-sm); outline: none; }
.tb-cal__in[aria-invalid="true"] { color: var(--danger); }
.tb-cal__foot { border-top: 0; }
.tb-cal__btns { display: inline-flex; gap: var(--sp-2); }
.tb-cal__btns .btn--ghost { box-shadow: inset 0 0 0 1px var(--border-strong); }

/* ── Календарь «Период» и «Фильтр» в стиле Stripe (09.11.2026, по скрину пользователя) ── */
.tb-pop--period { padding: var(--sp-4) var(--sp-5); border-radius: var(--r-md); }
.tb-period { grid-template-columns: 156px auto; gap: var(--sp-6); }
.tb-period__quick { gap: 2px; padding-right: 0; border-right: 0; }
.tb-period__quick .select__opt { min-height: 34px; font-size: var(--fs-sm); }
.tb-period__quick .select__opt[aria-selected="true"] { background: var(--accent-soft); color: var(--accent-soft-text); font-weight: var(--fw-medium); }
.tb-period__quick .select__opt > svg.icon { display: none; }
.tb-cal { gap: var(--sp-4); padding: 0; }
.tb-cal__range { gap: var(--sp-5); }
.tb-cal__field { flex: none; flex-direction: row; align-items: center; gap: var(--sp-2); height: auto; min-width: 0; padding: 0; box-shadow: none; font-size: var(--fs-sm); color: var(--text-muted); }
.tb-cal__in { width: 124px; height: 34px; padding: 0 var(--sp-3); border-radius: var(--r-xs); box-shadow: inset 0 0 0 1px var(--border-strong); letter-spacing: .02em; }
.tb-cal__in.is-on, .tb-cal__in:focus { box-shadow: inset 0 0 0 1px var(--accent), 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.tb-cal__months { grid-template-columns: repeat(2, 252px); gap: var(--sp-8); }
.tb-cal__mh { display: grid; grid-template-columns: 32px minmax(0, 1fr) 32px; align-items: center; height: 32px; margin-bottom: var(--sp-1); }
.tb-cal__nav { width: 32px; height: 32px; }
.tb-cal__nav:disabled { opacity: .35; }
.tb-cal__title { height: auto; font-size: var(--fs-md); font-weight: var(--fw-semibold); text-transform: capitalize; }
.tb-cal__wd { height: 28px; text-transform: capitalize; font-size: var(--fs-xs); color: var(--text-subtle); }
.tb-cal__grid { gap: 4px 0; }
.tb-cal__d, .tb-cal__d.is-end, .tb-cal__d.is-in, .tb-cal__d.is-lo, .tb-cal__d.is-hi { display: grid; place-items: center; height: 36px; padding: 0; border-radius: 0; background: none; color: var(--text); font-size: var(--fs-sm); }
.tb-cal__d > span { display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-full); transition: background var(--dur-fast) var(--ease-out); }
.tb-cal__d:hover:not(:disabled) { background: none; }
.tb-cal__d:hover:not(:disabled) > span { background: var(--surface-2); }
.tb-cal__d:disabled { opacity: 1; color: var(--text-subtle); }
.tb-cal__d.is-in { background: var(--accent-soft); color: var(--accent-text); }
.tb-cal__d.is-in.is-rs { border-radius: var(--r-full) 0 0 var(--r-full); }
.tb-cal__d.is-in.is-re { border-radius: 0 var(--r-full) var(--r-full) 0; }
.tb-cal__d.is-in.is-rs.is-re { border-radius: var(--r-full); }
.tb-cal__d.is-in:hover:not(:disabled) { background: var(--accent-soft); }
.tb-cal__d.is-lo:not(.is-re) { background: linear-gradient(to right, transparent 50%, var(--accent-soft) 50%); }
.tb-cal__d.is-hi:not(.is-rs) { background: linear-gradient(to left, transparent 50%, var(--accent-soft) 50%); }
.tb-cal__d.is-end > span, .tb-cal__d.is-end:hover:not(:disabled) > span { background: var(--accent); color: var(--on-accent); font-weight: var(--fw-semibold); }
.tb-cal__d.is-today:not(.is-end) > span { box-shadow: inset 0 0 0 1px var(--border-strong); }
.tb-cal__foot { justify-content: flex-end; padding-top: 0; border-top: 0; }
.tb-cal__foot .btn--ghost { color: var(--text); box-shadow: inset 0 0 0 1px var(--border-strong); }
@media (max-width: 760px) { .tb-period { grid-template-columns: minmax(0, 1fr); } .tb-cal__months { grid-template-columns: minmax(0, 1fr); } .tb-cal__month + .tb-cal__month { display: none; } .tb-cal__range { flex-wrap: wrap; gap: var(--sp-2); } }

.tb-pop--filter { width: min(380px, calc(100vw - 16px)); max-height: min(560px, 80vh); padding: var(--sp-4); }
.tb-filter { display: flex; flex-direction: column; gap: var(--sp-4); }
.tb-filter__g h4 { margin: 0 0 var(--sp-2); font-size: var(--fs-xs); font-weight: var(--fw-medium); color: var(--text-muted); }
.tb-filter__opts { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.tb-chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 var(--sp-3); border-radius: var(--r-full); box-shadow: inset 0 0 0 1px var(--border-strong); color: var(--text); font-size: var(--fs-sm); white-space: nowrap; transition: background var(--dur-fast) var(--ease-out); }
.tb-chip svg.icon { width: 16px; height: 16px; color: var(--text-muted); }
.tb-chip:hover { background: var(--surface-2); }
.tb-chip[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-soft-text); box-shadow: inset 0 0 0 1px var(--accent); }
.tb-chip[aria-pressed="true"] svg.icon { color: inherit; }
.tb-pop--filter .tb-pop__foot { margin-top: var(--sp-4); padding-top: var(--sp-3); }

/* ══ Стиль Stripe для всего Back-office и Super-Admin (09.11.2026, пользователь: «теперь так переделай все страницы»).
   Пилот — «Заказы», выжимка — docs/phase0/13-stripe-style.md. Строка KPI (.an-kpis) остаётся как есть — «норм такой дизайн».
   Область — страницы с окном .app__main (Back-office и Super-Admin); устройства (POS, KDS, CDS, киоск, телефоны) не трогаем. ══ */
:root:has(.app__main) { --font-sans: var(--font-admin); }

/* Шапка раздела: название слева, справа в одну строку поиск · Фильтр · Сортировка · Период · кнопки-иконки */
.sp-head { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: var(--sp-3); min-height: 36px; }
.sp-title { margin: 0; font-size: var(--fs-xl); font-weight: var(--fw-semibold); line-height: 1.2; }
.sp-acts { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--sp-2); margin-left: auto; }
.sp-h { margin: 0; font-size: var(--fs-lg); font-weight: var(--fw-semibold); }
.sp-sec { display: flex; flex-direction: column; gap: var(--sp-5); }
.sp-ibtn { display: inline-grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: var(--r-xs); color: var(--text); }
.sp-ibtn svg.icon { width: 16px; height: 16px; }
.sp-ibtn:disabled { opacity: .4; cursor: default; }

/* Кнопки панели и поиск: без заливки, тонкая обводка, едва заметная тень, радиус 6px */
:root:has(.app__main) :is(.tb-btn, .tb-btn.is-set, .sp-ibtn) { min-height: 32px; border-radius: var(--r-xs); background: transparent;
  box-shadow: inset 0 0 0 1px var(--border-strong), 0 1px 1px color-mix(in srgb, var(--text) 6%, transparent); }
:root:has(.app__main) :is(.tb, .sp-acts) .search .input { min-height: 32px; height: 32px; border-radius: var(--r-xs); background: transparent;
  box-shadow: inset 0 0 0 1px var(--border-strong), 0 1px 1px color-mix(in srgb, var(--text) 6%, transparent); }
:root:has(.app__main) :is(.tb-btn, .sp-ibtn):hover:not(:disabled), :root:has(.app__main) .tb-btn[aria-expanded="true"] { background: color-mix(in srgb, var(--text) 4%, transparent); }
:root:has(.app__main) .tb-btn.is-set { color: var(--accent-text); box-shadow: inset 0 0 0 1px var(--accent); }
:root:has(.app__main) :is(.tb-btn, .sp-ibtn):focus-visible, :root:has(.app__main) .tb-btn[aria-expanded="true"],
:root:has(.app__main) :is(.tb, .sp-acts) .search .input:focus { outline: none; box-shadow: inset 0 0 0 1px var(--accent), 0 0 0 2px color-mix(in srgb, var(--accent) 20%, transparent); }
.sp-acts .search { width: 240px; min-width: 0; }

/* Таблицы: без подложки, приглушённые заголовки с тонкими разделителями, строки через 1px, липкая шапка */
:root:has(.app__main) .table-wrap { border-radius: 0; background: transparent; }
:root:has(.app__main) .table thead th { position: sticky; top: 0; z-index: 2; height: 34px; background: var(--bg); color: var(--text-muted); font-size: var(--fs-xs); font-weight: var(--fw-medium); border-bottom: 0; box-shadow: inset 0 -1px 0 var(--border); }
:root:has(.app__main) .table thead th:not(:last-child)::after { content: ""; position: absolute; right: 0; top: 10px; bottom: 10px; width: 1px; background: var(--border); }
:root:has(.app__main) .table td { height: 42px; }
:root:has(.app__main) .table tbody tr:hover td { background: var(--surface-2); }

/* Бейджи статуса — маленькие, с тонкой рамкой своего цвета */
:root:has(.app__main) .badge { height: 20px; padding: 0 6px; border-radius: 4px; box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 30%, transparent); }

/* Блоки дашбордов — без карточек и подложек (как Stripe Home): заголовок, число, график; клик — заголовок акцентом */
:root:has(.app__main) .an-grid { gap: var(--sp-8); }
:root:has(.app__main) .an-tile { padding: 0; border-radius: 0; background: none; }
:root:has(.app__main) .an-tile[role="button"]:hover { background: none; }
:root:has(.app__main) .an-tile[role="button"]:hover :is(h3, .an-tile__head h3, .an-tile__title) { color: var(--accent-text); }

/* Вкладки правых панелей — как .ltabs: текст и короткая линия под активной (бегунок data-ink) */
.dialog--side .side-tabs { gap: var(--sp-5); padding: 0; border-radius: 0; background: none; border-bottom: 1px solid var(--border); overflow-x: auto; }
.dialog--side .side-tabs button { flex: none; min-height: 0; padding: var(--sp-2) var(--sp-1) var(--sp-3); border-radius: 0; background: none; box-shadow: none; }
.dialog--side .side-tabs button[aria-pressed="true"] { color: var(--accent-text); background: none; box-shadow: none; }
.dialog--side .side-tabs > .ink { background: none; box-shadow: none; }
.dialog--side .side-tabs > .ink::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 24px; height: 3px; margin-left: -12px; border-radius: var(--r-full); background: var(--accent); }
@media (max-width: 640px) { .sp-acts { flex: 1 1 100%; justify-content: flex-start; } .sp-acts .search { flex: 1 1 100%; width: auto; } .sp-title { font-size: var(--fs-lg); } }

/* Левое меню разделов прокручивается само (09.11.2026, пользователь: «когда вниз кручу информация справа левого блока оставалась на месте»):
   длинное меню (Настройки) не утаскивает за собой содержимое справа */
@media (min-width: 769px) {
  .set-nav { max-height: calc(100dvh - var(--topbar-h) - 2 * var(--window-gap) - 2 * var(--sp-5)); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
}

/* Окно выбора точки в стиле Stripe (09.11.2026, «исправь модалку выбора локалов»): поиск с тонкой обводкой, фильтры — чипы с обводкой,
   иконка «Все точки» без плашки, выбранная строка — лёгкий акцентный фон и галочка */
:root:has(.app__main) .dialog--lg .dialog__head h3 { font-size: var(--fs-lg); font-weight: var(--fw-semibold); }
:root:has(.app__main) .dialog--lg .search .input { min-height: 36px; height: 36px; border-radius: var(--r-xs); background: transparent; font-size: var(--fs-md);
  box-shadow: inset 0 0 0 1px var(--border-strong), 0 1px 1px color-mix(in srgb, var(--text) 6%, transparent); }
:root:has(.app__main) .dialog--lg .search .input:focus, :root:has(.app__main) .dialog--lg .search .input:focus-visible { outline: none; box-shadow: inset 0 0 0 1px var(--accent), 0 0 0 2px color-mix(in srgb, var(--accent) 20%, transparent); }
:root:has(.app__main) .dialog--lg .chip { min-height: 30px; background: transparent; color: var(--text); font-size: var(--fs-sm); box-shadow: inset 0 0 0 1px var(--border-strong); }
:root:has(.app__main) .dialog--lg .chip:hover { background: var(--surface-2); }
:root:has(.app__main) .dialog--lg .chip[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-soft-text); box-shadow: inset 0 0 0 1px var(--accent); }
:root:has(.app__main) .loc-option { border-radius: var(--r-sm); }
:root:has(.app__main) .loc-option[aria-selected="true"] { background: color-mix(in srgb, var(--accent) 7%, transparent); }
:root:has(.app__main) .loc-option--all .loc-thumb { background: none; color: var(--text-muted); }
:root:has(.app__main) .loc-option--all .loc-thumb svg.icon { width: 28px; height: 28px; }
:root:has(.app__main) .loc-head { color: var(--text-muted); }

/* Выбор точки в свёрнутом сайдбаре (09.11.2026, «исправь то как выглядит выбор локалов когда левый блок закрыт»):
   как пункт меню — голая иконка 40px по центру рельса, без белой карточки и плашки; фото точки остаётся круглым-квадратным превью */
.loc-thumb:not(:has(img)) { background: none; }
.app[data-sidebar="hidden"] .loc-switch { width: 40px; height: 40px; margin: 0 auto var(--sp-3); padding: 0; justify-content: center; background: none; border-radius: var(--r-sm); }
.app[data-sidebar="hidden"] .loc-switch:hover { background: var(--surface-2); }
.app[data-sidebar="hidden"] .loc-switch .loc-thumb { width: 28px; height: 28px; }
@media (max-width: 1100px) and (min-width: 768px) {
  .app .loc-switch { width: 40px; height: 40px; margin: 0 auto var(--sp-3); padding: 0; justify-content: center; background: none; border-radius: var(--r-sm); }
  .app .loc-switch:hover { background: var(--surface-2); }
  .app .loc-switch .loc-thumb { width: 28px; height: 28px; }
}
/* Второстепенные кнопки в Back-office — как у Stripe: без заливки, тонкая обводка (09.11.2026) */
:root:has(.app__main) .btn--secondary { background: transparent; box-shadow: inset 0 0 0 1px var(--border-strong), 0 1px 1px color-mix(in srgb, var(--text) 6%, transparent); }
:root:has(.app__main) .btn--secondary:hover { background: color-mix(in srgb, var(--text) 4%, transparent); }

/* ── Низ сайдбара: «Приложения» и «Центр помощи» над карточкой аккаунта (07-bo-orgs-support.md, 09.11.2026) ── */
.sidebar__foot { margin-top: auto; display: flex; flex-direction: column; gap: var(--sp-1); padding-top: var(--sp-3); }
.sidebar__foot + .account { margin-top: var(--sp-2); }
.app[data-sidebar="hidden"] .sidebar__foot .nav-item span { display: none; }

/* ── Чат с поддержкой (core/chat.js): кнопка справа внизу → наша правая панель .dialog--side.cw-dialog (пользователь, 09.11.2026:
   «как наши модалки пусть выходит, в нашем стиле»). Вкладки .side-tabs, строки с тонкими линиями, поле ввода в подвале. */
.chat-fab { position: fixed; right: var(--sp-5); bottom: var(--sp-5); z-index: var(--z-drawer); display: inline-flex; align-items: center; gap: var(--sp-2);
  height: 40px; padding: 0 var(--sp-4); border-radius: var(--r-full); background: var(--accent); color: var(--on-accent); font-weight: var(--fw-medium); box-shadow: var(--shadow-lg); }
.chat-fab:hover { background: var(--accent-hover); }
.chat-fab:focus-visible { outline: none; box-shadow: var(--focus-ring), var(--shadow-lg); }
.chat-fab svg.icon { width: 18px; height: 18px; }
.chat-fab.has-new::after { content: ""; position: absolute; top: -2px; right: -2px; width: 10px; height: 10px; border-radius: var(--r-full); background: var(--danger); box-shadow: 0 0 0 2px var(--bg); }
.cw-dialog .dialog__panel { width: min(480px, 100%); }
.cw-dialog .dialog__head { flex-wrap: wrap; row-gap: 0; }
.cw-online { order: 3; flex-basis: 100%; display: flex; align-items: center; gap: var(--sp-2); color: var(--text-muted); font-size: var(--fs-xs); }
.cw-dot { width: 6px; height: 6px; border-radius: var(--r-full); background: var(--success); flex: none; }
.cw-dialog .dialog__body { gap: var(--sp-4); }
.cw-hi { margin: 0; color: var(--text-muted); }
.cw-hi b { color: var(--text); font-weight: var(--fw-semibold); }
.cw-sec { display: flex; flex-direction: column; gap: var(--sp-2); }
.cw-sec__h { display: flex; align-items: center; justify-content: space-between; }
.cw-sec__h h4, .cw-h { margin: 0; font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.cw-link { color: var(--accent-text); font-size: var(--fs-sm); font-weight: var(--fw-medium); }
.cw-link:hover { text-decoration: underline; }
.cw-search { width: 100%; }
.cw-search .input { min-height: 36px; background: transparent; border-radius: var(--r-xs); box-shadow: inset 0 0 0 1px var(--border-strong); }
.cw-search .input:focus { outline: none; box-shadow: inset 0 0 0 1px var(--accent), 0 0 0 2px color-mix(in srgb, var(--accent) 20%, transparent); }
.cw-list { list-style: none; margin: 0; padding: 0; }
.cw-list > li + li { border-top: 1px solid var(--border); }
.cw-row, .cw-col, .cw-conv { display: flex; align-items: center; gap: var(--sp-3); width: 100%; min-height: 48px; padding: var(--sp-2); text-align: left; color: var(--text); border-radius: var(--r-xs); }
:is(.cw-row, .cw-col, .cw-conv):hover { background: var(--surface-2); }
.cw-row > svg.icon:first-child { width: 16px; height: 16px; color: var(--text-muted); flex: none; }
.cw-row span { flex: 1; font-size: var(--fs-sm); }
:is(.cw-row, .cw-col) > svg.icon:last-child { width: 16px; height: 16px; color: var(--text-subtle); flex: none; }
.cw-col span { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.cw-col b { font-weight: var(--fw-medium); }
.cw-col small { color: var(--text-muted); font-size: var(--fs-xs); }
.cw-conv__ic { width: 18px; height: 18px; color: var(--text-muted); flex: none; }
.cw-conv__t { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.cw-conv__t b { font-weight: var(--fw-medium); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cw-conv__t small { color: var(--text-muted); font-size: var(--fs-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cw-conv__end { display: flex; flex-direction: column; align-items: flex-end; gap: var(--sp-1); flex: none; }
.cw-conv__end small { color: var(--text-subtle); font-size: var(--fs-xs); white-space: nowrap; }
.cw-empty { padding: var(--sp-6) 0; color: var(--text-muted); text-align: center; list-style: none; }
.cw-status { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-3) 0 0; border-top: 1px solid var(--border); color: var(--text); font-size: var(--fs-sm); text-decoration: none; }
.cw-status span { flex: 1; }
.cw-status svg.icon { width: 16px; height: 16px; color: var(--success); flex: none; }
.cw-status.is-warn svg.icon:first-child { color: var(--warning); }
.cw-status svg.icon:last-child { color: var(--text-subtle); }
.cw-back { align-self: flex-start; display: inline-flex; align-items: center; gap: var(--sp-2); color: var(--text-muted); font-size: var(--fs-sm); font-weight: var(--fw-medium); }
.cw-back:hover { color: var(--text); }
.cw-back svg.icon { width: 16px; height: 16px; }
.cw-foot-note { display: inline-flex; align-items: center; gap: var(--sp-2); color: var(--text-muted); font-size: var(--fs-xs); }
.cw-art h4 { margin: 0; font-size: var(--fs-lg); font-weight: var(--fw-semibold); }
.cw-art small { color: var(--text-muted); font-size: var(--fs-xs); }
.cw-art p { margin: var(--sp-3) 0 0; line-height: 1.6; }
.cw-vote { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-2); padding-top: var(--sp-4); border-top: 1px solid var(--border); color: var(--text-muted); font-size: var(--fs-sm); }
.hc-ok { display: inline-flex; align-items: center; gap: var(--sp-2); color: var(--success); }
.hc-ok svg.icon { width: 16px; height: 16px; }
/* Диалог */
.cw-convhead { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.cw-convhead__meta { display: inline-flex; align-items: center; gap: var(--sp-2); color: var(--text-muted); font-size: var(--fs-sm); }
.cw-subject { margin: calc(-1 * var(--sp-2)) 0 0; font-weight: var(--fw-semibold); }
.chat__body { display: flex; flex-direction: column; gap: var(--sp-3); }
.msg { display: flex; flex-direction: column; gap: var(--sp-1); max-width: 85%; align-self: flex-start; }
.msg small { color: var(--text-subtle); font-size: var(--fs-xs); }
.msg__b { padding: var(--sp-2) var(--sp-3); border-radius: var(--r-sm); background: var(--surface-2); }
.msg__b p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg--me { align-self: flex-end; align-items: flex-end; }
.msg--me .msg__b { background: var(--accent-soft); color: var(--accent-soft-text); }
.msg__art { display: flex; align-items: center; gap: var(--sp-2); margin-top: var(--sp-2); color: var(--accent-text); font-weight: var(--fw-medium); text-decoration: none; }
.msg__art svg.icon { width: 16px; height: 16px; flex: none; }
.msg__art:hover span { text-decoration: underline; }
.chat__wait { display: flex; gap: var(--sp-2); margin: 0; color: var(--text-muted); font-size: var(--fs-sm); }
.chat__wait svg.icon { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.chat__topics { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.chat__topic { min-height: 30px; padding: 0 var(--sp-3); border-radius: var(--r-full); font-size: var(--fs-sm); box-shadow: inset 0 0 0 1px var(--border-strong); }
.chat__topic:hover { background: var(--surface-2); }
.chat__topic[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-soft-text); box-shadow: inset 0 0 0 1px var(--accent); }
.cw-dialog .dialog__foot:has(.chat__form) { display: block; }
.chat__form { display: flex; flex-direction: column; gap: var(--sp-2); width: 100%; }
.chat__in { min-height: 64px; max-height: 160px; resize: none; background: transparent; border-radius: var(--r-xs); box-shadow: inset 0 0 0 1px var(--border-strong); }
.chat__in:focus-visible { box-shadow: inset 0 0 0 1px var(--accent), 0 0 0 2px color-mix(in srgb, var(--accent) 20%, transparent); }
.chat__acts { display: flex; align-items: center; gap: var(--sp-2); }
@media (max-width: 767px) { .chat-fab { bottom: calc(var(--bottomnav-h) + var(--sp-3)); right: var(--sp-3); } }
.nav-item--back { color: var(--text-subtle); font-size: var(--fs-sm); min-height: 32px; }
.nav-item--back svg.icon { width: 16px; height: 16px; }
/* Открыта правая панель или окно — кнопка чата не перекрывает «Сохранить» */
body:has(.dialog) .chat-fab { display: none; }
.dialog--side .side-tabs { scrollbar-width: none; }
.dialog--side .side-tabs::-webkit-scrollbar { display: none; }

/* ── Уведомления (core/notify.js): правая панель, строки с голой цветной иконкой, точка «не прочитано» ── */
.nt-dialog .dialog__panel { width: min(480px, 100%); }
.nt-list { list-style: none; margin: 0; padding: 0; }
.nt-list > li + li { border-top: 1px solid var(--border); }
.nt-row { display: flex; align-items: flex-start; gap: var(--sp-3); padding: var(--sp-3) var(--sp-2); border-radius: var(--r-xs); color: var(--text); text-decoration: none; }
.nt-row:hover { background: var(--surface-2); }
.nt-row__ic { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.nt--danger { color: var(--danger); }
.nt--warning { color: var(--warning); }
.nt--info { color: var(--accent-text); }
.nt-row__t { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.nt-row__t b { font-weight: var(--fw-medium); }
.nt-row:not(.is-new) .nt-row__t b { font-weight: var(--fw-regular, 400); color: var(--text-muted); }
.nt-row__t small { color: var(--text-muted); font-size: var(--fs-xs); overflow-wrap: anywhere; }
.nt-row__loc { color: var(--text-subtle) !important; }
.nt-row__dot { width: 8px; height: 8px; margin-top: 6px; border-radius: var(--r-full); background: var(--accent); flex: none; }

/* ── ИИ-помощник (core/assistant.js), раньше assets/css/assistant.css ── */
/* ИИ-помощник владельца (core/assistant.js, docs/phase0/16-tech.md, п. 28): правая панель .dialog--side.ai-dialog.
   Сообщения и поле ввода — общие .msg / .chat__* из components.css; здесь только своё. Иконки голые, без подложек. */
.ai-dialog .dialog__panel { width: min(520px, 100%); }
.ai-dialog .dialog__head { flex-wrap: wrap; row-gap: 0; }
.ai-dialog .dialog__head h3 { display: inline-flex; align-items: center; gap: var(--sp-2); }
.ai-spark { width: 20px; height: 20px; color: var(--accent-text); flex: none; }
.ai-scope { order: 3; flex-basis: 100%; display: flex; align-items: center; gap: var(--sp-2); color: var(--text-muted); font-size: var(--fs-xs); }
.ai-scope svg.icon { width: 14px; height: 14px; flex: none; }
.ai-dialog .dialog__foot:has(.chat__form) { display: block; }

.ai-ans { max-width: 100%; width: 100%; }
.ai-ans .msg__b { display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0; }
.ai-ans .msg__b p { white-space: normal; }
.ai-ans b { font-weight: var(--fw-semibold); }
.ai-ans q { color: var(--text-muted); font-style: italic; }
.ai-list { margin: 0; padding-left: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-1); overflow-wrap: anywhere; }
.ai-over { color: var(--warning); font-size: var(--fs-xs); font-weight: var(--fw-medium); white-space: nowrap; }
.ai-links { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-4); }
.ai-link { display: inline-flex; align-items: center; gap: var(--sp-1); color: var(--accent-text); font-weight: var(--fw-medium); text-decoration: none; white-space: nowrap; }
.ai-link svg.icon { width: 14px; height: 14px; flex: none; }
.ai-link:hover { text-decoration: underline; }

.ai-cmp { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.ai-cmp th, .ai-cmp td { padding: var(--sp-1) var(--sp-2); text-align: right; border-bottom: 1px solid var(--border); }
.ai-cmp th:first-child, .ai-cmp th[scope="row"] { text-align: left; font-weight: var(--fw-regular); color: var(--text-muted); }
.ai-cmp thead th { font-weight: var(--fw-semibold); color: var(--text); overflow-wrap: anywhere; }
.ai-cmp tr:last-child > * { border-bottom: 0; }

.ai-sugg { display: flex; flex-wrap: wrap; gap: var(--sp-2); padding-top: var(--sp-2); }
.ai-sugg .chat__topic { text-align: left; min-height: 32px; padding: var(--sp-1) var(--sp-3); line-height: 1.3; }

@media (max-width: 767px) {
  .ai-cmp th, .ai-cmp td { padding: var(--sp-1); }
}

/* ── Плитка аккаунта и меню над ней (core/account.js, 10.11.2026; образец GoPOS «Your organizations», лучше) ──
   .acc-tile внизу сайдбара: фото организации · название + тариф · кто вошёл → .acc-pop (role=menu, fixed, над плиткой).
   Окна из меню — правые панели .acc-dialog. Иконки голые; фото — скруглённая картинка, не плашка. Старые .account* не используются. */
.acc-img { flex: none; width: 32px; height: 32px; border-radius: var(--r-xs); overflow: hidden; display: grid; place-items: center; color: var(--text-muted); }
.acc-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.acc-img svg.icon { width: 20px; height: 20px; }
.acc-tile { position: relative; margin-top: auto; display: flex; align-items: center; gap: var(--sp-3); width: 100%; min-height: 52px; padding: var(--sp-2); border-radius: var(--r-sm); text-align: left; color: var(--text); transition: background var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out); }
.sidebar__foot + .acc-tile { margin-top: var(--sp-2); border-top: 0; }
.acc-tile:hover { background: var(--surface-2); }
.acc-tile:active { transform: scale(.98); }
.acc-tile[aria-expanded="true"] { background: var(--surface-3); }
.acc-tile:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.acc-tile__t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; line-height: var(--lh-snug); }
.acc-tile__row { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; }
.acc-tile__row b { min-width: 0; font-weight: var(--fw-semibold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-tile__plan { flex: none; height: 18px; padding: 0 var(--sp-1); display: inline-flex; align-items: center; border: 1px solid var(--border-strong); border-radius: var(--r-xs); font-size: var(--fs-xs); font-weight: var(--fw-medium); color: var(--text-muted); }
.acc-tile__t small { font-size: var(--fs-xs); color: var(--text-subtle); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-tile svg.acc-tile__caret { flex: none; width: 16px; height: 16px; color: var(--text-subtle); }
.acc-tile__dot { position: absolute; top: var(--sp-2); left: calc(var(--sp-2) + 28px); width: 8px; height: 8px; border-radius: var(--r-full); background: var(--accent); box-shadow: 0 0 0 2px var(--shell); }
@media (min-width: 768px) {
  .app[data-sidebar="hidden"] .acc-tile { justify-content: center; padding: var(--sp-2) 0; }
  .app[data-sidebar="hidden"] :is(.acc-tile__t, .acc-tile__caret) { display: none; }
  .app[data-sidebar="hidden"] .acc-tile__dot { left: calc(50% + 12px); }
}
@media (max-width: 1100px) and (min-width: 768px) {
  .app:not([data-sidebar="hidden"]) .acc-tile { justify-content: center; padding: var(--sp-2) 0; }
  .app:not([data-sidebar="hidden"]) :is(.acc-tile__t, .acc-tile__caret) { display: none; }
  .app:not([data-sidebar="hidden"]) .acc-tile__dot { left: calc(50% + 12px); }
}

.acc-pop { position: fixed; z-index: var(--z-modal); display: flex; flex-direction: column; padding: var(--sp-1); overflow-y: auto; overscroll-behavior: contain; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-lg); animation: acc-pop-in var(--dur-fast) var(--ease-out); }
@keyframes acc-pop-in { from { opacity: 0; transform: translateY(4px); } }
.acc-pop__head { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-2) var(--sp-2) var(--sp-3); margin-bottom: var(--sp-1); border-bottom: 1px solid var(--border); }
.acc-pop__img { width: 40px; height: 40px; border-radius: var(--r-sm); }
.acc-pop__who { min-width: 0; display: flex; flex-direction: column; gap: 1px; line-height: var(--lh-snug); }
.acc-pop__who b { font-weight: var(--fw-semibold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-pop__who small { font-size: var(--fs-xs); color: var(--text-subtle); }
.acc-pop__label { padding: var(--sp-2) var(--sp-2) var(--sp-1); font-size: var(--fs-xs); color: var(--text-subtle); }
.acc-pop__venues { display: flex; flex-direction: column; max-height: 216px; overflow-y: auto; overscroll-behavior: contain; }
.acc-pop__item { flex: none; display: flex; align-items: center; gap: var(--sp-3); width: 100%; min-height: 36px; padding: 0 var(--sp-2); border-radius: 8px; text-align: left; color: var(--text); font-size: var(--fs-md); text-decoration: none; }
.acc-pop__item:hover, .acc-pop__item:focus-visible { background: var(--surface-2); outline: none; }
.acc-pop__item:active { transform: scale(.99); }
.acc-pop__item[aria-checked="true"] { background: var(--accent-soft); color: var(--accent-soft-text); }
.acc-pop__item svg.acc-pop__ic { flex: none; width: 18px; height: 18px; color: var(--text-muted); }
.acc-pop__thumb { width: 24px; height: 24px; border-radius: 6px; }
.acc-pop__thumb svg.icon { width: 16px; height: 16px; }
.acc-pop__name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-pop__meta { flex: none; max-width: 45%; font-size: var(--fs-xs); color: var(--text-subtle); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-pop__item svg.acc-pop__check { flex: none; width: 16px; height: 16px; color: var(--accent-text); }
.acc-pop__dot { flex: none; width: 8px; height: 8px; border-radius: var(--r-full); background: var(--accent); }
.acc-pop__sep { flex: none; height: 1px; margin: var(--sp-1) var(--sp-2); background: var(--border); }
.acc-pop__item--danger, .acc-pop__item--danger svg.acc-pop__ic { color: var(--danger); }

/* окна из меню */
.acc-me__av { width: 48px; height: 48px; border-radius: var(--r-sm); }
.acc-subm__plan { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; }
.acc-subm__name { font-size: var(--fs-xl); font-weight: var(--fw-semibold); line-height: 1.1; }
.acc-subm__price { color: var(--text-muted); font-size: var(--fs-sm); }
.acc-subm__price b { color: var(--text); font-size: var(--fs-md); font-weight: var(--fw-semibold); }
.acc-kv { margin: 0; display: flex; flex-direction: column; border-block: 1px solid var(--border); }
.acc-kv__row { display: flex; justify-content: space-between; gap: var(--sp-4); padding: var(--sp-2) 0; font-size: var(--fs-sm); }
.acc-kv__row + .acc-kv__row { border-top: 1px solid var(--border); }
.acc-kv dt { color: var(--text-muted); flex: none; }
.acc-kv dd { margin: 0; text-align: right; min-width: 0; overflow-wrap: anywhere; }
.acc-inv { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; white-space: nowrap; }
.acc-inv small { font-size: var(--fs-xs); }
.acc-ok { color: var(--success); }
.acc-due { color: var(--warning); }
.acc-more { display: inline-flex; align-items: center; gap: var(--sp-1); align-self: flex-start; }
.acc-more svg.icon { width: 14px; height: 14px; }
.acc-news { display: flex; flex-direction: column; }
.acc-news__item { display: flex; gap: var(--sp-3); padding: var(--sp-3) 0; border-bottom: 1px solid var(--border); }
.acc-news__item:first-child { padding-top: 0; }
.acc-news__item:last-child { border-bottom: 0; }
.acc-news__ic { flex: none; width: 20px; height: 20px; margin-top: 2px; color: var(--accent-text); }
.acc-news__ic--warn { color: var(--warning); }
.acc-news__t { min-width: 0; display: flex; flex-direction: column; gap: var(--sp-1); }
.acc-news__t b { font-weight: var(--fw-semibold); }
.acc-news__t p { margin: 0; color: var(--text-muted); font-size: var(--fs-sm); line-height: 1.45; }
.acc-news__date { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-xs); color: var(--text-subtle); }
.acc-news__new { color: var(--accent-text); font-weight: var(--fw-medium); }
.acc-empty { display: flex; align-items: center; gap: var(--sp-2); margin: 0; color: var(--text-muted); }
.acc-empty svg.icon { width: 20px; height: 20px; color: var(--text-subtle); }
.acc-q { margin: 0; font-size: var(--fs-base); font-weight: var(--fw-semibold); line-height: 1.35; }
.acc-nps { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: var(--sp-1); }
.acc-nps__b { min-height: 40px; border: 1px solid var(--border-strong); border-radius: 8px; color: var(--text); font-weight: var(--fw-medium); transition: background var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out); }
.acc-nps__b:hover { background: var(--surface-2); }
.acc-nps__b:active { transform: scale(.94); }
.acc-nps__b[aria-checked="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-soft-text); }
.acc-nps__ends { display: flex; justify-content: space-between; margin-top: calc(-1 * var(--sp-3)); font-size: var(--fs-xs); color: var(--text-subtle); }
.acc-done { display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-2); }
.acc-done svg.acc-done__ic { width: 28px; height: 28px; color: var(--success); }
.acc-done b { font-size: var(--fs-md); font-weight: var(--fw-semibold); }
.acc-done p { margin: 0; color: var(--text-muted); font-size: var(--fs-sm); }
.acc-link { display: flex; gap: var(--sp-2); }
.acc-link .input { flex: 1; min-width: 0; }
.acc-link .btn { flex: none; }
.acc-warn { display: flex; align-items: center; gap: var(--sp-2); margin: calc(-1 * var(--sp-3)) 0 0; color: var(--warning); font-size: var(--fs-sm); }
.acc-warn[hidden] { display: none; }
.acc-warn svg.icon { flex: none; width: 16px; height: 16px; }
.acc-st { flex: none; font-size: var(--fs-xs); font-weight: var(--fw-medium); color: var(--text-muted); white-space: nowrap; }
.acc-st--joined { color: var(--accent-text); }
.acc-st--live { color: var(--success); }
@media (max-width: 767px) {
  .acc-nps { gap: 2px; }
  .acc-nps__b { min-height: 36px; padding: 0; font-size: var(--fs-sm); }
}

/* Группа «Ещё» в сайдбаре заведения (10.11.2026, «оптимизировать левый слайдер»): <details class="nav-more">, раскрыта на своих страницах */
.nav-more { display: flex; flex-direction: column; gap: var(--sp-1); }
.nav-more > summary { list-style: none; cursor: pointer; }
.nav-more > summary::-webkit-details-marker { display: none; }
.nav-more__caret { width: 14px; height: 14px; margin-left: auto; color: var(--text-subtle); transition: transform var(--dur-fast) var(--ease-out); }
.nav-more[open] .nav-more__caret { transform: rotate(180deg); }
.nav-more > .nav-item:not(summary) { padding-left: var(--sp-3); }
.app[data-sidebar="hidden"] .nav-more__caret { display: none; }
@media (prefers-reduced-motion: reduce) { .nav-more__caret { transition: none; } }

/* ══ Доводка интерфейса (11.11.2026, пользователь: скелетоны по раскладке, честные неактивные кнопки, ИИ «анализирует»,
   выравнивание ячеек, без большой рамки окна, контраст сайдбара в светлой теме) ══ */

/* Окно без рамки: контент на ровном фоне, как у Stripe; сайдбар отделён тонкой линией */
:root:has(.app__main) { --shell: var(--bg); }
@media (min-width: 768px) {
  .app__main { margin: 0; border: 0; border-left: 1px solid var(--border); border-radius: 0; }
  .app__main .topbar { border-radius: 0; }
}

/* Сайдбар и меню разделов: текст темнее, выбранный пункт: фиолетовая подложка и фиолетовый текст (AA в обеих темах) */
.nav-item, .set-nav .set-nav__item { color: var(--nav-text); }
.nav-item svg.icon, .set-nav .set-nav__item svg.icon { color: var(--text-muted); }
.nav-item:hover, .set-nav .set-nav__item:hover { background: color-mix(in srgb, var(--text) 6%, transparent); color: var(--text); }
.nav-item[aria-current="page"], .set-nav .set-nav__item[aria-current="page"] { background: var(--accent-soft); color: var(--accent-soft-text); font-weight: var(--fw-semibold); }
.nav-item[aria-current="page"] svg.icon, .set-nav .set-nav__item[aria-current="page"] svg.icon { color: var(--accent-text); }
.set-nav .ink { background: var(--accent-soft); box-shadow: none; }
.set-nav:has(> .ink) .set-nav__item[aria-current="page"] { background: none; }
.sidebar__group { color: var(--text-muted); }
.ltabs > button { color: var(--nav-text); }
.ltabs > button[aria-pressed="true"], .ltabs > button[aria-selected="true"] { color: var(--accent-text); font-weight: var(--fw-semibold); }

/* Таблицы: всё в ячейке по центру строки. Иконка + текст (inline-flex) иначе садится ниже соседей: базовая линия у SVG внизу */
:where(td, th) :where([class]:not(svg, use, .sr-only)), :where(td, th) > :where(svg.icon) { vertical-align: middle; }
/* Иконка + текст в строку (span/a в ячейке): базовая линия берётся от текста, иконка по центру; так текст ровно на одной линии с соседними ячейками */
td :is(span, a, b, strong, small, em, label):not(.badge, .chip, [class*="badge"], [class*="pill"]):has(> svg.icon) { vertical-align: baseline; align-items: baseline; }
td :is(span, a, b, strong, small, em, label):not(.badge, .chip, [class*="badge"], [class*="pill"]):has(> svg.icon) > svg.icon { align-self: center; }

/* Неактивные кнопки: одинаково везде, без полупрозрачной акцентной заливки; причина подсказкой (core/ui.js: data-why) */
:is(.btn, .chip, .tb-btn, .sp-ibtn, .icon-btn):is(:disabled, [aria-disabled="true"]) { opacity: 1; cursor: not-allowed; }
.btn:is(:disabled, [aria-disabled="true"]):not(.btn--ghost) { background: var(--surface-2); color: var(--text-subtle); box-shadow: none; }
:root:has(.app__main) .btn--secondary:is(:disabled, [aria-disabled="true"]) { background: transparent; box-shadow: inset 0 0 0 1px var(--border); }
:is(.btn--ghost, .chip, .tb-btn, .sp-ibtn, .icon-btn):is(:disabled, [aria-disabled="true"]) { color: var(--text-subtle); background: transparent; }
:is(.btn, .sp-ibtn, .icon-btn):is(:disabled, [aria-disabled="true"]) svg.icon { color: inherit; }
.why-tip { position: fixed; z-index: calc(var(--z-modal) + 10); max-width: 280px; padding: var(--sp-2) var(--sp-3); border-radius: var(--r-sm); background: var(--text); color: var(--bg); font-size: var(--fs-xs); line-height: 1.4; box-shadow: var(--shadow-md); pointer-events: none; animation: fade-in var(--dur-fast) both; }

/* Окно «пока не работает» (core/services.js): заголовок, причина, что сделать, кнопки внизу */
.svc-dialog .dialog__panel { width: min(440px, 100%); }
.svc-dialog .dialog__body { display: flex; flex-direction: column; gap: var(--sp-3); padding: 0 var(--sp-5) var(--sp-5); }
.svc-dialog .dialog__foot { justify-content: flex-end; padding: var(--sp-4) var(--sp-5) var(--sp-5); }
.svc-do { display: flex; gap: var(--sp-2); margin: 0; color: var(--text-muted); }
.svc-do svg.icon { flex: none; width: 16px; height: 16px; margin-top: 2px; color: var(--accent-text); }

/* ИИ: этапы анализа перед ответом (core/think.js) */
.ai-think { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-2); font-size: var(--fs-sm); color: var(--text); }
.ai-think li { display: flex; align-items: center; gap: var(--sp-2); animation: fade-in var(--dur-base) var(--ease-out) both; }
.ai-think svg.icon { flex: none; width: 16px; height: 16px; }
.ai-think__spin { color: var(--accent-text); animation: spin .9s linear infinite; }
.ai-think__ok { display: none; color: var(--success); }
.ai-think li.is-done { color: var(--text-muted); }
.ai-think li.is-done .ai-think__spin { display: none; }
.ai-think li.is-done .ai-think__ok { display: block; }

/* Скелетоны страниц (core/skeleton.js): раскладка страницы, один общий блик по всему экрану */
.sk { display: flex; flex-direction: column; gap: var(--sp-5); animation: fade-in var(--dur-base) .12s both; }
.sk .skeleton { background-attachment: fixed; }
.sk-bar { display: block; flex: none; width: var(--w); max-width: 100%; height: var(--h); border-radius: var(--r-xs); }
.sk-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); min-height: 36px; }
.sk-acts { display: flex; align-items: center; gap: var(--sp-2); }
.sk-tabs { display: flex; gap: var(--sp-6); padding: var(--sp-1) 0 var(--sp-3); border-bottom: 1px solid var(--border); overflow: hidden; }
.sk-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--sp-6); }
.sk-kpi { display: flex; flex-direction: column; gap: var(--sp-2); }
.sk-table { display: flex; flex-direction: column; }
.sk-tr { display: grid; grid-template-columns: 1.1fr 1fr 1.5fr 1fr .9fr .8fr; align-items: center; height: 42px; border-bottom: 1px solid var(--border); }
.sk-tr--head { height: 34px; }
.sk-td { display: flex; padding: 0 var(--sp-3); min-width: 0; }
.sk-td--r { justify-content: flex-end; }
.sk-blocks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-8); }
.sk-block { display: flex; flex-direction: column; gap: var(--sp-3); }
.sk-fill { display: block; height: var(--h); border-radius: var(--r-sm); }
.sk-list { display: flex; flex-direction: column; }
.sk-li { display: flex; align-items: center; gap: var(--sp-3); min-height: 52px; border-bottom: 1px solid var(--border); }
.sk-li__t { flex: 1; display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0; }
.sk-form { display: flex; flex-direction: column; gap: var(--sp-5); max-width: 640px; }
.sk-field { display: flex; flex-direction: column; gap: var(--sp-2); }
.sk-main { display: flex; flex-direction: column; gap: var(--sp-5); min-width: 0; }
.sk-nav__label { margin: 0 var(--sp-3) var(--sp-2); }
.sk-nav__item { display: flex; align-items: center; gap: var(--sp-3); min-height: 36px; padding: 0 var(--sp-3); }
@media (max-width: 1100px) { .sk-nav { overflow: hidden; } .sk-nav__label { display: none; } .sk-nav__item { flex: none; width: 120px; } }
@media (max-width: 767px) {
  .sk-acts .sk-bar:first-child { display: none; }
  .sk-blocks { grid-template-columns: minmax(0, 1fr); }
  .sk-tr { grid-template-columns: 1.2fr 1fr 1fr .8fr; }
  .sk-td:nth-child(4), .sk-td:nth-child(5) { display: none; }
}
/* Касса и кухня */
.sk-pos { display: grid; grid-template-columns: 180px minmax(0, 1fr) 380px; gap: var(--sp-4); height: 100vh; padding: var(--sp-4); background: var(--shell); }
.sk-pos__cats, .sk-pos__check { display: flex; flex-direction: column; gap: var(--sp-3); }
.sk-pos__check { padding: var(--sp-4); border-radius: var(--r-lg); background: var(--surface); }
.sk-pos__check .sk-li { justify-content: space-between; border: 0; min-height: 36px; }
.sk-pos__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); grid-auto-rows: 140px; gap: var(--sp-3); align-content: start; }
.sk-tile { display: block; border-radius: var(--r-md); }
.sk-grow { flex: 1; }
.sk-kds { display: flex; gap: var(--sp-3); height: 100vh; padding: var(--sp-3); overflow: hidden; background: var(--shell); }
.sk-ticket { flex: 0 0 280px; display: flex; flex-direction: column; gap: var(--sp-3); padding: var(--sp-4); border-radius: var(--r-md); background: var(--surface); }
@media (max-width: 1100px) { .sk-pos { grid-template-columns: minmax(0, 1fr) 320px; } .sk-pos__cats { display: none; } }
@media (max-width: 767px) { .sk-pos { grid-template-columns: minmax(0, 1fr); } .sk-pos__check { display: none; } }
@media (prefers-reduced-motion: reduce) { .sk .skeleton, .ai-think__spin { animation: none; } }

/* Печать окна (core/services.js: Печать / Пречек в бэк-офисе): на бумаге только это окно, без кнопок */
@media print {
  body.is-printing > :not(.is-print) { display: none; }
  body.is-printing .dialog.is-print { position: static; display: block; padding: 0; }
  .dialog.is-print :is(.dialog__backdrop, .dialog__foot, .dialog__head [data-close], .side-tabs) { display: none; }
  .dialog.is-print .dialog__panel { position: static; width: auto; height: auto; max-height: none; box-shadow: none; overflow: visible; animation: none; }
  .dialog.is-print .dialog__body { overflow: visible; }
}
.tb-period.tb-period--solo { grid-template-columns: minmax(0, 1fr); }

/* Окно отключения модуля (core/org-modules.js → confirmOff): что пропадёт и что сохранится; иконки без подложки */
.mod-off__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.mod-off__list li, .mod-off__line { display: flex; align-items: flex-start; gap: var(--sp-2); margin: 0; font-size: var(--fs-sm); }
.mod-off__list .icon { flex: none; color: var(--void); }
.mod-off__line .icon { flex: none; color: var(--text-muted); }

/* Окна подтверждения (.modal на страницах) в одном стиле с .dialog: заголовок, текст, кнопки внизу за линией */
.modal__panel { gap: var(--sp-3); padding: var(--sp-5) var(--sp-5) 0; }
.modal__panel > h3 { font-size: var(--fs-lg); font-weight: var(--fw-semibold); }
.modal__actions { margin: var(--sp-2) calc(-1 * var(--sp-5)) 0; padding: var(--sp-4) var(--sp-5) var(--sp-5); border-top: 1px solid var(--border); }
.ai-think li[hidden], .ai-sugg[hidden] { display: none; }

/* ── Выбор даты и времени (core/datepick.js, 11.11.2026): вместо системного. Кнопка как «Период», окно как его календарь ── */
.dp { display: flex; min-width: 0; }
.dp-btn { display: inline-flex; align-items: center; gap: var(--sp-2); width: 100%; min-height: 36px; padding: 0 var(--sp-3); border-radius: var(--r-xs); color: var(--text-subtle); text-align: left; background: transparent;
  box-shadow: inset 0 0 0 1px var(--border-strong), 0 1px 1px color-mix(in srgb, var(--text) 6%, transparent); font-variant-numeric: tabular-nums; }
.dp-btn.is-set { color: var(--text); }
.dp-btn svg.icon { flex: none; width: 16px; height: 16px; color: var(--text-muted); }
.dp-btn__t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dp-btn:hover:not(:disabled) { background: color-mix(in srgb, var(--text) 4%, transparent); }
.dp-btn[aria-expanded="true"], .dp-btn:focus-visible { outline: none; box-shadow: inset 0 0 0 1px var(--accent), 0 0 0 2px color-mix(in srgb, var(--accent) 20%, transparent); }
:root:has(.app__main) .dp-btn.is-set { box-shadow: inset 0 0 0 1px var(--border-strong), 0 1px 1px color-mix(in srgb, var(--text) 6%, transparent); color: var(--text); }
.dp-pop { width: auto; max-height: none; padding: var(--sp-4); border-radius: var(--r-md); overflow: visible; }
.dp-cal { gap: var(--sp-3); }
.dp-cal .tb-cal__month { width: 252px; }
.dp-body { display: flex; gap: var(--sp-5); align-items: stretch; }
.dp-time { display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0; }
.dp-cal--dt .dp-time { width: 112px; }
.dp-cal--dt .dp-time .tb-cal__field > span, .dp-cal--time .tb-cal__field > span { display: none; }
.dp-cal--dt .dp-time .tb-cal__in, .dp-cal--time .tb-cal__in { width: 100%; }
.dp-times { display: flex; flex-direction: column; gap: 2px; max-height: 264px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.dp-cal--time { width: 200px; }
.dp-cal--time .dp-times { max-height: 240px; }
.dp-t { flex: none; height: 34px; border-radius: var(--r-xs); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; color: var(--text); }
.dp-t:hover { background: var(--surface-2); }
.dp-t.is-end { background: var(--accent); color: var(--on-accent); font-weight: var(--fw-semibold); }
.dp-months { display: grid; grid-template-columns: repeat(3, 76px); gap: var(--sp-2); }
.dp-mo { height: 40px; border-radius: var(--r-full); font-size: var(--fs-sm); text-transform: capitalize; color: var(--text); }
.dp-mo:hover { background: var(--surface-2); }
.dp-mo.is-end { background: var(--accent); color: var(--on-accent); font-weight: var(--fw-semibold); }
.dp-foot { display: flex; align-items: center; gap: var(--sp-2); }
.dp-foot .side__grow { flex: 1; }
.dp-cal .tb-cal__d:focus-visible > span, .dp-t:focus-visible, .dp-mo:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
/* Телефон: лист снизу на всю ширину, крупные цели */
.dp-pop--sheet { position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: 100%; max-width: none; padding: var(--sp-4) var(--gutter) calc(var(--sp-4) + env(safe-area-inset-bottom)); border-radius: var(--r-lg) var(--r-lg) 0 0; animation: kb-up var(--dur-base) var(--ease-out); }
.dp-pop--sheet .dp-cal .tb-cal__month { width: 100%; }
.dp-pop--sheet .dp-body { flex-direction: column; }
.dp-pop--sheet .dp-cal--dt .dp-time, .dp-pop--sheet .dp-cal--time { width: 100%; }
.dp-pop--sheet .dp-times { flex-direction: row; overflow-x: auto; max-height: none; }
.dp-pop--sheet .dp-t { padding: 0 var(--sp-3); height: 44px; }
.dp-pop--sheet .tb-cal__d, .dp-pop--sheet .tb-cal__d > span { height: 44px; }
.dp-pop--sheet .dp-months { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dp-pop--sheet .dp-foot .btn { min-height: 44px; }
.tb-cal__title { text-transform: none; }

/* ── Одна сетка отступов (11.11.2026, пользователь: «исправь лайауты то есть расстояние до краев»): шапка, KPI, вкладки, таблицы
   и панели в одном контейнере .page и с одними краями. Текст первой и последней колонки таблицы стоит ровно по краю контента,
   подсветка строки выходит за край на тот же отступ. Таблица не шире контейнера: если не влезает, обёртка прокручивается вбок (core/ui.js → .is-wide). */
:root:has(.app__main) #page table:not(.ai-cmp) :is(th, td):first-child { padding-left: 0; }
:root:has(.app__main) #page table:not(.ai-cmp) :is(th, td):last-child { padding-right: 0; }
:root:has(.app__main) #page table:not(.ai-cmp) tbody tr:hover > td:first-child { box-shadow: calc(-1 * var(--sp-3)) 0 0 var(--surface-2); }
:root:has(.app__main) #page table:not(.ai-cmp) tbody tr:hover > td:last-child { box-shadow: var(--sp-3) 0 0 var(--surface-2); }
:root:has(.app__main) #page table:not(.ai-cmp) tbody tr:hover > td:only-child { box-shadow: calc(-1 * var(--sp-3)) 0 0 var(--surface-2), var(--sp-3) 0 0 var(--surface-2); }
.table-wrap.is-wide, .t-fit.is-wide { overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; }
.t-fit { display: block; max-width: 100%; min-width: 0; }
/* Края одинаковы на всех страницах: место под полосу прокрутки есть всегда, левое меню разделов начинается там же, где заголовки других страниц */
.app__scroll { scrollbar-gutter: stable; }
.page:has(.set-layout) { padding-left: var(--gutter); }

/* ── Переключатель приложений (rp-sidebar.js + core/apps.js, 11.11.2026, docs/mvp/72-module-apps.md) ──
   Кнопка под знаком: иконка + «Приложение» + название; сетка всех приложений в popover. Иконки голые, неподключённое приглушено. */
.app-sw { display: flex; align-items: center; gap: var(--sp-3); width: 100%; min-height: 48px; margin-bottom: var(--sp-2); padding: var(--sp-2) var(--sp-3); border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); text-align: left; color: var(--text); transition: background var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out); }
.app-sw:hover { background: var(--surface-2); }
.app-sw:active { transform: scale(.98); }
.app-sw:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.app-sw svg.app-sw__ic { flex: none; width: 20px; height: 20px; color: var(--accent-text); }
.app-sw__t { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: var(--lh-snug); }
.app-sw__t small { font-size: var(--fs-xs); color: var(--text-subtle); }
.app-sw__t b { font-weight: var(--fw-semibold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-sw svg.app-sw__caret { flex: none; width: 16px; height: 16px; color: var(--text-subtle); }
.apps-pop { position: fixed; inset: auto; margin: 0; padding: var(--sp-2); background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-lg); }
.apps-pop:popover-open { animation: acc-pop-in var(--dur-fast) var(--ease-out); }
.apps-pop__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-2); margin: 0; padding: var(--sp-1) var(--sp-2) var(--sp-2); }
.apps-pop__head small { font-size: var(--fs-xs); color: var(--text-subtle); }
.apps-pop__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; }
.app-tile { display: flex; align-items: center; gap: var(--sp-3); min-height: 48px; padding: var(--sp-2); border-radius: var(--r-sm); color: var(--text); text-decoration: none; transition: background var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out); }
a.app-tile:hover { background: var(--surface-2); }
a.app-tile:active { transform: scale(.97); }
.app-tile:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.app-tile[aria-current="true"] { background: var(--accent-soft); }
.app-tile svg.app-tile__ic { flex: none; width: 20px; height: 20px; color: var(--accent-text); }
.app-tile__t { display: flex; flex-direction: column; min-width: 0; line-height: var(--lh-snug); }
.app-tile__t b { font-weight: var(--fw-medium); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-tile__t small { font-size: var(--fs-xs); color: var(--text-subtle); }
.app-tile:is(.is-try, .is-ask, .is-soon, .is-net) svg.app-tile__ic { color: var(--text-subtle); }
.app-tile:is(.is-try, .is-ask, .is-soon) .app-tile__t b { color: var(--text-muted); }
.app-tile.is-try .app-tile__t small { color: var(--accent-text); }
.app-tile.is-soon { cursor: default; opacity: .6; }
.apps-pop__all { display: flex; align-items: center; gap: var(--sp-3); margin-top: var(--sp-2); padding: var(--sp-2); border-top: 1px solid var(--border); color: var(--text-muted); font-weight: var(--fw-medium); text-decoration: none; }
.apps-pop__all:hover { color: var(--text); }
.apps-pop__all svg.icon { width: 18px; height: 18px; }
.app[data-sidebar="hidden"] .app-sw { justify-content: center; padding: var(--sp-2) 0; }
.app[data-sidebar="hidden"] :is(.app-sw__t, .app-sw__caret) { display: none; }
@media (max-width: 1100px) and (min-width: 768px) {
  .app:not([data-sidebar="hidden"]) .app-sw { justify-content: center; padding: var(--sp-2) 0; }
  .app:not([data-sidebar="hidden"]) :is(.app-sw__t, .app-sw__caret) { display: none; }
}

/* Нижняя панель по приложению (11.11.2026): пунктов от 2 до 5, делят ширину поровну */
@media (max-width: 767px) { .bottom-nav { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); } .bottom-nav span { max-width: 100%; padding: 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } }
/* Плавность по всему приложению (пользователь, 11.11.2026: «плавные простые анимации»): кольцо фокуса и фон поля плавно,
   кнопка чуть проседает под пальцем. Без подпрыгиваний, коротко; с «уменьшить движение» только цвет. */
.input, .textarea { transition: box-shadow var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out); }
.btn { transition: background var(--dur-fast) var(--ease-out), transform .12s var(--ease-out), box-shadow var(--dur-fast) var(--ease-out); }
.btn:active:not(:disabled) { transform: scale(.97); }
@media (prefers-reduced-motion: reduce) { .btn { transition: background var(--dur-fast) var(--ease-out); } .btn:active:not(:disabled) { transform: none; } }

/* ── Чат поддержки v2 (11.11.2026, docs/mvp/73-support-chat.md): вложения, галочки, «печатает», оценка, согласие на вход, подсказки до отправки ── */
.msg__files { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.msg__img { display: block; padding: 0; border-radius: var(--r-sm); overflow: hidden; background: var(--surface-2); cursor: zoom-in; }
.msg__img img { display: block; max-width: 220px; max-height: 180px; object-fit: cover; }
.msg__file { display: inline-flex; align-items: center; gap: var(--sp-1); padding: var(--sp-2) var(--sp-3); border-radius: var(--r-sm); background: var(--surface-2); color: var(--text); font-size: var(--fs-sm); text-decoration: none; }
.msg__file svg.icon, .msg__rc svg.icon, .msg__flag svg.icon, .dk-flag svg.icon { width: 14px; height: 14px; flex: none; }
.msg__rc, .msg__flag { display: inline-flex; align-items: center; gap: 2px; }
.msg__rc.is-read { color: var(--accent); }
.msg-sys, .dk-ev { display: flex; align-items: center; justify-content: center; gap: var(--sp-1); margin: 0; color: var(--text-subtle); font-size: var(--fs-xs); text-align: center; }
.msg-sys svg.icon, .dk-ev svg.icon { width: 14px; height: 14px; flex: none; }
.chat__typing { display: flex; align-items: center; gap: var(--sp-2); margin: 0; color: var(--text-muted); font-size: var(--fs-sm); }
.chat__typing[hidden] { display: none; }
.chat__dots { display: inline-flex; gap: 3px; }
.chat__dots i { width: 6px; height: 6px; border-radius: var(--r-full); background: var(--text-subtle); animation: chat-dot 1.2s var(--ease-out) infinite; }
.chat__dots i:nth-child(2) { animation-delay: .15s; }
.chat__dots i:nth-child(3) { animation-delay: .3s; }
@keyframes chat-dot { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .chat__dots i { animation: none; } }
.chat__atts { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.chat__att { display: inline-flex; align-items: center; gap: var(--sp-1); max-width: 100%; padding: 2px var(--sp-1) 2px var(--sp-2); border-radius: var(--r-xs); background: var(--surface-2); font-size: var(--fs-xs); }
.chat__att > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; }
.chat__att svg.icon { width: 14px; height: 14px; flex: none; }
.chat__att button { display: inline-flex; padding: 2px; color: var(--text-muted); border-radius: var(--r-xs); }
.chat__att button:hover { color: var(--danger); }
.chat__err { display: flex; align-items: center; gap: var(--sp-1); margin: 0; color: var(--danger); font-size: var(--fs-sm); }
.chat__err svg.icon { width: 16px; height: 16px; flex: none; }
.cw-conv.is-new b::after { content: ""; display: inline-block; width: 8px; height: 8px; margin-left: var(--sp-1); border-radius: var(--r-full); background: var(--danger); vertical-align: middle; }
.cw-n { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: var(--r-full); background: var(--danger); color: var(--on-accent); font-size: var(--fs-xs); line-height: 18px; text-align: center; }
.cw-consent, .cw-ctx, .cw-rated { display: flex; align-items: center; gap: var(--sp-2); margin: var(--sp-3) 0 0; color: var(--text-muted); font-size: var(--fs-sm); }
.cw-consent svg.icon, .cw-ctx svg.icon, .cw-rated svg.icon { width: 16px; height: 16px; flex: none; }
.cw-consent > span { flex: 1; min-width: 0; }
.cw-rated svg.icon { color: var(--success); }
.cw-sugg { margin-top: var(--sp-4); }
.cw-sugg h4, .cw-rate h4 { margin: 0 0 var(--sp-2); font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.cw-rate { display: flex; flex-direction: column; gap: var(--sp-2); margin-top: var(--sp-4); }
.cw-stars { display: flex; gap: var(--sp-1); }
.cw-stars button { display: inline-flex; padding: var(--sp-1); color: var(--text-subtle); border-radius: var(--r-xs); transition: color var(--dur-fast), transform var(--dur-fast) var(--ease-spring); }
.cw-stars button svg.icon { width: 28px; height: 28px; }
.cw-stars button.is-on, .cw-stars button:hover { color: var(--warning); }
.cw-stars button:active { transform: scale(.9); }
.cw-rate .btn { align-self: flex-start; }

/* ── Super-Admin → «Входящие»: очередь · переписка · карточка клиента (без рамок, колонки на фоне окна) ── */
.dk { display: grid; grid-template-columns: minmax(220px, 280px) minmax(0, 1fr) minmax(260px, 300px); gap: var(--sp-5); height: calc(100dvh - var(--topbar-h) - 150px); min-height: 520px; }
.dk-q, .dk-c, .dk-card { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.dk-tabs { margin-bottom: var(--sp-2); overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.dk-dot { display: inline-block; width: 6px; height: 6px; margin-left: 4px; border-radius: var(--r-full); background: var(--danger); vertical-align: top; }
.dk-search { margin-bottom: var(--sp-2); }
.dk-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.dk-row { display: flex; flex-direction: column; gap: 2px; width: 100%; padding: var(--sp-2) var(--sp-3); border-radius: var(--r-sm); text-align: left; color: var(--text); }
.dk-row:hover { background: var(--surface-2); }
.dk-row.is-cur { background: var(--accent-soft); }
.dk-row__top { display: flex; align-items: baseline; gap: var(--sp-2); }
.dk-row__top b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: var(--fw-medium); }
.dk-row.is-new .dk-row__top b { font-weight: var(--fw-semibold); }
.dk-row.is-new .dk-row__top b::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: var(--r-full); background: var(--accent); vertical-align: middle; }
.dk-row__top small, .dk-row__sub { color: var(--text-subtle); font-size: var(--fs-xs); }
.dk-row__sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dk-row__end { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); min-height: 18px; }
.dk-row__end:empty { display: none; }
.dk-sla { display: inline-flex; align-items: center; gap: 2px; color: var(--text-muted); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.dk-sla svg.icon { width: 13px; height: 13px; }
.dk-sla.is-soon { color: var(--warning); }
.dk-sla.is-late { color: var(--danger); font-weight: var(--fw-semibold); }
.dk-stars { display: inline-flex; align-items: center; gap: 2px; color: var(--warning); font-size: var(--fs-xs); }
.dk-stars svg.icon { width: 13px; height: 13px; }
.dk-empty { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-4) var(--sp-3); color: var(--text-muted); font-size: var(--fs-sm); }
.dk-empty svg.icon { width: 18px; height: 18px; color: var(--success); }
.dk-c--empty { justify-content: center; }
.dk-ch { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); padding-bottom: var(--sp-3); }
.dk-ch__t { display: flex; flex-direction: column; flex: 1 1 200px; min-width: 0; }
.dk-ch__t b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-md); }
.dk-ch__t small { font-size: var(--fs-xs); }
.dk-ch__acts { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.dk-ch__acts .select { min-width: 0; }
.dk-ch__acts [aria-disabled="true"] { opacity: .45; }
.dk-card-btn { display: none; }
.dk-linked, .dk-ok { display: flex; align-items: center; gap: var(--sp-2); margin: 0 0 var(--sp-2); color: var(--text-muted); font-size: var(--fs-sm); }
.dk-linked svg.icon, .dk-ok svg.icon { width: 16px; height: 16px; flex: none; }
.dk-ok svg.icon { color: var(--success); }
.dk-feed { flex: 1; display: flex; flex-direction: column; gap: var(--sp-3); overflow-y: auto; padding: var(--sp-3) var(--sp-8) var(--sp-3) var(--sp-3); border-radius: var(--r-md); background: var(--surface-2); }
.dk-feed .msg__b { background: var(--surface); }
.dk-feed .msg--me .msg__b { background: var(--accent-soft); }
.msg--note .msg__b, .dk-feed .msg--note .msg__b { background: var(--warning-soft); color: var(--text); }
.msg--note small svg.icon { width: 13px; height: 13px; vertical-align: -2px; }
.msg.is-hidden { opacity: .55; }
.msg.is-hidden .msg__b p { text-decoration: line-through; text-decoration-color: var(--text-subtle); }
.dk-feed .msg__b { position: relative; }
.dk-more { position: absolute; top: 2px; right: -30px; display: inline-flex; padding: 4px; color: var(--text-muted); border-radius: var(--r-xs); opacity: 0; transition: opacity var(--dur-fast); }
.msg:hover .dk-more, .dk-more:focus-visible { opacity: 1; }
.dk-more:hover { color: var(--text); background: var(--surface-3); }
.dk-flag { display: inline-flex; align-items: center; gap: 2px; color: var(--text-muted); }
.dk-flag--profanity, .dk-flag--spam { color: var(--warning); }
.dk-comp { display: flex; flex-direction: column; gap: var(--sp-2); padding-top: var(--sp-3); }
.dk-comp__top { display: flex; align-items: center; gap: var(--sp-2); }
.dk-comp.is-note .dk-in { background: var(--warning-soft); }
.dk-in { resize: vertical; min-height: 72px; max-height: 240px; }
.dk-hint { white-space: nowrap; }
.dk-ai:not([hidden]) { padding: var(--sp-2) 0; }
.dk-macros:not([hidden]) { max-height: 220px; overflow-y: auto; border-radius: var(--r-sm); background: var(--surface-2); padding: var(--sp-1); }
.dk-mac { list-style: none; margin: 0; padding: 0; }
.dk-mac button { display: flex; flex-direction: column; width: 100%; padding: var(--sp-2); border-radius: var(--r-xs); text-align: left; color: var(--text); }
.dk-mac button:hover, .dk-mac button:focus-visible { background: var(--surface); }
.dk-mac small { color: var(--text-muted); font-size: var(--fs-xs); }
.dk-card { overflow-y: auto; gap: var(--sp-4); padding-right: var(--sp-1); }
.dk-card__head { display: flex; align-items: center; gap: var(--sp-2); }
.dk-card__head b { flex: 1; font-size: var(--fs-md); }
.dk-card-x { display: none; }
.dk-sec h4 { margin: 0 0 var(--sp-2); color: var(--text-subtle); font-size: var(--fs-xs); font-weight: var(--fw-semibold); text-transform: uppercase; letter-spacing: .04em; }
.dk-ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.dk-li { display: flex; align-items: center; gap: var(--sp-2); min-height: 32px; font-size: var(--fs-sm); }
.dk-li > svg.icon { width: 16px; height: 16px; flex: none; color: var(--text-muted); }
.dk-li.is-warn > svg.icon { color: var(--warning); }
.dk-li__t { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.dk-li__t b { font-weight: var(--fw-medium); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dk-li__t small { color: var(--text-subtle); font-size: var(--fs-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dk-li--btn { width: 100%; padding: var(--sp-1); border-radius: var(--r-xs); text-align: left; color: var(--text); }
.dk-li--btn:hover { background: var(--surface-2); }
.dk-st { font-size: var(--fs-xs); color: var(--success); white-space: nowrap; }
.dk-st.is-off { color: var(--danger); }
.dk-mods { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-3); margin: 0; font-size: var(--fs-sm); }
.dk-quote { margin: 0 0 var(--sp-1); padding: var(--sp-2) var(--sp-3); border-radius: var(--r-sm); background: var(--surface-2); white-space: pre-wrap; }
.dk-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--sp-5); margin-top: var(--sp-5); }
@media (max-width: 1600px) {
  .dk { grid-template-columns: minmax(220px, 280px) minmax(0, 1fr); }
  .dk-card-btn, .dk-card-x { display: inline-flex; }
  .dk-card { position: fixed; top: 0; right: 0; bottom: 0; z-index: var(--z-drawer); width: min(360px, 92vw); padding: var(--sp-5); background: var(--surface); box-shadow: var(--shadow-lg); transform: translateX(105%); transition: transform var(--dur-base) var(--ease-out); }
  .dk-card.is-open { transform: none; }
}
@media (max-width: 768px) {
  .dk { grid-template-columns: 1fr; height: auto; }
  .dk-q { max-height: 40vh; }
  .dk-c { min-height: 70vh; }
  .dk-more { opacity: 1; }
}
/* Касса и KDS: окно чата поднимается над экранной клавиатурой (core/chat.js ставит --kb-h) */
body:has(.kb-dock) .cw-dialog .dialog__panel { padding-bottom: var(--kb-h, 0px); }

/* ── Скролл (15.11.2026, пользователь: «скролл сшит в систему… лайауты меняются из-за него»).
   Мышь и тачпад: тонкая полоса в цветах темы, без стрелок, место под неё зарезервировано заранее — плитки и таблицы не прыгают,
   когда список дорастает до скролла. Палец (касса, KDS, телефон): системная полоса поверх контента, места не занимает. ── */
@media (pointer: fine) {
  * { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
  ::-webkit-scrollbar { width: 10px; height: 10px; }
  ::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
  ::-webkit-scrollbar-thumb { background: var(--border-strong); background-clip: content-box; border: 3px solid transparent; border-radius: var(--r-full); }
  ::-webkit-scrollbar-thumb:hover { background-color: var(--text-subtle); }
  ::-webkit-scrollbar-button { display: none; }
  .dishes, .side__body, .dialog__body, .item-page__groups, .item-page__info, .order-list--page, .page-pane, .settings-pane, .settings-nav,
  .search-dlg__results, .select__list, .sidebar, .k-grid, .k-cart, .kds__page, .mgr__main, .wtr__main { scrollbar-gutter: stable; }
}

/* ── Устройства (касса, KDS, официант, киоск): ни одной цели меньше 48 px, в том числе в окнах (16.11.2026, 12 часов в день под палец) ── */
body.device .btn, body.device .chip { min-height: 48px; }
body.device .icon-btn { min-width: 48px; min-height: 48px; }
body.device .seat-head { min-height: 48px; }
body.device .segmented button { min-height: 48px; }

/* ── Касса: любое окно — панель на всю высоту сбоку (16.11.2026, пользователь: «открывающееся окно как окошко справа или слева»).
   Сторона = сторона панели заказа (Вид → «Панель заказа»), меню разделов — с другой стороны. Поиск на весь экран остаётся по центру ── */
body[data-page="pos"] .dialog:not(.dialog--full) { place-items: stretch end; padding: 0; }
body[data-page="pos"] .dialog:not(.dialog--full) .dialog__panel { width: min(480px, 100%); height: 100%; max-height: none; border-radius: var(--r-lg) 0 0 var(--r-lg); animation: side-in var(--dur-base) var(--ease-out); }
body[data-page="pos"] .dialog--lg:not(.dialog--full) .dialog__panel { width: min(820px, 100%); }
body[data-page="pos"][data-side="left"] .dialog:not(.dialog--full):not(.dialog--nav), body[data-page="pos"] .dialog--nav:not(.dialog--full) { place-items: stretch start; }
body[data-page="pos"][data-side="left"] .dialog:not(.dialog--full):not(.dialog--nav) .dialog__panel, body[data-page="pos"] .dialog--nav:not(.dialog--full) .dialog__panel { border-radius: 0 var(--r-lg) var(--r-lg) 0; animation-name: side-in-left; }
body[data-page="pos"][data-side="left"] .dialog--nav:not(.dialog--full) { place-items: stretch end; }
body[data-page="pos"][data-side="left"] .dialog--nav:not(.dialog--full) .dialog__panel { border-radius: var(--r-lg) 0 0 var(--r-lg); animation-name: side-in; }
body[data-page="pos"] .dialog--nav:not(.dialog--full) .dialog__panel { width: min(360px, 100%); }
body[data-page="pos"] .dialog--nav .dialog__body { display: flex; flex-direction: column; gap: var(--sp-3); }
@keyframes side-in-left { from { transform: translateX(-40px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { body[data-page="pos"] .dialog .dialog__panel { animation: none; } }
