/* Сайт операторов (1а): из утверждённых макетов `docs/design/mockups/operators-couriers/staff.css` (Р256, 14.10.2026); правки сайта — в `operator.css`. */
/* Сайт операторов (staff.html) — главный экран «Заказы» в виде платформы UserVanya (Р108; было — «панель один в один
   как сайт», 21.09): цвета — роли из platform.css (палитра логотипа, светлая и тёмная тема), шрифт — Geologica, как у
   пульта; детали — общие (components.css), они берут вид платформы сами. Цвета заведения здесь нет (кроме логотипа
   бренда у заказа — это данные). Размеры — только токенами, цвета — только ролями; сторож —
   tests/design/test_orders_staff.py. Новые детали — по образцу components.css.
   Раскладка (Р126): шапка во всю ширину; под ней сводка смены одной полосой счётчиков и строка отборов; ПК (с 1100) —
   лента слева, справа карта или курьеры, карточка заказа ложится поверх карты; планшет и телефон — переключатель
   «Лента | Карта | Курьеры», карточка шторкой. Строка заказа — плотная, как у рабочих диспетчерских: на 1440×900 видно
   не меньше 10 заказов. Строки перестраиваются по ширине самой ленты (запрос к контейнеру), а не окна.
   Карта и маршрут — staff-map.css, раздел «Загрузка» — staff-load.css. */

body[data-page="staff"] [hidden] { display: none !important; }
/* Цифры — табличные: таймеры и суммы не дрожат, номера в столбик ровные; время в журнале — моноширинным, как в пульте. */
body[data-page="staff"] { font-variant-numeric: tabular-nums; }
body[data-screen="load"] .staff-top, body[data-screen="load"] .staff-work, body[data-screen="load"] .staff-pick { display: none !important; }
body:not([data-screen="load"]) .load { display: none; }

/* Мелкая кнопка — для плотных строк ленты и загрузки (на телефоне — не меньше --tap, components.css) */
.btn.btn--sm { min-height: var(--control-sm); padding: 0 var(--space-3); border-radius: var(--radius-sm); font-size: var(--text-sm); }
.btn--sm svg { flex: none; width: var(--icon-sm); height: var(--icon-sm); }
@media (max-width: 767px) { .btn.btn--sm { min-width: var(--tap); min-height: var(--tap); } }

/* ── Знак платформы: только знак (Р123), слова «UserVanya» в шапке нет ── */
.pf-sign { display: inline-flex; align-items: center; flex: none; }
.pf-sign__mark { display: inline-flex; flex: none; padding: var(--space-1); border-radius: var(--radius-sm); background: var(--mark-pad); }
.pf-sign__mark img { width: auto; height: var(--control-sm); }
@media (min-width: 1100px) { .pf-sign__mark img { height: var(--control-md); } }
/* «Пиксели» логотипа — мотив платформы: квадратики у заголовков ленты и в пустых местах. */
.pf-pixels { display: grid; grid-template-columns: repeat(3, var(--space-3)); grid-template-rows: repeat(2, var(--space-3)); gap: var(--space-1); }
.pf-pixels i { border-radius: 2px; }
.pf-pixels i:nth-child(1) { grid-area: 1 / 1; background: var(--ink); }
.pf-pixels i:nth-child(2) { grid-area: 2 / 2; background: var(--gold); }
.pf-pixels i:nth-child(3) { grid-area: 1 / 3; background: var(--gold2); }

/* ── Шапка сайта операторов ───────────────────────────────────────────── */
.staff-bar { position: sticky; top: 0; z-index: var(--z-header); background: var(--panel); border-bottom: 1px solid var(--border); }
/* Перелив буквы V — тонкой полосой под шапкой */
.staff-bar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: linear-gradient(90deg, var(--pf-v-low), var(--pf-v-mid) 55%, var(--pf-v-top));
}
.staff-bar__inner { display: flex; align-items: center; gap: var(--space-3); min-height: var(--space-8); padding: 0 var(--gutter); }
/* Разделы «Заказы · Загрузка» (Р127): переходы — ссылки, текущий — подчёркнут переливом. */
.staff-sections { display: flex; align-self: stretch; gap: var(--space-1); padding-left: var(--space-3); border-left: 1px solid var(--border); }
.staff-sections__item {
  display: inline-flex; align-items: center; padding: 0 var(--space-3); border-bottom: 2px solid transparent;
  color: var(--muted); font-family: var(--font-title); font-size: var(--title-sm); font-weight: var(--weight-medium); text-decoration: none; white-space: nowrap;
}
.staff-sections__item:hover { color: var(--ink); }
.staff-sections__item[aria-current="page"] { border-bottom-color: var(--gold); color: var(--ink); }
.staff-bar__end { display: flex; align-items: center; gap: var(--space-3); min-width: 0; margin-left: auto; }
/* Спокойные кнопки шапки и отбора: рамка, а не заливка — шапка не спорит с «Принять» в ленте. */
.btn.staff-ctl { border-color: var(--border); background: var(--panel); color: var(--ink); }
.btn.staff-ctl:hover, .btn.staff-ctl[aria-expanded="true"] { border-color: var(--gold2); background: var(--tint); }
.staff-ctl svg { flex: none; width: var(--icon-md); height: var(--icon-md); color: var(--gold); }
.staff-ctl svg.staff-ctl__chevron { width: var(--icon-sm); height: var(--icon-sm); color: var(--muted); }
.staff-client { flex: 0 1 auto; min-width: 0; }
.staff-client__name { overflow: hidden; text-overflow: ellipsis; }
.staff-client--one { display: inline-flex; align-items: center; min-height: var(--control-md); font-weight: var(--weight-semibold); white-space: nowrap; }
.staff-rights { flex: 0 1 auto; min-width: 0; padding-right: var(--space-3); text-align: left; }
.staff-rights__text { display: grid; min-width: 0; line-height: var(--leading-title); }
.staff-rights__label { color: var(--muted); font-size: var(--text-xs); font-weight: var(--weight-medium); }
.staff-rights__value { max-width: calc(var(--space-8) * 4); overflow: hidden; text-overflow: ellipsis; }
.iiko-state { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); white-space: nowrap; }
.iiko-state::before { content: ""; flex: none; width: var(--space-2); height: var(--space-2); border-radius: var(--radius-pill); background: var(--ok); }
.iiko-state.is-down { color: var(--err); font-weight: var(--weight-semibold); }
.iiko-state.is-down::before { background: var(--err); }
.staff-sound[aria-pressed="false"] svg, .staff-sound.is-waking svg { color: var(--muted); }
.staff-sound.is-ringing svg { color: var(--err); animation: ring var(--motion-decor) var(--ease) infinite alternate; }
@keyframes ring { to { transform: scale(1.18); } }
.staff-who { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); white-space: nowrap; }
.staff-who svg { width: var(--icon-md); height: var(--icon-md); color: var(--muted); }
@media (max-width: 1279px) { .staff-who { display: none; } }
@media (max-width: 1099px) {
  .staff-rights, .staff-sound { width: var(--control-md); padding: 0; }
  .iiko-state__rest { display: none; }
  .staff-rights__text, .staff-rights .staff-ctl__chevron, .staff-sound__label {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
}
@media (max-width: 767px) {
  .staff-bar__inner { flex-wrap: wrap; gap: 0 var(--space-2); }
  .pf-sign, .staff-client, .staff-client--one, .staff-bar__end { margin-block: var(--space-2); }
  /* На телефоне разделы — второй строкой шапки во всю ширину; связь с iiko — для программ чтения экрана (молчание iiko
     и так видно плашкой над лентой). */
  .staff-sections { order: 9; flex-basis: 100%; padding-left: 0; border-left: 0; border-top: 1px solid var(--border2); }
  .staff-sections__item { flex: 1; justify-content: center; min-height: var(--tap); font-size: var(--text-md); }
  .iiko-state, .staff-sound__label {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
  .staff-bar__end { gap: var(--space-2); }
  .staff-client { padding: 0 var(--space-3); }
  .staff-rights, .staff-sound { width: var(--tap); min-height: var(--tap); padding: 0; }
  .staff-client, .staff-client--one { min-height: var(--tap); }
}

/* ── Сообщение у шапки (Р126): что сделал Гость, iiko или курьер; заказ скрыт отбором — «Показать» ── */
.staff-news {
  position: fixed; top: calc(var(--space-8) + var(--space-2)); left: 50%; z-index: var(--z-toast); transform: translateX(-50%);
  display: flex; align-items: center; gap: var(--space-3); width: max-content; max-width: calc(100vw - var(--gutter) * 2);
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4); border-radius: var(--radius-md);
  background: var(--dark); color: var(--footink); box-shadow: var(--shadow-2); font-size: var(--text-sm); font-weight: var(--weight-medium);
}
.staff-news__text { min-width: 0; }
.staff-news .btn { flex: none; border-color: var(--footink); background: transparent; color: var(--footink); }
@media (max-width: 767px) { .staff-news { top: calc(var(--space-8) + var(--tap) + var(--space-2)); } }

/* ── «Что вижу»: права словами (Р109) ─────────────────────────────────── */
.menu.rights { display: grid; gap: var(--space-3); width: min(calc(var(--space-8) * 6), calc(100vw - var(--space-4))); padding: var(--space-4); }
.rights.menu--in-sheet { padding: 0 var(--space-5) var(--space-5); }
.rights__short { font-weight: var(--weight-semibold); line-height: var(--leading-title); }
.rights__why { font-size: var(--text-sm); }
.rights__brands { display: grid; gap: var(--space-2); margin: 0; padding: var(--space-3) 0; border-block: 1px solid var(--border2); list-style: none; }
.rights__brand { display: flex; align-items: flex-start; gap: var(--space-2); font-size: var(--text-sm); line-height: var(--leading-title); }
.rights__points { display: block; color: var(--muted); }
.rights__note { color: var(--muted); font-size: var(--text-xs); }
.rights .btn { justify-self: start; }
.brand-logo { flex: none; width: var(--icon-md); height: var(--icon-md); border-radius: var(--radius-pill); background: var(--mark-pad); object-fit: contain; }

/* ── Главный экран: сводка смены, отборы ─────────────────────────────── */
.staff { flex: 1 0 auto; width: 100%; padding: var(--space-2) var(--gutter) var(--space-7); }
.staff-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--space-2) var(--space-3); margin-bottom: var(--space-2); }
.staff-views { grid-column: 1 / -1; display: none; }
.staff-views .segments__item svg { width: var(--icon-md); height: var(--icon-md); color: var(--gold); }
.staff-strip { display: contents; }
/* Сводка смены — одна полоса счётчиков; каждый отбирает ленту (несколько — «или»), «Все» — сброс. */
.staff-summary { grid-column: 1 / -1; display: flex; align-items: stretch; gap: var(--space-2); min-width: 0; overflow-x: auto; scrollbar-width: none; }
.staff-summary__sep { flex: none; width: 1px; margin: var(--space-1) var(--space-1); background: var(--border); }
.tally {
  display: inline-flex; flex: none; flex-direction: column-reverse; justify-content: center; min-height: var(--control-lg);
  padding: 0 var(--space-3); border: 1px solid var(--border2); border-radius: var(--radius-md); background: var(--panel);
  color: var(--ink); text-align: left; text-decoration: none; cursor: pointer;
  transition: border-color var(--motion-fast) var(--ease), background-color var(--motion-fast) var(--ease);
}
.tally:hover { border-color: var(--gold2); }
.tally__n { font-family: var(--font-title); font-size: var(--title-sm); font-weight: var(--weight-semibold); line-height: var(--leading-title); white-space: nowrap; }
.tally__label { color: var(--muted); font-size: var(--text-xs); font-weight: var(--weight-medium); line-height: var(--leading-title); white-space: nowrap; }
.tally.is-hot .tally__n { color: var(--err); }
.tally[aria-pressed="true"] { border-color: var(--accent); background: var(--tint); box-shadow: inset 0 0 0 1px var(--accent); color: var(--accent); }
.tally[aria-pressed="true"] .tally__label, .tally[aria-pressed="true"] .tally__n { color: var(--accent); }
/* Отборы: поиск по номеру и телефону, способ, оплата, «Сбросить фильтры»; справа — точка и табло. */
.staff-filters { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); min-width: 0; }
.staff-filters__open { display: none; }
.staff-search { width: calc(var(--space-8) * 3 + var(--space-5)); height: var(--control-md); }
.staff-search input { font-size: var(--text-sm); }
.staff-methods { display: inline-flex; flex-wrap: wrap; gap: var(--space-2); }
.chip.staff-chip { min-height: var(--control-md); padding: 0 var(--space-3); gap: var(--space-2); }
.staff-chip svg { flex: none; width: var(--icon-md); height: var(--icon-md); color: var(--gold); }
.chip.staff-chip[aria-pressed="true"] svg { color: var(--on-accent); }
.staff-chip__n {
  display: inline-flex; align-items: center; justify-content: center; min-width: var(--space-5); height: var(--space-5); padding: 0 var(--space-1);
  border-radius: var(--radius-pill); background: var(--cream); color: var(--ink); font-size: var(--text-xs); font-weight: var(--weight-semibold);
}
.staff-pay.is-set { border-color: var(--accent); color: var(--accent); }
.staff-pay__label { max-width: calc(var(--space-8) * 3); overflow: hidden; text-overflow: ellipsis; }
.staff-pays { width: min(calc(var(--space-8) * 5), calc(100vw - var(--space-4))); }
.staff-pays__box {
  display: inline-flex; align-items: center; justify-content: center; flex: none; width: var(--icon-md); height: var(--icon-md);
  border: 2px solid var(--gold2); border-radius: var(--radius-sm); color: var(--accent);
}
.staff-pays__box svg { width: var(--icon-sm); height: var(--icon-sm); }
.staff-pays__icon { flex: none; width: var(--icon-md); height: var(--icon-md); color: var(--gold); }
.staff-pays__n { color: var(--muted); font-size: var(--text-sm); }
/* Где: отбор «Точка» (только точки в правах, по брендам) и «Табло выдачи» своих точек */
.staff-where { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--space-2); min-width: 0; }
.staff-point { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.staff-point__label { color: var(--muted); font-size: var(--text-sm); }
.staff-point .select { width: auto; min-width: calc(var(--space-8) * 3); height: var(--control-md); font-size: var(--text-sm); }
.staff-point--one .staff-point__value { font-weight: var(--weight-semibold); overflow-wrap: anywhere; }
.staff-boards__group + .staff-boards__group { margin-top: var(--space-2); padding-top: var(--space-2); border-top: 1px solid var(--border2); }
.staff-boards__brand {
  display: flex; align-items: center; gap: var(--space-2); padding: var(--space-1) var(--space-3);
  color: var(--muted); font-size: var(--text-xs); font-weight: var(--weight-semibold);
}
/* Метка у точки с переменами загрузки (Р127): «Восточный · +20 мин готовка · зона 3 выкл.» — переход в «Загрузку». */
.load-tags { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: var(--space-2); }
.load-tag {
  display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--control-sm); padding: 0 var(--space-3);
  border-radius: var(--radius-pill); background: var(--panel); box-shadow: inset 0 0 0 1px var(--warn); color: var(--ink);
  font-size: var(--text-sm); text-decoration: none;
}
.load-tag svg { flex: none; width: var(--icon-md); height: var(--icon-md); color: var(--warn); }
.load-tag:hover { background: var(--tint); }
@media (max-width: 1099px) {
  .staff-views { display: flex; }
  .staff-top { grid-template-columns: minmax(0, 1fr); }
  .staff-where { justify-content: flex-start; }
}
.staff-methods { flex-wrap: nowrap; }
@media (max-width: 767px) {
  .staff-top { grid-template-columns: minmax(0, 1fr); }
  .staff-views { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .staff-views .segments__item { padding: 0 var(--space-2); }
  /* Одна строка отборов листается вбок, в начале — «Фильтры (N)» шторкой; поиск — в шторке. */
  .staff-strip {
    display: flex; align-items: center; gap: var(--space-2); margin-inline: calc(var(--gutter) * -1); padding: var(--space-1) var(--gutter);
    overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain;
  }
  .staff-summary, .staff-filters, .staff-methods { display: contents; }
  .staff-summary__sep { align-self: stretch; }
  .staff-filters__open { display: inline-flex; order: -1; flex: none; min-height: var(--tap); }
  .staff-search { display: none; }
  .tally { flex-direction: row-reverse; align-items: center; justify-content: flex-end; gap: var(--space-2); min-height: var(--tap); border-radius: var(--radius-pill); }
  .tally__n { font-size: var(--text-md); }
  .tally__label { font-size: var(--text-sm); }
  .staff-filters .btn, .staff-filters .chip { flex: none; min-height: var(--tap); }
  .staff-where { flex-wrap: nowrap; justify-content: stretch; gap: var(--space-2); }
  .staff-point { flex: 1; }
  .staff-point__label {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
  .staff-point .select { flex: 1; width: 100%; min-width: 0; height: var(--tap); }
  .staff-board { flex: none; min-height: var(--tap); padding: 0 var(--space-3); }
  .staff-board__more { display: none; }
  .load-tag { min-height: var(--tap); }
}

/* Телефон: все отборы шторкой — флажками с числами */
.filters-sheet .dialog__body { gap: var(--space-3); }
.filters__group { display: grid; gap: 0; margin: 0; padding: 0; border: 0; }
.filters__group legend { margin-bottom: var(--space-1); padding: 0; font-weight: var(--weight-semibold); }
.check.filter-row { width: 100%; min-height: var(--tap); }
.filter-row__label { flex: 1; }
.filter-row__n { color: var(--muted); font-size: var(--text-sm); }
.filters-sheet .search { height: var(--tap); }

#staff-outage:empty { display: none; }
.staff-outage {
  display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-3); padding: var(--space-2) var(--space-4); border: 1px solid var(--err);
  border-radius: var(--radius-md); background: var(--panel); box-shadow: inset var(--space-1) 0 0 var(--err); font-size: var(--text-sm);
}
.staff-outage > svg { flex: none; width: var(--icon-lg); height: var(--icon-lg); color: var(--err); }
.staff-outage p { display: flex; flex-wrap: wrap; gap: 0 var(--space-3); min-width: 0; }
.staff-outage__title { color: var(--err); font-weight: var(--weight-semibold); }

/* ── Рабочее место: лента слева, справа карта и курьеры ───────────────── */
.staff-work { display: grid; gap: var(--space-5); align-items: start; }
.staff-work > * { min-width: 0; }
@media (min-width: 1100px) { .staff-work { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); } }
@media (max-width: 1099px) {
  .staff-work[data-showing="feed"] .staff-side { display: none; }
  .staff-work:not([data-showing="feed"]) .staff-main { display: none; }
}

/* ── Лента ────────────────────────────────────────────────────────────── */
.feed { display: grid; gap: var(--space-3); min-width: 0; container: feed / inline-size; }
.feed-section { display: grid; gap: var(--space-1); min-width: 0; }
.feed-section__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.feed-section__head h2 {
  display: inline-flex; align-items: center; gap: var(--space-2); font-family: var(--font-text); font-size: var(--text-sm);
  font-weight: var(--weight-semibold); letter-spacing: 0.02em;
}
/* «Пиксель» логотипа у заголовка раздела ленты */
.feed-section__head h2::before { content: ""; flex: none; width: var(--space-2); height: var(--space-2); border-radius: 2px; background: var(--gold); }
.feed-count {
  display: inline-flex; align-items: center; justify-content: center; min-width: var(--space-5); height: var(--space-5);
  padding: 0 var(--space-2); border-radius: var(--radius-pill); background: var(--cream); font-size: var(--text-xs); font-weight: var(--weight-semibold);
}
.feed-count--alert { background: var(--err); color: var(--on-accent); }
.feed-empty { padding: var(--space-4); border: 1px dashed var(--border); border-radius: var(--radius-lg); }
.feed-empty b { color: var(--ink); font-family: var(--font-title); font-size: var(--title-sm); font-weight: var(--weight-medium); }
.feed-closed { display: block; }
.feed-closed > summary { min-height: var(--control-md); list-style: none; cursor: pointer; }
.feed-closed > summary::-webkit-details-marker { display: none; }
.feed-closed__chevron { width: var(--icon-md); height: var(--icon-md); color: var(--muted); transition: transform var(--motion-fast) var(--ease); }
.feed-closed[open] .feed-closed__chevron { transform: rotate(180deg); }
.feed-closed > .order-list { margin-top: var(--space-2); }
@media (max-width: 767px) { .feed-closed > summary { min-height: var(--tap); } }

/* Список — одной панелью, строки разделены волосяной линией: плотно, как в диспетчерской. */
.issues, .order-list {
  display: grid; margin: 0; padding: 0; list-style: none; overflow: hidden;
  border: 1px solid var(--border2); border-radius: var(--radius-lg); background: var(--panel);
}
.issues > li + li, .order-list > li + li { border-top: 1px solid var(--border2); }
/* Исключение — короткой строкой с действием: что сломалось, где, что сделать. */
.issue {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: var(--space-1) var(--space-2);
  padding: 2px var(--space-3) 2px var(--space-4); box-shadow: inset var(--space-1) 0 0 var(--warn);
}
.issue--err { box-shadow: inset var(--space-1) 0 0 var(--err); }
.issue__icon { width: var(--icon-md); height: var(--icon-md); color: var(--warn); }
.issue--err .issue__icon { color: var(--err); }
.issue__text { display: grid; min-width: 0; font-size: var(--text-sm); line-height: var(--leading-title); }
.issue__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--space-2); min-width: 0; }
.issue__title { font-weight: var(--weight-semibold); overflow-wrap: anywhere; }
.issue__why { min-width: 0; overflow: hidden; color: var(--muted); font-size: var(--text-xs); text-overflow: ellipsis; white-space: nowrap; }
.issue__meta { color: var(--muted); font-size: var(--text-xs); white-space: nowrap; }
.issue__actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
/* На ширине ленты — две строки: что и где, ниже мелко — почему (обрезается, полностью — в подсказке); действия справа. */
@container feed (min-width: 560px) {
  .issue { grid-template-columns: auto minmax(0, 1fr) auto; }
  .issue__head { flex-wrap: nowrap; }
  .issue__title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .issue__meta { flex: none; }
  .issue__why { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .issue__actions { grid-column: 3; flex-wrap: nowrap; justify-content: flex-end; }
}

/* Строка заказа (Р126): номер и срок крупно, остальное мельче; на ПК — одной строкой (вторая — когда есть что решить). */
/* Узкая лента (телефон, планшет и лента уже 830 — на ПК 1440 и уже): первая строка — флажок, номер, срок, способ,
   сумма, оплата; вторая — состояние, отметки и главное действие. Одной строкой — от 830: «Принять», «На карте» и
   «Открыть» вместе — 267, прочие колонки — 460, названию точки нужно ещё 100; на ленте уже кнопки вылезали за неё и
   ложились на название точки (помощник по Р336, снимок на 1100). */
.order-row {
  display: grid; grid-template-columns: auto auto auto auto minmax(0, 1fr);
  grid-template-areas: "no time method sum pay" "state state info info act" "more more more more more";
  align-items: center; gap: var(--space-1); padding: 2px var(--space-3) 2px var(--space-2);
  background: var(--panel); cursor: pointer;
  transition: background-color var(--motion-base) var(--ease), box-shadow var(--motion-base) var(--ease);
}
.order-row:hover { background: var(--tint); }
.order-row[aria-current="true"] { box-shadow: inset var(--space-1) 0 0 var(--accent); }
.order-row.is-picked { background: var(--tint); }
/* Перемена от Гостя, iiko или курьера — мягкая подсветка 2–3 секунды (Р126) */
.order-row.is-flash { background: var(--tint); box-shadow: inset 0 0 0 2px var(--accent); }
.check.order-pick { min-height: var(--control-sm); }
.order-row__open {
  grid-area: no; min-height: var(--control-sm); padding: 0; border: 0; background: transparent; color: var(--ink); cursor: pointer; text-align: left;
  font-family: var(--font-title); font-size: var(--title-sm); font-weight: var(--weight-semibold); line-height: var(--leading-title); white-space: nowrap;
}
.order-row__time { grid-area: time; font-size: var(--text-md); font-weight: var(--weight-semibold); line-height: var(--leading-title); }
.order-row__time.is-late { color: var(--err); }
.order-row__method, .order-row__pay { display: inline-flex; align-items: center; gap: var(--space-1); color: var(--gold); }
.order-row__method { grid-area: method; }
.order-row__pay { grid-area: pay; }
.order-row__method svg, .order-row__pay svg { flex: none; width: var(--icon-md); height: var(--icon-md); }
.order-row__bonus { display: inline-flex; color: var(--accent); }
.order-row__bonus svg { width: var(--icon-sm); height: var(--icon-sm); }
.order-row__sum { grid-area: sum; font-size: var(--text-sm); font-weight: var(--weight-semibold); white-space: nowrap; }
.order-row .state { grid-area: state; justify-self: start; }
.order-row__info { grid-area: info; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); min-width: 0; }
.order-row__info:empty { display: none; }
.order-row__act { grid-area: act; display: flex; justify-content: flex-end; gap: var(--space-2); }
.order-row__act:empty { display: none; }
.order-row__more { grid-area: more; display: grid; gap: 2px; padding-bottom: 2px; }
.order-row__more .order-hold, .order-row__more .order-row__alarm { font-size: var(--text-xs); }
.order-row__more .order-hold { padding: 2px var(--space-2); }
@container feed (min-width: 830px) {
  .order-row {
    grid-template-columns: calc(var(--space-8) + var(--space-1)) var(--space-8) var(--icon-md)
      var(--space-8) calc(var(--icon-md) * 2) calc(var(--space-8) + var(--space-2)) minmax(0, 1fr) auto;
    grid-template-areas: "no time method sum pay state info act" "more more more more more more more more";
    column-gap: var(--space-2);
    row-gap: 0;
  }
  /* Колонка состояния — по короткому слову («Принят»); длинное («Отменён Гостем», «Ждёт подтверждения в кассе») —
     в две строки внутри своей колонки, а не поверх точки (проход владельца 22.10). */
  .order-row .state { justify-self: start; max-width: 100%; white-space: normal; border-radius: var(--radius-sm); }
  .order-row__info:empty { display: flex; }
  .order-row__act:empty { display: flex; }
}
/* Состояние — цветной меткой */
.state {
  display: inline-flex; align-items: center; min-height: var(--space-5); padding: 0 var(--space-2); border-radius: var(--radius-pill);
  background: var(--cream); color: var(--ink); font-size: var(--text-xs); font-weight: var(--weight-semibold); line-height: var(--leading-title); white-space: nowrap;
}
.state--new { background: var(--accent); color: var(--on-accent); }
.state--ready { background: var(--ok); color: var(--on-accent); }
.state--onway, .state--assigned { background: var(--panel); box-shadow: inset 0 0 0 1px var(--accent); color: var(--accent); }
.state--done { background: var(--panel); box-shadow: inset 0 0 0 1px var(--border); color: var(--muted); }
.state--rejected, .state--cancelled { background: var(--panel); box-shadow: inset 0 0 0 1px var(--err); color: var(--err); }
.order-row.is-alarm { box-shadow: inset var(--space-1) 0 0 var(--err); }
.order-row.is-approaching { box-shadow: inset var(--space-1) 0 0 var(--accent); }
.order-row.is-consent .order-row__open { color: var(--accent); }
.order-wait {
  display: inline-flex; align-items: center; gap: var(--space-1); min-height: var(--space-5); padding: 0 var(--space-2);
  border-radius: var(--radius-pill); background: var(--cream); font-size: var(--text-xs); font-weight: var(--weight-semibold); white-space: nowrap;
}
.order-wait svg { flex: none; width: var(--icon-sm); height: var(--icon-sm); }
.order-wait--guest { background: var(--tint); color: var(--accent); }
.order-row.is-alarm .order-wait { background: var(--err); color: var(--on-accent); }
.order-row__alarm, .order-hold { display: flex; align-items: flex-start; gap: var(--space-2); font-size: var(--text-sm); line-height: var(--leading-title); }
.order-row__alarm { color: var(--err); font-weight: var(--weight-semibold); }
.order-row__alarm svg, .order-hold svg { flex: none; width: var(--icon-sm); height: var(--icon-sm); color: var(--gold); }
.order-row__alarm svg { color: var(--err); animation: ring var(--motion-decor) var(--ease) infinite alternate; }
.order-decide { display: flex; flex: 1 1 100%; gap: var(--space-2); }
.order-decide .btn { flex: 1; }
/* Почему «Принять» не нажать: Гость решает про новую цену (Р103), блюда нет в iiko (Р102). */
.order-hold { flex-wrap: wrap; align-items: center; padding: var(--space-1) var(--space-3); border-radius: var(--radius-md); background: var(--cream); }
.order-hold > span { flex: 1 1 auto; min-width: 0; }
.order-hold b { font-weight: var(--weight-semibold); }
.order-hold--consent svg { color: var(--accent); }
.order-hold--stop { background: var(--panel); box-shadow: inset 0 0 0 1px var(--err); color: var(--err); }
.order-hold--stop svg { color: var(--err); }
.order-hold--ok svg { color: var(--ok); }
.order-hold__call { display: inline-flex; align-items: center; min-height: var(--tap); color: var(--accent); font-weight: var(--weight-semibold); white-space: nowrap; }
@media (min-width: 768px) { .order-hold__call { min-height: 0; } }

/* Шаги заказа (в карточке): пройденные, текущий, будущие — пунктиром. */
.order-steps { display: flex; flex-wrap: wrap; gap: var(--space-1); margin: 0; padding: 0; list-style: none; }
.order-steps__item {
  display: inline-flex; align-items: center; min-height: var(--control-sm); padding: 0 var(--space-3); border: 1px dashed var(--border);
  border-radius: var(--radius-pill); color: var(--muted); font-size: var(--text-xs); font-weight: var(--weight-semibold); white-space: nowrap;
}
.order-steps__item.is-done { border-style: solid; border-color: var(--cream); background: var(--cream); color: var(--ink); }
.order-steps__item.is-current { border-style: solid; border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.order-manual { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.order-manual .btn[aria-pressed="true"] { opacity: 0.6; }

.marks { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-2); }
.mark {
  display: inline-flex; align-items: center; gap: var(--space-1); min-height: var(--space-5); padding: 0 var(--space-2);
  border-radius: var(--radius-pill); background: var(--cream); color: var(--ink); font-size: var(--text-xs); font-weight: var(--weight-semibold);
  line-height: var(--leading-title);
}
.mark svg { flex: none; width: var(--icon-sm); height: var(--icon-sm); color: var(--warn); }
.mark--go, .mark--err, .mark--late { color: var(--on-accent); }
.mark--go { background: var(--accent); }
.mark--err, .mark--late { background: var(--err); }
.mark--tight { background: var(--panel); box-shadow: inset 0 0 0 1px var(--warn); color: var(--warn); }
.mark--courier { background: var(--panel); box-shadow: inset 0 0 0 1px var(--border); }
.mark--courier svg { color: var(--gold); }
.mark--wait { background: var(--panel); box-shadow: inset 0 0 0 1px var(--accent); color: var(--accent); }
.mark--go svg, .mark--err svg { color: var(--on-accent); }
.order-where { display: inline-flex; align-items: center; gap: var(--space-1); color: var(--muted); font-size: var(--text-xs); }
.order-where .brand-logo { width: var(--icon-sm); height: var(--icon-sm); }

.order-row.order-row--closed {
  grid-template-columns: var(--control-sm) calc(var(--space-8) + var(--space-1)) var(--icon-md) minmax(0, 1fr);
  grid-template-areas: "pick no method what"; min-height: 0; padding-block: var(--space-1); column-gap: var(--space-3);
}
.order-row--closed::before { content: ""; grid-area: pick; }
.order-row--closed .order-row__open { font-size: var(--text-md); }
.order-row--closed .order-row__what { grid-area: what; color: var(--muted); font-size: var(--text-sm); overflow-wrap: anywhere; }
.order-row--closed.is-rejected .order-row__what, .order-row--closed.is-cancelled .order-row__what { color: var(--err); }
@media (max-width: 767px) {
  .order-row__open, .order-row--closed .order-row__open { min-width: var(--tap); min-height: var(--tap); }
  .check.order-pick { min-width: var(--tap); min-height: var(--tap); justify-content: center; }
  .check.order-pick input { left: 50%; transform: translate(-50%, -50%); }
}

/* ── Карточка заказа: на ПК — поверх карты справа, на планшете и телефоне — шторкой ───── */
.order-side__empty {
  display: grid; justify-items: center; gap: var(--space-2); padding: var(--space-7) var(--space-5);
  border: 1px dashed var(--border); border-radius: var(--radius-lg); color: var(--muted); text-align: center;
}
.order-card { display: grid; gap: var(--space-4); padding: var(--space-5); border: 1px solid var(--border2); border-radius: var(--radius-lg); background: var(--panel); }
.order-side .order-card { min-height: 100%; align-content: start; box-shadow: var(--shadow-2); }
.order-card.is-alarm { border-color: var(--err); }
.order-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); }
.order-card__title { display: grid; gap: var(--space-1); min-width: 0; }
.order-card__no { font-size: calc(var(--title-xl) * 1.4); line-height: 1; }
.order-card__status { font-weight: var(--weight-semibold); }
.order-card__point { display: flex; align-items: center; gap: var(--space-2); color: var(--muted); font-size: var(--text-sm); }
.order-card__close { flex: none; margin: calc(var(--space-2) * -1) calc(var(--space-2) * -1) 0 0; }
.order-block { display: grid; gap: var(--space-2); padding-top: var(--space-4); border-top: 1px solid var(--border2); }
.order-block__title {
  color: var(--muted); font-family: var(--font-text); font-size: var(--text-xs); font-weight: var(--weight-semibold);
  letter-spacing: 0.06em; text-transform: uppercase;
}
.order-block__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.order-when, .order-address, .order-courier, .order-pay, .order-deadline { display: flex; align-items: flex-start; gap: var(--space-2); }
.order-when, .order-pay { font-weight: var(--weight-semibold); }
/* Как видит Гость (Р381) — строкой под «Когда»; задерживается — «!» и «Сообщить Гостю о задержке» (ОВ41) */
.order-eta-line { display: flex; align-items: flex-start; gap: var(--space-2); margin: 0; color: var(--muted); }
.order-eta-line svg { flex: none; width: var(--icon-md); height: var(--icon-md); }
.order-eta-line__span { white-space: nowrap; }
.order-eta-line.is-late { display: grid; gap: var(--space-2); color: inherit; }
.order-eta-line.is-late .warn { display: flex; align-items: flex-start; gap: var(--space-2); margin: 0; }
.order-when svg, .order-address svg, .order-courier svg, .order-pay svg, .order-deadline svg {
  flex: none; width: var(--icon-md); height: var(--icon-md); margin-top: calc((1lh - var(--icon-md)) / 2); color: var(--gold);
}
.order-deadline { font-size: var(--text-sm); font-weight: var(--weight-semibold); }
.order-deadline.is-late, .order-deadline.is-late svg { color: var(--err); }
.order-deadline.is-tight, .order-deadline.is-tight svg { color: var(--warn); }
.order-deadline.is-ok svg { color: var(--ok); }
.order-lines { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.order-line { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: baseline; gap: 0 var(--space-2); }
.order-line__qty { color: var(--muted); font-weight: var(--weight-semibold); white-space: nowrap; }
.order-line__title { overflow-wrap: anywhere; }
.order-line__price { white-space: nowrap; }
.order-line__note { grid-column: 2 / -1; color: var(--accent); font-size: var(--text-sm); }
.order-line.is-missing .order-line__title { text-decoration: line-through; }
.order-line__note--stop { color: var(--err); font-weight: var(--weight-semibold); }
.order-persons { font-weight: var(--weight-semibold); }
.order-comment { padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); background: var(--cream); font-size: var(--text-sm); }
.order-guest { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-4); }
.order-guest__phone {
  display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--tap); color: var(--accent);
  font-weight: var(--weight-semibold); text-decoration: none;
}
.order-guest__phone svg { width: var(--icon-md); height: var(--icon-md); }
.order-guest__phone:hover { text-decoration: underline; text-underline-offset: 4px; }
.order-sum { display: grid; gap: var(--space-1); margin: 0; }
.order-sum div { display: flex; justify-content: space-between; gap: var(--space-3); }
.order-sum dd { margin: 0; text-align: right; white-space: nowrap; }
.order-sum__discount dd { color: var(--accent); }
.order-sum__total { padding-top: var(--space-2); border-top: 1px solid var(--border2); font-weight: var(--weight-semibold); }
.order-sum__total dd { font-family: var(--font-title); font-size: var(--title-sm); font-weight: var(--weight-medium); }
.order-sum__was { color: var(--err); font-size: var(--text-sm); font-weight: var(--weight-semibold); }
.order-journal { display: grid; gap: var(--space-1); margin: 0; padding: 0; list-style: none; font-size: var(--text-sm); }
.order-journal li { display: grid; grid-template-columns: calc(var(--space-7) + var(--space-1)) minmax(0, 1fr); gap: var(--space-2); }
.order-journal time { color: var(--muted); font-family: var(--font-num); font-size: var(--text-xs); line-height: var(--leading-text); }
.order-card__foot { display: flex; flex-wrap: wrap; gap: var(--space-2); padding-top: var(--space-4); border-top: 1px solid var(--border2); }
.order-card__foot .order-decide .btn { flex: 1; }
/* Решение по заказу — всегда на виду: низ карточки прилипает, пока прокручивается состав и журнал. */
.order-side .order-card__foot, .order-sheet .order-card__foot {
  position: sticky; bottom: 0; z-index: var(--z-raised);
  margin: 0 calc(var(--space-5) * -1) calc(var(--space-5) * -1); padding: var(--space-4) var(--space-5);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg); background: var(--panel);
}
.order-sheet .order-card { padding: var(--space-2) var(--space-5) var(--space-5); border: 0; border-radius: 0; background: transparent; }
@media (min-width: 768px) { .order-sheet { width: min(100%, calc(var(--space-8) * 10)); margin: 0 auto; } }

/* ── Окно отказа: причина уходит Гостю ────────────────────────────────── */
.reject { gap: var(--space-3); }
.reject__group { display: grid; gap: var(--space-1); margin: 0; padding: 0; border: 0; }
.reject__group legend { margin-bottom: var(--space-2); padding: 0; font-weight: var(--weight-semibold); }
.reject .radio, .reject .check { width: 100%; }
.reject__dishes, .reject__own { display: grid; gap: var(--space-1); padding-left: calc(var(--icon-md) + var(--space-3)); }
.reject__sub { color: var(--muted); font-size: var(--text-sm); }
.reject__preview { padding: var(--space-3); border-radius: var(--radius-md); background: var(--cream); font-size: var(--text-sm); }
@media (max-width: 767px) { .reject .radio, .reject .check { min-height: var(--tap); } }

/* ── Выбранные для маршрута — полоса внизу экрана (Р125) ─────────────── */
.staff-pick {
  position: fixed; left: 50%; bottom: var(--space-4); z-index: var(--z-sticky); transform: translateX(-50%);
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); width: max-content; max-width: calc(100vw - var(--gutter) * 2);
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4); border: 1px solid var(--accent); border-radius: var(--radius-lg);
  background: var(--panel); box-shadow: var(--shadow-3);
}
.staff-pick__text { display: grid; min-width: 0; line-height: var(--leading-title); }
.staff-pick__text span { color: var(--muted); font-size: var(--text-sm); }
.staff-pick .btn svg { width: var(--icon-md); height: var(--icon-md); }
@media (max-width: 767px) { .staff-pick { width: calc(100vw - var(--gutter) * 2); } }

/* ── Пульт эталона (в проверках скрыт) — как у страниц сайта ──────────── */
.btn.ref-panel__toggle { position: fixed; left: var(--space-4); bottom: var(--space-4); z-index: var(--z-toast); background: var(--panel); box-shadow: var(--shadow-2); }
.ref-panel {
  position: fixed; left: var(--space-4); bottom: calc(var(--control-lg) + var(--space-6)); z-index: var(--z-toast);
  display: grid; gap: var(--space-3); width: min(calc(var(--space-8) * 5), calc(100vw - var(--space-6)));
  max-height: calc(100vh - var(--space-8) * 2); overflow: auto; padding: var(--space-4);
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--panel); box-shadow: var(--shadow-3);
}
/* На ПК пульт — справа, над картой: лента, где видна перемена от Гостя (Р126), им не закрыта. */
@media (min-width: 1100px) {
  .btn.ref-panel__toggle { left: auto; right: var(--space-4); }
  .ref-panel { left: auto; right: var(--space-4); }
}
.ref-panel__head { display: flex; align-items: center; justify-content: space-between; }
.ref-panel__note, .ref-panel__caption { color: var(--muted); font-size: var(--text-xs); }
.ref-panel__caption { font-weight: var(--weight-semibold); }
.ref-panel__actions { display: grid; gap: var(--space-2); }
.ref-panel__actions .btn { white-space: normal; text-align: left; justify-content: flex-start; }
.ref-panel__links { display: flex; flex-wrap: wrap; gap: var(--space-3); font-size: var(--text-sm); }
.ref-panel__links a { color: var(--accent); }

/* ── Вход и быстрая смена (Р134, И124; staff-login.js) ─────────────────────────────── */
.gate {
  position: fixed; inset: 0; z-index: var(--z-dialog); display: grid; place-items: center; overflow-y: auto;
  padding: var(--space-5) var(--gutter); background: var(--page);
}
.gate__card {
  display: grid; gap: var(--space-4); width: min(100%, calc(var(--space-8) * 6)); padding: var(--space-6);
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--panel); box-shadow: var(--shadow-1);
}
.gate__title { margin: 0; font-size: var(--title-md); line-height: var(--leading-title); color: var(--ink); text-wrap: balance; }
.gate__sub, .gate__hint { margin: 0; color: var(--muted); }
.gate__hint { font-size: var(--text-sm); }
.gate__people, .gate__form { display: grid; gap: var(--space-3); }
.gate__person {
  display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: var(--space-3); align-items: center; min-height: var(--tap);
  padding: var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--panel);
  color: var(--ink); font: inherit; text-align: left; cursor: pointer;
}
.gate__person:hover { border-color: var(--accent); }
.gate__person:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.gate__avatar {
  grid-row: span 2; display: grid; place-items: center; width: var(--control-md); height: var(--control-md); border-radius: 50%;
  background: var(--tint); color: var(--accent); font-weight: var(--weight-semibold);
}
.gate__avatar--big { justify-self: center; width: var(--control-lg); height: var(--control-lg); font-size: var(--text-lg); }
.gate__name { font-weight: var(--weight-semibold); }
.gate__role { color: var(--muted); font-size: var(--text-sm); }
.gate__digits { text-align: center; letter-spacing: var(--space-3); font-size: var(--text-lg); font-variant-numeric: tabular-nums; }
.gate__back, .gate__other { justify-self: start; }
.staff-switch { white-space: nowrap; }
.gate__card[data-mk="code"] .gate__title, .gate__card[data-mk="code"] .gate__error { text-align: center; }

/* Заказ кассы или агрегатора — только просмотр (Р136, И123) */
.order-card__foreign { display: flex; align-items: flex-start; gap: var(--space-2); margin: 0; padding: var(--space-3); border-radius: var(--radius-md); background: var(--tint); color: var(--ink); font-size: var(--text-sm); }
.order-card__foreign svg { flex: none; width: var(--icon-md); height: var(--icon-md); color: var(--accent); }
.order-card__lines { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; font-size: var(--text-sm); }
.order-card__lines li, .order-card__total { display: flex; justify-content: space-between; gap: var(--space-3); }
.order-card__total { margin: 0; padding-top: var(--space-2); border-top: 1px solid var(--border2); }
.order-row__open .order-row__chan { display: block; color: var(--muted); font-size: var(--text-xs); font-weight: var(--weight-medium); line-height: 1; margin-bottom: 2px; }
/* Подпись канала не прибавляет строке высоты: она мелко над номером, в пределах той же строки. */
.order-row__open:has(.order-row__chan) { font-size: var(--text-md); line-height: 1; }
/* Общие устройства (И124, И137) */
.devices { display: grid; gap: var(--space-4); }
.devices__list { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.devices__row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-3); border: 1px solid var(--border2); border-radius: var(--radius-md); }
.devices__row > span { display: grid; min-width: 0; }
.devices__sub, .devices__lead { color: var(--muted); font-size: var(--text-sm); }
.devices__lead { margin: 0; }
.devices__add { display: grid; gap: var(--space-3); }
